Paul Eggert [Mon, 9 Jul 2012 16:06:19 +0000 (09:06 -0700)]
Minor improvements to make_formatted_string.
* alloc.c (make_formatted_string): Prefer int to ptrdiff_t
where int is good enough, as vsprintf returns an int.
* lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
Stop ns builds polluting the environment with EMACSDATA, EMACSDOC
It's bad form for one part of a program to communicate with another
part by making persistent changes to the environment of all subsequent
child processes. For example, it can cause odd bugs when building
Emacs from within Emacs (eg bug#6401, maybe).
* nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
(ns_init_paths): Do not set EMACSDATA, EMACSDOC.
* nsterm.h (ns_etc_directory): Add it.
* callproc.c [HAVE_NS]: Include nsterm.h.
(init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
lib-src/makefile.w32-in: Rework dependencies.
($(BLD)/test-distrib.exe): Use LIB_SRC, not SRC.
(LIB_SRC, NT_INC, GNU_LIB, MS_W32_H, CONFIG_H, INTTYPES_H, NTLIB_H)
(SYSTIME_H): New macros.
(SRC): Redefine to point to src/, not current directory.
($(BLD)/ctags.$(O), $(BLD)/ebrowse.$(O), $(BLD)/emacsclient.$(O))
($(BLD)/etags.$(O), $(BLD)/hexl.$(O), $(BLD)/make-docfile.$(O))
($(BLD)/movemail.$(O), $(BLD)/ntlib.$(O), $(BLD)/pop.$(O))
($(BLD)/profile.$(O), $(BLD)/test-distrib.$(O)): Update dependencies.
($(BLD)/regex.$(O)): New dependency.
Move marker debugging code under MARKER_DEBUG.
* marker.c (MARKER_DEBUG): Move marker debugging code under
#ifdef MARKER_DEBUG because byte_char_debug_check is too slow
for bootstrap with --enable-checking (~3x slowdown reported
by Juanma Barranquero <lekktu@gmail.com>).
(verify_bytepos): Move under #ifdef MARKER_DEBUG.
Paul Eggert [Sun, 8 Jul 2012 20:03:56 +0000 (13:03 -0700)]
Restore deprecation warnings, except for older libpng.
* configure.in (WARN_CFLAGS): Remove -Wno-deprecated-declarations.
(HAVE_LIBPNG_PNG_H): Don't bother checking for this if we have png.h.
(PNG_DEPRECATED): Define when compiling with older PNG versions.
Eli Zaretskii [Sun, 8 Jul 2012 16:38:43 +0000 (19:38 +0300)]
Cleanup changes following fix for bug #11832.
src/ xdisp.c (display_line): Add commentary about displaying
truncation glyphs on GUI frames.
(produce_special_glyphs): Move here from term.c.
src/term.c (produce_special_glyphs): Move to xdisp.c.
src/dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
section.
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.
* 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.
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.
* lisp/simple.el (yank-pop-change-selection): Doc fix.
(interprogram-cut-function, interprogram-paste-function): Mention
that we typically mean the clipboard.
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.
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.
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.
* 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.
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.
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.
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.
* 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.
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.
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.
* 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.
* 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.
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.
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).
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'.
* 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.