bpt/emacs.git
11 years agoImprove static checking when configured --with-ns.
Paul Eggert [Sat, 7 Jul 2012 19:23:41 +0000 (12:23 -0700)]
Improve static checking when configured --with-ns.

See Samuel Bronson's remarks in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00146.html>.
* configure.in (WARN_CFLAGS): Omit -Wunreachable-code, as it's
a no-op with recent GCC and harmful in earlier ones.
Omit -Wsync-nand, as it's irrelevant to Emacs and provokes a
warning when compiling with ObjC.  Always omit
-Wunsafe-loop-optimizations, as we don't mind when optimization is
being done correctly.

Fix some minor --with-ns problems found by static checking.
* src/frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
(x_set_font) [!HAVE_X_WINDOWS]:
* src/image.c (xpm_load_image) [HAVE_NS]:
(x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
(x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
Remove unused local.
(Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
(xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
* src/image.c (x_create_bitmap_from_file) [HAVE_NS]:
(xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
* src/nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
* src/xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
Fix pointer signedness problem.
* src/xfaces.c (FRAME_X_FONT_TABLE):
* src/xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.

11 years ago* configure.in (BROKEN_SA_RESTART): Doc fix.
Glenn Morris [Sat, 7 Jul 2012 18:16:15 +0000 (11:16 -0700)]
* configure.in (BROKEN_SA_RESTART): Doc fix.

* src/sysdep.c, src/s/irix6-5.h: Related comments.

11 years agoTry to simplify the initialization of Vload_path
Glenn Morris [Sat, 7 Jul 2012 18:06:32 +0000 (11:06 -0700)]
Try to simplify the initialization of Vload_path

* src/lread.c (load_path_check): New function, split from init_lread.
(init_lread): Reorganize.  Motivation:
If EMACSLOADPATH is set, check/warn about that rather than the
defaults, which we are not going to use.  Hence we can remove
the turn_off_warning and WINDOWSNT || HAVE_NS tests.
Don't warn if site-lisp directories are missing.
If not installed, start from a blank load-path, since
PATH_LOADSEARCH refers to the eventual installation directories.

11 years agoFix bug #11832 with truncated lines when fringes are disabled on GUI frames.
Eli Zaretskii [Sat, 7 Jul 2012 16:36:02 +0000 (19:36 +0300)]
Fix bug #11832 with truncated lines when fringes are disabled on GUI frames.

 src/xdisp.c (init_iterator): Get dimensions of truncation and
 continuation glyphs even if on GUI frames.  Adjust
 it->last_visible_x on GUI frames when the left or right fringes,
 or both, are absent.
 (start_display, move_it_in_display_line_to): Handle the case of a
 GUI frame without a fringe to display continuation or truncation
 glyphs.
 (insert_left_trunc_glyphs): Support GUI frames: make sure
 truncation glyphs overwrite enough glyphs from the current line to
 have sufficient space in pixels.
 (display_line): Support truncation and continuation glyphs on GUI
 frames.  If some spare pixels are left on the line after inserting
 the truncation glyphs, fill that space with a stretch glyph of a
 suitably computed width.
 src/term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
 produce_glyphs, to support GUI sessions.

11 years agoUpdate etc/tutorials/TUTORIAL.fr to reflect changes from 2012-07-07T10:34:37Z!cyd...
Bastien Guerry [Sat, 7 Jul 2012 14:37:47 +0000 (16:37 +0200)]
Update etc/tutorials/TUTORIAL.fr to reflect changes from 2012-07-07T10:34:37Z!cyd@gnu.org.

11 years ago* tutorials/TUTORIAL: Copyedits.
Michael Witten [Sat, 7 Jul 2012 10:34:37 +0000 (18:34 +0800)]
* tutorials/TUTORIAL: Copyedits.

Fixes: debbugs:11689

11 years agoAuto-commit of generated files.
Glenn Morris [Sat, 7 Jul 2012 10:17:27 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years ago* woman.el (woman2-process-escapes): Handle nofill regions.
Kevin Ryde [Sat, 7 Jul 2012 10:10:47 +0000 (18:10 +0800)]
* woman.el (woman2-process-escapes): Handle nofill regions.

Fixes: debbugs:11591

11 years ago* woman.el (woman-strings): Fix double-quote handling.
Kevin Ryde [Sat, 7 Jul 2012 10:06:38 +0000 (18:06 +0800)]
* woman.el (woman-strings): Fix double-quote handling.
(woman-decode-region): Replace escaped-escapes without destroying
bold or underline.

Fixes: debbugs:1151

11 years agoAdd "site-lisp" to manual indices.
Chong Yidong [Sat, 7 Jul 2012 09:51:59 +0000 (17:51 +0800)]
Add "site-lisp" to manual indices.

* custom.texi (Init File): Index site-lisp.

* doc/lispref/loading.texi (Library Search): Index site-lisp directories.

Fixes: debbugs:11435

11 years ago* lisp/simple.el (yank-pop-change-selection): Doc fix.
Chong Yidong [Sat, 7 Jul 2012 09:33:28 +0000 (17:33 +0800)]
* lisp/simple.el (yank-pop-change-selection): Doc fix.
(interprogram-cut-function, interprogram-paste-function): Mention
that we typically mean the clipboard.

Fixes: debbugs:11361

11 years ago* sysdep.c (ULLONG_MAX): Define if not already defined.
Paul Eggert [Sat, 7 Jul 2012 03:06:00 +0000 (20:06 -0700)]
* sysdep.c (ULLONG_MAX): Define if not already defined.

Fixes: debbugs:11781

11 years ago* sysdep.c (list_system_processes): Port to NetBSD-current.
Paul Eggert [Sat, 7 Jul 2012 02:25:28 +0000 (19:25 -0700)]
* sysdep.c (list_system_processes): Port to NetBSD-current.

Fixes: debbugs:11797

11 years agoDo not require float-time's arg to fit in time_t (Bug#11825).
Paul Eggert [Sat, 7 Jul 2012 01:57:42 +0000 (18:57 -0700)]
Do not require float-time's arg to fit in time_t (Bug#11825).

This works better on hosts where time_t is unsigned, and where
float-time is applied to the (negative) difference between two times.
* editfns.c (decode_time_components): Last arg is now double *,
not int *, and means to store all the result as a double, without
worrying about whether the seconds part fits in time_t.
All callers changed.
(lisp_time_argument): Remove last int * arg, as it's no longer needed.
All callers changed.
(Ffloat_time): Do not fail merely because the specified time falls
outside of time_t range.

11 years agoReplace some src/s undefs by never even checking on relevant platforms
Glenn Morris [Sat, 7 Jul 2012 01:03:46 +0000 (21:03 -0400)]
Replace some src/s undefs by never even checking on relevant platforms

* configure.in: (getwd): Don't check for it on unixware.
(random, rint): Don't check for these on hpux.
(res_init, libresolv): Don't check for these on darwin.

* src/s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
* src/s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
* src/s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).

11 years agoUpdate Windows port to gnulib changes in 2012-07-06T21:07:46Z!eggert@cs.ucla.edu.
Juanma Barranquero [Sat, 7 Jul 2012 00:20:56 +0000 (02:20 +0200)]
Update Windows port to gnulib changes in 2012-07-06T21:07:46Z!eggert@cs.ucla.edu.

* lib-src/makefile.w32-in ($(BLD)/ctags.$(O), $(BLD)/etags.$(O)):
Update dependencies.

* lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/c-ctype.$(O),
$(BLD)/c-strcasecmp.$(O) and $(BLD)/c-strncasecmp.$(O).
($(BLD)/c-ctype.$(O), $(BLD)/c-strcasecmp.$(O))
($(BLD)/c-strncasecmp.$(O)): New dependencies.

* src/makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
Update dependencies.

* src/s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.

11 years agoAdd gnulib files for Bug#11786 fix.
Paul Eggert [Fri, 6 Jul 2012 22:19:44 +0000 (15:19 -0700)]
Add gnulib files for Bug#11786 fix.

11 years ago* lisp/kmacro.el (kmacro-call-macro): Restore repeat message. (Bug#11817)
Glenn Morris [Fri, 6 Jul 2012 21:34:49 +0000 (17:34 -0400)]
* lisp/kmacro.el (kmacro-call-macro): Restore repeat message.  (Bug#11817)

11 years ago* configure.in: Document --enable-gcc-warnings better.
Paul Eggert [Fri, 6 Jul 2012 21:29:50 +0000 (14:29 -0700)]
* configure.in: Document --enable-gcc-warnings better.

11 years agoUse c_strcasecmp for ASCII case-insensitive comparison.
Paul Eggert [Fri, 6 Jul 2012 21:07:46 +0000 (14:07 -0700)]
Use c_strcasecmp for ASCII case-insensitive comparison.

Fixes: debbugs:11786

11 years ago* xfont.c (compare_font_names): Redo to omit the need for casts.
Paul Eggert [Fri, 6 Jul 2012 20:49:23 +0000 (13:49 -0700)]
* xfont.c (compare_font_names): Redo to omit the need for casts.

11 years ago* xfns.c (Fx_change_window_property): Doc fix.
Andreas Schwab [Fri, 6 Jul 2012 20:00:42 +0000 (22:00 +0200)]
* xfns.c (Fx_change_window_property): Doc fix.
* w32fns.c (Fx_change_window_property): Doc fix.

11 years ago* make-docfile.c (write_globals): Warn about duplicate function
Andreas Schwab [Fri, 6 Jul 2012 19:50:17 +0000 (21:50 +0200)]
* make-docfile.c (write_globals): Warn about duplicate function
definitions with differing signatures.

11 years agoFixes: debbugs:11870
Andreas Schwab [Fri, 6 Jul 2012 19:34:39 +0000 (21:34 +0200)]
Fixes: debbugs:11870

* w32fns.c (Fx_window_property): Accept the same arguments as the
X Windows version.  Doc fix.
* xfns.c (Fx_window_property): Doc fix.

11 years ago* lisp/files.el (toggle-read-only): Restrict message to interactive use.
Glenn Morris [Fri, 6 Jul 2012 19:06:54 +0000 (15:06 -0400)]
* lisp/files.el (toggle-read-only): Restrict message to interactive use.

11 years agotimespec-sub: avoid duplicate include
Paul Eggert [Fri, 6 Jul 2012 17:53:26 +0000 (10:53 -0700)]
timespec-sub: avoid duplicate include

11 years ago* nt/config.nt: Complete rework to bring it in sync with autogen/config.in.
Juanma Barranquero [Fri, 6 Jul 2012 17:19:33 +0000 (19:19 +0200)]
* nt/config.nt: Complete rework to bring it in sync with autogen/config.in.
All Windows-specific code moved to src/s/ms-w32.h.

* src/s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
Windows-specific code from nt/config.nt moved here.
Obsolete settings removed.

11 years ago* process.c: Avoid unnecessary calls to gettime.
Paul Eggert [Fri, 6 Jul 2012 16:57:32 +0000 (09:57 -0700)]
* process.c: Avoid unnecessary calls to gettime.

(wait_reading_process_output): Don't get the time of day
when gobbling data immediately and not waiting, as there's no need
for it in that case.  This removes a FIXME.

11 years agoFix stray '<' from last change.
Paul Eggert [Fri, 6 Jul 2012 15:46:51 +0000 (08:46 -0700)]
Fix stray '<' from last change.

11 years ago* gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3 is defined.
Jan Djärv [Fri, 6 Jul 2012 15:02:29 +0000 (17:02 +0200)]
* gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3 is defined.

Fixes: debbugs:11768

11 years agoFix marker debugging code.
Dmitry Antipov [Fri, 6 Jul 2012 14:16:54 +0000 (18:16 +0400)]
Fix marker debugging code.
* marker.c (byte_char_debug_check): Do not perform the check
if buffer is not multibyte.
(buf_charpos_to_bytepos, buf_bytepos_to_charpos): Call
byte_char_debug_check with correct arguments.

11 years ago* tramp.texi (Multi-hops): Introduce `tramp-restricted-shell-hosts-alist'.
Michael Albinus [Fri, 6 Jul 2012 13:19:33 +0000 (15:19 +0200)]
* tramp.texi (Multi-hops): Introduce `tramp-restricted-shell-hosts-alist'.

11 years ago* net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom.
Michael Albinus [Fri, 6 Jul 2012 13:16:13 +0000 (15:16 +0200)]
* net/tramp.el (tramp-restricted-shell-hosts-alist): New defcustom.

* net/tramp-sh.el (tramp-maybe-open-connection): Handle it.

11 years agoAuto-commit of generated files.
Glenn Morris [Fri, 6 Jul 2012 10:17:34 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years agoCompile marker debugging code only if ENABLE_CHECKING is defined.
Dmitry Antipov [Fri, 6 Jul 2012 09:20:41 +0000 (13:20 +0400)]
Compile marker debugging code only if ENABLE_CHECKING is defined.
* marker.c (byte_char_debug_check, count_markers): Use
only if ENABLE_CHECKING is defined.
(byte_debug_flag): Remove.
(CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
Always call byte_char_debug_check if ENABLE_CHECKING is defined.

11 years agoAvoid code repetition in marker-related functions.
Dmitry Antipov [Fri, 6 Jul 2012 08:53:15 +0000 (12:53 +0400)]
Avoid code repetition in marker-related functions.
* marker.c (attach_marker): New function.
(Fset_marker, set_marker_restricted, set_marker_both)
(set_marker_restricted_both): Use it.
(Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
Consistently rename charno to charpos.
(marker_position): Add eassert.
(marker_byte_position): Convert to eassert.

11 years ago* intro.texi (A Sample Variable Description): The saga continues...
Glenn Morris [Fri, 6 Jul 2012 07:48:10 +0000 (00:48 -0700)]
* intro.texi (A Sample Variable Description): The saga continues...
http://debbugs.gnu.org/11862#89

11 years agoComment tweak
Glenn Morris [Fri, 6 Jul 2012 07:45:23 +0000 (00:45 -0700)]
Comment tweak

11 years agoTweaks for make-dist --update.
Glenn Morris [Fri, 6 Jul 2012 07:40:43 +0000 (00:40 -0700)]
Tweaks for make-dist --update.

* make-dist [update]: Let autoreconf figure out what needs updating.
Use `make info-real'.  leim/leim-list.el should always exist.
Check cd return value.

11 years ago* buffer.c (unchain_overlay): Simplify. Add comment.
Dmitry Antipov [Fri, 6 Jul 2012 07:34:37 +0000 (11:34 +0400)]
* buffer.c (unchain_overlay): Simplify.  Add comment.
* marker.c (unchain_marker): Simplify.  Fix comments.

11 years ago* lisp/Makefile.in: Comment
Glenn Morris [Fri, 6 Jul 2012 07:29:43 +0000 (00:29 -0700)]
* lisp/Makefile.in: Comment

11 years agoMove a comment from lisp/Makefile.in to lisp/loadup.el.
Glenn Morris [Fri, 6 Jul 2012 07:23:25 +0000 (00:23 -0700)]
Move a comment from lisp/Makefile.in to lisp/loadup.el.
The comment in Makefile.in has been orphaned ever since
the bootstrap-prepare rule was removed in 2008.

11 years ago* lisp/Makefile.in (compile-one-process): Rename from "recompile".
Glenn Morris [Fri, 6 Jul 2012 07:08:10 +0000 (00:08 -0700)]
* lisp/Makefile.in (compile-one-process): Rename from "recompile".

11 years ago* lisp/Makefile.in (bzr-update): Use "compile".
Glenn Morris [Fri, 6 Jul 2012 07:06:13 +0000 (00:06 -0700)]
* lisp/Makefile.in (bzr-update): Use "compile".
It is the same as "recompile autoloads", but parallelizable.

11 years agoIn quit-window always restore window height when it's saved in
Dmitry Gutov [Fri, 6 Jul 2012 06:22:56 +0000 (08:22 +0200)]
In quit-window always restore window height when it's saved in
quit-restore parameter.

* window.el (quit-window): Always restore window height when
it's saved in quit-restore parameter.

11 years agoIntroduce fast path for the widely used marker operation.
Dmitry Antipov [Fri, 6 Jul 2012 05:07:44 +0000 (09:07 +0400)]
Introduce fast path for the widely used marker operation.
* alloc.c (build_marker): New function.
* lisp.h (build_marker): New prototype.
* buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
* composite.c (autocmp_chars): Likewise.
* editfns.c (buildmark): Remove.
(Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
(save_restriction_save): Use build_marker.
* marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
* window.c (save_window_save): Likewise.

11 years agoTweak Emacs manual info menu ordering.
Chong Yidong [Fri, 6 Jul 2012 04:48:35 +0000 (12:48 +0800)]
Tweak Emacs manual info menu ordering.

* doc/emacs/emacs.texi: Re-order top-level menu to correspond to logical
order, to avoid makeinfo warnings.

* doc/emacs/ack.texi (Acknowledgments): Note new python.el.

11 years agoDo not use Fdelete_overlay in delete_all_overlays
Dmitry Antipov [Fri, 6 Jul 2012 04:42:30 +0000 (08:42 +0400)]
Do not use Fdelete_overlay in delete_all_overlays
to avoid redundant calls to unchain_overlay.
* buffer.c (drop_overlay): New function.
(delete_all_overlays, Fdelete_overlay): Use it.
* minibuf.c (get_minibuffer): Fix comment.

11 years agoMerge from emacs-24; up to 2012-05-01T00:16:02Z!rgm@gnu.org
Chong Yidong [Fri, 6 Jul 2012 04:31:46 +0000 (12:31 +0800)]
Merge from emacs-24; up to 2012-05-01T00:16:02Z!rgm@gnu.org

11 years agoMisc fixes for Lisp manual.
Chong Yidong [Fri, 6 Jul 2012 04:25:04 +0000 (12:25 +0800)]
Misc fixes for Lisp manual.

* doc/lispref/intro.texi (A Sample Function Description): Fix incorrect
markup, undoing previous change.
(A Sample Variable Description): Minor clarifications and markup
improvements.

* doc/lispref/elisp.texi (Top):
* doc/lispref/text.texi (Text): Fix menu order.

11 years agoPort to OpenBSD 5.1 amd64.
Paul Eggert [Fri, 6 Jul 2012 03:08:57 +0000 (03:08 +0000)]
Port to OpenBSD 5.1 amd64.

11 years ago* doc/lispref/intro.texi (A Sample Variable Description): Use @dfn more.
Richard M. Stallman [Fri, 6 Jul 2012 01:54:35 +0000 (21:54 -0400)]
* doc/lispref/intro.texi (A Sample Variable Description): Use @dfn more.

11 years agoCommitter missed ChangeLog for previous change.
Richard M. Stallman [Fri, 6 Jul 2012 01:48:45 +0000 (21:48 -0400)]
Committer missed ChangeLog for previous change.

11 years ago* doc/lispref/intro.texi: Improve/undo previous changes.
Richard M. Stallman [Fri, 6 Jul 2012 01:47:46 +0000 (21:47 -0400)]
* doc/lispref/intro.texi: Improve/undo previous changes.

11 years ago* lisp/Makefile.in (cvs-update): Remove old alias.
Glenn Morris [Fri, 6 Jul 2012 01:31:54 +0000 (21:31 -0400)]
* lisp/Makefile.in (cvs-update): Remove old alias.

11 years ago* src/Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
Glenn Morris [Fri, 6 Jul 2012 01:29:54 +0000 (21:29 -0400)]
* src/Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.

It has nothing to do with building Emacs, and no-one is likely to be
paying attention to the result.  The CANNOT_DUMP branch was pointless,
since it sets EMACSLOADPATH=$(lispsource) it is impossible for there
to ever be any shadows.  The EMACSLOADPATH setting was probably necessary
for emacs to work at all when uninstalled, given the way init_lread
works for the CANNOT_DUMP case.  Since -batch implies -q, in the
non-CANNOT_DUMP branch, any shadows could only come from site-lisp
files.

11 years agoMore xmalloc and related cleanup.
Paul Eggert [Thu, 5 Jul 2012 18:35:48 +0000 (11:35 -0700)]
More xmalloc and related cleanup.

* alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
* callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
* font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
* gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
* nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
* regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
* sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
* xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
* xterm.c:
Omit needless casts involving void * pointers and allocation.
Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
as the former is more robust if P's type is changed.
Prefer xzalloc to xmalloc + memset 0.
Simplify malloc-or-realloc to realloc.
Don't worry about xmalloc returning a null pointer.
Prefer xstrdup to xmalloc + strcpy.
* editfns.c (Fmessage_box): Grow message_text by at least 80 when
growing it.
* keyboard.c (apply_modifiers_uncached): Prefer local array to
alloca of a constant.

11 years agoAvoid long futile looping on a TTY under huge values of hscroll.
Eli Zaretskii [Thu, 5 Jul 2012 16:28:34 +0000 (19:28 +0300)]
Avoid long futile looping on a TTY under huge values of hscroll.

 src/xdisp.c (display_line): Fix horizontal pixel coordinates when
 hscroll is larger than the line width.  Fixes long and futile
 looping inside extend_face_to_end_of_line (on a TTY) producing
 glyphs that are not needed and thrown away.

11 years ago* marker.c (set_marker_restricted_both): Simplify by using
Dmitry Antipov [Thu, 5 Jul 2012 16:14:39 +0000 (20:14 +0400)]
* marker.c (set_marker_restricted_both): Simplify by using
clip_to_bounds.

11 years ago* editfns.c (region_limit): Simplify by using clip_to_bounds.
Paul Eggert [Thu, 5 Jul 2012 16:00:20 +0000 (09:00 -0700)]
* editfns.c (region_limit): Simplify by using clip_to_bounds.

11 years agoDon't use deprecated functions when compiling with Gtk3.
Jan Djärv [Thu, 5 Jul 2012 15:44:53 +0000 (17:44 +0200)]
Don't use deprecated functions when compiling with Gtk3.

* gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
not defined (Bug#11768).
(xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
(xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
(make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
followed by gtk_box_set_homogeneous (Bug#11768).
(xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
(update_theme_scrollbar_width, xg_create_scroll_bar): Use
gtk_scrollbar_new (Bug#11768).
(xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
(is_box_type): New function (Bug#11768).
(xg_tool_item_stale_p): Call is_box_type.
(xg_initialize): Get settings by calling gtk_settings_get_for_screen
with default display (Bug#11768).

11 years agoRevert hscroll and min_hscroll to ptrdiff_t.
Eli Zaretskii [Thu, 5 Jul 2012 15:20:12 +0000 (18:20 +0300)]
Revert hscroll and min_hscroll to ptrdiff_t.

Fixes: debbugs:11857

11 years agoFix bug #11857 with messed up display for insanely large hscroll values.
Eli Zaretskii [Thu, 5 Jul 2012 15:04:57 +0000 (18:04 +0300)]
Fix bug #11857 with messed up display for insanely large hscroll values.

 src/xdisp.c (window_hscroll_limited): New function.
 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
 coordinates when window's hscroll is set to insanely large
 values.
 src/window.h (struct window) <hscroll, min_hscroll>: Change type to 'int'.

11 years agosrc/makefile.w32-in: Update dependencies.
Juanma Barranquero [Thu, 5 Jul 2012 12:07:29 +0000 (14:07 +0200)]
src/makefile.w32-in: Update dependencies.
($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.

11 years agoSync with Tramp 2.2.6-pre.
Michael Albinus [Thu, 5 Jul 2012 06:57:57 +0000 (08:57 +0200)]
Sync with Tramp 2.2.6-pre.

* net/tramp.el (tramp-drop-volume-letter): Provide an XEmacs
compatible declaration.

* net/tramp-cmds.el (tramp-append-tramp-buffers): Protect
`list-load-path-shadows' call.

* net/tramp-compat.el (top): Require packages, which aren't
autoloaded anymore for XEmacs.  Protect call of
`tramp-file-name-handler' by `tramp-compat-funcall', pacifying the
compiler.  Do not require tramp-util.el and tramp-vc.el anymore,
it hurts at least for SXEmacs.
(tramp-compat-temporary-file-directory): In XEmacs, there is no
standard-value for `temporary-file-directory'.

* net/tramp-sh.el (tramp-do-directory-files-and-attributes-with-stat):
Redirect stderr to /dev/null.
(tramp-sh-handle-write-region): uid and gid can be floats.
Reported by Russell Sim <russell.sim@gmail.com>.
(tramp-sh-handle-vc-registered): Hide errors.
(tramp-vc-file-name-handler): Use dummy results for `process-file'
and `start-file-process'.
(tramp-maybe-open-connection): Check also whether `non-essential'
is bound.

11 years agoCleanup xmalloc.
Dmitry Antipov [Thu, 5 Jul 2012 06:32:41 +0000 (10:32 +0400)]
Cleanup xmalloc.
* admin/coccinelle/xzalloc.cocci: Semantic patch to convert
calls to xmalloc with following memset to xzalloc.
* src/lisp.h (xzalloc): New prototype.  Omit needless casts.
* src/alloc.c (xzalloc): New function.  Omit needless casts.
* src/charset.c: Omit needless casts.  Convert all calls to
malloc with following memset to xzalloc.
* src/dispnew.c: Likewise.
* src/fringe.c: Likewise.
* src/image.c: Likewise.
* src/sound.c: Likewise.
* src/term.c: Likewise.
* src/w32fns.c: Likewise.
* src/w32font.c: Likewise.
* src/w32term.c: Likewise.
* src/xfaces.c: Likewise.
* src/xfns.c: Likewise.
* src/xterm.c: Likewise.
* src/atimer.c: Omit needless casts.
* src/buffer.c: Likewise.
* src/callproc.c: Likewise.
* src/ccl.c: Likewise.
* src/coding.c: Likewise.
* src/composite.c: Likewise.
* src/doc.c: Likewise.
* src/doprnt.c: Likewise.
* src/editfns.c: Likewise.
* src/emacs.c: Likewise.
* src/eval.c: Likewise.
* src/filelock.c: Likewise.
* src/fns.c: Likewise.
* src/gtkutil.c: Likewise.
* src/keyboard.c: Likewise.
* src/lisp.h: Likewise.
* src/lread.c: Likewise.
* src/minibuf.c: Likewise.
* src/msdos.c: Likewise.
* src/print.c: Likewise.
* src/process.c: Likewise.
* src/region-cache.c: Likewise.
* src/search.c: Likewise.
* src/sysdep.c: Likewise.
* src/termcap.c: Likewise.
* src/terminal.c: Likewise.
* src/tparam.c: Likewise.
* src/w16select.c: Likewise.
* src/w32.c: Likewise.
* src/w32reg.c: Likewise.
* src/w32select.c: Likewise.
* src/w32uniscribe.c: Likewise.
* src/widget.c: Likewise.
* src/xdisp.c: Likewise.
* src/xmenu.c: Likewise.
* src/xrdb.c: Likewise.
* src/xselect.c: Likewise.

11 years ago* fileio.c (time_error_value): Check the right error number.
Paul Eggert [Thu, 5 Jul 2012 04:16:11 +0000 (21:16 -0700)]
* fileio.c (time_error_value): Check the right error number.

Problem reported by Troels Nielsen in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.

11 years ago* doc/lispref/intro.texi (A Sample Function Description): Fix cross-refs.
Glenn Morris [Thu, 5 Jul 2012 03:06:50 +0000 (20:06 -0700)]
* doc/lispref/intro.texi (A Sample Function Description): Fix cross-refs.

11 years ago* doc/lispref/intro.texi (Evaluation Notation, A Sample Function Description)
Michael Witten [Thu, 5 Jul 2012 02:52:00 +0000 (22:52 -0400)]
* doc/lispref/intro.texi (Evaluation Notation, A Sample Function Description)
(A Sample Variable Description, Version Info): Copy edits.

Fixes: debbugs:11862

11 years ago* window.c (set_window_hscroll): Revert the 100000 hscroll limit.
Paul Eggert [Wed, 4 Jul 2012 17:58:55 +0000 (10:58 -0700)]
* window.c (set_window_hscroll): Revert the 100000 hscroll limit.

This should be fixed in a better way; see Eli Zaretskii in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
(HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.

11 years ago* nt/configure.bat (enablechecking): Enable checks through src/config.h.
Juanma Barranquero [Wed, 4 Jul 2012 17:17:19 +0000 (19:17 +0200)]
* nt/configure.bat (enablechecking): Enable checks through src/config.h.

* nt/gmake.defs (DEBUG_CFLAGS): Add -fno-crossjumping.
(CHECKING_CFLAGS): Remove.
(CFLAGS, ESC_CFLAGS): Do not include $(CHECKING_CFLAGS).

* nt/nmake.defs (CHECKING_CFLAGS): Remove.
(CFLAGS, ESC_CFLAGS): Do not include $(CHECKING_CFLAGS).

11 years ago* fileio.c (time_error_value): Rename from special_mtime.
Paul Eggert [Wed, 4 Jul 2012 17:11:11 +0000 (10:11 -0700)]
* fileio.c (time_error_value): Rename from special_mtime.

The old name's problems were noted by Eli Zaretskii in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.

11 years ago* emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
Paul Eggert [Wed, 4 Jul 2012 17:04:09 +0000 (10:04 -0700)]
* emacs.c (gdb_pvec_type): Change it back to enum pvec_type.

This variable's comment says Emacs needs at least one GDB-visible
symbol of type enum pvec_type, to work around GDB problems.
The symbol's value doesn't matter.

11 years ago* alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
Paul Eggert [Wed, 4 Jul 2012 16:52:51 +0000 (09:52 -0700)]
* alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'

that causes compilation to fail on pre-C99 compilers.

11 years agoRemove obsolete configuration options (Windows port).
Juanma Barranquero [Wed, 4 Jul 2012 16:46:42 +0000 (18:46 +0200)]
Remove obsolete configuration options (Windows port).

* admin/CPP-DEFINES (LISP_FLOAT_TYPE): Remove, obsolete.

* nt/config.nt (LISP_FLOAT_TYPE, HAVE_XFREE386, USE_TEXT_PROPERTIES)
(GSSAPI, HAVE_LIBINTL, HAVE_LIBGSSAPI_KRB5, HAVE_LIBGSSAPI)
(HAVE_GSSAPI_H, HAVE_LIBXBD, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET)
(HAVE_MEMCMP): Remove, obsolete.

* src/s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
(HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.

11 years agoFix ChangeLog typos.
Juanma Barranquero [Wed, 4 Jul 2012 16:32:54 +0000 (18:32 +0200)]
Fix ChangeLog typos.

11 years agoClean up syntax-table usage in xml.el
Chong Yidong [Wed, 4 Jul 2012 16:14:05 +0000 (00:14 +0800)]
Clean up syntax-table usage in xml.el

* xml.el (xml--parse-buffer): Use xml-syntax-table.
(xml-parse-tag): Likewise, and avoid changing entity tables.
(xml-syntax-table): Define from scratch, making sure not to give
x2000 and other Unicode spaces whitespace syntax, since those are
not spaces in XML.
(xml-parse-fragment): Delete unused function.
(xml-name-start-char-re, xml-name-char-re, xml-name-re)
(xml-names-re, xml-nmtoken-re, xml-nmtokens-re, xml-char-ref-re)
(xml-entity-ref, xml-pe-reference-re)
(xml-reference-re,xml-att-value-re, xml-tokenized-type-re)
(xml-notation-type-re, xml-enumeration-re, xml-enumerated-type-re)
(xml-att-type-re, xml-default-decl-re, xml-att-def-re)
(xml-entity-value-re): Use syntax references in regexps where
possible; no need to define inside a let-binding.
(xml-parse-dtd): Use xml-pe-reference-re.
(xml-entity-or-char-ref-re): New defconst.
(xml-parse-string, xml-substitute-special): Use it.

11 years ago* lisp/files.el (locate-dominating-file): Allow `name' to be a predicate.
Stefan Monnier [Wed, 4 Jul 2012 15:59:12 +0000 (11:59 -0400)]
* lisp/files.el (locate-dominating-file): Allow `name' to be a predicate.
(find-file--read-only): New function.
(find-file-read-only, find-file-read-only-other-window)
(find-file-read-only-other-frame): Use it.
(insert-file-contents-literally): Don't `fset'.
(get-free-disk-space): Use locate-dominating-file.

11 years ago* buffer.c (init_buffer_once): Fix initialization of
Dmitry Antipov [Wed, 4 Jul 2012 15:49:46 +0000 (19:49 +0400)]
* buffer.c (init_buffer_once):  Fix initialization of
headers for buffer_defaults and buffer_local_symbols.
Reported by Juanma Barranquero <lekktu@gmail.com>.

11 years ago* lisp/emacs-lisp/bytecomp.el (byte-compile): Don't signal an error if the
Stefan Monnier [Wed, 4 Jul 2012 14:42:59 +0000 (10:42 -0400)]
* lisp/emacs-lisp/bytecomp.el (byte-compile): Don't signal an error if the
function is already compiled.

11 years agoTurn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
Stefan Monnier [Wed, 4 Jul 2012 14:38:02 +0000 (10:38 -0400)]
Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
* src/lisp.h (enum pvec_type): Use fewer bits.
(PSEUDOVECTOR_SIZE_BITS): New constant.
(PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
(XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
change in pvec_type.
(PSEUDOVECTOR_TYPEP): New macro.
(TYPED_PSEUDOVECTORP): Use it.
* src/fns.c (internal_equal): Adapt code to extract pvectype.
* src/emacs.c (gdb_pvec_type): Update type.
* src/alloc.c (PSEUDOVECTOR_NBYTES): New macro.
(VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
(VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
(SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
(sweep_vectors): Use it.  Use local var `total_bytes' instead of
abusing vector->header.next.nbytes.
(live_vector_p): Use PVEC_TYPE.
(mark_object): Adapt code to extract pvectype.  Use switch.

11 years agoAuto-commit of generated files.
Glenn Morris [Wed, 4 Jul 2012 10:17:38 +0000 (06:17 -0400)]
Auto-commit of generated files.

11 years agoMerge from gnulib.
Paul Eggert [Wed, 4 Jul 2012 08:35:34 +0000 (01:35 -0700)]
Merge from gnulib.

* lib/alloca.in.h: New version from gnulib, incorporating:
2012-07-03 alloca: add support for HP NonStop TNS/E native

11 years ago* doprnt.c (doprnt): Don't assume string length fits in 'int'.
Paul Eggert [Wed, 4 Jul 2012 08:26:20 +0000 (01:26 -0700)]
* doprnt.c (doprnt): Don't assume string length fits in 'int'.

Tighten new eassert a bit.

11 years agoFix compilation with --enable-gcc-warnings and -O1
Dmitry Antipov [Wed, 4 Jul 2012 08:07:26 +0000 (12:07 +0400)]
Fix compilation with --enable-gcc-warnings and -O1
optimization level.
* configure.in: If --enable-gcc-warnings, disable
-Wunsafe-loop-optimizations for -O1 optimization level.
* src/doprnt.c (doprnt): Change type of tem to int, initialize
to avoid compiler warning.  Add eassert.
* src/search.c (simple_search): Initialize match_byte to avoid
compiler warning.  Add eassert.

11 years agoAvoid weird behavior with large horizontal scrolls.
Paul Eggert [Wed, 4 Jul 2012 06:15:31 +0000 (23:15 -0700)]
Avoid weird behavior with large horizontal scrolls.

Without this change, for example, large hscroll values would
mess up Emacs's display on Fedora 15 x86, presumably due to
overflows in int calculations in the display code.
Also, if buffers had long lines, Emacs would freeze.
* window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
(set_window_hscroll): New function, containing the old guts of
Fset_window_hscroll.  Return the clipped value.
(Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
This avoids the need to check against PTRDIFF_MAX.

11 years ago* buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
Paul Eggert [Wed, 4 Jul 2012 05:39:36 +0000 (22:39 -0700)]
* buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.

11 years ago* buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
Dmitry Antipov [Wed, 4 Jul 2012 03:49:19 +0000 (07:49 +0400)]
* buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.

11 years ago* lisp/xml.el (xml-name-regexp): Remove, redundant. Use xml-name-re.
Stefan Monnier [Wed, 4 Jul 2012 03:31:34 +0000 (23:31 -0400)]
* lisp/xml.el (xml-name-regexp): Remove, redundant.  Use xml-name-re.

11 years agoRemove stray empty line.
Paul Eggert [Wed, 4 Jul 2012 02:57:12 +0000 (19:57 -0700)]
Remove stray empty line.

11 years ago* regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
Paul Eggert [Wed, 4 Jul 2012 00:36:28 +0000 (17:36 -0700)]
* regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)

Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
since GCC 4.4.6 issues a bogus warning for them.

11 years agoFix bugs in file timestamp newness comparisons.
Paul Eggert [Wed, 4 Jul 2012 00:04:46 +0000 (17:04 -0700)]
Fix bugs in file timestamp newness comparisons.

* fileio.c (Ffile_newer_than_file_p):
* lread.c (Fload): Use full timestamp resolution of files,
not just the 1-second resolution, so that files that are only
slightly newer still count as newer.
* fileio.c (Ffile_newer_than_file_p): Don't assume file
timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.

11 years ago* fileio.c: Improve handling of file time marker. (Bug#11852)
Paul Eggert [Tue, 3 Jul 2012 23:51:32 +0000 (16:51 -0700)]
* fileio.c: Improve handling of file time marker.  (Bug#11852)

(special_mtime): New function.
(Finsert_file_contents, Fverify_visited_file_modtime):
Use it to set special mtime values consistently.

11 years ago* fileio.c (Finsert_file_contents): Properly handle st_mtime
Andreas Schwab [Tue, 3 Jul 2012 22:03:37 +0000 (00:03 +0200)]
* fileio.c (Finsert_file_contents): Properly handle st_mtime
marker for non-existing file.

11 years ago* make-docfile.c (scan_c_file): Suppress GCC warning.
Paul Eggert [Tue, 3 Jul 2012 21:14:48 +0000 (14:14 -0700)]
* make-docfile.c (scan_c_file): Suppress GCC warning.

11 years ago* src/lisp.h (Fread_file_name): Restore EXFUN
Glenn Morris [Tue, 3 Jul 2012 20:34:47 +0000 (16:34 -0400)]
* src/lisp.h (Fread_file_name): Restore EXFUN
(it's not a normal DEFUN and did not make it into globals.h).

11 years agoAuto-generate EXFUN using make-docfile
Tom Tromey [Tue, 3 Jul 2012 18:24:42 +0000 (12:24 -0600)]
Auto-generate EXFUN using make-docfile

src
* window.c (Fset_window_margins, Fset_window_fringes)
(Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
* textprop.c (Fprevious_property_change): No longer static.
* syntax.c (Fsyntax_table_p): No longer static.
* process.c (Fget_process, Fprocess_datagram_address): No longer
static.
* keymap.c (Flookup_key, Fcopy_keymap): No longer static.
* keyboard.c (Fcommand_execute): No longer static.
Remove EXFUN.
* insdel.c (Fcombine_after_change_execute): No longer static.
* image.c (Finit_image_library): No longer static.
* fileio.c (Fmake_symbolic_link): No longer static.
* eval.c (Ffetch_bytecode): No longer static.
* editfns.c (Fuser_full_name): No longer static.
* doc.c: (Fdocumentation_property, Fsnarf_documentation): No
longer static.
* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
static.
* dired.c (Ffile_attributes): No longer static.
* composite.c (Fcomposition_get_gstring): No longer static.
* callproc.c (Fgetenv_internal): No longer static.

* ccl.h: Remove EXFUNs.
* buffer.h: Remove EXFUNs.
* dispextern.h: Remove EXFUNs.
* intervals.h: Remove EXFUNs.
* fontset.h: Remove EXFUN.
* font.h: Remove EXFUNs.
* dosfns.c (system_process_attributes): Remove EXFUN.
* keymap.h: Remove EXFUNs.
* lisp.h: Remove EXFUNs.
* w32term.h: Remove EXFUNs.
* window.h: Remove EXFUNs.
* xsettings.h: Remove EXFUN.
* xterm.h: Remove EXFUN.

lib-src
* make-docfile.c (enum global_type) <FUNCTION>: New constant.
(struct global) <value>: New field.
(add_global): Add 'value' argument.
(compare_globals): Sort functions at the end.
(close_emacs_globals): New function.
(write_globals): Handle functions.
(scan_c_file): Call add_global for DEFUN.

11 years agoSpeed up generate-new-buffer-name for invisible buffers (bug#1229)
Glenn Morris [Tue, 3 Jul 2012 17:47:32 +0000 (13:47 -0400)]
Speed up generate-new-buffer-name for invisible buffers (bug#1229)

* src/buffer.c (Fgenerate_new_buffer_name):
Speed up finding a new buffer for invisible buffers.

* src/lisp.h (Frandom): Make it visible to C.

11 years agoFix block vector allocation code to allow VECTOR_BLOCK_SIZE
Dmitry Antipov [Tue, 3 Jul 2012 16:35:53 +0000 (20:35 +0400)]
Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
values which aren't power of 2.
* alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.  Verify
it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
accordingly.

11 years ago* src/alloc.c (mark_object): Revert part of last patch to use `switch'.
Stefan Monnier [Tue, 3 Jul 2012 14:37:55 +0000 (10:37 -0400)]
* src/alloc.c (mark_object): Revert part of last patch to use `switch'.
* src/lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.