bpt/emacs.git
13 years ago* lread.c (Fload): Don't compare a possibly-garbage time_t value.
Paul Eggert [Mon, 13 Jun 2011 05:18:27 +0000 (22:18 -0700)]
* lread.c (Fload): Don't compare a possibly-garbage time_t value.

13 years agoGLYPH_CODE_FACE returns EMACS_INT, not int.
Paul Eggert [Mon, 13 Jun 2011 05:15:27 +0000 (22:15 -0700)]
GLYPH_CODE_FACE returns EMACS_INT, not int.

* dispextern.h (merge_faces):
* xfaces.c (merge_faces):
* xdisp.c (get_next_display_element):
(next_element_from_display_vector): Don't assume EMACS_INT fits in int.

13 years ago* character.h (CHAR_VALID_P): Remove unused parameter.
Paul Eggert [Mon, 13 Jun 2011 04:55:03 +0000 (21:55 -0700)]
* character.h (CHAR_VALID_P): Remove unused parameter.

* fontset.c, lisp.h, xdisp.c: All uses changed.

13 years ago* editfns.c (Ftranslate_region_internal): Omit redundant test.
Paul Eggert [Mon, 13 Jun 2011 04:27:45 +0000 (21:27 -0700)]
* editfns.c (Ftranslate_region_internal): Omit redundant test.

13 years ago* fns.c (concat): Minor tuning based on overflow analysis.
Paul Eggert [Mon, 13 Jun 2011 02:41:13 +0000 (19:41 -0700)]
* fns.c (concat): Minor tuning based on overflow analysis.

This doesn't fix any bugs.  Use int to hold character, instead
of constantly refetching from Emacs object.  Use XFASTINT, not
XINT, for value known to be a character.  Don't bother comparing
a single byte to 0400, as it's always less.

13 years ago* floatfns.c (Fexpt): Omit unnecessary cast to unsigned.
Paul Eggert [Mon, 13 Jun 2011 02:27:16 +0000 (19:27 -0700)]
* floatfns.c (Fexpt): Omit unnecessary cast to unsigned.

13 years ago* fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
Paul Eggert [Mon, 13 Jun 2011 02:23:58 +0000 (19:23 -0700)]
* fileio.c (make_temp_name): Omit unnecessary cast to unsigned.

13 years ago* editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
Paul Eggert [Mon, 13 Jun 2011 02:21:14 +0000 (19:21 -0700)]
* editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT

for characters.

13 years ago* doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
Paul Eggert [Mon, 13 Jun 2011 02:09:34 +0000 (19:09 -0700)]
* doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.

13 years ago* data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
Paul Eggert [Mon, 13 Jun 2011 02:02:16 +0000 (19:02 -0700)]
* data.c (Faset): If ARRAY is a string, check that NEWELT is a char.

Without this fix, on a 64-bit host (aset S 0 4294967386) would
incorrectly succeed when S was a string, because 4294967386 was
truncated before it was used.

13 years ago* chartab.c (Fchar_table_range): Use CHARACTERP to check range.
Paul Eggert [Mon, 13 Jun 2011 01:38:25 +0000 (18:38 -0700)]
* chartab.c (Fchar_table_range): Use CHARACTERP to check range.

Otherwise, an out-of-range integer could cause undefined behavior
on a 64-bit host.

13 years ago* composite.c: Use int, not EMACS_INT, for characters.
Paul Eggert [Mon, 13 Jun 2011 01:35:47 +0000 (18:35 -0700)]
* composite.c: Use int, not EMACS_INT, for characters.

(fill_gstring_body, composition_compute_stop_pos): Use int, not
EMACS_INT, for values that are known to be in character range.
This doesn't fix any bugs but is the usual style inside Emacs and
may generate better code on 32-bit machines.

13 years agoMake sure a 64-bit char is never passed to ENCODE_CHAR.
Paul Eggert [Mon, 13 Jun 2011 01:07:35 +0000 (18:07 -0700)]
Make sure a 64-bit char is never passed to ENCODE_CHAR.

This is for reasons similar to the recent CHAR_STRING fix.
* charset.c (Fencode_char): Check that character arg is actually
a character.  Pass an int to ENCODE_CHAR.
* charset.h (ENCODE_CHAR): Verify that the character argument is no
wider than 'int', as a compile-time check to prevent future regressions
in this area.

13 years ago* character.c (char_string): Remove unnecessary casts.
Paul Eggert [Mon, 13 Jun 2011 00:36:44 +0000 (17:36 -0700)]
* character.c (char_string): Remove unnecessary casts.

