bpt/emacs.git
12 years agoMove/add window-buffer-related functions to window.el.
Martin Rudalics [Sat, 11 Jun 2011 09:50:37 +0000 (11:50 +0200)]
Move/add window-buffer-related functions to window.el.

* buffer.c: New Lisp objects Qbuffer_list_update_hook and
Qclone_number.  Remove external declaration of Qdelete_window.
(Fbuffer_list): Rewrite doc-string.  Minor restructuring of
code.
(Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
Qbuffer_list_update_hook if allowed.
(Fother_buffer): Rewrite doc-string.  Major rewrite for new
buffer list implementation.
(other_buffer_safely): New function.
(Fkill_buffer): Replace call to replace_buffer_in_all_windows by
calls to replace_buffer_in_windows and
replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
if allowed.
(record_buffer): Inhibit quitting and rewrite using quittable
functions.  Run Qbuffer_list_update_hook if allowed.
(Frecord_buffer, Funrecord_buffer): New functions.
(switch_to_buffer_1, Fswitch_to_buffer): Remove.  Move
switch-to-buffer to window.el.
(bury-buffer): Move to window.el.
(Vbuffer_list_update_hook): New variable.

* lisp.h (other_buffer_safely): Add prototype in buffer.c
section.

* window.h (resize_frame_windows): Move up in code.
(Fwindow_frame): Remove EXFUN.
(replace_buffer_in_all_windows): Remove prototype.
(replace_buffer_in_windows_safely): Add prototype.

* window.c: Declare Qdelete_window static again.  Move down
declaration of select_count.
(Fnext_window, Fprevious_window): Rewrite doc-strings.
(Fother_window): Move to window.el.
(window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
(Fdelete_windows_on, Freplace_buffer_in_windows): Move to
window.el.
(replace_buffer_in_windows): Implement by calling
Qreplace_buffer_in_windows.
(replace_buffer_in_all_windows): Remove with some functionality
moved into replace_buffer_in_windows_safely.
(replace_buffer_in_windows_safely): New function.
(select_window_norecord, select_frame_norecord): Move in front
of run_window_configuration_change_hook.  Remove now obsolete
declarations.
(Fset_window_buffer): Rewrite doc-string.  Call
Qrecord_window_buffer.
(keys_of_window): Move binding for other-window to window.el.

* loadup.el (top-level): Load window before files for the sake
of replace-buffer-in-windows.

* files.el (read-buffer-to-switch)
(switch-to-buffer-other-window)
(switch-to-buffer-other-frame, display-buffer-other-frame): Move
to window.el.

* simple.el (get-next-valid-buffer, last-buffer, next-buffer)
(previous-buffer): Move to window.el.

* bindings.el (unbury-buffer): Move to window.el.

* window.el (delete-other-windows-vertically): Move after
definition of delete-other-windows.
(other-window, delete-windows-on, replace-buffer-in-windows):
Move here from window.c.
(record-window-buffer, unrecord-window-buffer)
(set-window-buffer-start-and-point, switch-to-prev-buffer)
(switch-to-next-buffer): New functions.
(get-next-valid-buffer, last-buffer, next-buffer): Move here
from simple.el.  Call switch-to-next-buffer.
(previous-buffer): Move here from simple.el.  Call
switch-to-prev-buffer.
(bury-buffer): Move here from buffer.c.  Switch to previous
buffer when window cannot be deleted.
(unbury-buffer): Move here from bindings.el.
(ctl-x-map): Move binding for other-window from window.c to
here.
(read-buffer-to-switch, switch-to-buffer-other-window)
(switch-to-buffer-other-frame): Move here from files.el.
(normalize-buffer-to-switch-to): New functions.
(switch-to-buffer): Move here from buffer.c.  Use
read-buffer-to-switch and normalize-buffer-to-switch-to.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

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

12 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.

12 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.

12 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.

12 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'.

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

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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.

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

12 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.

12 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[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.

13 years agoExpose window-tree functions in Elisp.
Martin Rudalics [Mon, 6 Jun 2011 09:09:42 +0000 (11:09 +0200)]
Expose window-tree functions in Elisp.

(Fwindow_buffer): Move up and rewrite doc-string.
(Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
(Fwindow_prev): New functions.

13 years agoCheck for overflow when converting integer to cons and back.
Paul Eggert [Mon, 6 Jun 2011 08:29:01 +0000 (01:29 -0700)]
Check for overflow when converting integer to cons and back.

* charset.c (Fdefine_charset_internal, Fdecode_char):
Use cons_to_unsigned to catch overflow.
(Fencode_char): Use INTEGER_TO_CONS.
* composite.h (LGLYPH_CODE): Use cons_to_unsigned.
(LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
* data.c (long_to_cons, cons_to_long): Remove.
(cons_to_unsigned, cons_to_signed): New functions.
These signal an error for invalid or out-of-range values.
* dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
* fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
* font.c (Ffont_variation_glyphs):
* fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
* lisp.h: Include <intprops.h>.
(INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
(cons_to_signed, cons_to_unsigned): New decls.
(long_to_cons, cons_to_long): Remove decls.
* undo.c (record_first_change): Use INTEGER_TO_CONS.
(Fprimitive_undo): Use CONS_TO_INTEGER.
* xfns.c (Fx_window_property): Likewise.
* xselect.c: Include <limits.h>.
(x_own_selection, selection_data_to_lisp_data):
Use INTEGER_TO_CONS.
(x_handle_selection_request, x_handle_selection_clear)
(x_get_foreign_selection, Fx_disown_selection_internal)
(Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
(lisp_data_to_selection_data): Use cons_to_unsigned.
(x_fill_property_data): Use cons_to_signed.
Report values out of range.

13 years agoPrepare for exposing window-tree functions in Elisp.
Martin Rudalics [Mon, 6 Jun 2011 08:13:36 +0000 (10:13 +0200)]
Prepare for exposing window-tree functions in Elisp.

* window.c (decode_window, decode_any_window): Move up in code.
(Fwindowp, Fwindow_live_p): Rewrite doc-strings.
(inhibit_frame_unsplittable): Remove unused variable.

13 years agoCheck for buffer and string overflow more precisely.
Paul Eggert [Mon, 6 Jun 2011 06:16:12 +0000 (23:16 -0700)]
Check for buffer and string overflow more precisely.

* buffer.h (BUF_BYTES_MAX): New macro.
* lisp.h (STRING_BYTES_MAX): New macro.
* alloc.c (Fmake_string):
* character.c (string_escape_byte8):
* coding.c (coding_alloc_by_realloc):
* doprnt.c (doprnt):
* editfns.c (Fformat):
* eval.c (verror):
Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
since they may not be the same number.
* editfns.c (Finsert_char):
* fileio.c (Finsert_file_contents):
Likewise for BUF_BYTES_MAX.

13 years ago* image.c: Use ptrdiff_t, not int, for sizes.
Paul Eggert [Mon, 6 Jun 2011 06:10:06 +0000 (23:10 -0700)]
* image.c: Use ptrdiff_t, not int, for sizes.

(slurp_file): Switch from int to ptrdiff_t.
All uses changed.
(slurp_file): Check that file size fits in both size_t (for
malloc) and ptrdiff_t (for sanity and safety).

13 years ago* fileio.c (Fverify_visited_file_modtime): Avoid time overflow
Paul Eggert [Mon, 6 Jun 2011 05:57:31 +0000 (22:57 -0700)]
* fileio.c (Fverify_visited_file_modtime): Avoid time overflow

if b->modtime has its maximal value.

13 years ago* dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
Paul Eggert [Mon, 6 Jun 2011 05:55:38 +0000 (22:55 -0700)]
* dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.

13 years agoDon't assume time_t can fit into int.
Paul Eggert [Mon, 6 Jun 2011 05:50:29 +0000 (22:50 -0700)]
Don't assume time_t can fit into int.

* buffer.h (struct buffer.modtime): Now time_t, not int.
* fileio.c (Fvisited_file_modtime): No need for time_t cast now.
* undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.

13 years agoMinor fixes for signed vs unsigned integers.
Paul Eggert [Mon, 6 Jun 2011 05:48:28 +0000 (22:48 -0700)]
Minor fixes for signed vs unsigned integers.

* character.h (MAYBE_UNIFY_CHAR):
* charset.c (maybe_unify_char):
* keyboard.c (read_char, reorder_modifiers):
XINT -> XFASTINT, since the integer must be nonnegative.
* ftfont.c (ftfont_spec_pattern):
* keymap.c (access_keymap, silly_event_symbol_error):
XUINT -> XFASTINT, since the integer must be nonnegative.
(Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
since it makes no difference and we prefer signed.
* keyboard.c (record_char): Use XUINT when all the neighbors do.
(access_keymap): NATNUMP -> INTEGERP, since the integer must be
nonnegative.

13 years ago* alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO).
Paul Eggert [Mon, 6 Jun 2011 04:54:23 +0000 (21:54 -0700)]
* alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO).

Fixes: debbugs:8800

13 years ago* lisp/comint.el (comint-dynamic-complete-as-filename)
Andreas Schwab [Sun, 5 Jun 2011 23:20:16 +0000 (01:20 +0200)]
* lisp/comint.el (comint-dynamic-complete-as-filename)
(comint-dynamic-complete-filename): Correctly call
completion-in-region.

13 years agoFixes: debbugs:8806
Andreas Schwab [Sun, 5 Jun 2011 22:46:26 +0000 (00:46 +0200)]
Fixes: debbugs:8806

* src/editfns.c (Fformat): Correctly handle zero flag with hexadecimal
format.

13 years ago* src/gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
Andreas Schwab [Sun, 5 Jun 2011 22:20:42 +0000 (00:20 +0200)]
* src/gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.

13 years ago* src/xfns.c (x_set_scroll_bar_default_width): Move declarations
Andreas Schwab [Sun, 5 Jun 2011 22:20:42 +0000 (00:20 +0200)]
* src/xfns.c (x_set_scroll_bar_default_width): Move declarations
before statements.

13 years ago* lisp/net/rcirc.el (rcirc-prompt-for-encryption): Fix bug introduced in last change.
Deniz Dogan [Sun, 5 Jun 2011 19:39:17 +0000 (21:39 +0200)]
* lisp/net/rcirc.el (rcirc-prompt-for-encryption): Fix bug introduced in last change.

13 years agoHandle scroll bar width larger than 16 for GTK3.
Jan Djärv [Sun, 5 Jun 2011 19:04:51 +0000 (21:04 +0200)]
Handle scroll bar width larger than 16 for GTK3.

* gtkutil.c (xg_get_default_scrollbar_width): New function.

* gtkutil.h: Declare xg_get_default_scrollbar_width.

* xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
min width by calling x_set_scroll_bar_default_width.

Fixes: debbugs:8505

13 years ago* lisp/net/rcirc.el (rcirc-prompt-for-encryption): New function.
Deniz Dogan [Sun, 5 Jun 2011 19:03:28 +0000 (21:03 +0200)]
* lisp/net/rcirc.el (rcirc-prompt-for-encryption): New function.
(rcirc): Use it to prompt for encryption.

13 years agolisp/textmodes/bibtex.el: new command bibtex-search-entries
Roland Winkler [Sun, 5 Jun 2011 05:46:43 +0000 (00:46 -0500)]
lisp/textmodes/bibtex.el: new command bibtex-search-entries

13 years agolisp/textmodes/bibtex.el: various small bug fixes
Roland Winkler [Sun, 5 Jun 2011 04:58:39 +0000 (23:58 -0500)]
lisp/textmodes/bibtex.el: various small bug fixes

13 years agolisp/textmodes/bibtex.el (bibtex-search-entry-globally): New variable
Roland Winkler [Sun, 5 Jun 2011 04:47:45 +0000 (23:47 -0500)]
lisp/textmodes/bibtex.el (bibtex-search-entry-globally): New variable

13 years agolisp/textmodes/bibtex.el (bibtex-entry-format): new option sort-fields
Roland Winkler [Sun, 5 Jun 2011 04:39:40 +0000 (23:39 -0500)]
lisp/textmodes/bibtex.el (bibtex-entry-format): new option sort-fields

13 years agolisp/doc-view.el: Silence compiler warning.
Juanma Barranquero [Sun, 5 Jun 2011 00:18:46 +0000 (02:18 +0200)]
lisp/doc-view.el: Silence compiler warning.

13 years agosrc/xdisp.c (single_display_spec_intangible_p): Remove declaration.
Juanma Barranquero [Sun, 5 Jun 2011 00:14:08 +0000 (02:14 +0200)]
src/xdisp.c (single_display_spec_intangible_p): Remove declaration.

13 years agoDoc fixes for timer.el (Bug#8793).
Chong Yidong [Sat, 4 Jun 2011 22:46:26 +0000 (18:46 -0400)]
Doc fixes for timer.el (Bug#8793).

* emacs-lisp/timer.el (timer-activate): Remove unused arg.
(timer-activate, timer-activate-when-idle): Doc fix.

13 years ago* src/xselect.c (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
Chong Yidong [Sat, 4 Jun 2011 22:08:32 +0000 (18:08 -0400)]
* src/xselect.c (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).

13 years agoHandle errors when saving to clipboard manager (Bug#8779).
Chong Yidong [Sat, 4 Jun 2011 21:02:42 +0000 (17:02 -0400)]
Handle errors when saving to clipboard manager (Bug#8779).

* src/xselect.c (x_clipboard_manager_save): Remove redundant arg.
(x_clipboard_manager_save): Add return value.
(x_clipboard_manager_error_1, x_clipboard_manager_error_2): New
error handlers.
(x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
Obey Vx_select_enable_clipboard_manager.  Catch errors in
x_clipboard_manager_save (Bug#8779).
(Vx_select_enable_clipboard_manager): New variable.

13 years agoMerge from emacs-23; up to 2010-06-12T17:12:15Z!cyd@stupidchicken.com.
Glenn Morris [Sat, 4 Jun 2011 18:29:18 +0000 (11:29 -0700)]
Merge from emacs-23; up to 2010-06-12T17:12:15Z!cyd@stupidchicken.com.

13 years ago* lib/getopt.c: Merge trivial change from gnulib.
Paul Eggert [Sat, 4 Jun 2011 16:51:28 +0000 (09:51 -0700)]
* lib/getopt.c: Merge trivial change from gnulib.

13 years agoFix mistake in last iswitchb.el bug fix.
Deniz Dogan [Sat, 4 Jun 2011 15:13:11 +0000 (17:13 +0200)]
Fix mistake in last iswitchb.el bug fix.

13 years ago* net/tramp-sh.el (tramp-find-shell): Apply workaround also for
Michael Albinus [Sat, 4 Jun 2011 14:11:26 +0000 (16:11 +0200)]
* net/tramp-sh.el (tramp-find-shell): Apply workaround also for
"SunOS 5.10".

13 years ago* net/tramp.el (tramp-set-completion-function, tramp-parse-rhosts)
Michael Albinus [Sat, 4 Jun 2011 13:58:37 +0000 (15:58 +0200)]
* net/tramp.el (tramp-set-completion-function, tramp-parse-rhosts)
(tramp-parse-shosts, tramp-parse-sconfig, tramp-parse-shostkeys)
(tramp-parse-hosts, tramp-parse-passwd, tramp-parse-netrc)
(tramp-parse-putty):
* net/tramp-sh.el (tramp-completion-function-alist-rsh)
(tramp-completion-function-alist-ssh)
(tramp-completion-function-alist-telnet)
(tramp-completion-function-alist-su)
(tramp-completion-function-alist-putty): Set `tramp-autoload'
cookie.

* net/tramp-ftp.el:
* net/tramp-sh.el:
* net/tramp-smb.el: Set `tramp-autoload' cookie, and eval after
load "tramp.el" `tramp-set-completion-function'.

13 years ago* lisp/shell.el: Require and use pcomplete.
Stefan Monnier [Sat, 4 Jun 2011 12:31:34 +0000 (09:31 -0300)]
* lisp/shell.el: Require and use pcomplete.
(shell-dynamic-complete-functions): Add pcomplete-completions-at-point.
(shell-completion-vars): Set pcomplete-default-completion-function.

13 years ago* lisp/iswitchb.el (iswitchb-window-buffer-p): Use `member' instead of `memq'.
Deniz Dogan [Sat, 4 Jun 2011 11:02:37 +0000 (13:02 +0200)]
* lisp/iswitchb.el (iswitchb-window-buffer-p): Use `member' instead of `memq'.

Fixes: debbugs:8799

13 years agosrc/bidi.c (bidi_level_of_next_char): Fix last change.
Eli Zaretskii [Sat, 4 Jun 2011 08:04:48 +0000 (11:04 +0300)]
src/bidi.c (bidi_level_of_next_char): Fix last change.

13 years ago* lisp/url/url-future.el (url-future-test): Fix scope of `saver'.
Andreas Schwab [Sat, 4 Jun 2011 07:53:22 +0000 (09:53 +0200)]
* lisp/url/url-future.el (url-future-test): Fix scope of `saver'.

13 years agoSupport bidi reordering of text covered by display properties.
Eli Zaretskii [Sat, 4 Jun 2011 07:41:44 +0000 (10:41 +0300)]
Support bidi reordering of text covered by display properties.

 src/bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
 (bidi_cache_search, bidi_cache_iterator_state)
 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
 (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 character positions inside a run of characters covered by a
 display string.
 (bidi_paragraph_init, bidi_resolve_explicit_1)
 (bidi_level_of_next_char): Call bidi_fetch_char and
 bidi_fetch_char_advance instead of FETCH_CHAR and
 FETCH_CHAR_ADVANCE.
 (bidi_init_it): Initialize new members.
 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
 definitions.
 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
 instead of using explicit *_CHAR codes.
 (bidi_resolve_explicit, bidi_resolve_weak): Use
 FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
 bidirectional text is supported only in multibyte buffers.
 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
 it to initialize the frame_window_p member of struct bidi_it.
 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
 (bidi_resolve_explicit, bidi_resolve_weak)
 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
 bidi_it->nchars is non-positive.
 (bidi_level_of_next_char): Don't try to lookup the cache for the
 next/previous character if nothing is cached there yet, or if we
 were just reseat()'ed to a new position.
 src/xdisp.c (set_cursor_from_row): Set start and stop points
 according to the row's direction when priming the loop that looks
 for the glyph on which to display cursor.
 (single_display_spec_intangible_p): Function deleted.
 (display_prop_intangible_p): Reimplement to call
 handle_display_spec instead of single_display_spec_intangible_p.
 Accept 3 additional arguments needed by handle_display_spec.  This
 fixes incorrect cursor motion across display property with complex
 values: lists, `(when COND...)' forms, etc.
 (single_display_spec_string_p): Support property values that are
 lists with the argument STRING its top-level element.
 (display_prop_string_p): Fix the condition for processing a
 property that is a list to be consistent with handle_display_spec.
 (handle_display_spec): New function, refactored from the
 last portion of handle_display_prop.
 (compute_display_string_pos): Accept additional argument
 FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
 value of a `display' property is a "replacing spec".
 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
 and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
 the display property, but just return a value indicating whether
 the display property will replace the characters it covers.
 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
 frame_window_p members of struct bidi_it.
 (compute_display_string_pos, compute_display_string_end): New
 functions.
 (push_it): Accept second argument POSITION, where pop_it should
 jump to continue iteration.
 (reseat_1): Initialize bidi_it.disp_pos.
 src/keyboard.c (adjust_point_for_property): Adjust the call to
 display_prop_intangible_p to its new signature.
 src/dispextern.h (struct bidi_it): New member frame_window_p.
 (bidi_init_it): Update prototypes.
 (display_prop_intangible_p): Update prototype.
 (compute_display_string_pos, compute_display_string_end): Declare
 prototypes.
 (struct bidi_it): New members nchars and disp_pos.  ch_len is now
 EMACS_INT.

13 years ago* image.c (svg_load): Omit needless test.
Paul Eggert [Sat, 4 Jun 2011 03:24:42 +0000 (20:24 -0700)]
* image.c (svg_load): Omit needless test.

13 years agoCheck for buffer and string overflow more precisely.
Paul Eggert [Sat, 4 Jun 2011 02:49:51 +0000 (19:49 -0700)]
Check for buffer and string overflow more precisely.

* buffer.h (BUF_BYTES_MAX): New macro.
* lisp.h (STRING_BYTES_MAX): New macro.
* alloc.c (Fmake_string):
* character.c (string_escape_byte8):
* coding.c (coding_alloc_by_realloc):
* doprnt.c (doprnt):
* editfns.c (Fformat):
* eval.c (verror):
Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
since they may not be the same number.
* editfns.c (Finsert_char):
* fileio.c (Finsert_file_contents):
Likewise for BUF_BYTES_MAX.

13 years agoUse ptrdiff_t, not int, for sizes.
Paul Eggert [Sat, 4 Jun 2011 02:02:36 +0000 (19:02 -0700)]
Use ptrdiff_t, not int, for sizes.

* image.c (slurp_file): Switch from int to ptrdiff_t.
All uses changed.
(slurp_file, svg_load): Check that file size fits in both
size_t (for malloc) and ptrdiff_t (for sanity and safety).

13 years ago* buffers.texi (Buffers): Correct the size limit.
Paul Eggert [Fri, 3 Jun 2011 23:21:13 +0000 (16:21 -0700)]
* buffers.texi (Buffers): Correct the size limit.

13 years ago* xselect.c: Include <limits.h>.
Paul Eggert [Fri, 3 Jun 2011 20:14:12 +0000 (13:14 -0700)]
* xselect.c: Include <limits.h>.

13 years agoDocument wide integers better.
Paul Eggert [Fri, 3 Jun 2011 19:04:41 +0000 (12:04 -0700)]
Document wide integers better.

* files.texi (File Attributes):
ino_t values no longer map to anything larger than a single cons.

13 years agoCheck for overflow when converting integer to cons and back.
Paul Eggert [Fri, 3 Jun 2011 19:02:25 +0000 (12:02 -0700)]
Check for overflow when converting integer to cons and back.

* charset.c (Fdefine_charset_internal, Fdecode_char):
Use cons_to_unsigned to catch overflow.
(Fencode_char): Use INTEGER_TO_CONS.
* composite.h (LGLYPH_CODE): Use cons_to_unsigned.
(LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
* data.c (long_to_cons, cons_to_long): Remove.
(cons_to_unsigned, cons_to_signed): New functions.
These signal an error for invalid or out-of-range values.
* dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
* fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
* font.c (Ffont_variation_glyphs):
* fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
* lisp.h (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
(cons_to_signed, cons_to_unsigned): New decls.
(long_to_cons, cons_to_long): Remove decls.
* undo.c (record_first_change): Use INTEGER_TO_CONS.
(Fprimitive_undo): Use CONS_TO_INTEGER.
* xfns.c (Fx_window_property): Likewise.
* xselect.c (x_own_selection, selection_data_to_lisp_data):
Use INTEGER_TO_CONS.
(x_handle_selection_request, x_handle_selection_clear)
(x_get_foreign_selection, Fx_disown_selection_internal)
(Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
(lisp_data_to_selection_data): Use cons_to_unsigned.
(x_fill_property_data): Use cons_to_signed.  Report values out of range.