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.
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.
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.
* 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.
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.
* buffer.c (init_buffer_once): Fix initialization of
headers for buffer_defaults and buffer_local_symbols.
Reported by Juanma Barranquero <lekktu@gmail.com>.
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.
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.
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.
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.
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.
* alloc.c (allocate_vector_block): Remove redundant
calls to mallopt if DOUG_LEA_MALLOC is defined.
(allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
avoid calls to mallopt if zero_vector is returned.
* xml.el: Protect parser against XML bombs.
(xml-entity-expansion-limit): New variable.
(xml-parse-string, xml-substitute-special): Use it.
(xml-parse-dtd): Avoid infloop if the DTD is not terminated.
Cleanup basic buffer management.
* buffer.h (struct buffer): Change layout to use generic vector
marking code. Fix some comments. Change type of 'clip_changed'
to bitfield. Remove unused #ifndef old.
(FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
(GET_OVERLAYS_AT): Fix indentation.
(for_each_per_buffer_object_at): New macro.
* buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
(Fbuffer_local_variables): Use it.
(init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
* alloc.c (allocate_buffer): Adjust to match new layout of
struct buffer. Fix comment.
(mark_overlay): New function.
(mark_buffer): Use it. Use mark_vectorlike to mark normal
Lisp area of struct buffer.
(mark_object): Use it. Adjust marking of misc objects
and related comments.
* lisp/xml.el: Handle entity and character reference expansion correctly.
(xml-default-ns): New variable.
(xml-entity-alist): Use XML spec definitions for lt and amp.
(xml-parse-region): Make first two arguments optional. Discard
text properties.
(xml-parse-tag-1): New function, spun off from xml-parse-tag. All
callers changed.
(xml-parse-tag): Call xml-parse-tag-1. For backward
compatibility, this function should not modify buffer contents.
(xml-parse-tag-1): Fix opening-tag regexp.
(xml-parse-string): Rewrite, handling entity and character
references properly.
(xml--entity-replacement-text): Signal an error if a parameter
entity is undefined.
* test/automated/xml-parse-tests.el (xml-parse-tests--data): More
testcases.
Stefan Monnier [Mon, 2 Jul 2012 13:31:15 +0000 (09:31 -0400)]
* lisp/net/ange-ftp.el (ange-ftp-expand-file-name): Use ange-ftp-ftp-name
and file-name-absolute-p.
(ange-ftp-file-exists-p): Use ange-ftp-file-exists-p for
internal calls.
wrapper that is not needed because the wrapped code is a no-op (zero
machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
* alloc.c (mark_buffer): Simplify. Remove prototype.
(mark_object): Add comment. Reorganize marking of vector-like
objects. Use CHECK_LIVE for all vector-like ojects except buffers
and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
redundant calls to mark_vectorlike for bool vectors.
Eli Zaretskii [Sun, 1 Jul 2012 16:38:53 +0000 (19:38 +0300)]
Fix bug #11827 with file-relative-name on MS-Windows.
lisp/files.el (file-relative-name): Compare file names
case-insensitively if on MS-Windows or MS-DOS, or if
read-file-name-completion-ignore-case is non-nil. Don't use
case-fold-search for this purpose.
Improve xml parameter entity parsing, and add a new ERT test.
* test/automated/xml-parse-tests.el: New file.
* lisp/xml.el (xml--parse-buffer): New function. Move most of
xml-parse-region here.
(xml-parse-region): Copy region into a temporary buffer, since
parameter entity substitution requires changing buffer contents.
Use xml--parse-buffer.
(xml-parse-file): Use xml--parse-buffer.
(xml-parse-dtd): Make parameter entity substitution work right.
Glenn Morris [Sat, 30 Jun 2012 21:22:18 +0000 (14:22 -0700)]
Remove outdated and unnecessary dbus- declarations.
* net/secrets.el, net/tramp-gvfs.el, net/xesam.el, net/zeroconf.el:
Remove outdated and unnecessary dbus- declarations.
(They are in defined dbus.el now.)
Glenn Morris [Sat, 30 Jun 2012 21:10:50 +0000 (14:10 -0700)]
Make --no-site-lisp work for --enable-locallisppath elements
without "site-lisp" in the name.
Ref http://debbugs.gnu.org/10208#25, point iii).
* configure.in (standardlisppath): New output variable.
(lisppath): Use standardlisppath.
* Makefile.in (standardlisppath): New, set by configure.
(epaths-force): Use standardlisppath and locallisppath rather than lisppath.
* src/epaths.in (PATH_SITELOADSEARCH): New.
* src/lread.c (init_lread): Use PATH_SITELOADSEARCH.
Eli Zaretskii [Sat, 30 Jun 2012 15:55:27 +0000 (18:55 +0300)]
Adapt the MS-DOS build to the latest changes.
msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
bootstrap-clean (which doesn't exist).
msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
Remove lines that invoke PAXCTL.
(clean): Fix recipe not to run Unixy shell commands.
msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
(HAVE_STRNCASECMP): Edit to 1.
msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
(C_SWITCH_SYSTEM): Add "-I../msdos".
msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
(GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
(HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
(NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
(NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
(REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
(BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
(mostlyclean-local, distclean-generic): Fix recipe not to run
Unixy shell commands.
src/sysselect.h [DOS_NT]: Don't include sys/select.h.
src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
src/sysdep.c: Don't include dos.h and dosfns.h.
src/process.c (sys_select):
src/msdos.c (sys_select): Accept one more argument and ignore it.
src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
adapt data types and code to that.
src/dosfns.c:
src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
which clashes with the gnulib function of the same name.
src/ w32proc.c (sys_select): Accept and ignore one more argument.
src/w32.c (emacs_gnutls_pull): Call select with one more argument.
lisp/emacs-lisp/timer.el (timer-until): Subtract results of
float-time, instead of taking float-time of the result of
time-subtract, since float-time signals an error for negative time
arguments.
Eli Zaretskii [Sat, 30 Jun 2012 15:32:51 +0000 (18:32 +0300)]
Adapt the MS-DOS build to the latest changes.
msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
bootstrap-clean (which doesn't exist).
msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
Remove lines that invoke PAXCTL.
(clean): Fix recipe not to run Unixy shell commands.
msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
(HAVE_STRNCASECMP): Edit to 1.
msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
(C_SWITCH_SYSTEM): Add "-I../msdos".
msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
(GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
(HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
(NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
(NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
(REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
(BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
(mostlyclean-local, distclean-generic): Fix recipe not to run
Unixy shell commands.
src/sysselect.h [DOS_NT]: Don't include sys/select.h.
src/s/ms-w32.h (select, pselect): Don't define here, they are
defined in sysselect.h
src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
src/sysdep.c: Don't include dos.h and dosfns.h.
src/process.c (sys_select):
src/msdos.c (sys_select): Accept one more argument and ignore it.
src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
adapt data types and code to that.
src/dosfns.c:
src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
which clashes with the gnulib function of the same name.
lisp/emacs-lisp/timer.el (timer-until): Subtract results of
float-time, instead of taking float-time of the result of
time-subtract, since float-time signals an error for negative time
arguments.
Chong Yidong [Sat, 30 Jun 2012 14:21:24 +0000 (22:21 +0800)]
Fix use of eval-and-compile in regexps in xml.el.
* xml.el (xml-*-re): Convert defvars into defconsts, and
eval-and-compile them so eval-and-compile works on derivatives.
(xml--entity-replacement-text): Use eval-and-comple.
Michael Albinus [Sat, 30 Jun 2012 13:18:16 +0000 (15:18 +0200)]
* vc/vc-git.el (vc-git-registered): Use cache property
`git-registered'.
(vc-git-mode-line-string): Call `vc-working-revision' instead of
`vc-git-working-revision' in order to benefit from the cache.
(vc-git-root): Use cache property `git-root'.
Chong Yidong [Sat, 30 Jun 2012 11:33:22 +0000 (19:33 +0800)]
* xml.el: Implement XML parameter entities.
(xml-parameter-entity-alist): New variable.
(xml-parse-region, xml-parse-fragment): Preserve previous values
of xml-entity-alist and xml-parameter-entity-alist, so that
repeated calls on different documents do not change them.
(xml-parse-tag): Fix doctype regexp.
(xml--entity-replacement-text): New function.
(xml-parse-dtd): Use it. Don't handle system entities; doing that
properly requires url retrieval which is unimplemented.
(xml-escape-string): Doc fix.