13 years agoMake sure a 64-bit char is never passed to CHAR_STRING.
Paul Eggert [Mon, 13 Jun 2011 00:36:03 +0000 (17:36 -0700)]
Make sure a 64-bit char is never passed to CHAR_STRING.

Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
by silently ignoring the top 32 bits, allowing some values
that were far too large to be valid characters.
* character.h: Include <verify.h>.
(CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
arguments are no wider than unsigned, as a compile-time check
to prevent future regressions in this area.
* data.c (Faset):
* editfns.c (Fchar_to_string, general_insert_function, Finsert_char):
(Fsubst_char_in_region):
* fns.c (concat):
* xdisp.c (decode_mode_spec_coding):
Adjust to CHAR_STRING's new requirement.
* editfns.c (Finsert_char, Fsubst_char_in_region):
* fns.c (concat): Check that character args are actually
characters.  Without this test, these functions did the wrong
thing with wildly out-of-range values on 64-bit hosts.

13 years agoRemove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
Paul Eggert [Sun, 12 Jun 2011 23:28:37 +0000 (16:28 -0700)]
Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.

These casts should not be needed on 32-bit hosts, either.
* keyboard.c (read_char):
* lread.c (Fload): Remove casts to unsigned.

13 years ago* lisp.h (UNSIGNED_CMP): New macro.
Paul Eggert [Sun, 12 Jun 2011 23:25:12 +0000 (16:25 -0700)]
* lisp.h (UNSIGNED_CMP): New macro.

This fixes comparison bugs on 64-bit hosts.
(ASCII_CHAR_P): Use it.
* casefiddle.c (casify_object):
* character.h (ASCII_BYTE_P, CHAR_VALID_P):
(SINGLE_BYTE_CHAR_P, CHAR_STRING):
* composite.h (COMPOSITION_ENCODE_RULE_VALID):
* dispextern.h (FACE_FROM_ID):
* keyboard.c (read_char): Use UNSIGNED_CMP.

13 years agoMerge from trunk.
Paul Eggert [Sat, 11 Jun 2011 05:47:05 +0000 (22:47 -0700)]
Merge from trunk.

13 years agoMerge from trunk.
Paul Eggert [Sat, 11 Jun 2011 05:46:16 +0000 (22:46 -0700)]
Merge from trunk.

13 years agoCruft removal in struct image.
Chong Yidong [Sat, 11 Jun 2011 01:48:59 +0000 (21:48 -0400)]
Cruft removal in struct image.

* src/dispextern.h (struct image): Replace data member, whose int_val
and ptr_val fields were not used by anything, with a single
lisp_val object.

* src/image.c (Fimage_metadata, make_image, mark_image, tiff_load)
(gif_clear_image, gif_load, imagemagick_load_image)
(gs_clear_image, gs_load): Callers changed.

13 years ago* buffer.h: Include <time.h>, for time_t.
Paul Eggert [Fri, 10 Jun 2011 20:52:30 +0000 (13:52 -0700)]
* buffer.h: Include <time.h>, for time_t.

Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.

13 years agoMerge: Fix minor problems found by static checking.
Paul Eggert [Fri, 10 Jun 2011 20:38:18 +0000 (13:38 -0700)]
Merge: Fix minor problems found by static checking.

* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.

Make identifiers static if they are not used in other modules.
* data.c (Qcompiled_function, Qframe, Qvector):
* image.c (QimageMagick, Qsvg):
* minibuf.c (Qmetadata):
* window.c (resize_window_check, resize_root_window): Now static.
* window.h (resize_window_check, resize_root_window): Remove decls.

* window.c (window_deletion_count, delete_deletable_window):
Remove; unused.
(window_body_lines): Now static.
(Fdelete_other_windows_internal): Mark vars as initialized.
Make sure 'resize_failed' is initialized.
(run_window_configuration_change_hook): Rename local to avoid shadowing.
(resize_window_apply): Remove unused local.
* window.h (delete_deletable_window): Remove decl.

* image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
(imagemagick_load_image): Fix pointer signedness problem by changing
last arg from unsigned char * to char *.  All uses changed.
Also, fix a local for similar reasons.
Remove unused locals.  Remove locals to avoid shadowing.
(fn_rsvg_handle_free): Remove; unused.
(svg_load, svg_load_image): Fix pointer signedness problem.
(imagemagick_load_image): Don't use garbage pointer image_wand.

* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.

13 years ago* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
Paul Eggert [Fri, 10 Jun 2011 20:34:05 +0000 (13:34 -0700)]
* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.

13 years agoMake identifiers static if they are not used in other modules.
Paul Eggert [Fri, 10 Jun 2011 20:05:21 +0000 (13:05 -0700)]
Make identifiers static if they are not used in other modules.

* data.c (Qcompiled_function, Qframe, Qvector):
* image.c (QimageMagick, Qsvg):
* minibuf.c (Qmetadata):
* window.c (resize_window_check, resize_root_window): Now static.
* window.h (resize_window_check, resize_root_window): Remove decls.

13 years ago* image.c (imagemagick_load_image): Don't use garbage pointer image_wand.
Paul Eggert [Fri, 10 Jun 2011 19:52:27 +0000 (12:52 -0700)]
* image.c (imagemagick_load_image): Don't use garbage pointer image_wand.

13 years ago* window.c: Fix minor problems reported by GCC 4.6.0.
Paul Eggert [Fri, 10 Jun 2011 19:52:05 +0000 (12:52 -0700)]
* window.c: Fix minor problems reported by GCC 4.6.0.

(window_deletion_count, delete_deletable_window): Remove; unused.
(window_body_lines): Now static.
(Fdelete_other_windows_internal): Mark vars as initialized.
Make sure 'resize_failed' is initialized.
(run_window_configuration_change_hook): Rename local to avoid shadowing.
(resize_window_apply): Remove unused local.
* window.h (delete_deletable_window): Remove decl.

13 years ago* image.c: Fix minor problems reported by GCC 4.6.0.
Paul Eggert [Fri, 10 Jun 2011 19:35:58 +0000 (12:35 -0700)]
* image.c: Fix minor problems reported by GCC 4.6.0.

(gif_load, svg_load_image): Rename locals to avoid shadowing.
(imagemagick_load_image): Fix pointer signedness problem by changing
last arg from unsigned char * to char *.  All uses changed.
Also, fix a local for similar reasons.
Remove unused locals.  Remove locals to avoid shadowing.
(fn_rsvg_handle_free): Remove; unused.
(svg_load, svg_load_image): Fix pointer signedness problem.

13 years ago* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
Paul Eggert [Fri, 10 Jun 2011 19:31:15 +0000 (12:31 -0700)]
* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.

13 years agoMerge from trunk.
Paul Eggert [Fri, 10 Jun 2011 18:19:35 +0000 (11:19 -0700)]
Merge from trunk.

13 years ago* movemail.c: Fix race condition and related bugs (Bug#8836).
Paul Eggert [Fri, 10 Jun 2011 17:50:07 +0000 (10:50 -0700)]
* movemail.c: Fix race condition and related bugs (Bug#8836).

(main) [!MAIL_USE_SYSTEM_LOCK]: Prefer mkstemp to mktemp, as this
fixes some race conditions.  Report mkstemp/mktemp errno rather
than a possibly-garbage errno.  Reinitialize the template each
time through the loop, as earlier mkstemp/mktemp calls could have
trashed it.  Pass 0600 (not 0666) to mktemp, for consistency
with mkstemp; the permissions don't matter anyway.

13 years ago* image.c (gif_load): Fix omitted cast error introduced by 2011-06-06 change.
Chong Yidong [Fri, 10 Jun 2011 15:46:48 +0000 (11:46 -0400)]
* image.c (gif_load): Fix omitted cast error introduced by 2011-06-06 change.

13 years agoSome more window.h fixes missing in 2011-06-10T06:55:18Z!rudalics@gmx.at.
Martin Rudalics [Fri, 10 Jun 2011 13:18:13 +0000 (15:18 +0200)]
Some more window.h fixes missing in 2011-06-10T06:55:18Z!rudalics@gmx.at.

* window.h (resize_proportionally, orig_total_lines)
(orig_top_line): Remove from window structure.
(set_window_height, set_window_width, change_window_heights)
(Fdelete_window): Remove prototypes.
(resize_frame_windows): Remove duplicate declaration.

13 years agoAvoid compiler warnings about missing prototypes of window.c functions.
Eli Zaretskii [Fri, 10 Jun 2011 10:16:15 +0000 (13:16 +0300)]
Avoid compiler warnings about missing prototypes of window.c functions.

 src/window.h (resize_frame_windows, resize_window_check)
 (delete_deletable_window, resize_root_window)
 (resize_frame_windows): Declare prototypes.
 src/ window.c (resize_window_apply): Make definition be "static" to
 match the prototype.

13 years agoMove window resize code from window.c to window.el.
Martin Rudalics [Fri, 10 Jun 2011 06:55:18 +0000 (08:55 +0200)]
Move window resize code from window.c to window.el.

* window.c: Remove declarations of Qwindow_size_fixed,
window_min_size_1, window_min_size_2, window_min_size,
size_window, window_fixed_size_p, enlarge_window, delete_window.
Remove static from declaration of Qdelete_window, it's
temporarily needed by Fbury_buffer.
(replace_window): Don't assign orig_top_line and
orig_total_lines.
(Fdelete_window, delete_window): Remove.  Window deletion is
handled by window.el.
(window_loop): Remove DELETE_OTHER_WINDOWS case.  Replace
Fdelete_window calls with calls to Qdelete_window.
(Fdelete_other_windows): Remove.  Deleting other windows is
handled by window.el.
(window_fixed_size_p): Remove.  Fixed-sizeness of windows is
handled in window.el.
(window_min_size_2, window_min_size_1, window_min_size): Remove.
Window minimum sizes are handled in window.el.
(shrink_windows, size_window, set_window_height)
(set_window_width, change_window_heights, window_height)
(window_width, CURBEG, CURSIZE, enlarge_window)
(adjust_window_trailing_edge, Fadjust_window_trailing_edge)
(Fenlarge_window, Fshrink_window): Remove.  Window resizing is
handled in window.el.
(make_dummy_parent): Rename to make_parent_window and give it a
second argument horflag.
(make_window): Don't set resize_proportionally any more.
(Fsplit_window): Remove.  Windows are split in window.el.
(save_restore_action, save_restore_orig_size)
(shrink_window_lowest_first, save_restore_orig_size): Remove.
Resize mini windows in window.el.
(grow_mini_window, shrink_mini_window): Implement by calling
Qresize_root_window_vertically, resize_window_check and
resize_window_apply.
(saved_window, Fset_window_configuration, save_window_save): Do
not handle orig_top_line, orig_total_lines, and
resize_proportionally.
(window_min_height, window_min_width): Move to window.el.
(keys_of_window): Move bindings for delete-other-windows,
split-window, delete-window and enlarge-window to window.el.

* buffer.c: Temporarily extern Qdelete_window.
(Fbury_buffer): Temporarily call Qdelete_window instead of
Fdelete_window (Fbury_buffer will move to window.el soon).

* frame.c (set_menu_bar_lines_1): Remove code handling
orig_top_line and orig_total_lines.

* dispnew.c (adjust_frame_glyphs_initially): Don't use
set_window_height but set heights directly.
(change_frame_size_1): Use resize_frame_windows.

* xdisp.c (init_xdisp): Don't use set_window_height but set
heights directly.

* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
resize_frame_windows instead of change_window_heights and run
run_window_configuration_change_hook.

* w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
instead of change_window_heights and run
run_window_configuration_change_hook.

* window.el (window-min-height, window-min-width): Move here
from window.c.  Add defcustoms and rewrite doc-strings.
(resize-mini-window, resize-window): New functions.
(adjust-window-trailing-edge, enlarge-window, shrink-window):
Move here from window.c.
(maximize-window, minimize-window): New functions.
(delete-window, delete-other-windows, split-window): Move here
from window.c.
(window-split-min-size): New function.
(split-window-keep-point): Mention split-window-above-each-other
instead of split-window-vertically.
(split-window-above-each-other, split-window-vertically): Rename
split-window-vertically to split-window-above-each-other and
provide defalias for old definition.
(split-window-side-by-side, split-window-horizontally): Rename
split-window-horizontally to split-window-side-by-side and provide
defalias for the old definition.
(ctl-x-map): Move bindings for delete-window,
delete-other-windows and enlarge-window here from window.c.
Replace bindings for split-window-vertically and
split-window-horizontally by bindings for
split-window-above-each-other and split-window-side-by-side.

* cus-start.el (all): Remove entries for window-min-height and
window-min-width.  Add entries for window-splits and
window-nest.

13 years agoImprove Gnus' dribble data handling.
Katsumi Yamaoka [Fri, 10 Jun 2011 00:10:24 +0000 (00:10 +0000)]
Improve Gnus' dribble data handling.

13 years ago* lisp/calendar/appt.el (appt-mode-line): Eliminate one local variable.
Glenn Morris [Thu, 9 Jun 2011 20:36:04 +0000 (16:36 -0400)]
* lisp/calendar/appt.el (appt-mode-line): Eliminate one local variable.

13 years agoEliminate some code duplication in appt.el.
Glenn Morris [Thu, 9 Jun 2011 20:25:34 +0000 (16:25 -0400)]
Eliminate some code duplication in appt.el.

* lisp/calendar/appt.el (appt-mode-line): New function.
(appt-check, appt-disp-window): Use it.

13 years agoAllow/recommend explicit args for minor-modes in file local eval:s.
Glenn Morris [Thu, 9 Jun 2011 20:22:06 +0000 (16:22 -0400)]
Allow/recommend explicit args for minor-modes in file local eval:s.

* lisp/files.el (hack-one-local-variable-eval-safep):
Allow minor-modes with explicit +/-1 arguments.

* doc/emacs/custom.texi (Specifying File Variables):
Recommend explicit arguments for minor modes.

* etc/NEWS: Likewise.

* lisp/doc-view.el, lisp/net/soap-client.el: Update file locals.

13 years agoRemove obsolete comment about PNTR_COMPARISON_TYPE.
Paul Eggert [Thu, 9 Jun 2011 19:08:29 +0000 (12:08 -0700)]
Remove obsolete comment about PNTR_COMPARISON_TYPE.

13 years ago* buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
Paul Eggert [Thu, 9 Jun 2011 19:03:59 +0000 (12:03 -0700)]
* buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.

The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
isn't needed on 32-bit machines.

13 years agoAdd `xterm-extra-capabilities' defcustom for terminals where the xterm capabilities...
Ted Zlatanov [Thu, 9 Jun 2011 16:58:18 +0000 (11:58 -0500)]
Add `xterm-extra-capabilities' defcustom for terminals where the xterm capabilities query is not needed or wanted.

* term/xterm.el (xterm): Add defgroup.
(xterm-extra-capabilities): Add defcustom to supply known xterm
capabilities, skip querying them, or query them (default).
(terminal-init-xterm): Use it.
(terminal-init-xterm-modify-other-keys): New function to set up
modifyOtherKeys support to simplify `terminal-init-xterm'.

13 years agoAuto-commit of generated files.
Glenn Morris [Thu, 9 Jun 2011 10:18:21 +0000 (06:18 -0400)]
Auto-commit of generated files.

13 years agoFinal preparations in window.el for new window resize code.
Martin Rudalics [Thu, 9 Jun 2011 08:41:36 +0000 (10:41 +0200)]
Final preparations in window.el for new window resize code.

* window.el (resize-window-reset, resize-window-reset-1)
(resize-subwindows-skip-p, resize-subwindows-normal)
(resize-subwindows, resize-other-windows, resize-this-window)
(resize-root-window, resize-root-window-vertically)
(window-deletable-p, window-or-subwindow-p)
(frame-root-window-p): New functions.

13 years agoFinal preparations for new window resize code.
Martin Rudalics [Thu, 9 Jun 2011 06:35:02 +0000 (08:35 +0200)]
Final preparations for new window resize code.

* window.c (replace_window): Rename second argument REPLACEMENT to
NEW.  New third argument SETFLAG.  Rewrite.
(delete_window, make_dummy_parent): Call replace_window with
third argument 1.
(window_list_1): Move down in code.
(run_window_configuration_change_hook): Move set_buffer part
before select_frame_norecord part in order to unwind correctly.
Rename count1 to count.
(recombine_windows, delete_deletable_window, resize_root_window)
(Fdelete_other_windows_internal)
(Frun_window_configuration_change_hook, make_parent_window)
(resize_window_check, resize_window_apply, Fresize_window_apply)
(resize_frame_windows, Fsplit_window_internal)
(Fdelete_window_internal, Fresize_mini_window_internal): New
functions.
(syms_of_window): New variables Vwindow_splits and Vwindow_nest.

13 years agoange-ftp fixes for dired switches not being just a single short option.
Glenn Morris [Thu, 9 Jun 2011 06:07:11 +0000 (23:07 -0700)]
ange-ftp fixes for dired switches not being just a single short option.

* lisp/net/ange-ftp.el (ange-ftp-switches-ok): New function.
(ange-ftp-get-files): Use it.

13 years agoSmall fixes for dired-listing-switches usage.
Alexander Klimov [Thu, 9 Jun 2011 05:33:26 +0000 (22:33 -0700)]
Small fixes for dired-listing-switches usage.

Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg01000.html

* lisp/mail/sendmail.el (mail-recover-1, mail-recover):
* lisp/files.el (recover-file, recover-session):
Handle dired-listing-switches not being just a single short option.

13 years agoAllow some appt.el display functions to handle lists.
Glenn Morris [Thu, 9 Jun 2011 05:08:11 +0000 (22:08 -0700)]
Allow some appt.el display functions to handle lists.

* lisp/calendar/appt.el (appt-display-message, appt-disp-window):
Handle lists of appointments.

13 years ago* xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
Paul Eggert [Thu, 9 Jun 2011 01:12:45 +0000 (18:12 -0700)]
* xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,

not to EMACS_INT, to avoid GCC warning.

13 years ago* xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
Paul Eggert [Thu, 9 Jun 2011 01:11:15 +0000 (18:11 -0700)]
* xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.

13 years ago* buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'.
Paul Eggert [Thu, 9 Jun 2011 01:10:27 +0000 (18:10 -0700)]
* buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'.

13 years ago* buffer.c (advance_to_char_boundary): Return EMACS_INT, not int.
Paul Eggert [Thu, 9 Jun 2011 00:47:45 +0000 (17:47 -0700)]
* buffer.c (advance_to_char_boundary): Return EMACS_INT, not int.

13 years ago* buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.
Paul Eggert [Thu, 9 Jun 2011 00:40:43 +0000 (17:40 -0700)]
* buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.

13 years ago* data.c (Qcompiled_function): Now static.
Paul Eggert [Thu, 9 Jun 2011 00:19:18 +0000 (17:19 -0700)]
* data.c (Qcompiled_function): Now static.

13 years ago* window.c (window_body_lines): Now static.
Paul Eggert [Wed, 8 Jun 2011 21:45:17 +0000 (14:45 -0700)]
* window.c (window_body_lines): Now static.

13 years ago* image.c (gif_load): Rename local to avoid shadowing.
Paul Eggert [Wed, 8 Jun 2011 21:44:48 +0000 (14:44 -0700)]
* image.c (gif_load): Rename local to avoid shadowing.

13 years ago* print.c (print_object): Fix typo in ptrdiff_t printing.
Paul Eggert [Wed, 8 Jun 2011 21:43:46 +0000 (14:43 -0700)]
* print.c (print_object): Fix typo in ptrdiff_t printing.

13 years agoMerge from trunk.
Paul Eggert [Wed, 8 Jun 2011 21:36:31 +0000 (14:36 -0700)]
Merge from trunk.

13 years ago* lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
Paul Eggert [Wed, 8 Jun 2011 19:54:32 +0000 (12:54 -0700)]
* lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.

(struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
* alloc.c (make_save_value): Integer argument is now of type
ptrdiff_t, not int.
(mark_object): Use ptrdiff_t, not int.
* lisp.h (pD): New macro.
* print.c (print_object): Use it.

13 years ago* alloc.c (allocate_pseudovector): Don't use EMACS_INT when int would do.
Paul Eggert [Wed, 8 Jun 2011 19:18:46 +0000 (12:18 -0700)]
* alloc.c (allocate_pseudovector): Don't use EMACS_INT when int would do.

13 years ago* alloc.c (inhibit_garbage_collection): Set gc_cons_threshold to max value.
Paul Eggert [Wed, 8 Jun 2011 19:07:55 +0000 (12:07 -0700)]
* alloc.c (inhibit_garbage_collection): Set gc_cons_threshold to max value.

Previously, this ceilinged at INT_MAX, but that doesn't work on
64-bit machines.

13 years ago* alloc.c (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
Paul Eggert [Wed, 8 Jun 2011 19:01:08 +0000 (12:01 -0700)]
* alloc.c (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.

13 years ago* alloc.c: (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
Paul Eggert [Wed, 8 Jun 2011 18:51:02 +0000 (11:51 -0700)]
* alloc.c: (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)

(n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
These were 'int' variables that could overflow on 64-bit hosts;
they were never used, so remove them instead of repairing them.

13 years ago* alloc.c: Use EMACS_INT, not int, to count objects.
Paul Eggert [Wed, 8 Jun 2011 18:43:44 +0000 (11:43 -0700)]
* alloc.c: Use EMACS_INT, not int, to count objects.

(total_conses, total_markers, total_symbols, total_vector_size)
(total_free_conses, total_free_markers, total_free_symbols)
(total_free_floats, total_floats, total_free_intervals, total_intervals)
(total_strings, total_free_strings):
Now EMACS_INT, not int.  All uses changed.
(Fgarbage_collect): Compute overall total using a double, so that
integer overflow is less likely to be a problem.  Check for overflow
when converting back to an integer.

13 years ago* alloc.c (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
Paul Eggert [Wed, 8 Jun 2011 17:54:58 +0000 (10:54 -0700)]
* alloc.c (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT

when a (possibly-narrower) signed value would do just as well.
We prefer using signed arithmetic, to avoid comparison confusion.

13 years ago* alloc.c (allocate_vectorlike): Check for ptrdiff_t overflow.
Paul Eggert [Wed, 8 Jun 2011 17:48:26 +0000 (10:48 -0700)]
* alloc.c (allocate_vectorlike): Check for ptrdiff_t overflow.

13 years ago* alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
Paul Eggert [Wed, 8 Jun 2011 17:43:47 +0000 (10:43 -0700)]
* alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.

13 years ago* alloc.c: Catch some string size overflows that we were missing.
Paul Eggert [Wed, 8 Jun 2011 17:22:24 +0000 (10:22 -0700)]
* alloc.c: Catch some string size overflows that we were missing.

(XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
for convenience in STRING_BYTES_MAX.
(STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
The definition here is exact; the one in lisp.h was approximate.
(allocate_string_data): Check for string overflow.  This catches
some instances we weren't catching before.  Also, it catches
size_t overflow on (unusual) hosts where SIZE_MAX <= min
(PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
and ptrdiff_t and EMACS_INT are both 64 bits.
* character.c, coding.c, doprnt.c, editfns.c, eval.c:
All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
* lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.

13 years ago* lib/gnulib.mk, m4/gnulib-common.m4: Merge from gnulib.
Paul Eggert [Wed, 8 Jun 2011 16:26:45 +0000 (09:26 -0700)]
* lib/gnulib.mk, m4/gnulib-common.m4: Merge from gnulib.

13 years agoNew symbols in window.c.
Martin Rudalics [Wed, 8 Jun 2011 13:00:51 +0000 (15:00 +0200)]
New symbols in window.c.

* window.c: (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
(MIN_SAFE_WINDOW_HEIGHT): Really remove them from window.c.
(syms_of_window): New Lisp objects Qrecord_window_buffer,
Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
Qget_mru_window, Qresize_root_window,
Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
Qauto_buffer_name; staticpro them.

13 years agoA few new functions and rewrites in window.el.
Martin Rudalics [Wed, 8 Jun 2011 09:13:43 +0000 (11:13 +0200)]
A few new functions and rewrites in window.el.

* window.el (one-window-p): Move down in code.  Rewrite
doc-string.
(window-current-scroll-bars): Rewrite doc-string.  Normalize
live window argument.
(walk-windows, get-window-with-predicate, count-windows):
Rewrite doc-string.  Use window-list-1.
(window-in-direction-2, window-in-direction, get-mru-window):
New functions.

13 years agoAdd some new members to window structure in window.h.
Martin Rudalics [Wed, 8 Jun 2011 08:35:20 +0000 (10:35 +0200)]
Add some new members to window structure in window.h.

* window.h (window): Add some new members to window structure -
normal_lines, normal_cols, new_total, new_normal, clone_number,
splits, nest, prev_buffers, next_buffers.
(WINDOW_TOTAL_SIZE): Move here from window.c.
(MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define.

* window.c (WINDOW_TOTAL_SIZE): Move to window.h.
(make_dummy_parent): Set new members of windows structure.
(make_window): Move down in code.  Handle new members of window
structure.
(Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
(Fwindow_nest, Fset_window_nest, Fwindow_new_total)
(Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
(Fset_window_prev_buffers, Fwindow_next_buffers)
(Fset_window_next_buffers, Fset_window_clone_number): New
functions.
(Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
(Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
Doc-string fixes.
(Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
Argument WINDOW can be now internal window too.
(Fwindow_use_time): Move up in code.
(Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
Rewrite doc-string.
(Fset_window_configuration, saved_window)
(Fcurrent_window_configuration, save_window_save): Handle new
members of window structure.

13 years agoMerge from emacs-23; up to 2010-06-13T18:15:45Z!eliz@gnu.org.
Glenn Morris [Wed, 8 Jun 2011 07:17:26 +0000 (00:17 -0700)]
Merge from emacs-23; up to 2010-06-13T18:15:45Z!eliz@gnu.org.

13 years ago* lisp/calendar/appt.el (appt-check): Move some initializations into the let.
Ivan Kanis [Wed, 8 Jun 2011 06:57:38 +0000 (23:57 -0700)]
* lisp/calendar/appt.el (appt-check): Move some initializations into the let.

13 years agoChangeLog fixes.
Glenn Morris [Wed, 8 Jun 2011 06:53:00 +0000 (23:53 -0700)]
ChangeLog fixes.

13 years agoMove ChangeLog entry to the right file.
Glenn Morris [Wed, 8 Jun 2011 06:51:26 +0000 (23:51 -0700)]
Move ChangeLog entry to the right file.

13 years agowindow-height, window-width, and window-full-width-p are now in window.el.
Martin Rudalics [Wed, 8 Jun 2011 05:40:45 +0000 (07:40 +0200)]
window-height, window-width, and window-full-width-p are now in window.el.

* window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
Remove.
* window.el (window-height): Defalias to window-total-height.
(window-width): Defalias to window-body-width.

13 years agoSome changes and re-organization for animated gif support.
Chong Yidong [Tue, 7 Jun 2011 18:32:12 +0000 (14:32 -0400)]
Some changes and re-organization for animated gif support.

* lisp/image.el (image-animate-max-time): Moved to image-mode.el.
(create-animated-image): Remove unnecessary function.
(image-animate): Rename from image-animate-start.  New arg.
(image-animate-stop): Removed; just use image-animate-timer.
(image-animate-timer): Use car-safe.
(image-animate-timeout): Rename argument.

* lisp/image-mode.el (image-toggle-animation): New command.
(image-mode-map): Bind it to RET.
(image-mode): Update message.
(image-toggle-display-image): Avoid a spurious cache flush.
(image-transform-rotation): Doc fix.
(image-transform-properties): Return quickly in the normal case.
(image-animate-loop): Rename from image-animate-max-time.

13 years agoFix the MS-DOS build broken by STRING_BYTES_MAX.
Eli Zaretskii [Tue, 7 Jun 2011 13:57:44 +0000 (16:57 +0300)]
Fix the MS-DOS build broken by STRING_BYTES_MAX.

 msdos/sedlibmk.inp (PTRDIFF_T_SUFFIX): Edit to nothing.

13 years agoAdd and rewrite window size functions in window.el.
Martin Rudalics [Tue, 7 Jun 2011 13:50:31 +0000 (15:50 +0200)]
Add and rewrite window size functions in window.el.

* window.el (window-safe-min-height, window-safe-min-width):
New constants.
(window-size-ignore, window-min-size, window-min-size-1)
(window-sizable, window-sizable-p, window-size-fixed-1)
(window-size-fixed-p, window-min-delta-1, window-min-delta)
(window-max-delta-1, window-max-delta, window-resizable)
(window-resizable-p, window-total-height, window-total-width)
(window-body-width): New functions.
(window-full-height-p, window-full-width-p): Rewrite using
window-total-size.
(window-body-height): Rewrite using window-body-size.

13 years agoMove get-lru-window and get-largest-window to window.el.
Martin Rudalics [Tue, 7 Jun 2011 13:23:08 +0000 (15:23 +0200)]
Move get-lru-window and get-largest-window to window.el.

* window.c (window_loop): Remove handling of GET_LRU_WINDOW and
GET_LARGEST_WINDOW.
(Fget_lru_window, Fget_largest_window): Move to window.el.

* window.el (get-lru-window, get-largest-window): Move here from
window.c.  Rename first argument to ALL-FRAMES.  Rephrase
doc-strings.
(get-buffer-window-list): Rewrite using window-list-1.  Rephrase
doc-string.

13 years agoMake delete_all_subwindows argument a Lisp_Object.
Martin Rudalics [Tue, 7 Jun 2011 12:51:07 +0000 (14:51 +0200)]
Make delete_all_subwindows argument a Lisp_Object.

* window.c (delete_window, Fset_window_configuration): Call
delete_all_subwindows with window as argument.
(delete_all_subwindows): Take a window as argument and not a
structure.  Rewrite.

* window.h: delete_all_subwindows now takes a Lisp_Object as
argument.

* frame.c (delete_frame): Call delete_all_subwindows with root
window as argument.

13 years agont/ChangeLog: Fix a typo in last entry.
Eli Zaretskii [Tue, 7 Jun 2011 12:35:48 +0000 (15:35 +0300)]
nt/ChangeLog: Fix a typo in last entry.

13 years agoUpdate nt/inc/stdint.h for PTRDIFF_MAX.
Eli Zaretskii [Tue, 7 Jun 2011 12:34:09 +0000 (15:34 +0300)]
Update nt/inc/stdint.h for PTRDIFF_MAX.

 nt/inc/stdint.h (INT32_MAX, INT64_MAX, INTPTR_MAX, PTRDIFF_MAX)
 [!__GNUC__]: New macros.

13 years agoAuto-commit of generated files.
Glenn Morris [Tue, 7 Jun 2011 10:18:29 +0000 (06:18 -0400)]
Auto-commit of generated files.

13 years agoInstall some window-size related functions and window-list-1.
Martin Rudalics [Tue, 7 Jun 2011 09:26:21 +0000 (11:26 +0200)]
Install some window-size related functions and window-list-1.

* window.c (Fwindow_total_size, Fwindow_left_column)
(Fwindow_top_line, window_body_lines, Fwindow_body_size)
(Fwindow_list_1): New functions.
(window_box_text_cols): Replace with window_body_cols.
(Fwindow_width, Fscroll_left, Fscroll_right): Use
window_body_cols instead of window_box_text_cols.

* window.h: Extern window_body_cols instead of
window_box_text_cols.

* indent.c (compute_motion, Fcompute_motion): Use
window_body_cols instead of window_box_text_cols.

13 years ago* character.c (string_escape_byte8): Fix nbytes/nchars typo.
Paul Eggert [Tue, 7 Jun 2011 06:09:32 +0000 (23:09 -0700)]
* character.c (string_escape_byte8): Fix nbytes/nchars typo.

13 years ago* alloc.c (Fmake_string): Check for out-of-range init.
Paul Eggert [Tue, 7 Jun 2011 05:32:27 +0000 (22:32 -0700)]
* alloc.c (Fmake_string): Check for out-of-range init.

13 years ago[ChangeLog]
Paul Eggert [Tue, 7 Jun 2011 04:16:37 +0000 (21:16 -0700)]
[ChangeLog]

* configure.in: Add --with-wide-int.
* INSTALL: Mention this.
[etc/ChangeLog]
* NEWS: Mention new configure option --with-wide-int.

13 years ago* fns.c (Fputhash): Document return value.
Daniel Colascione [Tue, 7 Jun 2011 01:39:26 +0000 (18:39 -0700)]
* fns.c (Fputhash): Document return value.

13 years ago* src/image.c (gif_load): Implement gif89a spec "no disposal" method.
Chong Yidong [Mon, 6 Jun 2011 21:03:43 +0000 (17:03 -0400)]
* src/image.c (gif_load): Implement gif89a spec "no disposal" method.

13 years agoMerge from gnulib.
Paul Eggert [Mon, 6 Jun 2011 19:53:44 +0000 (12:53 -0700)]
Merge from gnulib.

* lib/careadlinkat.c, lib/careadlinkat.h, m4/gnulib-common.m4: Merge.

13 years agoMerge: Document wide integers better.
Paul Eggert [Mon, 6 Jun 2011 19:43:39 +0000 (12:43 -0700)]
Merge: Document wide integers better.

13 years agoAdd Bug#8794 to ChangeLog entry.
Paul Eggert [Mon, 6 Jun 2011 18:37:51 +0000 (11:37 -0700)]
Add Bug#8794 to ChangeLog entry.

13 years agoMerge: Cons<->int and similar integer overflow fixes.
Paul Eggert [Mon, 6 Jun 2011 18:36:36 +0000 (11:36 -0700)]
Merge: Cons<->int and similar integer overflow fixes.

13 years ago* Makefile.in (ALL_CFLAGS): Add -I$(srcdir)/../lib.
Paul Eggert [Mon, 6 Jun 2011 18:26:04 +0000 (11:26 -0700)]
* Makefile.in (ALL_CFLAGS): Add -I$(srcdir)/../lib.

This is needed because lisp.h includes intprops.h now.

13 years agoMerge from trunk.
Paul Eggert [Mon, 6 Jun 2011 17:58:07 +0000 (10:58 -0700)]
Merge from trunk.

13 years ago* src/window.h (Fwindow_frame): Declare.
Stefan Monnier [Mon, 6 Jun 2011 16:54:34 +0000 (13:54 -0300)]
* src/window.h (Fwindow_frame): Declare.

13 years ago* alloc.c: Simplify handling of large-request failures (Bug#8800).
Paul Eggert [Mon, 6 Jun 2011 16:41:21 +0000 (09:41 -0700)]
* alloc.c: Simplify handling of large-request failures (Bug#8800).

(SPARE_MEMORY): Always define.
(LARGE_REQUEST): Remove.
(memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.

13 years agoAdd window-tree based, atomic and side window functions to window.el.
Martin Rudalics [Mon, 6 Jun 2011 15:21:07 +0000 (17:21 +0200)]
Add window-tree based, atomic and side window functions to window.el.

* window.el (window-right, window-left, window-child)
(window-child-count, window-last-child, window-any-p)
(normalize-live-buffer, normalize-live-frame)
(normalize-any-window, normalize-live-window)
(window-iso-combination-p, window-iso-combined-p)
(window-iso-combinations)
(walk-window-tree-1, walk-window-tree, walk-window-subtree)
(windows-with-parameter, window-with-parameter)
(window-atom-root, make-window-atom, window-atom-check-1)
(window-atom-check, window-side-check, window-check): New
functions.
(ignore-window-parameters, window-sides, window-sides-vertical)
(window-sides-slots): New variables.
(window-size-fixed): Move down in code.  Minor doc-string fix.

13 years agoMove some window-related functions from frame.c to window.c.
Martin Rudalics [Mon, 6 Jun 2011 13:57:49 +0000 (15:57 +0200)]
Move some window-related functions from frame.c to window.c.

* lisp.h: Move EXFUNS for Fframe_root_window,
Fframe_first_window and Fset_frame_selected_window to window.h.

* window.h: Move EXFUNS for Fframe_root_window,
Fframe_first_window and Fset_frame_selected_window here from
lisp.h.

* frame.c (Fwindow_frame, Fframe_first_window)
(Fframe_root_window, Fframe_selected_window)
(Fset_frame_selected_window): Move to window.c.
(Factive_minibuffer_window): Move to minibuf.c.
(Fother_visible_frames_p): New function.

* minibuf.c (Factive_minibuffer_window): Move here from frame.c.

* window.c (Fwindow_frame): Move here from frame.c.  Accept any
window as argument.
(Fframe_root_window, Fframe_first_window)
(Fframe_selected_window): Move here from frame.c.  Accept frame
or arbitrary window as argument.  Update doc-strings.
(Fminibuffer_window): Move up in code.
(Fwindow_minibuffer_p): Move up in code and simplify.
(Fset_frame_selected_window): Move here from frame.c.  Marginal
rewrite.
(Fselected_window, select_window, Fselect_window): Move up in
code.  Minor doc-string fixes.