summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wohler <wohler@newt.com>2013-03-02 14:55:12 -0800
committerBill Wohler <wohler@newt.com>2013-03-02 14:55:12 -0800
commitaef2281c76c1a6ec9cb988b8c339a1ed569f1114 (patch)
treeee1503fffe75c38cc306ad85ca594a5ee2ee27dc
parent21733e4f154f8830fa568a347a0d6dbd59793c2b (diff)
parent2db41375423b6a48a55df2c5922bb2813319f06f (diff)
downloademacs-aef2281c76c1a6ec9cb988b8c339a1ed569f1114.tar.gz
Merge from trunk; up to 2013-03-02T21:05:52Z!eggert@cs.ucla.edu.
-rw-r--r--ChangeLog42
-rw-r--r--Makefile.in31
-rw-r--r--admin/CPP-DEFINES2
-rw-r--r--admin/ChangeLog5
-rw-r--r--autogen/Makefile.in5
-rw-r--r--autogen/config.in18
-rwxr-xr-xautogen/configure297
-rw-r--r--configure.ac219
-rw-r--r--doc/emacs/ChangeLog18
-rw-r--r--doc/emacs/ack.texi4
-rw-r--r--doc/emacs/emacs.texi2
-rw-r--r--doc/emacs/files.texi27
-rw-r--r--doc/emacs/xresources.texi2
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi2
-rw-r--r--doc/lispref/ChangeLog24
-rw-r--r--doc/lispref/display.texi109
-rw-r--r--doc/lispref/elisp.texi4
-rw-r--r--doc/lispref/files.texi3
-rw-r--r--doc/lispref/text.texi2
-rw-r--r--doc/lispref/variables.texi2
-rw-r--r--doc/misc/ChangeLog43
-rw-r--r--doc/misc/Makefile.in2
-rw-r--r--doc/misc/cl.texi16
-rw-r--r--doc/misc/eshell.texi23
-rw-r--r--doc/misc/flymake.texi16
-rw-r--r--doc/misc/gnus-faq.texi8
-rw-r--r--doc/misc/gnus.texi12
-rw-r--r--doc/misc/org.texi13
-rw-r--r--doc/misc/semantic.texi2
-rw-r--r--doc/misc/speedbar.texi2
-rw-r--r--doc/misc/tramp.texi130
-rw-r--r--etc/ChangeLog19
-rw-r--r--etc/DEBUG33
-rw-r--r--etc/MORE.STUFF33
-rw-r--r--etc/NEWS153
-rw-r--r--etc/PROBLEMS35
-rw-r--r--etc/TODO2
-rw-r--r--lib/putenv.c94
-rw-r--r--lisp/ChangeLog373
-rw-r--r--lisp/calc/calc-graph.el2
-rw-r--r--lisp/calc/calc-math.el8
-rw-r--r--lisp/calc/calcalg2.el18
-rw-r--r--lisp/cmuscheme.el6
-rw-r--r--lisp/dired-aux.el14
-rw-r--r--lisp/dired.el5
-rw-r--r--lisp/doc-view.el7
-rw-r--r--lisp/emacs-lisp/bytecomp.el21
-rw-r--r--lisp/emacs-lisp/cl-lib.el6
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el8
-rw-r--r--lisp/emacs-lisp/easy-mmode.el37
-rw-r--r--lisp/emacs-lisp/eieio-base.el20
-rw-r--r--lisp/emacs-lisp/eieio-custom.el38
-rw-r--r--lisp/emacs-lisp/eieio-datadebug.el14
-rw-r--r--lisp/emacs-lisp/eieio-opt.el44
-rw-r--r--lisp/emacs-lisp/eieio-speedbar.el8
-rw-r--r--lisp/emacs-lisp/eieio.el691
-rw-r--r--lisp/emacs-lisp/nadvice.el2
-rw-r--r--lisp/emulation/viper-cmd.el12
-rw-r--r--lisp/eshell/em-cmpl.el2
-rw-r--r--lisp/eshell/em-unix.el4
-rw-r--r--lisp/files.el57
-rw-r--r--lisp/font-lock.el4
-rw-r--r--lisp/gnus/ChangeLog12
-rw-r--r--lisp/gnus/gnus-registry.el16
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/htmlfontify.el2
-rw-r--r--lisp/image-mode.el42
-rw-r--r--lisp/image.el10
-rw-r--r--lisp/imenu.el23
-rw-r--r--lisp/info-look.el8
-rw-r--r--lisp/info.el33
-rw-r--r--lisp/informat.el20
-rw-r--r--lisp/isearch.el14
-rw-r--r--lisp/jka-cmpr-hook.el10
-rw-r--r--lisp/ldefs-boot.el392
-rw-r--r--lisp/net/net-utils.el47
-rw-r--r--lisp/net/tramp-adb.el96
-rw-r--r--lisp/net/tramp-cache.el114
-rw-r--r--lisp/net/tramp-sh.el164
-rw-r--r--lisp/net/tramp.el77
-rw-r--r--lisp/org/ChangeLog70
-rw-r--r--lisp/org/ob-tangle.el9
-rw-r--r--lisp/org/org-agenda.el271
-rw-r--r--lisp/org/org-clock.el6
-rw-r--r--lisp/org/org-datetree.el2
-rw-r--r--lisp/org/org-docview.el2
-rw-r--r--lisp/org/org-id.el10
-rw-r--r--lisp/org/org-indent.el2
-rw-r--r--lisp/org/org-macs.el3
-rw-r--r--lisp/org/org-mobile.el2
-rw-r--r--lisp/org/org-version.el4
-rw-r--r--lisp/org/org.el152
-rw-r--r--lisp/outline.el12
-rw-r--r--lisp/progmodes/inf-lisp.el4
-rw-r--r--lisp/progmodes/ps-mode.el9
-rw-r--r--lisp/progmodes/python.el90
-rw-r--r--lisp/progmodes/simula.el34
-rw-r--r--lisp/progmodes/tcl.el4
-rw-r--r--lisp/progmodes/vera-mode.el3
-rw-r--r--lisp/replace.el60
-rw-r--r--lisp/simple.el49
-rw-r--r--lisp/textmodes/artist.el2
-rw-r--r--lisp/textmodes/ispell.el511
-rw-r--r--lisp/textmodes/paragraphs.el4
-rw-r--r--lisp/textmodes/reftex.el2
-rw-r--r--lisp/textmodes/sgml-mode.el37
-rw-r--r--lisp/textmodes/tex-mode.el4
-rw-r--r--lisp/vc/diff-mode.el9
-rw-r--r--lisp/vc/ediff-util.el2
-rw-r--r--m4/extern-inline.m45
-rw-r--r--m4/gnulib-comp.m41
-rw-r--r--m4/putenv.m46
-rw-r--r--nt/ChangeLog6
-rw-r--r--nt/config.nt2
-rw-r--r--nt/inc/ms-w32.h12
-rw-r--r--src/ChangeLog228
-rw-r--r--src/ChangeLog.102
-rw-r--r--src/Makefile.in34
-rw-r--r--src/autodeps.mk1
-rw-r--r--src/bidi.c13
-rw-r--r--src/callint.c6
-rw-r--r--src/deps.mk2
-rw-r--r--src/editfns.c5
-rw-r--r--src/emacs.c26
-rw-r--r--src/eval.c2
-rw-r--r--src/filelock.c214
-rw-r--r--src/indent.c31
-rw-r--r--src/intervals.h4
-rw-r--r--src/keyboard.c101
-rw-r--r--src/lisp.h14
-rw-r--r--src/macros.c2
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/marker.c2
-rw-r--r--src/mem-limits.h43
-rw-r--r--src/pre-crt0.c10
-rw-r--r--src/ralloc.c188
-rw-r--r--src/search.c51
-rw-r--r--src/sheap.c4
-rw-r--r--src/textprop.c241
-rw-r--r--src/unexaix.c2
-rw-r--r--src/unexcoff.c4
-rw-r--r--src/vm-limit.c111
-rw-r--r--src/w32.c54
-rw-r--r--src/w32proc.c38
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c24
-rw-r--r--test/ChangeLog23
-rw-r--r--test/automated/python-tests.el2216
149 files changed, 5976 insertions, 3064 deletions
diff --git a/ChangeLog b/ChangeLog
index 9db5d2c3f39..84d9987ccea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2013-03-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib, incorporating:
+ 2013-02-21 putenv: port better to native Windows
+ 2013-02-18 extern-inline: avoid compilation error with HP-UX cc
+ 2013-02-14 putenv: fix heap corruption with mixed putenv/_putenv
+
+2013-02-28 Ken Brown <kbrown@cornell.edu>
+
+ * configure.ac (HAVE_DATA_START): Fix test. (Bug#13818)
+
+2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify data_start configuration (Bug#13783).
+ * configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START)
+ (LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove.
+ (AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's
+ not always needed.
+ (HAVE_DATA_START): New macro.
+
+2013-02-18 Aidan Gauland <aidalgol@no8wireless.co.nz>
+
+ * lisp/eshell/em-cmpl.el: Corrected "context-related help"
+ keybinding in commentary.
+
+2013-02-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ Parallelize documentation builds.
+ This speeds up building of documentation on multiprocessor
+ platforms, and is motivated by Texinfo 5.0, which is much slower.
+ Add a toplevel rule 'make docs' to make all the documentation.
+ * .bzrignore: Add .dvi, .html, .ps.
+ * Makefile.in (DVIS, HTMLS, INFOS, PSS, DOCS): New macros.
+ ($(DOCS), docs, vi, html, pdf, ps): New rules.
+ (info-real): Depend on $(INFOS) rather than doing it sequentially.
+ (dvi): Depend on $(DVIS) rather than doing it sequentially.
+
+2013-02-18 Aidan Gauland <aidalgol@no8wireless.co.nz>
+
+ * doc/misc/eshell.texi: Added documentation for Eshell insert
+ output redirection operator, >>>.
+
2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
Fix AIX port (Bug#13650).
diff --git a/Makefile.in b/Makefile.in
index a2de4f3b164..42b900401f7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -54,6 +54,9 @@
# make bootstrap
# Removes all the compiled files to force a new bootstrap from a
# clean slate, and then build in the normal way.
+#
+# make docs
+# Make Emacs documentation files from their sources; requires makeinfo.
SHELL = /bin/sh
@@ -859,13 +862,25 @@ check:
dist:
cd ${srcdir}; ./make-dist
+DVIS = lispref-dvi lispintro-dvi emacs-dvi misc-dvi
+HTMLS = lispref-html lispintro-html emacs-html misc-html
+INFOS = lispref-info lispintro-info emacs-info misc-info
+PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf
+PSS = lispref-ps lispintro-ps emacs-ps # no misc-ps
+
+DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
+$(DOCS):
+ t=$@; IFS=-; set $$t; IFS=; cd doc/$$1 && $(MAKE) $(MFLAGS) $$2
+
+.PHONY: $(DOCS) docs pdf ps
.PHONY: info dvi dist check html info-real force-info check-info-dir
-info-real:
- (cd doc/emacs; $(MAKE) $(MFLAGS) info)
- (cd doc/misc; $(MAKE) $(MFLAGS) info)
- (cd doc/lispref; $(MAKE) $(MFLAGS) info)
- (cd doc/lispintro; $(MAKE) $(MFLAGS) info)
+docs: $(DOCS)
+dvi: $(DVIS)
+html: $(HTMLS)
+info-real: $(INFOS)
+pdf: $(PDFS)
+ps: $(PSS)
force-info:
# Note that man/Makefile knows how to put the info files in $(srcdir),
@@ -904,12 +919,6 @@ check-info-dir: info
fi ; \
echo "info/dir is OK"
-dvi:
- (cd doc/emacs; $(MAKE) $(MFLAGS) dvi)
- (cd doc/misc; $(MAKE) $(MFLAGS) dvi)
- (cd doc/lispref; $(MAKE) $(MFLAGS) elisp.dvi)
- (cd doc/lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
-
#### Bootstrapping.
### This first cleans the lisp subdirectory, removing all compiled
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 393cf56e993..da8dec5a0f6 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -90,7 +90,6 @@ BROKEN_NON_BLOCKING_CONNECT
BROKEN_PTY_READ_AFTER_EAGAIN
CLASH_DETECTION
DATA_SEG_BITS
-DATA_START
DEFAULT_SOUND_DEVICE
DEVICE_SEP
DIRECTORY_SEP
@@ -408,7 +407,6 @@ NO_EDITRES
NSIG
NSIG_MINIMUM
NULL_DEVICE
-ORDINARY_LINK
PAGESIZE
PREFER_VSUSP
PTY_ITERATION
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 7e72e10cd9f..28e25ad98a3 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify data_start configuration (Bug#13783).
+ * CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove.
+
2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
Tune by using memchr and memrchr.
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index 65d3880c027..eadb1ab8c22 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -174,7 +174,6 @@ CFLAGS_SOUND = @CFLAGS_SOUND@
COM_ERRLIB = @COM_ERRLIB@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CRT_DIR = @CRT_DIR@
CRYPTOLIB = @CRYPTOLIB@
CYGPATH_W = @CYGPATH_W@
CYGWIN_OBJ = @CYGWIN_OBJ@
@@ -619,7 +618,6 @@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
KRB4LIB = @KRB4LIB@
KRB5LIB = @KRB5LIB@
LDFLAGS = @LDFLAGS@
-LD_FIRSTFLAG = @LD_FIRSTFLAG@
LD_SWITCH_SYSTEM = @LD_SWITCH_SYSTEM@
LD_SWITCH_SYSTEM_TEMACS = @LD_SWITCH_SYSTEM_TEMACS@
LD_SWITCH_X_SITE = @LD_SWITCH_X_SITE@
@@ -659,11 +657,9 @@ LIBX_OTHER = @LIBX_OTHER@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_EACCESS = @LIB_EACCESS@
LIB_EXECINFO = @LIB_EXECINFO@
-LIB_GCC = @LIB_GCC@
LIB_MATH = @LIB_MATH@
LIB_PTHREAD = @LIB_PTHREAD@
LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
-LIB_STANDARD = @LIB_STANDARD@
LIB_TIMER_TIME = @LIB_TIMER_TIME@
LN_S = @LN_S@
LTLIBINTL = @LTLIBINTL@
@@ -858,7 +854,6 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
-START_FILES = @START_FILES@
STDALIGN_H = @STDALIGN_H@
STDARG_H = @STDARG_H@
STDBOOL_H = @STDBOOL_H@
diff --git a/autogen/config.in b/autogen/config.in
index 0492fc20110..12bfc70b090 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -93,9 +93,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Extra bits to be or'd in with any pointers stored in a Lisp_Object. */
#undef DATA_SEG_BITS
-/* Address of the start of the data segment. */
-#undef DATA_START
-
/* Name of the default sound device. */
#undef DEFAULT_SOUND_DEVICE
@@ -259,6 +256,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `copysign' function. */
#undef HAVE_COPYSIGN
+/* Define to 1 if data_start is the address of the start of the main data
+ segment. */
+#undef HAVE_DATA_START
+
/* Define to 1 if using D-Bus. */
#undef HAVE_DBUS
@@ -1129,6 +1130,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `_ftime' function. */
#undef HAVE__FTIME
+/* Define to 1 if you have the `_putenv' function. */
+#undef HAVE__PUTENV
+
/* Define to 1 if _setjmp and _longjmp work. */
#undef HAVE__SETJMP
@@ -1227,9 +1231,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if the nlist n_name member is a pointer */
#undef N_NAME_POINTER
-/* Define if the C compiler is the linker. */
-#undef ORDINARY_LINK
-
/* Name of package */
#undef PACKAGE
@@ -1572,13 +1573,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
_GL_INLINE_HEADER_END contains useful stuff to put
in the same include file, after uses of _GL_INLINE.
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
Suppress the use of extern inline on Apple's platforms,
as Libc-825.25 (2012-09-19) is incompatible with it; see
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
#if ((__GNUC__ \
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__) \
+ : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \
&& !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
diff --git a/autogen/configure b/autogen/configure
index 0ba98637fa4..a1844067f9d 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -605,8 +605,6 @@ LTLIBOBJS
LIBOBJS
SUBDIR_MAKEFILES_IN
WINDOW_SYSTEM_OBJ
-LIB_GCC
-LD_FIRSTFLAG
LD_SWITCH_SYSTEM_TEMACS
LIBGNU_LTLIBDEPS
LIBGNU_LIBDEPS
@@ -1337,7 +1335,6 @@ W32_RES
W32_LIBS
W32_OBJ
WINDRES
-LIB_STANDARD
NS_OBJC_OBJ
NS_OBJ
ns_self_contained
@@ -1352,8 +1349,6 @@ ALSA_LIBS
ALSA_CFLAGS
LIBSOUND
PKG_CONFIG
-CRT_DIR
-START_FILES
LIB_MATH
LIBS_SYSTEM
C_SWITCH_SYSTEM
@@ -1507,7 +1502,6 @@ with_inotify
with_makeinfo
with_compress_info
with_pkg_config_prog
-with_crt_dir
with_gameuser
with_gnustep_conf
enable_ns_self_contained
@@ -2236,8 +2230,6 @@ Optional Packages:
--without-compress-info don't compress the installed Info pages
--with-pkg-config-prog=FILENAME
file name of pkg-config for finding GTK and librsvg
- --with-crt-dir=DIR directory containing crtn.o etc. The default is
- /usr/lib, or /usr/lib64 on some platforms.
--with-gameuser=USER user for shared game score files
--with-gnustep-conf=FILENAME
name of GNUstep.conf; default $GNUSTEP_CONFIG_FILE,
@@ -3326,7 +3318,6 @@ as_fn_append ac_header_list " linux/version.h"
as_fn_append ac_header_list " sys/systeminfo.h"
as_fn_append ac_header_list " coff.h"
as_fn_append ac_header_list " pty.h"
-as_fn_append ac_header_list " sys/vlimit.h"
as_fn_append ac_header_list " sys/resource.h"
as_fn_append ac_header_list " sys/utsname.h"
as_fn_append ac_header_list " pwd.h"
@@ -4368,15 +4359,6 @@ if test "X${with_pkg_config_prog}" != X; then
fi
fi
-CRT_DIR=
-
-# Check whether --with-crt-dir was given.
-if test "${with_crt_dir+set}" = set; then :
- withval=$with_crt_dir;
-fi
-
-CRT_DIR="${with_crt_dir}"
-
# Check whether --with-gameuser was given.
if test "${with_gameuser+set}" = set; then :
@@ -8571,36 +8553,24 @@ fi
LIB_MATH=-lm
-LIB_STANDARD=
-START_FILES=
SYSTEM_TYPE=`echo $opsys | sed -e 's/[0-9].*//' -e 's|-|/|'`
case $opsys in
cygwin )
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
darwin )
## Adding -lm confuses the dynamic linker, so omit it.
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
freebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
SYSTEM_TYPE=berkeley-unix
;;
gnu-linux | gnu-kfreebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
;;
hpux10-20 | hpux11 )
- LIB_STANDARD=-lc
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
;;
netbsd | openbsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
SYSTEM_TYPE=berkeley-unix
;;
@@ -8612,117 +8582,11 @@ esac
-
cat >>confdefs.h <<_ACEOF
#define SYSTEM_TYPE "$SYSTEM_TYPE"
_ACEOF
-crt_files=
-
-for file in x $LIB_STANDARD $START_FILES; do
- case "$file" in
- *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;;
- esac
-done
-
-if test "x$crt_files" != x; then
-
- ## If user specified a crt-dir, use that unconditionally.
- crt_gcc=no
-
- if test "X$CRT_DIR" = "X"; then
-
- CRT_DIR=/usr/lib # default
-
- case "$canonical" in
- x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
- ## On x86-64 and s390x GNU/Linux distributions, the standard library
- ## can be in a variety of places. We only try /usr/lib64 and /usr/lib.
- ## For anything else (eg /usr/lib32), it is up the user to specify
- ## the location (bug#5655).
- ## Test for crtn.o, not just the directory, because sometimes the
- ## directory exists but does not have the relevant files (bug#1287).
- ## FIXME better to test for binary compatibility somehow.
- test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
- ;;
-
- powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;;
- esac
-
- case "$opsys" in
- hpux10-20) CRT_DIR=/lib ;;
- esac
-
- test "x${GCC}" = xyes && crt_gcc=yes
-
- fi # CRT_DIR = ""
-
- crt_missing=
-
- for file in $crt_files; do
-
- ## If we're using gcc, try to determine it automatically by asking
- ## gcc. [If this doesn't work, CRT_DIR will remain at the
- ## system-dependent default from above.]
- if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then
-
- crt_file=`$CC --print-file-name=$file 2>/dev/null`
- case "$crt_file" in
- */*)
- CRT_DIR=`$as_dirname -- "$crt_file" ||
-$as_expr X"$crt_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$crt_file" : 'X\(//\)[^/]' \| \
- X"$crt_file" : 'X\(//\)$' \| \
- X"$crt_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$crt_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- ;;
- esac
- fi
-
- crt_gcc=no
-
- test -e $CRT_DIR/$file || crt_missing="$crt_missing $file"
- done # $crt_files
-
- test "x$crt_missing" = x || \
- as_fn_error "Required file(s) not found:$crt_missing
-Try using the --with-crt-dir option." "$LINENO" 5
-
-fi # crt_files != ""
-
-
-
-case $opsys in
- netbsd | openbsd )
- if test -f $CRT_DIR/crti.o; then
-
- test -f $CRT_DIR/crtn.o || \
- as_fn_error "Required file not found: crtn.o" "$LINENO" 5
-
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
- fi
- ;;
-esac
-
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
@@ -8992,8 +8856,6 @@ done
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if personality LINUX32 can be set" >&5
$as_echo_n "checking if personality LINUX32 can be set... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9719,8 +9581,6 @@ if test "${with_ns}" != no; then
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread"
- LIB_STANDARD=
- START_FILES=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS" >&5
$as_echo_n "checking if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS... " >&6; }
if test "${emacs_cv_objc_exceptions+set}" = set; then :
@@ -9858,7 +9718,6 @@ CPPFLAGS="$tmp_CPPFLAGS"
-
HAVE_W32=no
W32_OBJ=
W32_LIBS=
@@ -10149,6 +10008,50 @@ $as_echo "#define SYSTEM_MALLOC 1" >>confdefs.h
else
test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
VMLIMIT_OBJ=vm-limit.o
+
+ for ac_header in sys/vlimit.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/vlimit.h" "ac_cv_header_sys_vlimit_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_vlimit_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_VLIMIT_H 1
+_ACEOF
+
+fi
+
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for data_start" >&5
+$as_echo_n "checking for data_start... " >&6; }
+if test "${emacs_cv_data_start+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern char data_start[]; char ch;
+int
+main ()
+{
+return data_start < &ch;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ emacs_cv_data_start=yes
+else
+ emacs_cv_data_start=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_data_start" >&5
+$as_echo "$emacs_cv_data_start" >&6; }
+ if test $emacs_cv_data_start = yes; then
+
+$as_echo "#define HAVE_DATA_START 1" >>confdefs.h
+
+ fi
fi
@@ -15808,28 +15711,16 @@ esac
-
case $opsys in
- gnu)
- $as_echo "#define DATA_START ({ extern int data_start; (char *) &data_start; })" >>confdefs.h
-
- ;;
-
aix*)
- $as_echo "#define DATA_START 0x20000000" >>confdefs.h
-
- $as_echo "#define DATA_SEG_BITS 0x20000000" >>confdefs.h
+ $as_echo "#define DATA_SEG_BITS 0x20000000" >>confdefs.h
;;
hpux*)
- $as_echo "#define DATA_START 0x40000000" >>confdefs.h
-
- $as_echo "#define DATA_SEG_BITS 0x40000000" >>confdefs.h
+ $as_echo "#define DATA_SEG_BITS 0x40000000" >>confdefs.h
;;
irix6-5)
- $as_echo "#define DATA_START 0x10000000" >>confdefs.h
-
$as_echo "#define DATA_SEG_BITS 0x10000000" >>confdefs.h
;;
@@ -23382,6 +23273,19 @@ $as_echo "$gl_cv_func_svid_putenv" >&6; }
gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext"
+
+ for ac_func in _putenv
+do :
+ ac_fn_c_check_func "$LINENO" "_putenv" "ac_cv_func__putenv"
+if test "x$ac_cv_func__putenv" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__PUTENV 1
+_ACEOF
+
+fi
+done
+
+
fi
@@ -26644,89 +26548,6 @@ esac
-
-LD_FIRSTFLAG=
-ORDINARY_LINK=
-case "$opsys" in
- ## gnu: GNU needs its own crt0.
- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
-
- ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
- ## library search parth, i.e. it won't search /usr/lib for libc and
- ## friends. Using -nostartfiles instead avoids this problem, and
- ## will also work on earlier NetBSD releases.
- netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;;
-
- ## powerpc*: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
- ## MkLinux/LinuxPPC needs this.
- ## s390x-* only supports opsys = gnu-linux so it can be added here.
- gnu-*)
- case "$canonical" in
- powerpc*|s390x-*) LD_FIRSTFLAG="-nostdlib" ;;
- esac
- ;;
-esac
-
-
-if test "x$ORDINARY_LINK" = "xyes"; then
-
- LD_FIRSTFLAG=""
-
-$as_echo "#define ORDINARY_LINK 1" >>confdefs.h
-
-
-## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are:
-## freebsd, gnu-* not on powerpc*|s390x*.
-elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then
-
- ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
- ## places that are difficult to figure out at make time. Fortunately,
- ## these same versions allow you to pass arbitrary flags on to the
- ## linker, so there is no reason not to use it as a linker.
- ##
- ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from
- ## searching for libraries in its internal directories, so we have to
- ## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
- LD_FIRSTFLAG="-nostdlib"
-fi
-
-## FIXME? What setting of EDIT_LDFLAGS should this have?
-test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic"
-
-
-
-
-## FIXME? The logic here is not precisely the same as that above.
-## There is no check here for a pre-defined LD_FIRSTFLAG.
-## Should we only be setting LIB_GCC if LD ~ -nostdlib?
-LIB_GCC=
-if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
-
- case "$opsys" in
- freebsd|netbsd|openbsd) LIB_GCC= ;;
-
- gnu-*)
- ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
- ## build on ARM EABI under GNU/Linux. (Bug#5518)
- case $host_cpu in
- arm*)
- LIB_GCC="-lgcc_s"
- ;;
- *)
- ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
- ## immediately undefine it again and redefine it to empty.
- ## Was the C_SWITCH_X_SITE part really necessary?
-## LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
- LIB_GCC=
- ;;
- esac
- ;;
-
- ## Ask GCC where to find libgcc.a.
- *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;;
- esac
-fi
-
## Common for all window systems
if test "$window_system" != "none"; then
diff --git a/configure.ac b/configure.ac
index 3b1b9a92b54..cf930e7dee3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,12 +230,6 @@ if test "X${with_pkg_config_prog}" != X; then
fi
fi
-CRT_DIR=
-AC_ARG_WITH([crt-dir],dnl
-[AS_HELP_STRING([--with-crt-dir=DIR],[directory containing crtn.o etc.
-The default is /usr/lib, or /usr/lib64 on some platforms.])])
-CRT_DIR="${with_crt_dir}"
-
AC_ARG_WITH(gameuser,dnl
[AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])])
test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \
@@ -1051,42 +1045,29 @@ AC_DEFUN([AC_TYPE_UID_T])
LIB_MATH=-lm
-LIB_STANDARD=
-START_FILES=
dnl Current possibilities handled by sed (aix4-2 -> aix,
dnl gnu-linux -> gnu/linux, etc.):
dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt.
SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'`
-dnl NB do not use CRT_DIR unquoted here, since it might not be set yet.
case $opsys in
cygwin )
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
darwin )
## Adding -lm confuses the dynamic linker, so omit it.
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
freebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
SYSTEM_TYPE=berkeley-unix
;;
gnu-linux | gnu-kfreebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
;;
hpux10-20 | hpux11 )
- LIB_STANDARD=-lc
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
;;
dnl NB this may be adjusted below.
netbsd | openbsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
SYSTEM_TYPE=berkeley-unix
;;
@@ -1097,96 +1078,9 @@ case $opsys in
esac
AC_SUBST(LIB_MATH)
-AC_SUBST(START_FILES)
AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
[The type of system you are compiling for; sets `system-type'.])
-dnl Not all platforms use crtn.o files. Check if the current one does.
-crt_files=
-
-for file in x $LIB_STANDARD $START_FILES; do
- case "$file" in
- *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;;
- esac
-done
-
-if test "x$crt_files" != x; then
-
- ## If user specified a crt-dir, use that unconditionally.
- crt_gcc=no
-
- if test "X$CRT_DIR" = "X"; then
-
- CRT_DIR=/usr/lib # default
-
- case "$canonical" in
- x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
- ## On x86-64 and s390x GNU/Linux distributions, the standard library
- ## can be in a variety of places. We only try /usr/lib64 and /usr/lib.
- ## For anything else (eg /usr/lib32), it is up the user to specify
- ## the location (bug#5655).
- ## Test for crtn.o, not just the directory, because sometimes the
- ## directory exists but does not have the relevant files (bug#1287).
- ## FIXME better to test for binary compatibility somehow.
- test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
- ;;
-
- powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;;
- esac
-
- case "$opsys" in
- hpux10-20) CRT_DIR=/lib ;;
- esac
-
- test "x${GCC}" = xyes && crt_gcc=yes
-
- fi # CRT_DIR = ""
-
- crt_missing=
-
- for file in $crt_files; do
-
- ## If we're using gcc, try to determine it automatically by asking
- ## gcc. [If this doesn't work, CRT_DIR will remain at the
- ## system-dependent default from above.]
- if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then
-
- crt_file=`$CC --print-file-name=$file 2>/dev/null`
- case "$crt_file" in
- */*)
- CRT_DIR=`AS_DIRNAME(["$crt_file"])`
- ;;
- esac
- fi
-
- dnl We expect all the files to be in a single directory, so after the
- dnl first there is no point asking gcc.
- crt_gcc=no
-
- test -e $CRT_DIR/$file || crt_missing="$crt_missing $file"
- done # $crt_files
-
- test "x$crt_missing" = x || \
- AC_MSG_ERROR([Required file(s) not found:$crt_missing
-Try using the --with-crt-dir option.])
-
-fi # crt_files != ""
-
-AC_SUBST(CRT_DIR)
-
-case $opsys in
- netbsd | openbsd )
- if test -f $CRT_DIR/crti.o; then
-
- test -f $CRT_DIR/crtn.o || \
- AC_MSG_ERROR([Required file not found: crtn.o])
-
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
- fi
- ;;
-esac
-
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
@@ -1304,7 +1198,7 @@ dnl checks for header files
AC_CHECK_HEADERS_ONCE(
linux/version.h sys/systeminfo.h
coff.h pty.h
- sys/vlimit.h sys/resource.h
+ sys/resource.h
sys/utsname.h pwd.h utmp.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
@@ -1521,8 +1415,6 @@ if test "${with_ns}" != no; then
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread"
- LIB_STANDARD=
- START_FILES=
dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1.
dnl If they had chosen to either define it or not, we could have
dnl just used AC_CHECK_DECL here.
@@ -1611,7 +1503,6 @@ AC_SUBST(INSTALL_ARCH_INDEP_EXTRA)
AC_SUBST(ns_self_contained)
AC_SUBST(NS_OBJ)
AC_SUBST(NS_OBJC_OBJ)
-AC_SUBST(LIB_STANDARD)
HAVE_W32=no
W32_OBJ=
@@ -1751,6 +1642,20 @@ if test "${system_malloc}" = "yes"; then
else
test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
VMLIMIT_OBJ=vm-limit.o
+
+ AC_CHECK_HEADERS([sys/vlimit.h])
+ AC_CACHE_CHECK([for data_start], [emacs_cv_data_start],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char data_start[]; char ch;]],
+ [[return data_start < &ch;]])],
+ [emacs_cv_data_start=yes],
+ [emacs_cv_data_start=no])])
+ if test $emacs_cv_data_start = yes; then
+ AC_DEFINE([HAVE_DATA_START], 1,
+ [Define to 1 if data_start is the address of the start
+ of the main data segment.])
+ fi
fi
AC_SUBST(GMALLOC_OBJ)
AC_SUBST(VMLIMIT_OBJ)
@@ -3735,9 +3640,7 @@ case $opsys in
esac
-dnl Used in vm-limit.c
-AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
-dnl Used in lisp.h, emacs.c, mem-limits.h
+dnl Used in lisp.h, emacs.c, vm-limit.c
dnl NEWS.18 describes this as "a number which contains
dnl the high bits to be inclusive or'ed with pointers that are unpacked."
AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
@@ -3745,23 +3648,15 @@ stored in a Lisp_Object.])
dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
case $opsys in
- gnu)
- dnl libc defines data_start.
- AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })])
- ;;
-
aix*)
dnl This works with 32-bit executables; Emacs doesn't support 64-bit.
- AC_DEFINE(DATA_START, [0x20000000])
AC_DEFINE(DATA_SEG_BITS, [0x20000000])
;;
hpux*)
dnl The data segment on this machine always starts at address 0x40000000.
- AC_DEFINE(DATA_START, [0x40000000])
AC_DEFINE(DATA_SEG_BITS, [0x40000000])
;;
irix6-5)
- AC_DEFINE(DATA_START, [0x10000000])
AC_DEFINE(DATA_SEG_BITS, [0x10000000])
;;
esac
@@ -4321,88 +4216,6 @@ esac
AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
-
-LD_FIRSTFLAG=
-ORDINARY_LINK=
-case "$opsys" in
- ## gnu: GNU needs its own crt0.
- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
-
- ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
- ## library search parth, i.e. it won't search /usr/lib for libc and
- ## friends. Using -nostartfiles instead avoids this problem, and
- ## will also work on earlier NetBSD releases.
- netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;;
-
- ## powerpc*: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
- ## MkLinux/LinuxPPC needs this.
- ## s390x-* only supports opsys = gnu-linux so it can be added here.
- gnu-*)
- case "$canonical" in
- powerpc*|s390x-*) LD_FIRSTFLAG="-nostdlib" ;;
- esac
- ;;
-esac
-
-
-if test "x$ORDINARY_LINK" = "xyes"; then
-
- LD_FIRSTFLAG=""
- AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.])
-
-## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are:
-## freebsd, gnu-* not on powerpc*|s390x*.
-elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then
-
- ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
- ## places that are difficult to figure out at make time. Fortunately,
- ## these same versions allow you to pass arbitrary flags on to the
- ## linker, so there is no reason not to use it as a linker.
- ##
- ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from
- ## searching for libraries in its internal directories, so we have to
- ## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
- LD_FIRSTFLAG="-nostdlib"
-fi
-
-## FIXME? What setting of EDIT_LDFLAGS should this have?
-test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic"
-
-AC_SUBST(LD_FIRSTFLAG)
-
-
-## FIXME? The logic here is not precisely the same as that above.
-## There is no check here for a pre-defined LD_FIRSTFLAG.
-## Should we only be setting LIB_GCC if LD ~ -nostdlib?
-LIB_GCC=
-if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
-
- case "$opsys" in
- freebsd|netbsd|openbsd) LIB_GCC= ;;
-
- gnu-*)
- ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
- ## build on ARM EABI under GNU/Linux. (Bug#5518)
- case $host_cpu in
- arm*)
- LIB_GCC="-lgcc_s"
- ;;
- *)
- ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
- ## immediately undefine it again and redefine it to empty.
- ## Was the C_SWITCH_X_SITE part really necessary?
-## LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
- LIB_GCC=
- ;;
- esac
- ;;
-
- ## Ask GCC where to find libgcc.a.
- *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;;
- esac
-fi dnl if $GCC
-AC_SUBST(LIB_GCC)
-
## Common for all window systems
if test "$window_system" != "none"; then
AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index ba6f7e323e0..bd70b1fdebf 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,21 @@
+2013-02-28 Bastien Guerry <bzg@gnu.org>
+
+ * xresources.texi (GTK resources): Fix broken link.
+
+2013-02-25 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (Interlocking): Don't refer to symlinks as the
+ exclusive means of locking files.
+
+2013-02-22 Glenn Morris <rgm@gnu.org>
+
+ * ack.texi (Acknowledgments):
+ * emacs.texi (Acknowledgments): Small updates.
+
+2013-02-21 Glenn Morris <rgm@gnu.org>
+
+ * files.texi (File Conveniences): Not just GIFs can be animated.
+
2013-02-13 Glenn Morris <rgm@gnu.org>
* ack.texi (Acknowledgments): Don't mention yow any more.
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index 718a51c60db..17309f74408 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -202,7 +202,7 @@ Andrew Choi and Yamamoto Mitsuharu wrote the Carbon support, used
prior to Emacs 23 for Mac OS.
@item
-Chong Yidong was the Emacs co-maintainer from Emacs 23 onwards. He made many
+Chong Yidong was the Emacs co-maintainer from Emacs 23 to 24.3. He made many
improvements to the Emacs display engine. He also wrote
@file{tabulated-list.el}, a generic major mode for lists of data;
and improved support for themes and packages.
@@ -825,7 +825,7 @@ facility. He also wrote @code{ebrowse}, the C@t{++} browser;
and @file{rx.el}, a regular expression constructor.
@item
-Stefan Monnier was the Emacs co-maintainer from Emacs 23 onwards. He added
+Stefan Monnier was the Emacs (co-)maintainer from Emacs 23 onwards. He added
support for Arch and Subversion to VC, re-wrote much of the Emacs server
to use the built-in networking primitives, and re-wrote the abbrev and
minibuffer completion code for Emacs 23. He also wrote @code{PCL-CVS},
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 4f11da8032a..bda7c0821c0 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -1375,7 +1375,7 @@ Engster, Hans Henrik Eriksen, Michael Ernst, Ata Etemadi, Frederick
Farnbach, Oscar Figueiredo, Fred Fish, Steve Fisk, Karl Fogel, Gary
Foster, Eric S. Fraga, Romain Francoise, Noah Friedman, Andreas
Fuchs, Shigeru Fukaya, Hallvard Furuseth, Keith Gabryelski, Peter S.
-Galbraith, Kevin Gallagher, Kevin Gallo, Juan León Lahoz García,
+Galbraith, Kevin Gallagher, Fabián E. Gallina, Kevin Gallo, Juan León Lahoz García,
Howard Gayle, Daniel German, Stephen Gildea, Julien Gilles, David
Gillespie, Bob Glickstein, Deepak Goel, David De La Harpe Golden, Boris
Goldowsky, David Goodger, Chris Gray, Kevin Greiner, Michelangelo Grigni, Odd
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index a85c16ee1bc..1f78747eaa6 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -734,10 +734,10 @@ file.
@cindex locking files
When you make the first modification in an Emacs buffer that is
visiting a file, Emacs records that the file is @dfn{locked} by you.
-(It does this by creating a specially-named symbolic link in the same
-directory.) Emacs removes the lock when you save the changes. The
-idea is that the file is locked whenever an Emacs buffer visiting it
-has unsaved changes.
+(It does this by creating a specially-named symbolic link or regular
+file with special contents in the same directory.) Emacs removes the
+lock when you save the changes. The idea is that the file is locked
+whenever an Emacs buffer visiting it has unsaved changes.
@vindex create-lockfiles
You can prevent the creation of lock files by setting the variable
@@ -774,14 +774,14 @@ multiple names, Emacs does not prevent two users from editing it
simultaneously under different names.
A lock file cannot be written in some circumstances, e.g., if Emacs
-lacks the system permissions or the system does not support symbolic
-links. In these cases, Emacs can still detect the collision when you
-try to save a file, by checking the file's last-modification date. If
-the file has changed since the last time Emacs visited or saved it,
-that implies that changes have been made in some other way, and will
-be lost if Emacs proceeds with saving. Emacs then displays a warning
-message and asks for confirmation before saving; answer @kbd{yes} to
-save, and @kbd{no} or @kbd{C-g} cancel the save.
+lacks the system permissions or cannot create lock files for some
+other reason. In these cases, Emacs can still detect the collision
+when you try to save a file, by checking the file's last-modification
+date. If the file has changed since the last time Emacs visited or
+saved it, that implies that changes have been made in some other way,
+and will be lost if Emacs proceeds with saving. Emacs then displays a
+warning message and asks for confirmation before saving; answer
+@kbd{yes} to save, and @kbd{no} or @kbd{C-g} cancel the save.
If you are notified that simultaneous editing has already taken
place, one way to compare the buffer to its file is the @kbd{M-x
@@ -1937,8 +1937,7 @@ or taller than the frame, the usual point motion keys (@kbd{C-f},
displayed. If the image can be animated, the command @kbd{RET}
(@code{image-toggle-animation}) starts or stops the animation.
Animation plays once, unless the option @code{image-animate-loop} is
-non-@code{nil}. Currently, Emacs only supports animation in GIF
-files.
+non-@code{nil}.
@cindex ImageMagick support
@vindex imagemagick-enabled-types
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 7274a9df71c..3723c8e5e1d 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -507,7 +507,7 @@ those are governed by normal X resources (@pxref{Resources}).
The following sections describe how to customize GTK+ resources for
Emacs. For details about GTK+ resources, see the GTK+ API document at
-@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}.
+@uref{http://developer.gnome.org/gtk2/stable/gtk2-Resource-Files.html}.
In GTK+ version 3, GTK+ resources have been replaced by a completely
different system. The appearance of GTK+ widgets is now determined by
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 3366ad6e7f7..3f9208c3c27 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -4583,7 +4583,7 @@ argument to the value returned by its second argument.
@item buffer-name
Without an argument, return the name of the buffer, as a string.
-@itemx buffer-file-name
+@item buffer-file-name
Without an argument, return the name of the file the buffer is
visiting.
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d8a08ee5d3e..42f5b5f5536 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,27 @@
+2013-02-28 Bastien Guerry <bzg@gnu.org>
+
+ * variables.texi (File Local Variables): Fix reference.
+
+2013-02-24 Eli Zaretskii <eliz@gnu.org>
+
+ * files.texi (Magic File Names): Improve wording and indexing.
+
+2013-02-21 Glenn Morris <rgm@gnu.org>
+
+ * display.texi (Multi-Frame Images): Minor rephrasing.
+
+2013-02-20 Glenn Morris <rgm@gnu.org>
+
+ * display.texi (GIF Images, TIFF Images): Delete these nodes.
+ (ImageMagick Images): For :index, use an xref rather than duplicating.
+ (Other Image Types): Add GIF, adjust formatting.
+ (Multi-Frame Images): Rename from Animated Images. Expand section.
+ * elisp.texi (Top): Update menu for these changes.
+
+2013-02-19 Glenn Morris <rgm@gnu.org>
+
+ * text.texi (Change Hooks): Fix typo.
+
2013-02-15 Glenn Morris <rgm@gnu.org>
* modes.texi (Basic Major Modes): 'z' no longer bound in special-mode.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index cc6e980dadc..eae6af9969d 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4199,14 +4199,12 @@ displayed (@pxref{Display Feature Testing}).
* Image Descriptors:: How to specify an image for use in @code{:display}.
* XBM Images:: Special features for XBM format.
* XPM Images:: Special features for XPM format.
-* GIF Images:: Special features for GIF format.
-* TIFF Images:: Special features for TIFF format.
* PostScript Images:: Special features for PostScript format.
* ImageMagick Images:: Special features available through ImageMagick.
* Other Image Types:: Various other formats are supported.
* Defining Images:: Convenient ways to define an image for later use.
* Showing Images:: Convenient ways to display an image once it is defined.
-* Animated Images:: Some image formats can be animated.
+* Multi-Frame Images:: Some images contain more than one frame.
* Image Cache:: Internal mechanisms of image display.
@end menu
@@ -4541,35 +4539,6 @@ the name of a color as it appears in the image file, and @var{color}
specifies the actual color to use for displaying that name.
@end table
-@node GIF Images
-@subsection GIF Images
-@cindex GIF
-
- For GIF images, specify image type @code{gif}.
-
-@table @code
-@item :index @var{index}
-You can use @code{:index} to specify image number @var{index} from a
-GIF file that contains more than one image. If the GIF file doesn't
-contain an image with the specified index, the image displays as a
-hollow box. GIF files with more than one image can be animated,
-@pxref{Animated Images}.
-@end table
-
-@node TIFF Images
-@subsection TIFF Images
-@cindex TIFF
-
- For TIFF images, specify image type @code{tiff}.
-
-@table @code
-@item :index @var{index}
-You can use @code{:index} to specify image number @var{index} from a
-TIFF file that contains more than one image. If the TIFF file doesn't
-contain an image with the specified index, the image displays as a
-hollow box.
-@end table
-
@node PostScript Images
@subsection PostScript Images
@cindex postscript images
@@ -4653,10 +4622,7 @@ Specifies a rotation angle in degrees.
@item :index
@c Doesn't work: http://debbugs.gnu.org/7978
-This has the same meaning as it does for GIF images (@pxref{GIF Images}),
-i.e., it specifies which image to view inside an image bundle file format
-such as DJVM@. You can use the @code{image-metadata} function to
-retrieve the total number of images in an image bundle.
+@xref{Multi-Frame Images}.
@end table
@node Other Image Types
@@ -4681,13 +4647,27 @@ used for each pixel in the PBM that is 0. The default is the frame's
background color.
@end table
- For JPEG images, specify image type @code{jpeg}.
+@noindent
+The remaining image types that Emacs can support are:
- For TIFF images, specify image type @code{tiff}.
+@table @asis
+@item GIF
+Image type @code{gif}.
+Supports the @code{:index} property. @xref{Multi-Frame Images}.
+
+@item JPEG
+Image type @code{jpeg}.
- For PNG images, specify image type @code{png}.
+@item PNG
+Image type @code{png}.
- For SVG images, specify image type @code{svg}.
+@item SVG
+Image type @code{svg}.
+
+@item TIFF
+Image type @code{tiff}.
+Supports the @code{:index} property. @xref{Multi-Frame Images}.
+@end table
@node Defining Images
@subsection Defining Images
@@ -4923,20 +4903,45 @@ cache, it can always be displayed, even if the value of
@var{max-image-size} is subsequently changed (@pxref{Image Cache}).
@end defvar
-@node Animated Images
-@subsection Animated Images
+@node Multi-Frame Images
+@subsection Multi-Frame Images
@cindex animation
@cindex image animation
-Some image files can contain more than one image. This can be used to
-create animation. Currently, Emacs only supports animated GIF files.
-The following functions related to animated images are available.
+@cindex image frames
+Some image files can contain more than one image. We say that there
+are multiple ``frames'' in the image. At present, Emacs supports
+multiple frames for GIF, TIFF, and certain ImageMagick formats such as
+DJVM@.
+
+The frames can be used either to represent multiple ``pages'' (this is
+usually the case with multi-frame TIFF files, for example), or to
+create animation (usually the case with multi-frame GIF files).
+
+A multi-frame image has a property @code{:index}, whose value is an
+integer (counting from 0) that specifies which frame is being displayed.
+
+@defun image-multi-frame-p image
+This function returns non-@code{nil} if @var{image} contains more than
+one frame. The actual return value is a cons @code{(@var{nimages}
+. @var{delay})}, where @var{nimages} is the number of frames and
+@var{delay} is the delay in seconds between them, or @code{nil}
+if the image does not specify a delay. Images that are intended to be
+animated usually specify a frame delay, whereas ones that are intended
+to be treated as multiple pages do not.
+@end defun
+
+@defun image-current-frame image
+This function returns the index of the current frame number for
+@var{image}, counting from 0.
+@end defun
-@defun image-animated-p image
-This function returns non-@code{nil} if @var{image} can be animated.
-The actual return value is a cons @code{(@var{nimages} . @var{delay})},
-where @var{nimages} is the number of frames and @var{delay} is the
-delay in seconds between them.
+@defun image-show-frame image n &optional nocheck
+This function switches @var{image} to frame number @var{n}. It
+replaces a frame number outside the valid range with that of the end
+of the range, unless @var{nocheck} is non-@code{nil}. If @var{image}
+does not contain a frame with the specified number, the image displays
+as a hollow box.
@end defun
@defun image-animate image &optional index limit
@@ -4948,7 +4953,9 @@ forever; if a number animation stops after that many seconds.
@end defun
@noindent Animation operates by means of a timer. Note that Emacs imposes a
-minimum frame delay of 0.01 seconds.
+minimum frame delay of 0.01 (@code{image-minimum-frame-delay}) seconds.
+If the image itself does not specify a delay, Emacs uses
+@code{image-default-frame-delay}.
@defun image-animate-timer image
This function returns the timer responsible for animating @var{image},
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 3d1c4cf577d..8ff34941b7d 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1417,15 +1417,13 @@ Images
* Image Descriptors:: How to specify an image for use in @code{:display}.
* XBM Images:: Special features for XBM format.
* XPM Images:: Special features for XPM format.
-* GIF Images:: Special features for GIF format.
-* TIFF Images:: Special features for TIFF format.
* PostScript Images:: Special features for PostScript format.
* ImageMagick Images:: Special features available through ImageMagick.
* Other Image Types:: Various other formats are supported.
* Defining Images:: Convenient ways to define an image for later use.
* Showing Images:: Convenient ways to display an image once
it is defined.
-* Animated Images:: Some image formats can be animated.
+* Multi-Frame Images:: Some images contain more than one frame.
* Image Cache:: Internal mechanisms of image display.
Buttons
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index be44590f2ec..971e38f20b7 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2681,7 +2681,7 @@ no prefix argument is given, and @code{nil} otherwise.
You can implement special handling for certain file names. This is
called making those names @dfn{magic}. The principal use for this
-feature is in implementing remote file names (@pxref{Remote Files,,
+feature is in implementing access to remote files (@pxref{Remote Files,,
Remote Files, emacs, The GNU Emacs Manual}).
To define a kind of magic file name, you must supply a regular
@@ -2689,6 +2689,7 @@ expression to define the class of names (all those that match the
regular expression), plus a handler that implements all the primitive
Emacs file operations for file names that match.
+@cindex file handler
@vindex file-name-handler-alist
The variable @code{file-name-handler-alist} holds a list of handlers,
together with regular expressions that determine when to apply each
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 00ec62ec49d..c6cbfa5b3f8 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -4344,7 +4344,7 @@ This variable holds a list of functions to call after any buffer
modification. Each function receives three arguments: the beginning
and end of the region just changed, and the length of the text that
existed before the change. All three arguments are integers. The
-buffer has been changed is always the current buffer.
+buffer that has been changed is always the current buffer.
The length of the old text is the difference between the buffer
positions before and after that text as it was before the change. As
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 3f4edebfb8b..4bcf7985f0c 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1556,7 +1556,7 @@ an ordinary evaluated argument.
A file can specify local variable values; Emacs uses these to create
buffer-local bindings for those variables in the buffer visiting that
-file. @xref{File variables, , Local Variables in Files, emacs, The
+file. @xref{File Variables, , Local Variables in Files, emacs, The
GNU Emacs Manual}, for basic information about file-local variables.
This section describes the functions and variables that affect how
file-local variables are processed.
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index d24f2b593d4..b256bac417f 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,46 @@
+2013-03-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Inline methods): Remove "ssh1", "ssh2", "plink1"
+ and "plink2" entries. "plink2" is obsolete for a long time.
+ (External methods): Remove "scp1" and "scp2" entries. Explain
+ user name and host name specification for "adb".
+
+2013-02-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (External methods): Mention `tramp-adb-program'.
+
+2013-02-28 Bastien Guerry <bzg@gnu.org>
+
+ * org.texi (Visibility cycling): Suggest to set
+ `org-agenda-inhibit-startup' to nil if user wants the startup
+ visibility settings to be honored in any circumstances.
+ (Progress logging, Checkboxes): Fix typos.
+
+2013-02-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (top) [xxx, yyy, trampfn]: Provide two versions of
+ the macros, for Texinfo 4.13 and 5.0.
+
+2013-02-24 Michael Albinus <michael.albinus@gmx.de>
+
+ Port Tramp documentation to Texinfo 5.0.
+ * tramp.texi (top) [xxx, yyy, trampfn]: Remove superfluous @c.
+ (Filename Syntax): Do not use @trampfn{} in @item.
+ (Filename completion): Use @columnfractions in @multitable.
+
+2013-02-22 Glenn Morris <rgm@gnu.org>
+
+ * flymake.texi (Syntax check statuses): Fix multitable continued rows.
+
+2013-02-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.in (html): New rule.
+
+2013-02-20 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Android shell setup): Improve. Reported by Thierry
+ Volpiatto <thierry.volpiatto@gmail.com>.
+
2013-02-16 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi (Top, Configuration): Insert section `Android shell
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 3dac35aafee..add1b42a545 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -192,6 +192,8 @@ webhack: clean
dvi: $(DVI_TARGETS)
+html: $(HTML_TARGETS)
+
pdf: $(PDF_TARGETS)
# Note that all the Info targets build the Info files in srcdir.
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 11f19c8df06..83df411cb23 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -703,14 +703,6 @@ The type symbol @code{real} is a synonym for @code{number}, and
The type symbols @code{character} and @code{string-char} match
integers in the range from 0 to 255.
-@c No longer relevant, so covered by first item above (float -> floatp).
-@ignore
-@item
-The type symbol @code{float} uses the @code{cl-floatp-safe} predicate
-defined by this package rather than @code{floatp}, so it will work
-correctly even in Emacs versions without floating-point support.
-@end ignore
-
@item
The type list @code{(integer @var{low} @var{high})} represents all
integers between @var{low} and @var{high}, inclusive. Either bound
@@ -2921,14 +2913,6 @@ This predicate tests whether @var{integer} is even. It is an
error if the argument is not an integer.
@end defun
-@ignore
-@defun cl-floatp-safe object
-This predicate tests whether @var{object} is a floating-point
-number. On systems that support floating-point, this is equivalent
-to @code{floatp}. On other systems, this always returns @code{nil}.
-@end defun
-@end ignore
-
@node Numerical Functions
@section Numerical Functions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 94093dc15ce..ec01f731daf 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -83,8 +83,8 @@ handling the sort of tasks accomplished by those tools.
* GNU Free Documentation License:: The license for this documentation.
* Concept Index::
* Function and Variable Index::
-* Key Index::
* Command Index::
+* Key Index::
@end menu
@node What is Eshell?
@@ -285,8 +285,8 @@ history and invoking commands in a script file.
@menu
* Invocation::
* Arguments::
-* Variables::
* Built-ins::
+* Variables::
* Aliases::
* History::
* Completion::
@@ -465,7 +465,7 @@ Uses TRAMP's @command{su} or @command{sudo} method to run a command via
@end table
-@section Built-in variables
+@subsection Built-in variables
Eshell knows a few built-in variables:
@table @code
@@ -709,11 +709,17 @@ which commands need to be run in a terminal, add them to the list
@var{eshell-visual-commands}.
Redirection is mostly the same in Eshell as it is in other command
-shells. The output redirection operators @code{>} and @code{>>} as well
-as pipes are supported, but there is not yet any support for input
-redirection. Output can also be redirected to Elisp functions, using
+shells. The output redirection operators @code{>} and @code{>>} as
+well as pipes are supported, but there is not yet any support for
+input redirection. Output can also be redirected to buffers, using
+the @code{>>>} redirection operator, and Elisp functions, using
virtual devices.
+The buffer redirection operator, @code{>>>}, expects a buffer object
+on the right-hand side, into which it inserts the output of the
+left-hand side. e.g., @samp{echo hello >>> #<buffer *scratch*>}
+inserts the string @code{"hello"} into the @code{*scratch*} buffer.
+
@var{eshell-virtual-targets} is a list of mappings of virtual device
names to functions. Eshell comes with two virtual devices:
@file{/dev/kill}, which sends the text to the kill ring, and
@@ -725,8 +731,9 @@ by adding a list of the form @code{("/dev/name" function mode)} to
@code{function} may be either a lambda or a function name. If
@code{mode} is nil, then the function is the output function; if it is
non-nil, then the function is passed the redirection mode as a
-symbol--@code{overwrite}, @code{append}, or @code{insert}--and the
-function is expected to return the output function.
+symbol--@code{overwrite} for @code{>}, @code{append} for @code{>>}, or
+@code{insert} for @code{>>>}--and the function is expected to return
+the output function.
The output function is called once on each line of output until
@code{nil} is passed, indicating end of output.
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 79259a76503..5dedda16ee1 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -210,14 +210,14 @@ The following statuses are defined.
@multitable @columnfractions 0.25 0.75
@item Flymake* or Flymake:E/W*
@tab Flymake is currently running. For the second case, E/W contains the
- error and warning count for the previous run.
+error and warning count for the previous run.
@item Flymake
@tab Syntax check is not running. Usually this means syntax check was
- successfully passed (no errors, no warnings). Other possibilities are:
- syntax check was killed as a result of executing
- @code{flymake-compile}, or syntax check cannot start as compilation
- is currently in progress.
+successfully passed (no errors, no warnings). Other possibilities are:
+syntax check was killed as a result of executing
+@code{flymake-compile}, or syntax check cannot start as compilation
+is currently in progress.
@item Flymake:E/W
@tab Number of errors/warnings found by the syntax check process.
@@ -232,9 +232,9 @@ OFF for the buffer.
@multitable @columnfractions 0.25 0.75
@item CFGERR
@tab Syntax check process returned nonzero exit code, but no
- errors/warnings were reported. This indicates a possible configuration
- error (for example, no suitable error message patterns for the
- syntax check tool).
+errors/warnings were reported. This indicates a possible configuration
+error (for example, no suitable error message patterns for the
+syntax check tool).
@item NOMASTER
@tab Flymake was unable to find master file for the current buffer.
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi
index e7367730040..ede957a5c35 100644
--- a/doc/misc/gnus-faq.texi
+++ b/doc/misc/gnus-faq.texi
@@ -3,8 +3,8 @@
@c %**start of header
@c Copyright (C) 1995, 2001-2013 Free Software Foundation, Inc.
@c
-@setfilename gnus-faq.info
-@settitle Frequently Asked Questions
+@c @setfilename gnus-faq.info
+@c @settitle Frequently Asked Questions
@c %**end of header
@c
@@ -41,7 +41,7 @@ Please submit features and suggestions to the
@email{ding@@gnus.org, ding list}.
@node FAQ - Changes
-@subheading Changes
+@subsection Changes
@@ -57,7 +57,7 @@ reference to discontinued service.
@end itemize
@node FAQ - Introduction
-@subheading Introduction
+@subsection Introduction
This is the Gnus Frequently Asked Questions list.
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 65e2ce6150e..983887d721d 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14541,6 +14541,7 @@ maildir, for instance.
@menu
* Mail Source Specifiers:: How to specify what a mail source is.
+* Mail Source Functions::
* Mail Source Customization:: Some variables that influence things.
* Fetching Mail:: Using the mail source specifiers.
@end menu
@@ -15000,6 +15001,7 @@ useful when you use local mail and news.
@end table
@end table
+@node Mail Source Functions
@subsubsection Function Interface
Some of the above keywords specify a Lisp function to be executed.
@@ -16068,6 +16070,10 @@ Spool}).
* Mail Spool:: Store your mail in a private spool?
* MH Spool:: An mhspool-like back end.
* Maildir:: Another one-file-per-message format.
+* nnmaildir Group Parameters::
+* Article Identification::
+* NOV Data::
+* Article Marks::
* Mail Folders:: Having one file for each group.
* Comparing Mail Back Ends:: An in-depth looks at pros and cons.
@end menu
@@ -16375,6 +16381,7 @@ different in the future. If your split rules create new groups,
remember to supply a @code{create-directory} server parameter.
@end table
+@node nnmaildir Group Parameters
@subsubsection Group parameters
@code{nnmaildir} uses several group parameters. It's safe to ignore
@@ -16485,6 +16492,7 @@ that are either marked with @code{tick} or not marked with
@code{read}, plus a little extra.
@end table
+@node Article Identification
@subsubsection Article identification
Articles are stored in the @file{cur/} subdirectory of each maildir.
Each article file is named like @code{uniq:info}, where @code{uniq}
@@ -16497,6 +16505,7 @@ about the corresponding article. The full pathname of an article is
available in the variable @code{nnmaildir-article-file-name} after you
request the article in the summary buffer.
+@node NOV Data
@subsubsection NOV data
An article identified by @code{uniq} has its @acronym{NOV} data (used
to generate lines in the summary buffer) stored in
@@ -16510,6 +16519,7 @@ file, but @emph{beware}: this will also cause @code{nnmaildir} to
assign a new article number for this article, which may cause trouble
with @code{seen} marks, the Agent, and the cache.
+@node Article Marks
@subsubsection Article marks
An article identified by @code{uniq} is considered to have the mark
@code{flag} when the file @file{.nnmaildir/marks/flag/uniq} exists.
@@ -25850,8 +25860,8 @@ of all messages matching a particular set of criteria.
@menu
* Gnus Registry Setup::
-* Fancy splitting to parent::
* Registry Article Refer Method::
+* Fancy splitting to parent::
* Store custom flags and keywords::
* Store arbitrary data::
@end menu
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 16015e49362..1d7de18ada6 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -2,7 +2,7 @@
@c %**start of header
@setfilename ../../info/org
@settitle The Org Manual
-@set VERSION 7.9.3e (GNU Emacs 24.3)
+@set VERSION 7.9.3f (GNU Emacs 24.3)
@c Use proper quote and backtick for code sections in PDF output
@c Cf. Texinfo manual 14.2
@@ -1296,6 +1296,7 @@ Copy the @i{visible} text in the region into the kill ring.
@end table
@vindex org-startup-folded
+@vindex org-agenda-inhibit-startup
@cindex @code{overview}, STARTUP keyword
@cindex @code{content}, STARTUP keyword
@cindex @code{showall}, STARTUP keyword
@@ -1314,6 +1315,10 @@ buffer:
#+STARTUP: showeverything
@end example
+The startup visibility options are ignored when the file is open for the
+first time during the agenda generation: if you want the agenda to honor
+the startup visibility, set @code{org-agenda-inhibit-startup} to nil.
+
@cindex property, VISIBILITY
@noindent
Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
@@ -2439,7 +2444,7 @@ You may reference a rectangular range of fields by specifying two field
references connected by two dots @samp{..}. If both fields are in the
current row, you may simply use @samp{$2..$7}, but if at least one field
is in a different row, you need to use the general @code{@@row$column}
-format at least for the first field (i.e., the reference must start with
+format at least for the first field (i.e the reference must start with
@samp{@@} in order to be interpreted correctly). Examples:
@example
@@ -4075,7 +4080,7 @@ module @file{org-depend.el}.
Org mode can automatically record a timestamp and possibly a note when
you mark a TODO item as DONE, or even each time you change the state of
-a TODO item. This system is highly configurable, settings can be on a
+a TODO item. This system is highly configurable; settings can be on a
per-keyword basis and can be localized to a file or even a subtree. For
information on how to clock working time for a task, see @ref{Clocking
work time}.
@@ -4431,7 +4436,7 @@ lists. But you can allow it by modifying @code{org-list-automatic-rules}
accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting
it with the string @samp{[ ]}. This feature is similar to TODO items
(@pxref{TODO Items}), but is more lightweight. Checkboxes are not included
-into the global TODO list, so they are often great to split a task into a
+in the global TODO list, so they are often great to split a task into a
number of simple steps. Or you can use them in a shopping list. To toggle a
checkbox, use @kbd{C-c C-c}, or use the mouse (thanks to Piotr Zielinski's
@file{org-mouse.el}).
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi
index de5019ee897..f43316f5012 100644
--- a/doc/misc/semantic.texi
+++ b/doc/misc/semantic.texi
@@ -520,7 +520,7 @@ Regression tests from the older Semantic 1.x API.
@node Glossary
@appendix Glossary
-@table @keyword
+@table @asis
@item BNF
In semantic 1.4, a BNF file represented ``Bovine Normal Form'', the
grammar file used for the 1.4 parser generator. This was a play on
diff --git a/doc/misc/speedbar.texi b/doc/misc/speedbar.texi
index 7227e2597ae..3cb0ec3aed8 100644
--- a/doc/misc/speedbar.texi
+++ b/doc/misc/speedbar.texi
@@ -223,7 +223,7 @@ Text in speedbar consists of four different types of data. Knowing how
to read these textual elements will make it easier to navigate by
identifying the types of data available.
-@subsubsection Groups
+@subsection Groups
@cindex groups
Groups summarize information in a single line, and provide a high level
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 64b5ea40f24..84eee0c4319 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -20,6 +20,33 @@
@c xxx and yyy are auxiliary macros in order to omit leading and
@c trailing whitespace. Not very elegant, but I don't know it better.
+@c There are subtle differences between texinfo 4.13 and 5.0. We must
+@c declare two versions of the macro. This will be improved, hopefully.
+
+@c Texinfo 5.0.
+@ifset txicommandconditionals
+@macro xxx {one}
+@set \one\
+@end macro
+
+@macro yyy {one, two}
+@xxx{x\one\}@c
+@ifclear x
+\one\@w{}\two\@c
+@end ifclear
+@clear x\one\
+@end macro
+
+@macro trampfn {method, user, host, localname}
+@value{prefix}@c
+@yyy{\method\,@value{postfixhop}}@c
+@yyy{\user\,@@}@c
+\host\@value{postfix}\localname\
+@end macro
+@end ifset
+
+@c Texinfo 4.13.
+@ifclear txicommandconditionals
@macro xxx {one}@c
@set \one\@c
@end macro
@@ -35,6 +62,7 @@
@macro trampfn {method, user, host, localname}@c
@value{prefix}@yyy{\method\,@value{postfixhop}}@yyy{\user\,@@}\host\@value{postfix}\localname\@c
@end macro
+@end ifclear
@copying
Copyright @copyright{} 1999--2013 Free Software Foundation, Inc.
@@ -144,9 +172,6 @@ For the end user:
* Usage:: An overview of the operation of @value{tramp}.
* Bug Reports:: Reporting Bugs and Problems.
* Frequently Asked Questions:: Questions and answers from the mailing list.
-* Function Index:: @value{tramp} functions.
-* Variable Index:: User options and variables.
-* Concept Index:: An item for each concept.
For the developer:
@@ -155,6 +180,9 @@ For the developer:
* Issues:: Debatable Issues and What Was Decided.
* GNU Free Documentation License:: The license for this documentation.
+* Function Index:: @value{tramp} functions.
+* Variable Index:: User options and variables.
+* Concept Index:: An item for each concept.
@detailmenu
--- The Detailed Node Listing ---
@@ -621,13 +649,6 @@ Connect to the remote host with @command{ssh}. This is identical to
the previous option except that the @command{ssh} package is used,
making the connection more secure.
-There are also two variants, @option{ssh1} and @option{ssh2}, that
-call @samp{ssh -1} and @samp{ssh -2}, respectively. This way, you can
-explicitly select whether you want to use the SSH protocol version 1
-or 2 to connect to the remote host. (You can also specify in
-@file{~/.ssh/config}, the SSH configuration file, which protocol
-should be used, and use the regular @option{ssh} method.)
-
All the methods based on @command{ssh} have an additional feature: you
can specify a host name which looks like @file{host#42} (the real host
name, then a hash sign, then a port number). This means to connect to
@@ -723,16 +744,6 @@ remote host.
This supports the @samp{-P} argument.
-Additionally, the methods @option{plink1} and @option{plink2} are
-provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in
-order to use SSH protocol version 1 or 2 explicitly.
-
-CCC: Do we have to connect to the remote host once from the command
-line to accept the SSH key? Maybe this can be made automatic?
-
-CCC: Say something about the first shell command failing. This might
-be due to a wrong setting of @code{tramp-rsh-end-of-line}.
-
@item @option{plinkx}
@cindex method plinkx
@@ -796,13 +807,6 @@ The cost of the cryptographic handshake at the start of an @command{scp}
session can begin to absorb the advantage that the lack of encoding and
decoding presents.
-There are also two variants, @option{scp1} and @option{scp2}, that
-call @samp{ssh -1} and @samp{ssh -2}, respectively. This way, you can
-explicitly select whether you want to use the SSH protocol version 1
-or 2 to connect to the remote host. (You can also specify in
-@file{~/.ssh/config}, the SSH configuration file, which protocol
-should be used, and use the regular @option{scp} method.)
-
All the @command{ssh} based methods support the @samp{-p} feature
where you can specify a port number to connect to in the host name.
For example, the host name @file{host#42} tells @value{tramp} to
@@ -995,9 +999,23 @@ name.
@cindex adb method
This special method uses the Android Debug Bridge for connecting
-Android devices. The Android Debug Bridge, part of the Android SDK,
-must be installed locally. The variable @var{tramp-adb-sdk-dir} must
-be set to its installation directory.
+Android devices. The Android Debug Bridge must be installed locally.
+Some GNU/Linux distributions offer it for installation, otherwise it
+can be installed as part of the Android SDK. If @command{adb} is not
+found via the @code{$PATH} environment variable, the variable
+@var{tramp-adb-program} must point to its absolute path.
+
+Usually, the @command{adb} method does not need any user name. It
+runs under the permissions of the @command{adbd} process on the
+Android device. If a user name is specified, @value{tramp} applies an
+@command{su} on the device. This does not work with all Android
+devices, especially with nonrooted ones. In that case, an error
+message is displayed.
+
+If there is exactly one Android device connected to the local machine,
+a host name is not needed. The shortest @value{tramp} name to be used
+is @file{@trampfn{adb, , ,}} therefore. Otherwise, one could find
+potential host names with the shell command @command{adb devices}.
@end table
@@ -2016,7 +2034,7 @@ local machine.
When an @command{sshd} process runs on the Android device, like
provided by the @code{SSHDroid} app, any @option{ssh}-based method can
-be used. However, this requires some special settings.
+be used. This requires some special settings.
The default shell @code{/bin/sh} does not exist. Instead, you shall
use just @code{sh}, which invokes the shell installed on the device.
@@ -2030,24 +2048,51 @@ You can instruct @value{tramp} by this form:
@noindent
with @samp{192.168.0.26} being the IP address of your Android device.
-The user settings for the @code{$PATH} environment valiable must be
-preserved. Add this setting:
+The user settings for the @code{$PATH} environment variable must be
+preserved. It has also been reported, that the commands in
+@file{/system/xbin} are better suited than the ones in
+@file{/system/bin}. Add these setting:
@lisp
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
+(add-to-list 'tramp-remote-path "/system/xbin")
@end lisp
+@noindent
If the Android device is not @samp{rooted}, you must give the shell a
-writable directory for temporary files. You could use this setting:
+writable directory for temporary files:
@lisp
(add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME")
@end lisp
+@noindent
Now you shall be able to open a remote connection with @kbd{C-x C-f
@trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd}
listens on port @samp{2222}.
+It is also recommended to add a corresponding entry to your
+@file{~/.ssh/config} for that connection, like
+
+@example
+Host android
+ HostName 192.168.0.26
+ User root
+ Port 2222
+@end example
+
+@noindent
+In this case, you must change the setting for the remote shell to
+
+@lisp
+(add-to-list 'tramp-connection-properties
+ (list (regexp-quote "android") "remote-shell" "sh"))
+@end lisp
+
+@noindent
+You would open the connection with @kbd{C-x C-f @trampfn{ssh, ,
+android, }} then.
+
@node Auto-save and Backup
@section Auto-save and Backup configuration
@@ -2296,25 +2341,25 @@ using the default method. @xref{Default Method}.
Some examples of @value{tramp} filenames are shown below.
@table @file
-@item @trampfn{, , melancholia, .emacs}
+@item @value{prefix}melancholia@value{postfix}.emacs
Edit the file @file{.emacs} in your home directory on the machine
@code{melancholia}.
-@item @trampfn{, , melancholia.danann.net, .emacs}
+@item @value{prefix}melancholia.danann.net@value{postfix}.emacs
This edits the same file, using the fully qualified domain name of
the machine.
-@item @trampfn{, , melancholia, ~/.emacs}
+@item @value{prefix}melancholia@value{postfix}~/.emacs
This also edits the same file; the @file{~} is expanded to your
home directory on the remote machine, just like it is locally.
-@item @trampfn{, , melancholia, ~daniel/.emacs}
+@item @value{prefix}melancholia@value{postfix}~daniel/.emacs
This edits the file @file{.emacs} in the home directory of the user
@code{daniel} on the machine @code{melancholia}. The @file{~<user>}
construct is expanded to the home directory of that user on the remote
machine.
-@item @trampfn{, , melancholia, /etc/squid.conf}
+@item @value{prefix}melancholia@value{postfix}/etc/squid.conf
This edits the file @file{/etc/squid.conf} on the machine
@code{melancholia}.
@@ -2426,7 +2471,8 @@ If you, for example, type @kbd{C-x C-f @value{prefix}t
@key{TAB}}, @value{tramp} might give you as result the choice for
@example
-@multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
+@c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
+@multitable @columnfractions .5 .5
@ifset emacs
@item @value{prefixhop}telnet@value{postfixhop} @tab tmp/
@item @value{prefixhop}toto@value{postfix} @tab
@@ -2453,7 +2499,8 @@ Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in
your @file{/etc/hosts} file, let's say
@example
-@multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
+@multitable @columnfractions .5 .5
+@c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
@item @trampfn{telnet, , 127.0.0.1,} @tab @trampfn{telnet, , 192.168.0.1,}
@item @trampfn{telnet, , @value{ipv6prefix}::1@value{ipv6postfix},} @tab @trampfn{telnet, , localhost,}
@item @trampfn{telnet, , melancholia.danann.net,} @tab @trampfn{telnet, , melancholia,}
@@ -3860,3 +3907,4 @@ for @value{emacsothername}.
@c * Use `filename' resp. `file name' consistently.
@c * Use `host' resp. `machine' consistently.
@c * Consistent small or capitalized words especially in menus.
+@c * Make a unique declaration of @trampfn.
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 48db23a59e2..7ebb2a751ab 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,20 @@
+2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
+
+2013-03-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: Fix Tramp "adb" entry. Extend list of discontinued Tramp
+ methods.
+
+2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify data_start configuration (Bug#13783).
+ * NEWS: Document removal of --with-crt-dir.
+ * PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove.
+ Remove legacy-systems section, as this stuff is no longer
+ applicable with current linking strategies.
+
2013-02-14 Michael Albinus <michael.albinus@gmx.de>
* NEWS: Tramp methods "scpc" and "rsyncc" are discontinued.
@@ -1519,7 +1536,7 @@
2009-01-27 Kenichi Handa <handa@m17n.org>
- * NEWS: New function `coding-sytem-from-name'.
+ * NEWS: New function `coding-system-from-name'.
2009-01-25 Carsten Dominik <dominik@science.uva.nl>
diff --git a/etc/DEBUG b/etc/DEBUG
index 6cd0abeeaa5..709e8987d03 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -8,17 +8,28 @@ See the end of the file for license conditions.
read the Windows-specific section near the end of this document.]
** When you debug Emacs with GDB, you should start it in the directory
-where the executable was made. That directory has a .gdbinit file
-that defines various "user-defined" commands for debugging Emacs.
-(These commands are described below under "Examining Lisp object
-values" and "Debugging Emacs Redisplay problems".)
-
-** When you are trying to analyze failed assertions, it will be
-essential to compile Emacs either completely without optimizations or
-at least (when using GCC) with the -fno-crossjumping option. Failure
-to do so may make the compiler recycle the same abort call for all
-assertions in a given function, rendering the stack backtrace useless
-for identifying the specific failed assertion.
+where the executable was made (the 'src' directory in the Emacs source
+tree). That directory has a .gdbinit file that defines various
+"user-defined" commands for debugging Emacs. (These commands are
+described below under "Examining Lisp object values" and "Debugging
+Emacs Redisplay problems".)
+
+Some GDB versions by default do not automatically load .gdbinit files
+in the directory where you invoke GDB. With those versions of GDB,
+you will see a warning when GDB starts, like this:
+
+ warning: File ".../src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
+
+There are several ways to overcome that difficulty, they are all
+described in the node "Auto-loading safe path" in the GDB user manual.
+
+** When you are trying to analyze failed assertions or backtraces, it
+will be essential to compile Emacs either completely without
+optimizations (set CFLAGS to "-O0 -g3") or at least (when using GCC)
+with the -fno-crossjumping option in CFLAGS. Failure to do so may
+make the compiler recycle the same abort call for all assertions in a
+given function, rendering the stack backtrace useless for identifying
+the specific failed assertion.
** It is a good idea to run Emacs under GDB (or some other suitable
debugger) *all the time*. Then, when Emacs crashes, you will be able
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index 19b35f8ab28..671d8a06755 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -41,9 +41,6 @@ a web search is often the best way to find results.
The Emacs Wiki has an area for storing elisp files
<URL:http://www.emacswiki.org/cgi-bin/wiki/ElispArea>.
-* WikEmacs
- <URL:http://wikemacs.org> is an alternative wiki for Emacs.
-
* Emacs slides and tutorials can be found here:
<URL:http://web.psung.name/emacs/>
@@ -55,16 +52,8 @@ so you will find the latest version in Emacs.
* Ada-mode: <URL:http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html>
- * Battery and Info Look: <URL:http://ralph-schleicher.de/emacs.html>
-
* CC mode: <URL:http://cc-mode.sourceforge.net/>
- * CPerl: <URL:http://math.berkeley.edu/~ilya/software/emacs/>
-
- * Ediff and Viper: <URL:http://www.cs.sunysb.edu/~kifer/emacs.html>
-
- * ERC: <URL:http://savannah.gnu.org/projects/erc/>
-
* Gnus: <URL:http://www.gnus.org/>
* MH-E: <URL:http://mh-e.sourceforge.net/>
@@ -73,25 +62,11 @@ so you will find the latest version in Emacs.
* Org mode: <URL:http://orgmode.org/>
- * RefTeX: <URL:http://www.gnu.org/software/auctex/reftex.html>
-
- * Remember: <URL:https://gna.org/p/remember-el>
-
* CEDET: <URL:http://cedet.sourceforge.net/>
* Tramp: Remote file access via rsh/ssh
<URL:http://savannah.gnu.org/projects/tramp/>
-* Auxiliary files
-
- * (Tex)info files for use with Info-look that don't come from GNU
- packages:
- * Scheme: <URL:http://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz>
- * LaTeX: <URL:ftp://ctan.tug.org/tex-archive/info/latex2e-help-texinfo/
- latex2e.texi> (or CTAN mirrors)
- * Perl: <URL:ftp://ftp.cpan.org/pub/CPAN/doc/manual/texinfo/>
- (or CPAN mirrors)
-
* GNU Zile: <URL:http://www.gnu.org/software/zile/>
A lightweight Emacs clone, for when you don't have room for Emacs proper.
@@ -108,6 +83,7 @@ packages that you can install.
* AUCTeX: <URL:http://www.gnu.org/software/auctex/>
An extensible package that supports writing and formatting TeX
files (including AMS-TeX, LaTeX, Texinfo, ConTeXt, and docTeX).
+ Includes Preview LaTeX: embed preview LaTeX images in source buffer.
Available from GNU ELPA.
* BBDB: personal Info Rolodex integrated with mail/news:
@@ -134,6 +110,7 @@ packages that you can install.
* Emacs Muse: <URL:http://mwolson.org/projects/EmacsMuse.html>
An authoring and publishing environment for Emacs.
+ Available from GNU ELPA.
* Emacs speaks statistics (ESS): statistical programming within Emacs
<URL:http://ess.r-project.org>
@@ -170,9 +147,6 @@ packages that you can install.
* Planner Mode: <URL:http://www.wjsullivan.net/PlannerMode.html>
Planner is an organizer and day planner for Emacs.
- * Preview LaTeX: embed preview LaTeX images in source buffer.
- <URL:http://www.gnu.org/software/auctex/preview-latex.html>
-
* Quack: <URL:http://www.neilvandyke.org/quack/>
Quack enhances Emacs support for Scheme.
@@ -205,9 +179,6 @@ packages that you can install.
WhizzyTeX provides a minor mode for Emacs or XEmacs, a (bash)
shell-script daemon and some LaTeX macros.
- * X-Symbol: <URL:http://x-symbol.sourceforge.net/>
- Quasi-WYSIWYG editing of TeX & al.
-
Local Variables:
mode: text
eval: (view-mode 1)
diff --git a/etc/NEWS b/etc/NEWS
index 2eda7a5c775..73f7991823f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -28,6 +28,9 @@ This happens by default if a suitable support library is found at
build time, like libacl on GNU/Linux. To prevent this, use the
configure option `--without-acl'.
+** The configure option --with-crt-dir has been removed.
+It is no longer needed, as the crt*.o files are no longer linked specially.
+
* Startup Changes in Emacs 24.4
@@ -145,8 +148,6 @@ directory, respectively.
`f' (`image-next-frame') and `b' (`image-previous-frame') visit the
next or previous frame. `F' (`image-goto-frame') shows a specific frame.
-*** `image-animated-p' is now `image-multi-frame-p'.
-
---
*** The command `image-mode-fit-frame' deletes other windows.
When toggling, it restores the frame's previous window configuration.
@@ -195,12 +196,13 @@ leave different number of spaces.
+++
*** New connection method "adb", which allows to access Android
-devices by the Android Debug Bridge. The variable `tramp-adb-sdk-dir'
-must be set to the Android SDK installation directory.
+devices by the Android Debug Bridge. The variable `tramp-adb-program'
+can be used to adapt the path of the "adb" program, if needed.
-*** The connection methods "scpc" and "rsyncc" are discontinued. The
-ssh option "ControlMaster=auto" is set automatically in all ssh-based
-methods, when possible.
+*** The connection methods "plink1", "ssh1", "ssh2", "scp1", "scp2",
+"scpc" and "rsyncc" are discontinued. The ssh option
+"ControlMaster=auto" is set automatically in all ssh-based methods,
+when possible.
+++
*** Handlers for `file-acl' and `set-file-acl' for remote machines
@@ -220,6 +222,10 @@ are obsolete. Customize the `woman-* faces instead.
+++
*** yow.el is obsolete; use fortune.el or cookie1.el instead.
+---
+*** The Info-edit command is obsolete. Editing Info nodes by hand
+has not been relevant for some time.
+
* New Modes and Packages in Emacs 24.4
** New nadvice.el package offering lighter-weight advice facilities.
@@ -291,6 +297,21 @@ rather than inheriting from it (as do face specs set via Customize).
*** New face characteristic (supports :underline (:style wave))
specifies whether or not the terminal can display a wavy line.
+** Image API
+
++++
+*** `image-animated-p' is now `image-multi-frame-p'.
+It returns non-nil for any image that contains multiple frames,
+whether or not it specifies a frame delay.
+
++++
+*** When animating images that do not specify a frame delay,
+Emacs uses `image-default-frame-delay'.
+
++++
+*** New functions `image-current-frame' and `image-show-frame' for getting
+and setting the current frame of a multi-frame image.
+
** time-to-seconds is not obsolete any more.
** New function special-form-p.
** Docstrings can be made dynamic by adding a `dynamic-docstring-function'
@@ -299,6 +320,18 @@ text-property on the first char.
** The `defalias-fset-function' property lets you catch calls to defalias
and redirect them to your own function instead of `fset'.
+** The lock for 'DIR/FILE' is now 'DIR/.#FILE' or 'DIR/.#-FILE'.
+When you edit DIR/FILE, Emacs normally creates a symbolic link
+DIR/.#FILE as a lock that warns other instances of Emacs that DIR/FILE
+is being edited. Formerly, if there was already a non-symlink file
+named DIR/.#FILE, Emacs fell back on the lock names DIR/.#FILE.0
+through DIR/.#FILE.9. These fallbacks have been removed, so that
+Emacs now no longer locks DIR/FILE in that case.
+
+On MS-Windows the lock is a regular file DIR/.#-FILE, not a symlink.
+MS-Windows and non-MS-Windows implementations of Emacs ignore each
+other's locks.
+
** The 9th element returned by `file-attributes' is now unspecified.
Formerly, it was t if the file's gid would change if file were deleted
and recreated. This value has been inaccurate for years on many
@@ -328,6 +361,13 @@ Setting it has no effect, and %t in the mode-line format is ignored.
Likewise, `file-name-buffer-file-type-alist' is now obsolete, and
modifying it has no effect.
+---
+** Lock files now work on MS-Windows.
+This allows to avoid losing your edits if the same file is being
+edited in another Emacs session or by another user. See the node
+"Interlocking" in the Emacs User Manual for the details. To disable
+file locking, customize `create-lockfiles' to nil.
+
** Improved fullscreen support on Mac OS X.
Both native (>= OSX 10.7) and "old style" fullscreen are supported.
Customize `ns-use-native-fullscreen' to change style. For >= 10.7
@@ -752,6 +792,29 @@ Sphinx support has been improved.
*** The constant `rst-version' describes the rst.el package version.
+** Ruby mode
+
+*** Support for percent literals and recognition of regular expressions
+in method calls without parentheses with more methods, including Cucumber
+steps definitions.
+
+*** Improved syntax highlighting and indentation.
+
+*** New command `ruby-toggle-block', bound to `C-c {'.
+
+*** Some non-standard keybindings/commands have been removed:
+
+**** `ruby-electric-brace'; use `electric-indent-mode' instead.
+
+**** `ruby-mark-defun'; use `mark-defun'.
+
+**** `ruby-beginning-of-defun' and `ruby-end-of-defun' are replaced by
+appropriate settings for the variables `beginning-of-defun-function'
+and `end-of-defun-function'.
+
+**** Non-standard keybindings for `backward-kill-word', `comment-region',
+`reindent-then-newline-and-indent' and `newline' have been removed.
+
** Shell Script mode
*** Pairing of parens/quotes uses `electric-pair-mode' instead of skeleton-pair.
@@ -802,6 +865,63 @@ See the variable `calendar-month-header'.
*** The calendars produced by cal-html include holidays.
Customize `cal-html-holidays' to change this.
+** CEDET
+
+*** The major modes from the parser generators "Bovine" and "Wisent"
+are now properly integrated in Emacs. The file suffixes ".by" and ".wy"
+are in `auto-mode-alist', and the corresponding manuals are included.
+
+*** EDE
+
+**** Menu support for the "Configuration" feature. This allows users to
+choose the active configuration (such as debug or install) from the menu.
+
+**** New command `ede-set' to interactively set project-local variables.
+
+**** Support for compiling, debugging, and running in "generic" projects.
+
+**** Autoconf editing support for M4 macros with complex arguments.
+
+**** Compilation support for the "linux" project type.
+
+**** "simple" projects have been removed; use "generic" projects instead.
+
+*** Semantic
+
+**** Support for parsing #include statements inside a namespace in C/C++.
+
+**** Improved support for 'extern "C"' declarations in C/C++.
+
+**** The ability to ignore more common special C/C++ preprocessor symbols,
+such as '__nonnull' and '__asm'. Add '__cplusplus' macro when parsing C++.
+If available, include cdefs.h as an additional source of preprocessor symbols.
+
+**** Improved C/C++ function pointer parsing.
+
+**** In Python, support for converting imports to include file names.
+
+**** Ability to dynamically determine the Python load path.
+
+**** Support for the Python 'WITH' and 'AT' keywords.
+
+**** Improved tooltip completion.
+
+*** SRecode
+
+**** The SRecode manual is now included.
+
+**** Tag generation supports constructor/destructor settings and system
+include differentiation.
+
+**** Addition of 'Framework' support: Frameworks are specified when a
+particular kind of library (such as Android) is needed in a common language
+mode (like Java).
+
+**** Support for nested templates and let variables override based on priority.
+
+**** Support for merging tables from multiple related modes, such as
+default -> c++ -> arduino.
+
** Compile has a new option `compilation-always-kill'.
** Customize
@@ -1141,6 +1261,25 @@ accessed via the new `timer--psecs' accessor.
*** Last-modified time stamps in undo lists now are of the form
(t HI-SECS LO-SECS USECS PSECS) instead of (t HI-SECS . LO-SECS).
+** EIEIO
+
+*** Improved security when handling persistent objects:
+
+**** `eieio-persistent-read' now features optional arguments for specifying
+the class to load, as well as a flag stating whether subclasses are allowed;
+if provided, other classes will be rejected by the reader. For
+compatibility with existing code, if the class is omitted only a
+warning is issued.
+
+**** New specialized reader for pulling in classes and signaling errors
+without evaluation of suspicious code.
+
+**** All slots that contain objects must have a :type. Slots with lists
+of objects must use a new type predicate for a list of an object type.
+
+*** Support for `find-function' and similar utilities, through the addition
+of filename support to generated symbols.
+
** Floating point functions now always return special values like NaN,
instead of signaling errors, if given invalid args; e.g., (log -1.0).
Previously, they returned NaNs on some platforms but signaled errors
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 441ad7b4df4..b38a1240540 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -432,21 +432,7 @@ The fix is to install an unshared library that corresponds to what you
installed in the shared library, and then relink Emacs.
If you have already installed the name resolver in the file libresolv.a,
-then you need to compile Emacs to use that library. The easiest way to
-do this is to add to config.h a definition of LIBS_SYSTEM, LIBS_MACHINE
-or LIB_STANDARD which uses -lresolv. Watch out! If you redefine a macro
-that is already in use in your configuration to supply some other libraries,
-be careful not to lose the others.
-
-Thus, you could start by adding this to config.h:
-
-#define LIBS_SYSTEM -lresolv
-
-Then if this gives you an error for redefining a macro, and you see that
-config.h already defines LIBS_SYSTEM as -lfoo -lbar at some other point
-(possibly in an included file) you could change it to say this:
-
-#define LIBS_SYSTEM -lresolv -lfoo -lbar
+then you need to compile Emacs to use that library.
*** Emacs does not know your host's fully-qualified domain name.
@@ -3179,25 +3165,6 @@ as a concentrator.
This problem seems to be a matter of configuring the DECserver to use
7 bit characters rather than 8 bit characters.
-
-* Build problems on legacy systems
-
-** SunOS: Emacs gets error message from linker on Sun.
-
-If the error message says that a symbol such as `f68881_used' or
-`ffpa_used' or `start_float' is undefined, this probably indicates
-that you have compiled some libraries, such as the X libraries,
-with a floating point option other than the default.
-
-It's not terribly hard to make this work with small changes in
-crt0.c together with linking with Fcrt1.o, Wcrt1.o or Mcrt1.o.
-However, the easiest approach is to build Xlib with the default
-floating point option: -fsoft.
-
-** HPUX 10.20: Emacs crashes during dumping on the HPPA machine.
-
-This seems to be due to a GCC bug; it is fixed in GCC 2.8.1.
-
This file is part of GNU Emacs.
diff --git a/etc/TODO b/etc/TODO
index b28888b7484..faa9fc4c98d 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -107,8 +107,6 @@ for users to customize.
** Distribute a bar cursor of width > 1 evenly between the two glyphs
on each side of the bar (what to do at the edges?).
-** buffer-offer-save should be a permanent local.
-
** revert-buffer should eliminate overlays and the mark.
For related problems consult the thread starting with
http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01346.html
diff --git a/lib/putenv.c b/lib/putenv.c
index 5f0fedaf9cc..ed666afc3bb 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -34,6 +34,11 @@
#include <string.h>
#include <unistd.h>
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
#if _LIBC
# if HAVE_GNU_LD
# define environ __environ
@@ -67,6 +72,21 @@ _unsetenv (const char *name)
len = strlen (name);
+#if HAVE__PUTENV
+ {
+ int putenv_result, putenv_errno;
+ char *name_ = malloc (len + 2);
+ memcpy (name_, name, len);
+ name_[len] = '=';
+ name_[len + 1] = 0;
+ putenv_result = _putenv (name_);
+ putenv_errno = errno;
+ free (name_);
+ __set_errno (putenv_errno);
+ return putenv_result;
+ }
+#else
+
LOCK;
ep = environ;
@@ -87,6 +107,7 @@ _unsetenv (const char *name)
UNLOCK;
return 0;
+#endif
}
@@ -95,9 +116,8 @@ _unsetenv (const char *name)
int
putenv (char *string)
{
- const char *const name_end = strchr (string, '=');
- register size_t size;
- register char **ep;
+ const char *name_end = strchr (string, '=');
+ char **ep;
if (name_end == NULL)
{
@@ -105,30 +125,68 @@ putenv (char *string)
return _unsetenv (string);
}
- size = 0;
- for (ep = environ; *ep != NULL; ++ep)
- if (!strncmp (*ep, string, name_end - string) &&
- (*ep)[name_end - string] == '=')
+#if HAVE__PUTENV
+ /* Rely on _putenv to allocate the new environment. If other
+ parts of the application use _putenv, the !HAVE__PUTENV code
+ would fight over who owns the environ vector, causing a crash. */
+ if (name_end[1])
+ return _putenv (string);
+ else
+ {
+ /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+ to allocate the environ vector and then replace the new
+ entry with "NAME=". */
+ int putenv_result, putenv_errno;
+ char *name_x = malloc (name_end - string + sizeof "= ");
+ if (!name_x)
+ return -1;
+ memcpy (name_x, string, name_end - string + 1);
+ name_x[name_end - string + 1] = ' ';
+ name_x[name_end - string + 2] = 0;
+ putenv_result = _putenv (name_x);
+ putenv_errno = errno;
+ for (ep = environ; *ep; ep++)
+ if (strcmp (*ep, name_x) == 0)
+ {
+ *ep = string;
+ break;
+ }
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ if (putenv_result == 0)
+ {
+ /* _putenv propagated "NAME= " into the subprocess environment;
+ fix that by calling SetEnvironmentVariable directly. */
+ name_x[name_end - string] = 0;
+ putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+ putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */
+ }
+# endif
+ free (name_x);
+ __set_errno (putenv_errno);
+ return putenv_result;
+ }
+#else
+ for (ep = environ; *ep; ep++)
+ if (strncmp (*ep, string, name_end - string) == 0
+ && (*ep)[name_end - string] == '=')
break;
- else
- ++size;
- if (*ep == NULL)
+ if (*ep)
+ *ep = string;
+ else
{
static char **last_environ = NULL;
- char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
- if (new_environ == NULL)
+ size_t size = ep - environ;
+ char **new_environ = malloc ((size + 2) * sizeof *new_environ);
+ if (! new_environ)
return -1;
- (void) memcpy ((void *) new_environ, (void *) environ,
- size * sizeof (char *));
- new_environ[size] = (char *) string;
- new_environ[size + 1] = NULL;
+ new_environ[0] = string;
+ memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ);
free (last_environ);
last_environ = new_environ;
environ = new_environ;
}
- else
- *ep = string;
+#endif
return 0;
}
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b1d1c1e7fd0..8b6ffeed01d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,376 @@
+2013-03-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-prompt): Extend regexp.
+ (tramp-adb-handle-process-file): Remove superfluous setting.
+ (tramp-adb-command-exit-status): Handle case that COMMAND is nil.
+ (tramp-adb-barf-unless-okay): Use `tramp-adb-command-exit-status'.
+ (tramp-adb-maybe-open-connection): Apply "su" if user is defined.
+
+2013-03-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * textmodes/ispell.el: Fix nitpicks and byte-compiler warnings.
+ (ispell-print-if-debug): Build `format' in. Avoid end-of-buffer.
+ (ispell-parse-hunspell-affix-file): Avoid beginning-of-buffer.
+ Use dict-key rather than dict-name for the error message.
+
+2013-03-01 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * net/net-utils.el (net-utils-run-simple): Don't display-buffer
+ when reverting (bug#13831).
+
+2013-03-01 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-find-hunspell-dictionaries):
+ Always expand affix-file before storing to protect against changed
+ `default-directory'.
+ (ispell-print-if-debug): Make sure message is printed at the end
+ of the debug buffer.
+
+2013-03-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-obsolete-methods): New defconst.
+ (tramp-warned-obsolete-methods): New defvar.
+ (tramp-find-method): Check for obsolete methods. Map them to a
+ replacement method if appropriate.
+
+ * net/tramp-sh.el (tramp-methods) [scp1, scp2, ssh1, ssh2, plink1]:
+ Remove methods.
+ (top): Remove completion functions for "scp1", "scp2", "ssh1",
+ "ssh2" and "plink1".
+
+2013-02-28 Dale Sedivec <dale@codefu.org>
+
+ * textmodes/sgml-mode.el (sgml-syntax-propertize-function):
+ Return valid syntax-table property value when converting
+ quotes within text from string syntax to punctuation syntax (bug#13844).
+
+2013-02-28 Juri Linkov <juri@jurta.org>
+
+ * dired-aux.el (dired-diff): If file at point is a backup file,
+ use its original as the default value, and reverse the order
+ of arguments to the `diff' call. Doc fix. (Bug#13772)
+
+2013-02-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-sdk-dir): Remove. Replaced by ...
+ (tramp-adb-program): New defcustom. Remove function. Adapt calls.
+
+2013-02-28 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ Initial support for hunspell dictionaries auto-detection (Bug#13639)
+
+ * textmodes/ispell.el (ispell-find-hunspell-dictionaries):
+ Ask hunspell about available and default dictionaries.
+ (ispell-parse-hunspell-affix-file): Extract relevant info from
+ hunspell affix file.
+ (ispell-hunspell-fill-dictionary-entry): Fill non-initialized
+ `ispell-dictionary-alist' entry for given dictionary after info
+ provided by `ispell-parse-hunspell-affix-file'.
+ (ispell-hunspell-dict-paths-alist): New defvar to contain an alist
+ of parsed hunspell dicts and associated affix files.
+ (ispell-hunspell-dictionary-alist): New defvar to contain an alist
+ of parsed hunspell dicts and associated parameters.
+ (ispell-set-spellchecker-params):
+ Call `ispell-find-hunspell-dictionaries' if hunspell and not
+ previously done.
+ (ispell-start-process):
+ Call `ispell-hunspell-fill-dictionary-entry' for current
+ dictionary if it is not initialized.
+
+2013-02-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * imenu.el: Comment nitpicks.
+
+2013-02-28 Sam Steingold <sds@gnu.org>
+
+ * vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces.
+ See <http://stackoverflow.com/questions/14720205>.
+
+2013-02-28 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * net/net-utils.el (net-utils--revert-function): New fun (bug#13831).
+ (net-utils-mode): Use it.
+ (net-utils--revert-cmd): New var.
+ (net-utils-run-simple): Set it, and remove bogus interactive spec.
+ (traceroute): Use net-utils-run-simple.
+
+2013-02-28 Glenn Morris <rgm@gnu.org>
+
+ * textmodes/paragraphs.el (mark-paragraph): Doc fix.
+
+2013-02-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * doc-view.el: Preserve h&v scroll across C-c C-c C-c C-c.
+ (doc-view-fallback-mode): Remove overlays here.
+ (doc-view-toggle-display): Instead of here. Don't throw away
+ image-mode-winprops-alist.
+ (doc-view-goto-page): Don't mess with hscroll.
+
+2013-02-27 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * font-lock.el (lisp-font-lock-keywords-2): Fix highlighting of
+ &optional (bug#13819).
+
+2013-02-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-adb.el (tramp-adb-parse-device-names)
+ (tramp-adb-maybe-open-connection): Add timeouts. (Bug#13299)
+
+2013-02-26 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-sh-handle-insert-directory):
+ Add "2>/dev/null" to the ls command, in case "en_US.utf8" is not
+ defined. POSIX environments fall back to the "C" locale then and
+ emit a warning, which shall be suppressed.
+
+2013-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Tweak logic.
+ (easy-mmode-set-keymap-parents): Use make-composed-keymap.
+
+2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/bytecomp.el (byte-compile-file): Use let.
+
+2013-02-25 Juri Linkov <juri@jurta.org>
+
+ * replace.el (read-regexp): Let-bind `default' to the first
+ element of `defaults' if it's a list, otherwise it should be
+ a string or nil. Let-bind `suggestions' to `defaults' if it's
+ a list, otherwise make a list with the string value. Doc fix.
+ (Bug#13805)
+
+2013-02-25 Eli Zaretskii <eliz@gnu.org>
+
+ * emacs-lisp/bytecomp.el (byte-recompile-directory): Reject files
+ that match "\`\.#", to avoid compiling lock files, even if they
+ are readable (as they are on MS-Windows).
+
+2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (basic-save-buffer): Remove redundant directory-creation.
+
+2013-02-24 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-ext.el (math-to-radians-2, math-from-radians-2):
+ Add option to force `pi' to remain symbolic.
+ * calc/calcalg2.el (calcFunc-sin, calcFunc-cos, calcFunc-tan)
+ (calcFunc-cot, calcFunc-csc, calcFunc-sec, calcFunc-arcsin)
+ (calcFunc-arccos, calcFunc-arctan): Use symbolic `pi' in the
+ derivatives, when necessary.
+
+2013-02-23 Peter Kleiweg <p.c.j.kleiweg@rug.nl>
+
+ * progmodes/ps-mode.el (ps-mode-version): Bump to 1.1i.
+ (ps-mode-octal-region): Use string-make-unibyte.
+
+2013-02-23 Glenn Morris <rgm@gnu.org>
+
+ * emulation/viper-cmd.el (viper-submit-report):
+ * progmodes/ps-mode.el (ps-mode-maintainer-address):
+ * progmodes/vera-mode.el (vera-mode-help-address):
+ * textmodes/artist.el (artist-maintainer-address):
+ * textmodes/reftex.el (reftex-report-bug):
+ * vc/ediff-util.el (ediff-submit-report):
+ Add bug-gnu-emacs to bug report address.
+
+ * progmodes/simula.el (simula-mode-menu, simula-mode-map):
+ Remove bug report entries.
+ (simula-mode-help-address, simula-submit-bug-report): Make obsolete.
+
+ * emacs-lisp/bytecomp.el (byte-compile-level): New.
+ (byte-compile-file, byte-compile-from-buffer):
+ Use separate input/output buffers for each level of recursive
+ byte-compile-file calls. (Bug#13787)
+
+2013-02-23 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-methods): Fix docstring.
+ (tramp-ssh-controlmaster-options): Rename it from
+ `tramp-ssh-controlmaster-template'. Return a string.
+ (tramp-default-method): Adapt check for
+ `tramp-ssh-controlmaster-options'.
+
+ * net/tramp-sh.el (tramp-methods):
+ Replace `tramp-ssh-controlmaster-template' by "%c".
+ (tramp-do-copy-or-rename-file-out-of-band)
+ (tramp-maybe-open-connection): Use it in format spec. Ensure,
+ that it is applied for the first hop only.
+
+2013-02-22 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-lazy-highlight-new-loop):
+ Set `isearch-lazy-highlight-start' and `isearch-lazy-highlight-end'
+ to `isearch-other-end' if it is not nil. (Bug#13402)
+
+ * replace.el (replace-highlight): Let-bind `isearch-other-end'
+ to `match-beg'.
+
+ * textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
+ Let-bind `isearch-other-end' to `start', `isearch-forward' to t
+ and `isearch-error' to nil.
+
+2013-02-22 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-tramp-file-p): Fix docstring.
+
+ * net/tramp-sh.el (tramp-sh-handle-insert-directory):
+ Handle multibyte file names.
+
+2013-02-22 Glenn Morris <rgm@gnu.org>
+
+ * textmodes/sgml-mode.el (sgml-xml-mode): Move before use.
+ (sgml-transformation-function): Give it a :set function.
+ (sgml-tag): Doc fix.
+
+ * cmuscheme.el (scheme-buffer):
+ * progmodes/inf-lisp.el (inferior-lisp-buffer):
+ * progmodes/tcl.el (inferior-tcl-buffer):
+ * textmodes/tex-mode.el (tex-command): Doc fixes.
+
+ * image-mode.el (image-mode): Add mouse bindings for mode-line-process.
+
+ * htmlfontify.el (hfy-default-header): Encode title string. (Bug#7457)
+
+2013-02-21 Bastien Guerry <bzg@gnu.org>
+
+ * cmuscheme.el (scheme-buffer): Fix docstring. (Bug#13778)
+
+2013-02-21 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-info-current-defun):
+ Enhance match-data cluttering prevention.
+
+2013-02-21 Glenn Morris <rgm@gnu.org>
+
+ * net/tramp.el (tramp-get-debug-buffer): Ensure outline.el is not
+ loaded while outline-regexp is let bound. (Bug#9584)
+
+2013-02-21 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-info-current-defun): Fix failed
+ defun name retrieval because of unwanted match-data cluttering.
+
+2013-02-21 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-ssh-controlmaster-template): Make it a
+ defconst. Apply independent check for ControlPersist.
+
+ * net/tramp-sh.el (tramp-sh-handle-set-file-times): Set $UTC only
+ temporarily, via "env".
+
+2013-02-21 Glenn Morris <rgm@gnu.org>
+
+ * info.el (Info-enable-edit): Remove.
+ (Info-edit): Disable it rather than using Info-enable.
+ (Info-edit-mode-hook, Info-edit-map, Info-edit-mode, Info-edit)
+ (Info-cease-edit): Make editing of Info files obsolete.
+
+ * informat.el (Info-tagify):
+ Handle buffers not visiting files. (Bug#13763)
+
+2013-02-21 Juanma Barranquero <lekktu@gmail.com>
+
+ * calc/calc-graph.el (calc-graph-show-dumb): Fix typo.
+
+2013-02-21 Glenn Morris <rgm@gnu.org>
+
+ * files.el (basic-save-buffer): Move check for existing parent
+ directory after hooks. (Bug#13773)
+
+2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * simple.el (command-execute): Move from C. Add obsolete check.
+ (extended-command-history): Move from C.
+
+2013-02-20 Ulrich Müller <ulm@gentoo.org>
+
+ * jka-cmpr-hook.el (jka-compr-compression-info-list)
+ (jka-compr-mode-alist-additions): Handle .txz suffix for
+ XZ-compressed tar archives (bug#13770).
+
+2013-02-20 Bastien Guerry <bzg@gnu.org>
+
+ * outline.el (outline-regexp, outline-heading-end-regexp):
+ Make variables, not options (bug#13731).
+
+2013-02-20 Glenn Morris <rgm@gnu.org>
+
+ * image.el (image-current-frame): Change from variable to function.
+ (image-show-frame): Rename from image-nth-frame. Update callers.
+ * image-mode.el (image-multi-frame): New variable.
+ (image-mode-map, image-mode, image-goto-frame):
+ Use image-multi-frame rather than image-current-frame.
+ (image-mode, image-goto-frame): Use image-current-frame as
+ function rather than as variable.
+
+ * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp.
+ * emacs-lisp/cl-macs.el (cl--make-type-test)
+ (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe.
+
+2013-02-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-cache.el (tramp-get-hash-table): New defun.
+ (tramp-get-file-property, tramp-set-file-property)
+ (tramp-get-connection-property, tramp-set-connection-property): Use it.
+ (tramp-flush-file-property, tramp-flush-directory-property):
+ Rename argument to KEY.
+ (tramp-flush-connection-property): Simplify a little bit.
+ (tramp-connection-property-p): New defun.
+ (top): Reapply saved values only if there isn't a corresponding
+ entry in `tramp-connection-properties'.
+
+2013-02-19 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * progmodes/python.el (python-indent-context):
+ Fix python-info-line-ends-backslash-p call.
+ (python-info-line-ends-backslash-p)
+ (python-info-beginning-of-backslash): Respect line-number argument.
+ (python-info-current-line-comment-p):
+ Fix behavior when not at beginning-of-line.
+ (python-util-position): Remove function.
+ (python-util-goto-line): New function.
+
+2013-02-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * eshell/em-unix.el (eshell/su): Require tramp.
+ (eshell/sudo): Require tramp. Remove now unnecessary check.
+
+ * net/tramp-sh.el (tramp-sh-handle-start-file-process): Let-bind
+ `tramp-current-connection' in order to avoid an error when several
+ commands are invoked in a short time in eshell and friends.
+
+2013-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Cleanup some of EIEIO's namespace.
+ * emacs-lisp/eieio.el (eieio--define-field-accessors): New macro.
+ Use it to define all the class-* and object-* field accessors (renamed
+ to eieio--class-* and eieio--object-*). Update all uses.
+ (eieio--class-num-slots, eieio--object-num-slots): Rename from
+ class-num-slots and object-num-slots.
+ (eieio--check-type): New macro.
+ (eieio-defclass, eieio-oref, eieio-oref-default, same-class-p)
+ (object-of-class-p, child-of-class-p, object-slots, class-slot-initarg)
+ (eieio-oset, eieio-oset-default, object-assoc, object-assoc-list)
+ (object-assoc-list-safe): Use it.
+ (eieio-defclass): Tighten regexp.
+ (eieio--defmethod): Use `memq'. Signal an error for unknown method kind.
+ Remove unreachable code.
+ (object-class-fast): Declare obsolete.
+ (eieio-class-name, eieio-object-name, eieio-object-set-name-string)
+ (eieio-object-class, eieio-object-class-name, eieio-class-parents)
+ (eieio-class-children, eieio-class-precedence-list, eieio-class-parent):
+ Rename from class-name, object-name, object-set-name-string,
+ object-class, object-class-name, class-parents, class-children,
+ class-precedence-list, class-parent; with obsolete alias.
+ (class-of, class-direct-superclasses, class-direct-subclasses):
+ Declare obsolete.
+ (eieio-defmethod): Use `memq'; remove unreachable code.
+ * emacs-lisp/eieio-base.el (eieio-persistent-read):
+ * emacs-lisp/eieio-opt.el (eieio-class-button, eieio-describe-generic)
+ (eieio-browse-tree, eieio-browse): Use eieio--check-type.
+
+
2013-02-18 Michael Heerdegen <michael_heerdegen@web.de>
* emacs-lisp/eldoc.el (eldoc-highlight-function-argument):
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index c84c7fdf949..16fc6c09dbe 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -948,7 +948,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
(setq calc-dumb-map (make-sparse-keymap))
(define-key calc-dumb-map "\n" 'scroll-up-command)
(define-key calc-dumb-map " " 'scroll-up-command)
- (define-key calc-dump-map [?\S-\ ] 'scroll-down-command)
+ (define-key calc-dumb-map [?\S-\ ] 'scroll-down-command)
(define-key calc-dumb-map "\177" 'scroll-down-command)
(define-key calc-dumb-map "<" 'scroll-left)
(define-key calc-dumb-map ">" 'scroll-right)
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 94b3f645785..3b845f563a1 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -777,18 +777,18 @@ If this can't be done, return NIL."
(math-to-hms a 'rad))
(t a)))
-(defun math-to-radians-2 (a) ; [N N]
+(defun math-to-radians-2 (a &optional force-symbolic) ; [N N]
(cond ((eq (car-safe a) 'hms)
(math-from-hms a 'rad))
((memq calc-angle-mode '(deg hms))
- (if calc-symbolic-mode
+ (if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul a '(var pi var-pi)) 180)
(math-mul a (math-pi-over-180))))
(t a)))
-(defun math-from-radians-2 (a) ; [N N]
+(defun math-from-radians-2 (a &optional force-symbolic) ; [N N]
(cond ((memq calc-angle-mode '(deg hms))
- (if calc-symbolic-mode
+ (if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul 180 a) '(var pi var-pi))
(math-div a (math-pi-over-180))))
(t a)))
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 58a82bcf143..cd962e7dbed 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -401,18 +401,18 @@
(put 'calcFunc-sin\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2 (math-normalize
- (list 'calcFunc-cos u))))))
+ (list 'calcFunc-cos u)) t))))
(put 'calcFunc-cos\' 'math-derivative-1
(function (lambda (u) (math-neg (math-to-radians-2
(math-normalize
- (list 'calcFunc-sin u)))))))
+ (list 'calcFunc-sin u)) t)))))
(put 'calcFunc-tan\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2
(math-sqr
(math-normalize
- (list 'calcFunc-sec u)))))))
+ (list 'calcFunc-sec u))) t))))
(put 'calcFunc-sec\' 'math-derivative-1
(function (lambda (u) (math-to-radians-2
@@ -420,7 +420,7 @@
(math-normalize
(list 'calcFunc-sec u))
(math-normalize
- (list 'calcFunc-tan u)))))))
+ (list 'calcFunc-tan u))) t))))
(put 'calcFunc-csc\' 'math-derivative-1
(function (lambda (u) (math-neg
@@ -429,32 +429,32 @@
(math-normalize
(list 'calcFunc-csc u))
(math-normalize
- (list 'calcFunc-cot u))))))))
+ (list 'calcFunc-cot u))) t)))))
(put 'calcFunc-cot\' 'math-derivative-1
(function (lambda (u) (math-neg
(math-to-radians-2
(math-sqr
(math-normalize
- (list 'calcFunc-csc u))))))))
+ (list 'calcFunc-csc u))) t)))))
(put 'calcFunc-arcsin\' 'math-derivative-1
(function (lambda (u)
(math-from-radians-2
(math-div 1 (math-normalize
(list 'calcFunc-sqrt
- (math-sub 1 (math-sqr u)))))))))
+ (math-sub 1 (math-sqr u))))) t))))
(put 'calcFunc-arccos\' 'math-derivative-1
(function (lambda (u)
(math-from-radians-2
(math-div -1 (math-normalize
(list 'calcFunc-sqrt
- (math-sub 1 (math-sqr u)))))))))
+ (math-sub 1 (math-sqr u))))) t))))
(put 'calcFunc-arctan\' 'math-derivative-1
(function (lambda (u) (math-from-radians-2
- (math-div 1 (math-add 1 (math-sqr u)))))))
+ (math-div 1 (math-add 1 (math-sqr u))) t))))
(put 'calcFunc-sinh\' 'math-derivative-1
(function (lambda (u) (math-normalize (list 'calcFunc-cosh u)))))
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index d40822188ee..0f89eae8828 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -447,7 +447,7 @@ in the next one.")
"\"\)\n")))
-(defvar scheme-buffer nil "*The current scheme process buffer.
+(defvar scheme-buffer nil "The current scheme process buffer.
MULTIPLE PROCESS SUPPORT
===========================================================================
@@ -478,8 +478,8 @@ This process selection is performed by function `scheme-proc'.
Whenever \\[run-scheme] fires up a new process, it resets `scheme-buffer'
to be the new process's buffer. If you only run one process, this will
-do the right thing. If you run multiple processes, you can change
-`scheme-buffer' to another process buffer with \\[set-variable].
+do the right thing. If you run multiple processes, you might need to
+set `scheme-buffer' to whichever process buffer you want to use.
More sophisticated approaches are, of course, possible. If you find yourself
needing to switch back and forth between multiple processes frequently,
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 13443419bd7..f6ff32b0b01 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -55,7 +55,8 @@ into this list; they also should call `dired-log' to log the errors.")
(defun dired-diff (file &optional switches)
"Compare file at point with file FILE using `diff'.
If called interactively, prompt for FILE. If the file at point
-has a backup file, use that as the default. If the mark is active
+has a backup file, use that as the default. If the file at point
+is a backup file, use its original. If the mark is active
in Transient Mark mode, use the file at the mark as the default.
\(That's the mark set by \\[set-mark-command], not by Dired's
\\[dired-mark] command.)
@@ -67,8 +68,10 @@ With prefix arg, prompt for second argument SWITCHES, which is
the string of command switches for the third argument of `diff'."
(interactive
(let* ((current (dired-get-filename t))
- ;; Get the latest existing backup file.
- (oldf (diff-latest-backup-file current))
+ ;; Get the latest existing backup file or its original.
+ (oldf (if (backup-file-name-p current)
+ (file-name-sans-versions current)
+ (diff-latest-backup-file current)))
;; Get the file at the mark.
(file-at-mark (if (and transient-mark-mode mark-active)
(save-excursion (goto-char (mark t))
@@ -107,7 +110,10 @@ the string of command switches for the third argument of `diff'."
(equal (expand-file-name current file)
(expand-file-name current))))
(error "Attempt to compare the file to itself"))
- (diff file current switches)))
+ (if (and (backup-file-name-p current)
+ (equal file (file-name-sans-versions current)))
+ (diff current file switches)
+ (diff file current switches))))
;;;###autoload
(defun dired-backup-diff (&optional switches)
diff --git a/lisp/dired.el b/lisp/dired.el
index 28045043c82..f03e0aca475 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3864,13 +3864,14 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;; dired-diff) "dired-aux" "dired-aux.el" "066bb17769887a7fbc0490003f59e4b3")
+;;;;;; dired-diff) "dired-aux" "dired-aux.el" "d6a694b6d13fa948465fde52a9ffb3ba")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
Compare file at point with file FILE using `diff'.
If called interactively, prompt for FILE. If the file at point
-has a backup file, use that as the default. If the mark is active
+has a backup file, use that as the default. If the file at point
+is a backup file, use its original. If the mark is active
in Transient Mark mode, use the file at the mark as the default.
\(That's the mark set by \\[set-mark-command], not by Dired's
\\[dired-mark] command.)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 89d2edd3dbb..0cfdc9a22d1 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -485,8 +485,7 @@ Typically \"page-%s.png\".")
(defun doc-view-goto-page (page)
"View the page given by PAGE."
(interactive "nPage: ")
- (let ((len (doc-view-last-page-number))
- (hscroll (window-hscroll)))
+ (let ((len (doc-view-last-page-number)))
(if (< page 1)
(setq page 1)
(when (and (> page len)
@@ -520,7 +519,6 @@ Typically \"page-%s.png\".")
(format doc-view--image-file-pattern page)
(doc-view-current-cache-dir))))
(doc-view-insert-image file :pointer 'arrow)
- (set-window-hscroll (selected-window) hscroll)
(when (and (not (file-exists-p file))
doc-view-current-converter-processes)
;; The PNG file hasn't been generated yet.
@@ -1381,8 +1379,6 @@ For now these keys are useful:
(progn
(doc-view-kill-proc)
(setq buffer-read-only nil)
- (remove-overlays (point-min) (point-max) 'doc-view t)
- (setq-local image-mode-winprops-alist t)
;; Switch to the previously used major mode or fall back to
;; normal mode.
(doc-view-fallback-mode)
@@ -1725,6 +1721,7 @@ toggle between displaying the document or editing it as text.
(mapcar (lambda (var) (cons var (symbol-value var)))
'(doc-view-resolution
image-mode-winprops-alist)))))
+ (remove-overlays (point-min) (point-max) 'doc-view t)
(if doc-view-previous-major-mode
(funcall doc-view-previous-major-mode)
(let ((auto-mode-alist
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 280a1bbc2dd..5db1793a407 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1594,7 +1594,9 @@ that already has a `.elc' file."
(setq directories (nconc directories (list source))))
;; It is an ordinary file. Decide whether to compile it.
(if (and (string-match emacs-lisp-file-regexp source)
+ ;; The next 2 tests avoid compiling lock files
(file-readable-p source)
+ (not (string-match "\\`\\.#" file))
(not (auto-save-file-name-p source))
(not (string-equal dir-locals-file
(file-name-nondirectory source))))
@@ -1675,6 +1677,9 @@ If compilation is needed, this functions returns the result of
(load (if (file-exists-p dest) dest filename)))
'no-byte-compile)))
+(defvar byte-compile-level 0 ; bug#13787
+ "Depth of a recursive byte compilation.")
+
;;;###autoload
(defun byte-compile-file (filename &optional load)
"Compile a file of Lisp code named FILENAME into a file of byte code.
@@ -1717,7 +1722,13 @@ The value is non-nil if there were no errors, nil if errors."
(setq target-file (byte-compile-dest-file filename))
(setq byte-compile-dest-file target-file)
(with-current-buffer
- (setq input-buffer (get-buffer-create " *Compiler Input*"))
+ ;; It would be cleaner to use a temp buffer, but if there was
+ ;; an error, we leave this buffer around for diagnostics.
+ ;; Its name is documented in the lispref.
+ (setq input-buffer (get-buffer-create
+ (concat " *Compiler Input*"
+ (if (zerop byte-compile-level) ""
+ (format "-%s" byte-compile-level)))))
(erase-buffer)
(setq buffer-file-coding-system nil)
;; Always compile an Emacs Lisp file as multibyte
@@ -1775,7 +1786,8 @@ The value is non-nil if there were no errors, nil if errors."
;; within byte-compile-from-buffer lingers in that buffer.
(setq output-buffer
(save-current-buffer
- (byte-compile-from-buffer input-buffer)))
+ (let ((byte-compile-level (1+ byte-compile-level)))
+ (byte-compile-from-buffer input-buffer))))
(if byte-compiler-error-flag
nil
(when byte-compile-verbose
@@ -1881,7 +1893,10 @@ With argument ARG, insert value in current buffer after the form."
(byte-compile-close-variables
(with-current-buffer
(setq byte-compile--outbuffer
- (get-buffer-create " *Compiler Output*"))
+ (get-buffer-create
+ (concat " *Compiler Output*"
+ (if (<= byte-compile-level 1) ""
+ (format "-%s" (1- byte-compile-level))))))
(set-buffer-multibyte t)
(erase-buffer)
;; (emacs-lisp-mode)
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 2de8260c941..f3bf70b0190 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -271,11 +271,7 @@ so that they are registered at compile-time as well as run-time."
;;; Numbers.
-(defun cl-floatp-safe (object)
- "Return t if OBJECT is a floating point number.
-On Emacs versions that lack floating-point support, this function
-always returns nil."
- (and (numberp object) (not (integerp object))))
+(define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4")
(defsubst cl-plusp (number)
"Return t if NUMBER is positive."
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 734975f7f11..8ab2abec67e 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'.
;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
-;;;;;; "cl-macs" "cl-macs.el" "3b4d4e869f81f0b07ab3aa08f5478c2e")
+;;;;;; "cl-macs" "cl-macs.el" "8a90c81a400a2846e7b4c3da07626d94")
;;; Generated autoloads from cl-macs.el
(autoload 'cl--compiler-macro-list* "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index b63086d7a5f..e9cc200baaa 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2520,7 +2520,7 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc."
((memq type '(nil t)) type)
((eq type 'null) `(null ,val))
((eq type 'atom) `(atom ,val))
- ((eq type 'float) `(cl-floatp-safe ,val))
+ ((eq type 'float) `(floatp ,val))
((eq type 'real) `(numberp ,val))
((eq type 'fixnum) `(integerp ,val))
;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef
@@ -2739,7 +2739,7 @@ surrounded by (cl-block NAME ...).
(cond ((eq test 'eq) `(assq ,a ,list))
((eq test 'equal) `(assoc ,a ,list))
((and (macroexp-const-p a) (or (null keys) (eq test 'eql)))
- (if (cl-floatp-safe (cl--const-expr-val a))
+ (if (floatp (cl--const-expr-val a))
`(assoc ,a ,list) `(assq ,a ,list)))
(t form))))
@@ -2776,7 +2776,7 @@ surrounded by (cl-block NAME ...).
(put y 'side-effect-free t))
;;; Things that are inline.
-(cl-proclaim '(inline cl-floatp-safe cl-acons cl-map cl-concatenate cl-notany
+(cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany
cl-notevery cl--set-elt cl-revappend cl-nreconc gethash))
;;; Things that are side-effect-free.
@@ -2787,7 +2787,7 @@ surrounded by (cl-block NAME ...).
;;; Things that are side-effect-and-error-free.
(mapc (lambda (x) (put x 'side-effect-free 'error-free))
- '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp
+ '(eql cl-list* cl-subst cl-acons cl-equalp
cl-random-state-p copy-tree cl-sublis))
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 2088e690228..abe7b1ea741 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -359,10 +359,8 @@ on if the hook has explicitly disabled it."
(MODE-check-buffers
(intern (concat global-mode-name "-check-buffers")))
(MODE-cmhh (intern (concat global-mode-name "-cmhh")))
- (MODE-disable-in-buffer
- (intern (concat global-mode-name "-disable-in-buffer")))
(minor-MODE-hook (intern (concat mode-name "-hook")))
- (disable-MODE (intern (concat "disable-" mode-name)))
+ (MODE-set-explicitly (intern (concat mode-name "-set-explicitly")))
(MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))
keyw)
@@ -409,8 +407,6 @@ See `%s' for more information on %s."
(add-hook 'find-file-hook ',MODE-check-buffers)
(add-hook 'change-major-mode-hook ',MODE-cmhh))
(remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers)
- (remove-hook 'change-major-mode-after-body-hook
- ',MODE-enable-in-buffers)
(remove-hook 'find-file-hook ',MODE-check-buffers)
(remove-hook 'change-major-mode-hook ',MODE-cmhh))
@@ -425,7 +421,7 @@ See `%s' for more information on %s."
;; A function which checks whether MODE has been disabled in the major
;; mode hook which has just been run.
- (add-hook ',minor-MODE-hook ',MODE-disable-in-buffer)
+ (add-hook ',minor-MODE-hook ',MODE-set-explicitly)
;; List of buffers left to process.
(defvar ,MODE-buffers nil)
@@ -435,8 +431,7 @@ See `%s' for more information on %s."
(dolist (buf ,MODE-buffers)
(when (buffer-live-p buf)
(with-current-buffer buf
- (if ,disable-MODE
- (if ,mode (,mode -1))
+ (unless ,MODE-set-explicitly
(unless (eq ,MODE-major-mode major-mode)
(if ,mode
(progn
@@ -457,30 +452,20 @@ See `%s' for more information on %s."
(add-to-list ',MODE-buffers (current-buffer))
(add-hook 'post-command-hook ',MODE-check-buffers))
(put ',MODE-cmhh 'definition-name ',global-mode)
- ;; disable-MODE is set in MODE-disable-in-buffer and cleared by
+ ;; MODE-set-explicitly is set in MODE-set-explicitly and cleared by
;; kill-all-local-variables.
- (defvar-local ,disable-MODE nil)
- (defun ,MODE-disable-in-buffer ()
- (unless ,mode
- (setq ,disable-MODE t)))
- (put ',MODE-disable-in-buffer 'definition-name ',global-mode))))
+ (defvar-local ,MODE-set-explicitly nil)
+ (defun ,MODE-set-explicitly ()
+ (setq ,MODE-set-explicitly t))
+ (put ',MODE-set-explicitly 'definition-name ',global-mode))))
;;;
;;; easy-mmode-defmap
;;;
-(eval-and-compile
- (if (fboundp 'set-keymap-parents)
- (defalias 'easy-mmode-set-keymap-parents 'set-keymap-parents)
- (defun easy-mmode-set-keymap-parents (m parents)
- (set-keymap-parent
- m
- (cond
- ((not (consp parents)) parents)
- ((not (cdr parents)) (car parents))
- (t (let ((m (copy-keymap (pop parents))))
- (easy-mmode-set-keymap-parents m parents)
- m)))))))
+(defun easy-mmode-set-keymap-parents (m parents)
+ (set-keymap-parent
+ m (if (cdr parents) (make-composed-keymap parents) (car parents))))
;;;###autoload
(defun easy-mmode-define-keymap (bs &optional name m args)
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 24d680181bb..c8ae3f4bf1a 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -65,19 +65,19 @@ SLOT-NAME is the offending slot. FN is the function signaling the error."
"Clone OBJ, initializing `:parent' to OBJ.
All slots are unbound, except those initialized with PARAMS."
(let ((nobj (make-vector (length obj) eieio-unbound))
- (nm (aref obj object-name))
+ (nm (eieio--object-name obj))
(passname (and params (stringp (car params))))
(num 1))
(aset nobj 0 'object)
- (aset nobj object-class (aref obj object-class))
+ (setf (eieio--object-class nobj) (eieio--object-class obj))
;; The following was copied from the default clone.
(if (not passname)
(save-match-data
(if (string-match "-\\([0-9]+\\)" nm)
(setq num (1+ (string-to-number (match-string 1 nm)))
nm (substring nm 0 (match-beginning 0))))
- (aset nobj object-name (concat nm "-" (int-to-string num))))
- (aset nobj object-name (car params)))
+ (setf (eieio--object-name nobj) (concat nm "-" (int-to-string num))))
+ (setf (eieio--object-name nobj) (car params)))
;; Now initialize from params.
(if params (shared-initialize nobj (if passname (cdr params) params)))
(oset nobj parent-instance obj)
@@ -232,8 +232,7 @@ for CLASS. Optional ALLOW-SUBCLASS says that it is ok for
being pedantic."
(unless class
(message "Unsafe call to `eieio-persistent-read'."))
- (when (and class (not (class-p class)))
- (signal 'wrong-type-argument (list 'class-p class)))
+ (when class (eieio--check-type class-p class))
(let ((ret nil)
(buffstr nil))
(unwind-protect
@@ -308,7 +307,7 @@ Second, any text properties will be stripped from strings."
(type nil)
(classtype nil))
(setq slot-idx (- slot-idx 3))
- (setq type (aref (aref (class-v class) class-public-type)
+ (setq type (aref (eieio--class-public-type (class-v class))
slot-idx))
(setq classtype (eieio-persistent-slot-type-is-class-p
@@ -482,14 +481,13 @@ Argument SLOT-NAME is the slot that was attempted to be accessed.
OPERATION is the type of access, such as `oref' or `oset'.
NEW-VALUE is the value that was being set into SLOT if OPERATION were
a set type."
- (if (or (eq slot-name 'object-name)
- (eq slot-name :object-name))
+ (if (memq slot-name '(object-name :object-name))
(cond ((eq operation 'oset)
(if (not (stringp new-value))
(signal 'invalid-slot-type
(list obj slot-name 'string new-value)))
- (object-set-name-string obj new-value))
- (t (object-name-string obj)))
+ (eieio-object-set-name-string obj new-value))
+ (t (eieio-object-name-string obj)))
(call-next-method)))
(provide 'eieio-base)
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index 46dc34d6d45..f9917bddd42 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -192,22 +192,22 @@ Optional argument IGNORE is an extraneous parameter."
(let* ((chil nil)
(obj (widget-get widget :value))
(master-group (widget-get widget :eieio-group))
- (cv (class-v (object-class-fast obj)))
- (slots (aref cv class-public-a))
- (flabel (aref cv class-public-custom-label))
- (fgroup (aref cv class-public-custom-group))
- (fdoc (aref cv class-public-doc))
- (fcust (aref cv class-public-custom)))
+ (cv (class-v (eieio--object-class obj)))
+ (slots (eieio--class-public-a cv))
+ (flabel (eieio--class-public-custom-label cv))
+ (fgroup (eieio--class-public-custom-group cv))
+ (fdoc (eieio--class-public-doc cv))
+ (fcust (eieio--class-public-custom cv)))
;; First line describes the object, but may not editable.
(if (widget-get widget :eieio-show-name)
(setq chil (cons (widget-create-child-and-convert
widget 'string :tag "Object "
:sample-face 'bold
- (object-name-string obj))
+ (eieio-object-name-string obj))
chil)))
;; Display information about the group being shown
(when master-group
- (let ((groups (class-option (object-class-fast obj) :custom-groups)))
+ (let ((groups (class-option (eieio--object-class obj) :custom-groups)))
(widget-insert "Groups:")
(while groups
(widget-insert " ")
@@ -260,7 +260,7 @@ Optional argument IGNORE is an extraneous parameter."
(let ((s (symbol-name
(or
(class-slot-initarg
- (object-class-fast obj)
+ (eieio--object-class obj)
(car slots))
(car slots)))))
(capitalize
@@ -287,17 +287,17 @@ Optional argument IGNORE is an extraneous parameter."
"Get the value of WIDGET."
(let* ((obj (widget-get widget :value))
(master-group eieio-cog)
- (cv (class-v (object-class-fast obj)))
- (fgroup (aref cv class-public-custom-group))
+ (cv (class-v (eieio--object-class obj)))
+ (fgroup (eieio--class-public-custom-group cv))
(wids (widget-get widget :children))
(name (if (widget-get widget :eieio-show-name)
(car (widget-apply (car wids) :value-inline))
nil))
(chil (if (widget-get widget :eieio-show-name)
(nthcdr 1 wids) wids))
- (cv (class-v (object-class-fast obj)))
- (slots (aref cv class-public-a))
- (fcust (aref cv class-public-custom)))
+ (cv (class-v (eieio--object-class obj)))
+ (slots (eieio--class-public-a cv))
+ (fcust (eieio--class-public-custom cv)))
;; If there are any prefix widgets, clear them.
;; -- None yet
;; Create a batch of initargs for each slot.
@@ -316,7 +316,7 @@ Optional argument IGNORE is an extraneous parameter."
fgroup (cdr fgroup)
fcust (cdr fcust)))
;; Set any name updates on it.
- (if name (aset obj object-name name))
+ (if name (setf (eieio--object-name obj) name))
;; This is the same object we had before.
obj))
@@ -354,7 +354,7 @@ These groups are specified with the `:group' slot flag."
(let* ((g (or group 'default)))
(switch-to-buffer (get-buffer-create
(concat "*CUSTOMIZE "
- (object-name obj) " "
+ (eieio-object-name obj) " "
(symbol-name g) "*")))
(setq buffer-read-only nil)
(kill-all-local-variables)
@@ -367,7 +367,7 @@ These groups are specified with the `:group' slot flag."
;; Add an apply reset option at the top of the buffer.
(eieio-custom-object-apply-reset obj)
(widget-insert "\n\n")
- (widget-insert "Edit object " (object-name obj) "\n\n")
+ (widget-insert "Edit object " (eieio-object-name obj) "\n\n")
;; Create the widget editing the object.
(make-local-variable 'eieio-wo)
(setq eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
@@ -452,7 +452,7 @@ Must return the created widget."
(vector (concat "Group " (symbol-name group))
(list 'customize-object obj (list 'quote group))
t))
- (class-option (object-class-fast obj) :custom-groups)))
+ (class-option (eieio--object-class obj) :custom-groups)))
(defvar eieio-read-custom-group-history nil
"History for the custom group reader.")
@@ -460,7 +460,7 @@ Must return the created widget."
(defmethod eieio-read-customization-group ((obj eieio-default-superclass))
"Do a completing read on the name of a customization group in OBJ.
Return the symbol for the group, or nil"
- (let ((g (class-option (object-class-fast obj) :custom-groups)))
+ (let ((g (class-option (eieio--object-class obj) :custom-groups)))
(if (= (length g) 1)
(car g)
;; Make the association list
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el
index e23bbb07fe2..7daa24257a1 100644
--- a/lisp/emacs-lisp/eieio-datadebug.el
+++ b/lisp/emacs-lisp/eieio-datadebug.el
@@ -58,9 +58,9 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
(end nil)
(str (object-print object))
(tip (format "Object %s\nClass: %S\nParent(s): %S\n%d slots"
- (object-name-string object)
- (object-class object)
- (class-parents (object-class object))
+ (eieio-object-name-string object)
+ (eieio-object-class object)
+ (eieio-class-parents (eieio-object-class object))
(length (object-slots object))
))
)
@@ -82,16 +82,16 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
(defmethod data-debug/eieio-insert-slots ((obj eieio-default-superclass)
prefix)
"Insert the slots of OBJ into the current DDEBUG buffer."
- (data-debug-insert-thing (object-name-string obj)
+ (data-debug-insert-thing (eieio-object-name-string obj)
prefix
"Name: ")
- (let* ((cl (object-class obj))
+ (let* ((cl (eieio-object-class obj))
(cv (class-v cl)))
(data-debug-insert-thing (class-constructor cl)
prefix
"Class: ")
;; Loop over all the public slots
- (let ((publa (aref cv class-public-a))
+ (let ((publa (eieio--class-public-a cv))
)
(while publa
(if (slot-boundp obj (car publa))
@@ -123,7 +123,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
;;
(defmethod data-debug-show ((obj eieio-default-superclass))
"Run ddebug against any EIEIO object OBJ."
- (data-debug-new-buffer (format "*%s DDEBUG*" (object-name obj)))
+ (data-debug-new-buffer (format "*%s DDEBUG*" (eieio-object-name obj)))
(data-debug-insert-object-slots obj "]"))
;;; DEBUG FUNCTIONS
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 8867d88cc3a..29ad980991b 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -45,7 +45,7 @@ variable `eieio-default-superclass'."
nil t)))
nil))
(if (not root-class) (setq root-class 'eieio-default-superclass))
- (if (not (class-p root-class)) (signal 'wrong-type-argument (list 'class-p root-class)))
+ (eieio--check-type class-p root-class)
(display-buffer (get-buffer-create "*EIEIO OBJECT BROWSE*") t)
(with-current-buffer (get-buffer "*EIEIO OBJECT BROWSE*")
(erase-buffer)
@@ -58,9 +58,9 @@ variable `eieio-default-superclass'."
Argument THIS-ROOT is the local root of the tree.
Argument PREFIX is the character prefix to use.
Argument CH-PREFIX is another character prefix to display."
- (if (not (class-p (eval this-root))) (signal 'wrong-type-argument (list 'class-p this-root)))
+ (eieio--check-type class-p this-root)
(let ((myname (symbol-name this-root))
- (chl (aref (class-v this-root) class-children))
+ (chl (eieio--class-children (class-v this-root)))
(fprefix (concat ch-prefix " +--"))
(mprefix (concat ch-prefix " | "))
(lprefix (concat ch-prefix " ")))
@@ -99,7 +99,7 @@ Optional HEADERFCN should be called to insert a few bits of info first."
(princ "'"))
(terpri)
;; Inheritance tree information
- (let ((pl (class-parents class)))
+ (let ((pl (eieio-class-parents class)))
(when pl
(princ " Inherits from ")
(while pl
@@ -107,7 +107,7 @@ Optional HEADERFCN should be called to insert a few bits of info first."
(setq pl (cdr pl))
(if pl (princ ", ")))
(terpri)))
- (let ((ch (class-children class)))
+ (let ((ch (eieio-class-children class)))
(when ch
(princ " Children ")
(while ch
@@ -177,13 +177,13 @@ Optional HEADERFCN should be called to insert a few bits of info first."
"Describe the slots in CLASS.
Outputs to the standard output."
(let* ((cv (class-v class))
- (docs (aref cv class-public-doc))
- (names (aref cv class-public-a))
- (deflt (aref cv class-public-d))
- (types (aref cv class-public-type))
- (publp (aref cv class-public-printer))
+ (docs (eieio--class-public-doc cv))
+ (names (eieio--class-public-a cv))
+ (deflt (eieio--class-public-d cv))
+ (types (eieio--class-public-type cv))
+ (publp (eieio--class-public-printer cv))
(i 0)
- (prot (aref cv class-protection))
+ (prot (eieio--class-protection cv))
)
(princ "Instance Allocated Slots:")
(terpri)
@@ -213,11 +213,11 @@ Outputs to the standard output."
publp (cdr publp)
prot (cdr prot)
i (1+ i)))
- (setq docs (aref cv class-class-allocation-doc)
- names (aref cv class-class-allocation-a)
- types (aref cv class-class-allocation-type)
+ (setq docs (eieio--class-class-allocation-doc cv)
+ names (eieio--class-class-allocation-a cv)
+ types (eieio--class-class-allocation-type cv)
i 0
- prot (aref cv class-class-allocation-protection))
+ prot (eieio--class-class-allocation-protection cv))
(when names
(terpri)
(princ "Class Allocated Slots:"))
@@ -281,7 +281,7 @@ Uses `eieio-describe-class' to describe the class being constructed."
(mapcar
(lambda (c)
(append (list c) (eieio-build-class-list c)))
- (class-children-fast class)))
+ (eieio-class-children-fast class)))
(list class)))
(defun eieio-build-class-alist (&optional class instantiable-only buildlist)
@@ -291,7 +291,7 @@ If INSTANTIABLE-ONLY is non nil, only allow names of classes which
are not abstract, otherwise allow all classes.
Optional argument BUILDLIST is more list to attach and is used internally."
(let* ((cc (or class eieio-default-superclass))
- (sublst (aref (class-v cc) class-children)))
+ (sublst (eieio--class-children (class-v cc))))
(unless (assoc (symbol-name cc) buildlist)
(when (or (not instantiable-only) (not (class-abstract-p cc)))
(setq buildlist (cons (cons (symbol-name cc) 1) buildlist))))
@@ -335,8 +335,7 @@ are not abstract."
"Describe the generic function GENERIC.
Also extracts information about all methods specific to this generic."
(interactive (list (eieio-read-generic "Generic Method: ")))
- (if (not (generic-p generic))
- (signal 'wrong-type-argument '(generic-p generic)))
+ (eieio--check-type generic-p generic)
(with-output-to-temp-buffer (help-buffer) ; "*Help*"
(help-setup-xref (list #'eieio-describe-generic generic)
(called-interactively-p 'interactive))
@@ -757,9 +756,8 @@ current expansion depth."
(defun eieio-class-button (class depth)
"Draw a speedbar button at the current point for CLASS at DEPTH."
- (if (not (class-p class))
- (signal 'wrong-type-argument (list 'class-p class)))
- (let ((subclasses (aref (class-v class) class-children)))
+ (eieio--check-type class-p class)
+ (let ((subclasses (eieio--class-children (class-v class))))
(if subclasses
(speedbar-make-tag-line 'angle ?+
'eieio-sb-expand
@@ -784,7 +782,7 @@ Argument INDENT is the depth of indentation."
(speedbar-with-writable
(save-excursion
(end-of-line) (forward-char 1)
- (let ((subclasses (aref (class-v class) class-children)))
+ (let ((subclasses (eieio--class-children (class-v class))))
(while subclasses
(eieio-class-button (car subclasses) (1+ indent))
(setq subclasses (cdr subclasses)))))))
diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el
index 27c7d01f3b8..c230226eae4 100644
--- a/lisp/emacs-lisp/eieio-speedbar.el
+++ b/lisp/emacs-lisp/eieio-speedbar.el
@@ -198,7 +198,7 @@ that path."
(defmethod eieio-speedbar-description (object)
"Return a string describing OBJECT."
- (object-name-string object))
+ (eieio-object-name-string object))
(defmethod eieio-speedbar-derive-line-path (object)
"Return the path which OBJECT has something to do with."
@@ -206,7 +206,7 @@ that path."
(defmethod eieio-speedbar-object-buttonname (object)
"Return a string to use as a speedbar button for OBJECT."
- (object-name-string object))
+ (eieio-object-name-string object))
(defmethod eieio-speedbar-make-tag-line (object depth)
"Insert a tag line into speedbar at point for OBJECT.
@@ -324,7 +324,7 @@ Argument DEPTH is the depth at which the tag line is inserted."
(defmethod eieio-speedbar-child-make-tag-lines ((object eieio-speedbar) depth)
"Base method for creating tag lines for non-object children."
(error "You must implement `eieio-speedbar-child-make-tag-lines' for %s"
- (object-name object)))
+ (eieio-object-name object)))
(defmethod eieio-speedbar-expand ((object eieio-speedbar) depth)
"Expand OBJECT at indentation DEPTH.
@@ -365,7 +365,7 @@ TOKEN is the object. INDENT is the current indentation level."
(defmethod eieio-speedbar-child-description ((obj eieio-speedbar))
"Return a description for a child of OBJ which is not an object."
(error "You must implement `eieio-speedbar-child-description' for %s"
- (object-name obj)))
+ (eieio-object-name obj)))
(defun eieio-speedbar-item-info ()
"Display info for the current line when in EDE display mode."
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 626bc0f6dc6..37b1ec5fa94 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -105,49 +105,67 @@ default setting for optimization purposes.")
;; This is a bootstrap for eieio-default-superclass so it has a value
;; while it is being built itself.
-(defvar eieio-default-superclass nil)
-
-;; FIXME: The constants below should have an `eieio-' prefix added!!
-(defconst class-symbol 1 "Class's symbol (self-referencing.).")
-(defconst class-parent 2 "Class parent slot.")
-(defconst class-children 3 "Class children class slot.")
-(defconst class-symbol-obarray 4 "Obarray permitting fast access to variable position indexes.")
-;; @todo
-;; the word "public" here is leftovers from the very first version.
-;; Get rid of it!
-(defconst class-public-a 5 "Class attribute index.")
-(defconst class-public-d 6 "Class attribute defaults index.")
-(defconst class-public-doc 7 "Class documentation strings for attributes.")
-(defconst class-public-type 8 "Class type for a slot.")
-(defconst class-public-custom 9 "Class custom type for a slot.")
-(defconst class-public-custom-label 10 "Class custom group for a slot.")
-(defconst class-public-custom-group 11 "Class custom group for a slot.")
-(defconst class-public-printer 12 "Printer for a slot.")
-(defconst class-protection 13 "Class protection for a slot.")
-(defconst class-initarg-tuples 14 "Class initarg tuples list.")
-(defconst class-class-allocation-a 15 "Class allocated attributes.")
-(defconst class-class-allocation-doc 16 "Class allocated documentation.")
-(defconst class-class-allocation-type 17 "Class allocated value type.")
-(defconst class-class-allocation-custom 18 "Class allocated custom descriptor.")
-(defconst class-class-allocation-custom-label 19 "Class allocated custom descriptor.")
-(defconst class-class-allocation-custom-group 20 "Class allocated custom group.")
-(defconst class-class-allocation-printer 21 "Class allocated printer for a slot.")
-(defconst class-class-allocation-protection 22 "Class allocated protection list.")
-(defconst class-class-allocation-values 23 "Class allocated value vector.")
-(defconst class-default-object-cache 24
- "Cache index of what a newly created object would look like.
+(defvar eieio-default-superclass nil))
+
+(defmacro eieio--define-field-accessors (prefix fields)
+ (declare (indent 1))
+ (let ((index 0)
+ (defs '()))
+ (dolist (field fields)
+ (let ((doc (if (listp field)
+ (prog1 (cadr field) (setq field (car field))))))
+ (push `(defmacro ,(intern (format "eieio--%s-%s" prefix field)) (x)
+ ,@(if doc (list (format (if (string-match "\n" doc)
+ "Return %s" "Return %s of a %s.")
+ doc prefix)))
+ (list 'aref x ,index))
+ defs)
+ (setq index (1+ index))))
+ `(eval-and-compile
+ ,@(nreverse defs)
+ (defconst ,(intern (format "eieio--%s-num-slots" prefix)) ,index))))
+
+(eieio--define-field-accessors class
+ (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
+ (symbol "symbol (self-referencing)")
+ parent children
+ (symbol-obarray "obarray permitting fast access to variable position indexes")
+ ;; @todo
+ ;; the word "public" here is leftovers from the very first version.
+ ;; Get rid of it!
+ (public-a "class attribute index")
+ (public-d "class attribute defaults index")
+ (public-doc "class documentation strings for attributes")
+ (public-type "class type for a slot")
+ (public-custom "class custom type for a slot")
+ (public-custom-label "class custom group for a slot")
+ (public-custom-group "class custom group for a slot")
+ (public-printer "printer for a slot")
+ (protection "protection for a slot")
+ (initarg-tuples "initarg tuples list")
+ (class-allocation-a "class allocated attributes")
+ (class-allocation-doc "class allocated documentation")
+ (class-allocation-type "class allocated value type")
+ (class-allocation-custom "class allocated custom descriptor")
+ (class-allocation-custom-label "class allocated custom descriptor")
+ (class-allocation-custom-group "class allocated custom group")
+ (class-allocation-printer "class allocated printer for a slot")
+ (class-allocation-protection "class allocated protection list")
+ (class-allocation-values "class allocated value vector")
+ (default-object-cache "what a newly created object would look like.
This will speed up instantiation time as only a `copy-sequence' will
be needed, instead of looping over all the values and setting them
from the default.")
-(defconst class-options 25
- "Storage location of tagged class options.
-Stored outright without modifications or stripping.")
+ (options "storage location of tagged class options.
+Stored outright without modifications or stripping.")))
-(defconst class-num-slots 26
- "Number of slots in the class definition object.")
+(eieio--define-field-accessors object
+ (-unused-0 ;;FIXME: not sure, but at least there was no accessor!
+ (class "class struct defining OBJ")
+ name))
-(defconst object-class 1 "Index in an object vector where the class is stored.")
-(defconst object-name 2 "Index in an object where the name is stored.")
+(eval-and-compile
+;; FIXME: The constants below should have an `eieio-' prefix added!!
(defconst method-static 0 "Index into :static tag on a method.")
(defconst method-before 1 "Index into :before tag on a method.")
@@ -188,13 +206,13 @@ CLASS is a symbol."
`(condition-case nil
(let ((tobj ,obj))
(and (eq (aref tobj 0) 'object)
- (class-p (aref tobj object-class))))
+ (class-p (eieio--object-class tobj))))
(error nil)))
(defalias 'object-p 'eieio-object-p)
(defmacro class-constructor (class)
"Return the symbol representing the constructor of CLASS."
- `(aref (class-v ,class) class-symbol))
+ `(eieio--class-symbol (class-v ,class)))
(defmacro generic-p (method)
"Return t if symbol METHOD is a generic function.
@@ -241,7 +259,7 @@ Methods with only primary implementations are executed in an optimized way."
(defmacro class-option (class option)
"Return the value stored for CLASS' OPTION.
Return nil if that option doesn't exist."
- `(class-option-assoc (aref (class-v ,class) class-options) ',option))
+ `(class-option-assoc (eieio--class-options (class-v ,class)) ',option))
(defmacro class-abstract-p (class)
"Return non-nil if CLASS is abstract.
@@ -334,14 +352,14 @@ It creates an autoload function for CNAME's constructor."
;; Assume we've already debugged inputs.
(let* ((oldc (when (class-p cname) (class-v cname)))
- (newc (make-vector class-num-slots nil))
+ (newc (make-vector eieio--class-num-slots nil))
)
(if oldc
nil ;; Do nothing if we already have this class.
;; Create the class in NEWC, but don't fill anything else in.
(aset newc 0 'defclass)
- (aset newc class-symbol cname)
+ (setf (eieio--class-symbol newc) cname)
(let ((clear-parent nil))
;; No parents?
@@ -371,12 +389,12 @@ It creates an autoload function for CNAME's constructor."
)
;; We have a parent, save the child in there.
- (when (not (member cname (aref (class-v SC) class-children)))
- (aset (class-v SC) class-children
- (cons cname (aref (class-v SC) class-children)))))
+ (when (not (member cname (eieio--class-children (class-v SC))))
+ (setf (eieio--class-children (class-v SC))
+ (cons cname (eieio--class-children (class-v SC))))))
;; save parent in child
- (aset newc class-parent (cons SC (aref newc class-parent)))
+ (setf (eieio--class-parent newc) (cons SC (eieio--class-parent newc)))
)
;; turn this into a usable self-pointing symbol
@@ -389,7 +407,7 @@ It creates an autoload function for CNAME's constructor."
(put cname 'eieio-class-definition newc)
;; Clear the parent
- (if clear-parent (aset newc class-parent nil))
+ (if clear-parent (setf (eieio--class-parent newc) nil))
;; Create an autoload on top of our constructor function.
(autoload cname filename doc nil nil)
@@ -404,6 +422,15 @@ It creates an autoload function for CNAME's constructor."
(when (eq (car-safe (symbol-function cname)) 'autoload)
(load-library (car (cdr (symbol-function cname))))))
+(defmacro eieio--check-type (type obj)
+ (unless (symbolp obj)
+ (error "eieio--check-type wants OBJ to be a variable"))
+ `(if (not ,(cond
+ ((eq 'or (car-safe type))
+ `(or ,@(mapcar (lambda (type) `(,type ,obj)) (cdr type))))
+ (t `(,type ,obj))))
+ (signal 'wrong-type-argument (list ',type ,obj))))
+
(defun eieio-defclass (cname superclasses slots options-and-doc)
;; FIXME: Most of this should be moved to the `defclass' macro.
"Define CNAME as a new subclass of SUPERCLASSES.
@@ -416,18 +443,17 @@ See `defclass' for more information."
(run-hooks 'eieio-hook)
(setq eieio-hook nil)
- (if (not (listp superclasses))
- (signal 'wrong-type-argument '(listp superclasses)))
+ (eieio--check-type listp superclasses)
(let* ((pname superclasses)
- (newc (make-vector class-num-slots nil))
+ (newc (make-vector eieio--class-num-slots nil))
(oldc (when (class-p cname) (class-v cname)))
(groups nil) ;; list of groups id'd from slots
(options nil)
(clearparent nil))
(aset newc 0 'defclass)
- (aset newc class-symbol cname)
+ (setf (eieio--class-symbol newc) cname)
;; If this class already existed, and we are updating its structure,
;; make sure we keep the old child list. This can cause bugs, but
@@ -435,13 +461,13 @@ See `defclass' for more information."
;; method table breakage, particularly when the users is only
;; byte compiling an EIEIO file.
(if oldc
- (aset newc class-children (aref oldc class-children))
+ (setf (eieio--class-children newc) (eieio--class-children oldc))
;; If the old class did not exist, but did exist in the autoload map, then adopt those children.
;; This is like the above, but deals with autoloads nicely.
(let ((sym (intern-soft (symbol-name cname) eieio-defclass-autoload-map)))
(when sym
(condition-case nil
- (aset newc class-children (symbol-value sym))
+ (setf (eieio--class-children newc) (symbol-value sym))
(error nil))
(unintern (symbol-name cname) eieio-defclass-autoload-map)
))
@@ -469,30 +495,30 @@ See `defclass' for more information."
(error "Given parent class %s is not a class" (car pname))
;; good parent class...
;; save new child in parent
- (when (not (member cname (aref (class-v (car pname)) class-children)))
- (aset (class-v (car pname)) class-children
- (cons cname (aref (class-v (car pname)) class-children))))
+ (when (not (member cname (eieio--class-children (class-v (car pname)))))
+ (setf (eieio--class-children (class-v (car pname)))
+ (cons cname (eieio--class-children (class-v (car pname))))))
;; Get custom groups, and store them into our local copy.
(mapc (lambda (g) (add-to-list 'groups g))
(class-option (car pname) :custom-groups))
;; save parent in child
- (aset newc class-parent (cons (car pname) (aref newc class-parent))))
+ (setf (eieio--class-parent newc) (cons (car pname) (eieio--class-parent newc))))
(error "Invalid parent class %s" pname))
(setq pname (cdr pname)))
;; Reverse the list of our parents so that they are prioritized in
;; the same order as specified in the code.
- (aset newc class-parent (nreverse (aref newc class-parent))) )
+ (setf (eieio--class-parent newc) (nreverse (eieio--class-parent newc))) )
;; If there is nothing to loop over, then inherit from the
;; default superclass.
(unless (eq cname 'eieio-default-superclass)
;; adopt the default parent here, but clear it later...
(setq clearparent t)
;; save new child in parent
- (if (not (member cname (aref (class-v 'eieio-default-superclass) class-children)))
- (aset (class-v 'eieio-default-superclass) class-children
- (cons cname (aref (class-v 'eieio-default-superclass) class-children))))
+ (if (not (member cname (eieio--class-children (class-v 'eieio-default-superclass))))
+ (setf (eieio--class-children (class-v 'eieio-default-superclass))
+ (cons cname (eieio--class-children (class-v 'eieio-default-superclass)))))
;; save parent in child
- (aset newc class-parent (list eieio-default-superclass))))
+ (setf (eieio--class-parent newc) (list eieio-default-superclass))))
;; turn this into a usable self-pointing symbol
(set cname cname)
@@ -714,26 +740,26 @@ See `defclass' for more information."
;; Now that everything has been loaded up, all our lists are backwards!
;; Fix that up now.
- (aset newc class-public-a (nreverse (aref newc class-public-a)))
- (aset newc class-public-d (nreverse (aref newc class-public-d)))
- (aset newc class-public-doc (nreverse (aref newc class-public-doc)))
- (aset newc class-public-type
- (apply 'vector (nreverse (aref newc class-public-type))))
- (aset newc class-public-custom (nreverse (aref newc class-public-custom)))
- (aset newc class-public-custom-label (nreverse (aref newc class-public-custom-label)))
- (aset newc class-public-custom-group (nreverse (aref newc class-public-custom-group)))
- (aset newc class-public-printer (nreverse (aref newc class-public-printer)))
- (aset newc class-protection (nreverse (aref newc class-protection)))
- (aset newc class-initarg-tuples (nreverse (aref newc class-initarg-tuples)))
+ (setf (eieio--class-public-a newc) (nreverse (eieio--class-public-a newc)))
+ (setf (eieio--class-public-d newc) (nreverse (eieio--class-public-d newc)))
+ (setf (eieio--class-public-doc newc) (nreverse (eieio--class-public-doc newc)))
+ (setf (eieio--class-public-type newc)
+ (apply 'vector (nreverse (eieio--class-public-type newc))))
+ (setf (eieio--class-public-custom newc) (nreverse (eieio--class-public-custom newc)))
+ (setf (eieio--class-public-custom-label newc) (nreverse (eieio--class-public-custom-label newc)))
+ (setf (eieio--class-public-custom-group newc) (nreverse (eieio--class-public-custom-group newc)))
+ (setf (eieio--class-public-printer newc) (nreverse (eieio--class-public-printer newc)))
+ (setf (eieio--class-protection newc) (nreverse (eieio--class-protection newc)))
+ (setf (eieio--class-initarg-tuples newc) (nreverse (eieio--class-initarg-tuples newc)))
;; The storage for class-class-allocation-type needs to be turned into
;; a vector now.
- (aset newc class-class-allocation-type
- (apply 'vector (aref newc class-class-allocation-type)))
+ (setf (eieio--class-class-allocation-type newc)
+ (apply 'vector (eieio--class-class-allocation-type newc)))
;; Also, take class allocated values, and vectorize them for speed.
- (aset newc class-class-allocation-values
- (apply 'vector (aref newc class-class-allocation-values)))
+ (setf (eieio--class-class-allocation-values newc)
+ (apply 'vector (eieio--class-class-allocation-values newc)))
;; Attach slot symbols into an obarray, and store the index of
;; this slot as the variable slot in this new symbol. We need to
@@ -741,8 +767,8 @@ See `defclass' for more information."
;; prime number length, and we also need to make our vector small
;; to save space, and also optimal for the number of items we have.
(let* ((cnt 0)
- (pubsyms (aref newc class-public-a))
- (prots (aref newc class-protection))
+ (pubsyms (eieio--class-public-a newc))
+ (prots (eieio--class-protection newc))
(l (length pubsyms))
(vl (let ((primes '( 3 5 7 11 13 17 19 23 29 31 37 41 43 47
53 59 61 67 71 73 79 83 89 97 101 )))
@@ -758,7 +784,7 @@ See `defclass' for more information."
(if (car prots) (put newsym 'protection (car prots)))
(setq pubsyms (cdr pubsyms)
prots (cdr prots)))
- (aset newc class-symbol-obarray oa)
+ (setf (eieio--class-symbol-obarray newc) oa)
)
;; Create the constructor function
@@ -790,7 +816,7 @@ See `defclass' for more information."
buffer-file-name))
loc)
(when fname
- (when (string-match "\\.elc$" fname)
+ (when (string-match "\\.elc\\'" fname)
(setq fname (substring fname 0 (1- (length fname)))))
(put cname 'class-location fname)))
@@ -802,23 +828,23 @@ See `defclass' for more information."
(setq options (cons :custom-groups (cons g options)))))
;; Set up the options we have collected.
- (aset newc class-options options)
+ (setf (eieio--class-options newc) options)
;; if this is a superclass, clear out parent (which was set to the
;; default superclass eieio-default-superclass)
- (if clearparent (aset newc class-parent nil))
+ (if clearparent (setf (eieio--class-parent newc) nil))
;; Create the cached default object.
- (let ((cache (make-vector (+ (length (aref newc class-public-a))
- 3) nil)))
+ (let ((cache (make-vector (+ (length (eieio--class-public-a newc)) 3)
+ nil)))
(aset cache 0 'object)
- (aset cache object-class cname)
- (aset cache object-name 'default-cache-object)
+ (setf (eieio--object-class cache) cname)
+ (setf (eieio--object-name cache) 'default-cache-object)
(let ((eieio-skip-typecheck t))
;; All type-checking has been done to our satisfaction
;; before this call. Don't waste our time in this call..
(eieio-set-defaults cache t))
- (aset newc class-default-object-cache cache))
+ (setf (eieio--class-default-object-cache newc) cache))
;; Return our new class object
;; newc
@@ -855,7 +881,7 @@ if default value is nil."
;; To prevent override information w/out specification of storage,
;; we need to do this little hack.
- (if (member a (aref newc class-class-allocation-a)) (setq alloc ':class))
+ (if (member a (eieio--class-class-allocation-a newc)) (setq alloc ':class))
(if (or (not alloc) (and (symbolp alloc) (eq alloc ':instance)))
;; In this case, we modify the INSTANCE version of a given slot.
@@ -863,31 +889,31 @@ if default value is nil."
(progn
;; Only add this element if it is so-far unique
- (if (not (member a (aref newc class-public-a)))
+ (if (not (member a (eieio--class-public-a newc)))
(progn
(eieio-perform-slot-validation-for-default a type d skipnil)
- (aset newc class-public-a (cons a (aref newc class-public-a)))
- (aset newc class-public-d (cons d (aref newc class-public-d)))
- (aset newc class-public-doc (cons doc (aref newc class-public-doc)))
- (aset newc class-public-type (cons type (aref newc class-public-type)))
- (aset newc class-public-custom (cons cust (aref newc class-public-custom)))
- (aset newc class-public-custom-label (cons label (aref newc class-public-custom-label)))
- (aset newc class-public-custom-group (cons custg (aref newc class-public-custom-group)))
- (aset newc class-public-printer (cons print (aref newc class-public-printer)))
- (aset newc class-protection (cons prot (aref newc class-protection)))
- (aset newc class-initarg-tuples (cons (cons init a) (aref newc class-initarg-tuples)))
+ (setf (eieio--class-public-a newc) (cons a (eieio--class-public-a newc)))
+ (setf (eieio--class-public-d newc) (cons d (eieio--class-public-d newc)))
+ (setf (eieio--class-public-doc newc) (cons doc (eieio--class-public-doc newc)))
+ (setf (eieio--class-public-type newc) (cons type (eieio--class-public-type newc)))
+ (setf (eieio--class-public-custom newc) (cons cust (eieio--class-public-custom newc)))
+ (setf (eieio--class-public-custom-label newc) (cons label (eieio--class-public-custom-label newc)))
+ (setf (eieio--class-public-custom-group newc) (cons custg (eieio--class-public-custom-group newc)))
+ (setf (eieio--class-public-printer newc) (cons print (eieio--class-public-printer newc)))
+ (setf (eieio--class-protection newc) (cons prot (eieio--class-protection newc)))
+ (setf (eieio--class-initarg-tuples newc) (cons (cons init a) (eieio--class-initarg-tuples newc)))
)
;; When defaultoverride is true, we are usually adding new local
;; attributes which must override the default value of any slot
;; passed in by one of the parent classes.
(when defaultoverride
;; There is a match, and we must override the old value.
- (let* ((ca (aref newc class-public-a))
+ (let* ((ca (eieio--class-public-a newc))
(np (member a ca))
(num (- (length ca) (length np)))
- (dp (if np (nthcdr num (aref newc class-public-d))
+ (dp (if np (nthcdr num (eieio--class-public-d newc))
nil))
- (tp (if np (nth num (aref newc class-public-type))))
+ (tp (if np (nth num (eieio--class-public-type newc))))
)
(if (not np)
(error "EIEIO internal error overriding default value for %s"
@@ -904,7 +930,7 @@ if default value is nil."
(setcar dp d))
;; If we have a new initarg, check for it.
(when init
- (let* ((inits (aref newc class-initarg-tuples))
+ (let* ((inits (eieio--class-initarg-tuples newc))
(inita (rassq a inits)))
;; Replace the CAR of the associate INITA.
;;(message "Initarg: %S replace %s" inita init)
@@ -920,7 +946,7 @@ if default value is nil."
;; EML - We used to have (if prot... here,
;; but a prot of 'nil means public.
;;
- (let ((super-prot (nth num (aref newc class-protection)))
+ (let ((super-prot (nth num (eieio--class-protection newc)))
)
(if (not (eq prot super-prot))
(error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
@@ -932,7 +958,7 @@ if default value is nil."
;; groups and new ones.
(when custg
(let* ((groups
- (nthcdr num (aref newc class-public-custom-group)))
+ (nthcdr num (eieio--class-public-custom-group newc)))
(list1 (car groups))
(list2 (if (listp custg) custg (list custg))))
(if (< (length list1) (length list2))
@@ -947,20 +973,20 @@ if default value is nil."
;; set, simply replaces the old one.
(when cust
;; (message "Custom type redefined to %s" cust)
- (setcar (nthcdr num (aref newc class-public-custom)) cust))
+ (setcar (nthcdr num (eieio--class-public-custom newc)) cust))
;; If a new label is specified, it simply replaces
;; the old one.
(when label
;; (message "Custom label redefined to %s" label)
- (setcar (nthcdr num (aref newc class-public-custom-label)) label))
+ (setcar (nthcdr num (eieio--class-public-custom-label newc)) label))
;; End PLN
;; PLN Sat Jun 30 17:24:42 2007 : when a new
;; doc is specified, simply replaces the old one.
(when doc
;;(message "Documentation redefined to %s" doc)
- (setcar (nthcdr num (aref newc class-public-doc))
+ (setcar (nthcdr num (eieio--class-public-doc newc))
doc))
;; End PLN
@@ -968,38 +994,38 @@ if default value is nil."
;; the old one.
(when print
;; (message "printer redefined to %s" print)
- (setcar (nthcdr num (aref newc class-public-printer)) print))
+ (setcar (nthcdr num (eieio--class-public-printer newc)) print))
)))
))
;; CLASS ALLOCATED SLOTS
(let ((value (eieio-default-eval-maybe d)))
- (if (not (member a (aref newc class-class-allocation-a)))
+ (if (not (member a (eieio--class-class-allocation-a newc)))
(progn
(eieio-perform-slot-validation-for-default a type value skipnil)
;; Here we have found a :class version of a slot. This
;; requires a very different approach.
- (aset newc class-class-allocation-a (cons a (aref newc class-class-allocation-a)))
- (aset newc class-class-allocation-doc (cons doc (aref newc class-class-allocation-doc)))
- (aset newc class-class-allocation-type (cons type (aref newc class-class-allocation-type)))
- (aset newc class-class-allocation-custom (cons cust (aref newc class-class-allocation-custom)))
- (aset newc class-class-allocation-custom-label (cons label (aref newc class-class-allocation-custom-label)))
- (aset newc class-class-allocation-custom-group (cons custg (aref newc class-class-allocation-custom-group)))
- (aset newc class-class-allocation-protection (cons prot (aref newc class-class-allocation-protection)))
+ (setf (eieio--class-class-allocation-a newc) (cons a (eieio--class-class-allocation-a newc)))
+ (setf (eieio--class-class-allocation-doc newc) (cons doc (eieio--class-class-allocation-doc newc)))
+ (setf (eieio--class-class-allocation-type newc) (cons type (eieio--class-class-allocation-type newc)))
+ (setf (eieio--class-class-allocation-custom newc) (cons cust (eieio--class-class-allocation-custom newc)))
+ (setf (eieio--class-class-allocation-custom-label newc) (cons label (eieio--class-class-allocation-custom-label newc)))
+ (setf (eieio--class-class-allocation-custom-group newc) (cons custg (eieio--class-class-allocation-custom-group newc)))
+ (setf (eieio--class-class-allocation-protection newc) (cons prot (eieio--class-class-allocation-protection newc)))
;; Default value is stored in the 'values section, since new objects
;; can't initialize from this element.
- (aset newc class-class-allocation-values (cons value (aref newc class-class-allocation-values))))
+ (setf (eieio--class-class-allocation-values newc) (cons value (eieio--class-class-allocation-values newc))))
(when defaultoverride
;; There is a match, and we must override the old value.
- (let* ((ca (aref newc class-class-allocation-a))
+ (let* ((ca (eieio--class-class-allocation-a newc))
(np (member a ca))
(num (- (length ca) (length np)))
(dp (if np
(nthcdr num
- (aref newc class-class-allocation-values))
+ (eieio--class-class-allocation-values newc))
nil))
- (tp (if np (nth num (aref newc class-class-allocation-type))
+ (tp (if np (nth num (eieio--class-class-allocation-type newc))
nil)))
(if (not np)
(error "EIEIO internal error overriding default value for %s"
@@ -1023,7 +1049,7 @@ if default value is nil."
;; I wonder if a more flexible schedule might be
;; implemented.
(let ((super-prot
- (car (nthcdr num (aref newc class-class-allocation-protection)))))
+ (car (nthcdr num (eieio--class-class-allocation-protection newc)))))
(if (not (eq prot super-prot))
(error "Child slot protection `%s' does not match inherited protection `%s' for `%s'"
prot super-prot a)))
@@ -1031,7 +1057,7 @@ if default value is nil."
;; and new ones.
(when custg
(let* ((groups
- (nthcdr num (aref newc class-class-allocation-custom-group)))
+ (nthcdr num (eieio--class-class-allocation-custom-group newc)))
(list1 (car groups))
(list2 (if (listp custg) custg (list custg))))
(if (< (length list1) (length list2))
@@ -1045,7 +1071,7 @@ if default value is nil."
;; doc is specified, simply replaces the old one.
(when doc
;;(message "Documentation redefined to %s" doc)
- (setcar (nthcdr num (aref newc class-class-allocation-doc))
+ (setcar (nthcdr num (eieio--class-class-allocation-doc newc))
doc))
;; End PLN
@@ -1053,7 +1079,7 @@ if default value is nil."
;; the old one.
(when print
;; (message "printer redefined to %s" print)
- (setcar (nthcdr num (aref newc class-class-allocation-printer)) print))
+ (setcar (nthcdr num (eieio--class-class-allocation-printer newc)) print))
))
))
@@ -1063,22 +1089,22 @@ if default value is nil."
"Copy into NEWC the slots of PARENTS.
Follow the rules of not overwriting early parents when applying to
the new child class."
- (let ((ps (aref newc class-parent))
- (sn (class-option-assoc (aref newc class-options)
+ (let ((ps (eieio--class-parent newc))
+ (sn (class-option-assoc (eieio--class-options newc)
':allow-nil-initform)))
(while ps
;; First, duplicate all the slots of the parent.
(let ((pcv (class-v (car ps))))
- (let ((pa (aref pcv class-public-a))
- (pd (aref pcv class-public-d))
- (pdoc (aref pcv class-public-doc))
- (ptype (aref pcv class-public-type))
- (pcust (aref pcv class-public-custom))
- (plabel (aref pcv class-public-custom-label))
- (pcustg (aref pcv class-public-custom-group))
- (printer (aref pcv class-public-printer))
- (pprot (aref pcv class-protection))
- (pinit (aref pcv class-initarg-tuples))
+ (let ((pa (eieio--class-public-a pcv))
+ (pd (eieio--class-public-d pcv))
+ (pdoc (eieio--class-public-doc pcv))
+ (ptype (eieio--class-public-type pcv))
+ (pcust (eieio--class-public-custom pcv))
+ (plabel (eieio--class-public-custom-label pcv))
+ (pcustg (eieio--class-public-custom-group pcv))
+ (printer (eieio--class-public-printer pcv))
+ (pprot (eieio--class-protection pcv))
+ (pinit (eieio--class-initarg-tuples pcv))
(i 0))
(while pa
(eieio-add-new-slot newc
@@ -1099,15 +1125,15 @@ the new child class."
pinit (cdr pinit))
)) ;; while/let
;; Now duplicate all the class alloc slots.
- (let ((pa (aref pcv class-class-allocation-a))
- (pdoc (aref pcv class-class-allocation-doc))
- (ptype (aref pcv class-class-allocation-type))
- (pcust (aref pcv class-class-allocation-custom))
- (plabel (aref pcv class-class-allocation-custom-label))
- (pcustg (aref pcv class-class-allocation-custom-group))
- (printer (aref pcv class-class-allocation-printer))
- (pprot (aref pcv class-class-allocation-protection))
- (pval (aref pcv class-class-allocation-values))
+ (let ((pa (eieio--class-class-allocation-a pcv))
+ (pdoc (eieio--class-class-allocation-doc pcv))
+ (ptype (eieio--class-class-allocation-type pcv))
+ (pcust (eieio--class-class-allocation-custom pcv))
+ (plabel (eieio--class-class-allocation-custom-label pcv))
+ (pcustg (eieio--class-class-allocation-custom-group pcv))
+ (printer (eieio--class-class-allocation-printer pcv))
+ (pprot (eieio--class-class-allocation-protection pcv))
+ (pval (eieio--class-class-allocation-values pcv))
(i 0))
(while pa
(eieio-add-new-slot newc
@@ -1252,7 +1278,7 @@ IMPL is the symbol holding the method implementation."
;; We do have an object. Make sure it is the right type.
(if ,(if (eq class eieio-default-superclass)
nil ; default superclass means just an obj. Already asked.
- `(not (child-of-class-p (aref (car local-args) object-class)
+ `(not (child-of-class-p (eieio--object-class (car local-args))
',class)))
;; If not the right kind of object, call no applicable
@@ -1335,27 +1361,20 @@ Summary:
(defun eieio--defmethod (method kind argclass code)
"Work part of the `defmethod' macro defining METHOD with ARGS."
(let ((key
- ;; find optional keys
- (cond ((or (eq ':BEFORE kind)
- (eq ':before kind))
- method-before)
- ((or (eq ':AFTER kind)
- (eq ':after kind))
- method-after)
- ((or (eq ':PRIMARY kind)
- (eq ':primary kind))
- method-primary)
- ((or (eq ':STATIC kind)
- (eq ':static kind))
- method-static)
- ;; Primary key
- (t method-primary))))
+ ;; Find optional keys.
+ (cond ((memq kind '(:BEFORE :before)) method-before)
+ ((memq kind '(:AFTER :after)) method-after)
+ ((memq kind '(:STATIC :static)) method-static)
+ ((memq kind '(:PRIMARY :primary nil)) method-primary)
+ ;; Primary key.
+ ;; (t method-primary)
+ (t (error "Unknown method kind %S" kind)))))
;; Make sure there is a generic (when called from defclass).
(eieio--defalias
method (eieio--defgeneric-init-form
method (or (documentation code)
(format "Generically created method `%s'." method))))
- ;; create symbol for property to bind to. If the first arg is of
+ ;; Create symbol for property to bind to. If the first arg is of
;; the form (varname vartype) and `vartype' is a class, then
;; that class will be the type symbol. If not, then it will fall
;; under the type `primary' which is a non-specific calling of the
@@ -1364,11 +1383,9 @@ Summary:
(if (not (class-p argclass))
(error "Unknown class type %s in method parameters"
argclass))
- (if (= key -1)
- (signal 'wrong-type-argument (list :static 'non-class-arg)))
- ;; generics are higher
+ ;; Generics are higher.
(setq key (eieio-specialized-key-to-generic-key key)))
- ;; Put this lambda into the symbol so we can find it
+ ;; Put this lambda into the symbol so we can find it.
(eieiomt-add method code key argclass)
)
@@ -1449,7 +1466,7 @@ an error."
nil
;; Trim off object IDX junk added in for the object index.
(setq slot-idx (- slot-idx 3))
- (let ((st (aref (aref (class-v class) class-public-type) slot-idx)))
+ (let ((st (aref (eieio--class-public-type (class-v class)) slot-idx)))
(if (not (eieio-perform-slot-validation st value))
(signal 'invalid-slot-type (list class slot st value))))))
@@ -1460,7 +1477,7 @@ SLOT is the slot that is being checked, and is only used when throwing
an error."
(if eieio-skip-typecheck
nil
- (let ((st (aref (aref (class-v class) class-class-allocation-type)
+ (let ((st (aref (eieio--class-class-allocation-type (class-v class))
slot-idx)))
(if (not (eieio-perform-slot-validation st value))
(signal 'invalid-slot-type (list class slot st value))))))
@@ -1471,7 +1488,7 @@ INSTANCE is the object being referenced. SLOTNAME is the offending
slot. If the slot is ok, return VALUE.
Argument FN is the function calling this verifier."
(if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
- (slot-unbound instance (object-class instance) slotname fn)
+ (slot-unbound instance (eieio-object-class instance) slotname fn)
value))
;;; Get/Set slots in an object.
@@ -1484,27 +1501,24 @@ created by the :initarg tag."
(defun eieio-oref (obj slot)
"Return the value in OBJ at SLOT in the object vector."
- (if (not (or (eieio-object-p obj) (class-p obj)))
- (signal 'wrong-type-argument (list '(or eieio-object-p class-p) obj)))
- (if (not (symbolp slot))
- (signal 'wrong-type-argument (list 'symbolp slot)))
+ (eieio--check-type (or eieio-object-p class-p) obj)
+ (eieio--check-type symbolp slot)
(if (class-p obj) (eieio-class-un-autoload obj))
- (let* ((class (if (class-p obj) obj (aref obj object-class)))
+ (let* ((class (if (class-p obj) obj (eieio--object-class obj)))
(c (eieio-slot-name-index class obj slot)))
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
(if (setq c (eieio-class-slot-name-index class slot))
;; Oref that slot.
- (aref (aref (class-v class) class-class-allocation-values) c)
+ (aref (eieio--class-class-allocation-values (class-v class)) c)
;; The slot-missing method is a cool way of allowing an object author
;; to intercept missing slot definitions. Since it is also the LAST
;; thing called in this fn, its return value would be retrieved.
(slot-missing obj slot 'oref)
- ;;(signal 'invalid-slot-name (list (object-name obj) slot))
+ ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
)
- (if (not (eieio-object-p obj))
- (signal 'wrong-type-argument (list 'eieio-object-p obj)))
+ (eieio--check-type eieio-object-p obj)
(eieio-barf-if-slot-unbound (aref obj c) obj slot 'oref))))
(defalias 'slot-value 'eieio-oref)
@@ -1520,9 +1534,9 @@ tag in the `defclass' call."
(defun eieio-oref-default (obj slot)
"Do the work for the macro `oref-default' with similar parameters.
Fills in OBJ's SLOT with its default value."
- (if (not (or (eieio-object-p obj) (class-p obj))) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
- (let* ((cl (if (eieio-object-p obj) (aref obj object-class) obj))
+ (eieio--check-type (or eieio-object-p class-p) obj)
+ (eieio--check-type symbolp slot)
+ (let* ((cl (if (eieio-object-p obj) (eieio--object-class obj) obj))
(c (eieio-slot-name-index cl obj slot)))
(if (not c)
;; It might be missing because it is a :class allocated slot.
@@ -1530,13 +1544,13 @@ Fills in OBJ's SLOT with its default value."
(if (setq c
(eieio-class-slot-name-index cl slot))
;; Oref that slot.
- (aref (aref (class-v cl) class-class-allocation-values)
+ (aref (eieio--class-class-allocation-values (class-v cl))
c)
(slot-missing obj slot 'oref-default)
;;(signal 'invalid-slot-name (list (class-name cl) slot))
)
(eieio-barf-if-slot-unbound
- (let ((val (nth (- c 3) (aref (class-v cl) class-public-d))))
+ (let ((val (nth (- c 3) (eieio--class-public-d (class-v cl)))))
(eieio-default-eval-maybe val))
obj cl 'oref-default))))
@@ -1590,62 +1604,78 @@ variable name of the same name as the slot."
;;; Simple generators, and query functions. None of these would do
;; well embedded into an object.
;;
-(defmacro object-class-fast (obj) "Return the class struct defining OBJ with no check."
- `(aref ,obj object-class))
+(define-obsolete-function-alias
+ 'object-class-fast #'eieio--object-class "24.4")
-(defun class-name (class) "Return a Lisp like symbol name for CLASS."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
+(defun eieio-class-name (class) "Return a Lisp like symbol name for CLASS."
+ (eieio--check-type class-p class)
;; I think this is supposed to return a symbol, but to me CLASS is a symbol,
;; and I wanted a string. Arg!
(format "#<class %s>" (symbol-name class)))
+(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
-(defun object-name (obj &optional extra)
+(defun eieio-object-name (obj &optional extra)
"Return a Lisp like symbol string for object OBJ.
If EXTRA, include that in the string returned to represent the symbol."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (format "#<%s %s%s>" (symbol-name (object-class-fast obj))
- (aref obj object-name) (or extra "")))
-
-(defun object-name-string (obj) "Return a string which is OBJ's name."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (aref obj object-name))
-
-(defun object-set-name-string (obj name) "Set the string which is OBJ's NAME."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (if (not (stringp name)) (signal 'wrong-type-argument (list 'stringp name)))
- (aset obj object-name name))
-
-(defun object-class (obj) "Return the class struct defining OBJ."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (object-class-fast obj))
-(defalias 'class-of 'object-class)
-
-(defun object-class-name (obj) "Return a Lisp like symbol name for OBJ's class."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (class-name (object-class-fast obj)))
-
-(defmacro class-parents-fast (class) "Return parent classes to CLASS with no check."
- `(aref (class-v ,class) class-parent))
-
-(defun class-parents (class)
+ (eieio--check-type eieio-object-p obj)
+ (format "#<%s %s%s>" (symbol-name (eieio--object-class obj))
+ (eieio--object-name obj) (or extra "")))
+(define-obsolete-function-alias 'object-name #'eieio-object-name "24.4")
+
+(defun eieio-object-name-string (obj) "Return a string which is OBJ's name."
+ (eieio--check-type eieio-object-p obj)
+ (eieio--object-name obj))
+(define-obsolete-function-alias
+ 'object-name-string #'eieio-object-name-string "24.4")
+
+(defun eieio-object-set-name-string (obj name)
+ "Set the string which is OBJ's NAME."
+ (eieio--check-type eieio-object-p obj)
+ (eieio--check-type stringp name)
+ (setf (eieio--object-name obj) name))
+(define-obsolete-function-alias
+ 'object-set-name-string 'eieio-object-set-name-string "24.4")
+
+(defun eieio-object-class (obj) "Return the class struct defining OBJ."
+ (eieio--check-type eieio-object-p obj)
+ (eieio--object-class obj))
+(define-obsolete-function-alias 'object-class #'eieio-object-class "24.4")
+;; CLOS name, maybe?
+(define-obsolete-function-alias 'class-of #'eieio-object-class "24.4")
+
+(defun eieio-object-class-name (obj)
+ "Return a Lisp like symbol name for OBJ's class."
+ (eieio--check-type eieio-object-p obj)
+ (eieio-class-name (eieio--object-class obj)))
+(define-obsolete-function-alias
+ 'object-class-name 'eieio-object-class-name "24.4")
+
+(defmacro eieio-class-parents-fast (class)
+ "Return parent classes to CLASS with no check."
+ `(eieio--class-parent (class-v ,class)))
+
+(defun eieio-class-parents (class)
"Return parent classes to CLASS. (overload of variable).
The CLOS function `class-direct-superclasses' is aliased to this function."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (class-parents-fast class))
+ (eieio--check-type class-p class)
+ (eieio-class-parents-fast class))
+(define-obsolete-function-alias 'class-parents #'eieio-class-parents "24.4")
-(defmacro class-children-fast (class) "Return child classes to CLASS with no check."
- `(aref (class-v ,class) class-children))
+(defmacro eieio-class-children-fast (class) "Return child classes to CLASS with no check."
+ `(eieio--class-children (class-v ,class)))
-(defun class-children (class)
-"Return child classes to CLASS.
+(defun eieio-class-children (class)
+ "Return child classes to CLASS.
The CLOS function `class-direct-subclasses' is aliased to this function."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (class-children-fast class))
+ (eieio--check-type class-p class)
+ (eieio-class-children-fast class))
+(define-obsolete-function-alias
+ 'class-children #'eieio-class-children "24.4")
(defun eieio-c3-candidate (class remaining-inputs)
- "Returns CLASS if it can go in the result now, otherwise nil"
+ "Return CLASS if it can go in the result now, otherwise nil"
;; Ensure CLASS is not in any position but the first in any of the
;; element lists of REMAINING-INPUTS.
(and (not (let ((found nil))
@@ -1691,7 +1721,7 @@ If a consistent order does not exist, signal an error."
(defun eieio-class-precedence-dfs (class)
"Return all parents of CLASS in depth-first order."
- (let* ((parents (class-parents-fast class))
+ (let* ((parents (eieio-class-parents-fast class))
(classes (copy-sequence
(apply #'append
(list class)
@@ -1712,21 +1742,21 @@ If a consistent order does not exist, signal an error."
(defun eieio-class-precedence-bfs (class)
"Return all parents of CLASS in breadth-first order."
(let ((result)
- (queue (or (class-parents-fast class)
+ (queue (or (eieio-class-parents-fast class)
'(eieio-default-superclass))))
(while queue
(let ((head (pop queue)))
(unless (member head result)
(push head result)
(unless (eq head 'eieio-default-superclass)
- (setq queue (append queue (or (class-parents-fast head)
+ (setq queue (append queue (or (eieio-class-parents-fast head)
'(eieio-default-superclass))))))))
(cons class (nreverse result)))
)
(defun eieio-class-precedence-c3 (class)
"Return all parents of CLASS in c3 order."
- (let ((parents (class-parents-fast class)))
+ (let ((parents (eieio-class-parents-fast class)))
(eieio-c3-merge-lists
(list class)
(append
@@ -1739,7 +1769,7 @@ If a consistent order does not exist, signal an error."
(list parents))))
)
-(defun class-precedence-list (class)
+(defun eieio-class-precedence-list (class)
"Return (transitively closed) list of parents of CLASS.
The order, in which the parents are returned depends on the
method invocation orders of the involved classes."
@@ -1753,52 +1783,56 @@ method invocation orders of the involved classes."
(:c3
(eieio-class-precedence-c3 class))))
)
+(define-obsolete-function-alias
+ 'class-precedence-list 'eieio-class-precedence-list "24.4")
;; Official CLOS functions.
-(defalias 'class-direct-superclasses 'class-parents)
-(defalias 'class-direct-subclasses 'class-children)
-
-(defmacro class-parent-fast (class) "Return first parent class to CLASS with no check."
- `(car (class-parents-fast ,class)))
+(define-obsolete-function-alias
+ 'class-direct-superclasses #'eieio-class-parents "24.4")
+(define-obsolete-function-alias
+ 'class-direct-subclasses #'eieio-class-children "24.4")
-(defmacro class-parent (class) "Return first parent class to CLASS. (overload of variable)."
- `(car (class-parents ,class)))
+(defmacro eieio-class-parent (class)
+ "Return first parent class to CLASS. (overload of variable)."
+ `(car (eieio-class-parents ,class)))
+(define-obsolete-function-alias 'class-parent #'eieio-class-parent "24.4")
-(defmacro same-class-fast-p (obj class) "Return t if OBJ is of class-type CLASS with no error checking."
- `(eq (aref ,obj object-class) ,class))
+(defmacro same-class-fast-p (obj class)
+ "Return t if OBJ is of class-type CLASS with no error checking."
+ `(eq (eieio--object-class ,obj) ,class))
(defun same-class-p (obj class) "Return t if OBJ is of class-type CLASS."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
+ (eieio--check-type class-p class)
+ (eieio--check-type eieio-object-p obj)
(same-class-fast-p obj class))
(defun object-of-class-p (obj class)
"Return non-nil if OBJ is an instance of CLASS or CLASS' subclasses."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
+ (eieio--check-type eieio-object-p obj)
;; class will be checked one layer down
- (child-of-class-p (aref obj object-class) class))
+ (child-of-class-p (eieio--object-class obj) class))
;; Backwards compatibility
(defalias 'obj-of-class-p 'object-of-class-p)
(defun child-of-class-p (child class)
"Return non-nil if CHILD class is a subclass of CLASS."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (if (not (class-p child)) (signal 'wrong-type-argument (list 'class-p child)))
+ (eieio--check-type class-p class)
+ (eieio--check-type class-p child)
(let ((p nil))
(while (and child (not (eq child class)))
- (setq p (append p (aref (class-v child) class-parent))
+ (setq p (append p (eieio--class-parent (class-v child)))
child (car p)
p (cdr p)))
(if child t)))
(defun object-slots (obj)
"Return list of slots available in OBJ."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (aref (class-v (object-class-fast obj)) class-public-a))
+ (eieio--check-type eieio-object-p obj)
+ (eieio--class-public-a (class-v (eieio--object-class obj))))
(defun class-slot-initarg (class slot) "Fetch from CLASS, SLOT's :initarg."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (let ((ia (aref (class-v class) class-initarg-tuples))
+ (eieio--check-type class-p class)
+ (let ((ia (eieio--class-initarg-tuples (class-v class)))
(f nil))
(while (and ia (not f))
(if (eq (cdr (car ia)) slot)
@@ -1817,25 +1851,24 @@ with in the :initarg slot. VALUE can be any Lisp object."
(defun eieio-oset (obj slot value)
"Do the work for the macro `oset'.
Fills in OBJ's SLOT with VALUE."
- (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
- (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
- (let ((c (eieio-slot-name-index (object-class-fast obj) obj slot)))
+ (eieio--check-type eieio-object-p obj)
+ (eieio--check-type symbolp slot)
+ (let ((c (eieio-slot-name-index (eieio--object-class obj) obj slot)))
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
(if (setq c
- (eieio-class-slot-name-index (aref obj object-class) slot))
+ (eieio-class-slot-name-index (eieio--object-class obj) slot))
;; Oset that slot.
(progn
- (eieio-validate-class-slot-value (object-class-fast obj) c value slot)
- (aset (aref (class-v (aref obj object-class))
- class-class-allocation-values)
+ (eieio-validate-class-slot-value (eieio--object-class obj) c value slot)
+ (aset (eieio--class-class-allocation-values (class-v (eieio--object-class obj)))
c value))
;; See oref for comment on `slot-missing'
(slot-missing obj slot 'oset value)
- ;;(signal 'invalid-slot-name (list (object-name obj) slot))
+ ;;(signal 'invalid-slot-name (list (eieio-object-name obj) slot))
)
- (eieio-validate-slot-value (object-class-fast obj) c value slot)
+ (eieio-validate-slot-value (eieio--object-class obj) c value slot)
(aset obj c value))))
(defmacro oset-default (class slot value)
@@ -1848,8 +1881,8 @@ after they are created."
(defun eieio-oset-default (class slot value)
"Do the work for the macro `oset-default'.
Fills in the default value in CLASS' in SLOT with VALUE."
- (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
- (if (not (symbolp slot)) (signal 'wrong-type-argument (list 'symbolp slot)))
+ (eieio--check-type class-p class)
+ (eieio--check-type symbolp slot)
(let* ((scoped-class class)
(c (eieio-slot-name-index class nil slot)))
(if (not c)
@@ -1859,15 +1892,15 @@ Fills in the default value in CLASS' in SLOT with VALUE."
(progn
;; Oref that slot.
(eieio-validate-class-slot-value class c value slot)
- (aset (aref (class-v class) class-class-allocation-values) c
+ (aset (eieio--class-class-allocation-values (class-v class)) c
value))
- (signal 'invalid-slot-name (list (class-name class) slot)))
+ (signal 'invalid-slot-name (list (eieio-class-name class) slot)))
(eieio-validate-slot-value class c value slot)
;; Set this into the storage for defaults.
- (setcar (nthcdr (- c 3) (aref (class-v class) class-public-d))
+ (setcar (nthcdr (- c 3) (eieio--class-public-d (class-v class)))
value)
;; Take the value, and put it into our cache object.
- (eieio-oset (aref (class-v class) class-default-object-cache)
+ (eieio-oset (eieio--class-default-object-cache (class-v class))
slot value)
)))
@@ -1894,12 +1927,12 @@ OBJECT can be an instance or a class."
(defun slot-exists-p (object-or-class slot)
"Return non-nil if OBJECT-OR-CLASS has SLOT."
(let ((cv (class-v (cond ((eieio-object-p object-or-class)
- (object-class object-or-class))
+ (eieio-object-class object-or-class))
((class-p object-or-class)
object-or-class))
)))
- (or (memq slot (aref cv class-public-a))
- (memq slot (aref cv class-class-allocation-a)))
+ (or (memq slot (eieio--class-public-a cv))
+ (memq slot (eieio--class-class-allocation-a cv)))
))
(defun find-class (symbol &optional errorp)
@@ -1919,7 +1952,7 @@ LIST is a list of objects whose slots are searched.
Objects in LIST do not need to have a slot named SLOT, nor does
SLOT need to be bound. If these errors occur, those objects will
be ignored."
- (if (not (listp list)) (signal 'wrong-type-argument (list 'listp list)))
+ (eieio--check-type listp list)
(while (and list (not (condition-case nil
;; This prevents errors for missing slots.
(equal key (eieio-oref (car list) slot))
@@ -1931,7 +1964,7 @@ be ignored."
"Return an association list with the contents of SLOT as the key element.
LIST must be a list of objects with SLOT in it.
This is useful when you need to do completing read on an object group."
- (if (not (listp list)) (signal 'wrong-type-argument (list 'listp list)))
+ (eieio--check-type listp list)
(let ((assoclist nil))
(while list
(setq assoclist (cons (cons (eieio-oref (car list) slot)
@@ -1945,7 +1978,7 @@ This is useful when you need to do completing read on an object group."
LIST must be a list of objects, but those objects do not need to have
SLOT in it. If it does not, then that element is left out of the association
list."
- (if (not (listp list)) (signal 'wrong-type-argument (list 'listp list)))
+ (eieio--check-type listp list)
(let ((assoclist nil))
(while list
(if (slot-exists-p (car list) slot)
@@ -1993,14 +2026,13 @@ If SLOT is unbound, do nothing."
"Return non-nil if START-CLASS is the first class to define SLOT.
This is for testing if `scoped-class' is the class that defines SLOT
so that we can protect private slots."
- (let ((par (class-parents start-class))
+ (let ((par (eieio-class-parents start-class))
(ret t))
(if (not par)
t
(while (and par ret)
(if (intern-soft (symbol-name slot)
- (aref (class-v (car par))
- class-symbol-obarray))
+ (eieio--class-symbol-obarray (class-v (car par))))
(setq ret nil))
(setq par (cdr par)))
ret)))
@@ -2015,8 +2047,7 @@ If SLOT is the value created with :initarg instead,
reverse-lookup that name, and recurse with the associated slot value."
;; Removed checks to outside this call
(let* ((fsym (intern-soft (symbol-name slot)
- (aref (class-v class)
- class-symbol-obarray)))
+ (eieio--class-symbol-obarray (class-v class))))
(fsi (if (symbolp fsym) (symbol-value fsym) nil)))
(if (integerp fsi)
(cond
@@ -2026,7 +2057,7 @@ reverse-lookup that name, and recurse with the associated slot value."
(bound-and-true-p scoped-class)
(or (child-of-class-p class scoped-class)
(and (eieio-object-p obj)
- (child-of-class-p class (object-class obj)))))
+ (child-of-class-p class (eieio-object-class obj)))))
(+ 3 fsi))
((and (eq (get fsym 'protection) 'private)
(or (and (bound-and-true-p scoped-class)
@@ -2044,7 +2075,7 @@ call. If SLOT is the value created with :initarg instead,
reverse-lookup that name, and recurse with the associated slot value."
;; This will happen less often, and with fewer slots. Do this the
;; storage cheap way.
- (let* ((a (aref (class-v class) class-class-allocation-a))
+ (let* ((a (eieio--class-class-allocation-a (class-v class)))
(l1 (length a))
(af (memq slot a))
(l2 (length af)))
@@ -2099,7 +2130,7 @@ This should only be called from a generic function."
(load (nth 1 (symbol-function firstarg))))
;; Determine the class to use.
(cond ((eieio-object-p firstarg)
- (setq mclass (object-class-fast firstarg)))
+ (setq mclass (eieio--object-class firstarg)))
((class-p firstarg)
(setq mclass firstarg))
)
@@ -2236,7 +2267,7 @@ for this common case to improve performance."
;; Determine the class to use.
(cond ((eieio-object-p firstarg)
- (setq mclass (object-class-fast firstarg)))
+ (setq mclass (eieio--object-class firstarg)))
((not firstarg)
(error "Method %s called on nil" method))
((not (eieio-object-p firstarg))
@@ -2303,7 +2334,7 @@ If CLASS is nil, then an empty list of methods should be returned."
;; Collect lambda expressions stored for the class and its parent
;; classes.
(let (lambdas)
- (dolist (ancestor (class-precedence-list class))
+ (dolist (ancestor (eieio-class-precedence-list class))
;; Lookup the form to use for the PRIMARY object for the next level
(let ((tmpl (eieio-generic-form method key ancestor)))
(when (and tmpl
@@ -2447,7 +2478,7 @@ This is different from function `class-parent' as class parent returns
nil for superclasses. This function performs no type checking!"
;; No type-checking because all calls are made from functions which
;; are safe and do checking for us.
- (or (class-parents-fast class)
+ (or (eieio-class-parents-fast class)
(if (eq class 'eieio-default-superclass)
nil
'(eieio-default-superclass))))
@@ -2460,7 +2491,7 @@ nil for superclasses. This function performs no type checking!"
;; we replace the nil from above.
(let ((external-symbol (intern-soft (symbol-name s))))
(catch 'done
- (dolist (ancestor (rest (class-precedence-list external-symbol)))
+ (dolist (ancestor (rest (eieio-class-precedence-list external-symbol)))
(let ((ov (intern-soft (symbol-name ancestor)
eieiomt-optimizing-obarray)))
(when (fboundp ov)
@@ -2489,7 +2520,7 @@ is memorized for faster future use."
(eieiomt-sym-optimize cs))))
;; 3) If it's bound return this one.
(if (fboundp cs)
- (cons cs (aref (class-v class) class-symbol))
+ (cons cs (eieio--class-symbol (class-v class)))
;; 4) If it's not bound then this variable knows something
(if (symbol-value cs)
(progn
@@ -2499,8 +2530,7 @@ is memorized for faster future use."
;; 4.2) The optimizer should always have chosen a
;; function-symbol
;;(if (fboundp cs)
- (cons cs (aref (class-v (intern (symbol-name class)))
- class-symbol))
+ (cons cs (eieio--class-symbol (class-v (intern (symbol-name class)))))
;;(error "EIEIO optimizer: erratic data loss!"))
)
;; There never will be a funcall...
@@ -2523,9 +2553,9 @@ is memorized for faster future use."
If SET-ALL is non-nil, then when a default is nil, that value is
reset. If SET-ALL is nil, the slots are only reset if the default is
not nil."
- (let ((scoped-class (aref obj object-class))
+ (let ((scoped-class (eieio--object-class obj))
(eieio-initializing-object t)
- (pub (aref (class-v (aref obj object-class)) class-public-a)))
+ (pub (eieio--class-public-a (class-v (eieio--object-class obj)))))
(while pub
(let ((df (eieio-oref-default obj (car pub))))
(if (or df set-all)
@@ -2536,7 +2566,7 @@ not nil."
"For CLASS, convert INITARG to the actual attribute name.
If there is no translation, pass it in directly (so we can cheat if
need be... May remove that later...)"
- (let ((tuple (assoc initarg (aref (class-v class) class-initarg-tuples))))
+ (let ((tuple (assoc initarg (eieio--class-initarg-tuples (class-v class)))))
(if tuple
(cdr tuple)
nil)))
@@ -2544,7 +2574,7 @@ need be... May remove that later...)"
(defun eieio-attribute-to-initarg (class attribute)
"In CLASS, convert the ATTRIBUTE into the corresponding init argument tag.
This is usually a symbol that starts with `:'."
- (let ((tuple (rassoc attribute (aref (class-v class) class-initarg-tuples))))
+ (let ((tuple (rassoc attribute (eieio--class-initarg-tuples (class-v class)))))
(if tuple
(car tuple)
nil)))
@@ -2632,10 +2662,9 @@ SLOTS are the initialization slots used by `shared-initialize'.
This static method is called when an object is constructed.
It allocates the vector used to represent an EIEIO object, and then
calls `shared-initialize' on that object."
- (let* ((new-object (copy-sequence (aref (class-v class)
- class-default-object-cache))))
+ (let* ((new-object (copy-sequence (eieio--class-default-object-cache (class-v class)))))
;; Update the name for the newly created object.
- (aset new-object object-name newname)
+ (setf (eieio--object-name new-object) newname)
;; Call the initialize method on the new object with the slots
;; that were passed down to us.
(initialize-instance new-object slots)
@@ -2649,9 +2678,9 @@ Called from the constructor routine.")
(defmethod shared-initialize ((obj eieio-default-superclass) slots)
"Set slots of OBJ with SLOTS which is a list of name/value pairs.
Called from the constructor routine."
- (let ((scoped-class (aref obj object-class)))
+ (let ((scoped-class (eieio--object-class obj)))
(while slots
- (let ((rn (eieio-initarg-to-attribute (object-class-fast obj)
+ (let ((rn (eieio-initarg-to-attribute (eieio--object-class obj)
(car slots))))
(if (not rn)
(slot-missing obj (car slots) 'oset (car (cdr slots)))
@@ -2673,9 +2702,9 @@ not taken, then new objects of your class will not have their values
dynamically set from SLOTS."
;; First, see if any of our defaults are `lambda', and
;; re-evaluate them and apply the value to our slots.
- (let* ((scoped-class (class-v (aref this object-class)))
- (slot (aref scoped-class class-public-a))
- (defaults (aref scoped-class class-public-d)))
+ (let* ((scoped-class (class-v (eieio--object-class this)))
+ (slot (eieio--class-public-a scoped-class))
+ (defaults (eieio--class-public-d scoped-class)))
(while slot
;; For each slot, see if we need to evaluate it.
;;
@@ -2705,7 +2734,7 @@ to be set.
This method is called from `oref', `oset', and other functions which
directly reference slots in EIEIO objects."
- (signal 'invalid-slot-name (list (object-name object)
+ (signal 'invalid-slot-name (list (eieio-object-name object)
slot-name)))
(defgeneric slot-unbound (object class slot-name fn)
@@ -2723,7 +2752,7 @@ Use `slot-boundp' to determine if a slot is bound or not.
In CLOS, the argument list is (CLASS OBJECT SLOT-NAME), but
EIEIO can only dispatch on the first argument, so the first two are swapped."
- (signal 'unbound-slot (list (class-name class) (object-name object)
+ (signal 'unbound-slot (list (eieio-class-name class) (eieio-object-name object)
slot-name fn)))
(defgeneric no-applicable-method (object method &rest args)
@@ -2737,7 +2766,7 @@ ARGS are the arguments that were passed to METHOD.
Implement this for a class to block this signal. The return
value becomes the return value of the original method call."
- (signal 'no-method-definition (list method (object-name object)))
+ (signal 'no-method-definition (list method (eieio-object-name object)))
)
(defgeneric no-next-method (object &rest args)
@@ -2751,7 +2780,7 @@ ARGS are the arguments it is called by.
This method signals `no-next-method' by default. Override this
method to not throw an error, and its return value becomes the
return value of `call-next-method'."
- (signal 'no-next-method (list (object-name object) args))
+ (signal 'no-next-method (list (eieio-object-name object) args))
)
(defgeneric clone (obj &rest params)
@@ -2764,7 +2793,7 @@ first and modify the returned object.")
(defmethod clone ((obj eieio-default-superclass) &rest params)
"Make a copy of OBJ, and then apply PARAMS."
(let ((nobj (copy-sequence obj))
- (nm (aref obj object-name))
+ (nm (eieio--object-name obj))
(passname (and params (stringp (car params))))
(num 1))
(if params (shared-initialize nobj (if passname (cdr params) params)))
@@ -2773,8 +2802,8 @@ first and modify the returned object.")
(if (string-match "-\\([0-9]+\\)" nm)
(setq num (1+ (string-to-number (match-string 1 nm)))
nm (substring nm 0 (match-beginning 0))))
- (aset nobj object-name (concat nm "-" (int-to-string num))))
- (aset nobj object-name (car params)))
+ (setf (eieio--object-name nobj) (concat nm "-" (int-to-string num))))
+ (setf (eieio--object-name nobj) (car params)))
nobj))
(defgeneric destructor (this &rest params)
@@ -2806,7 +2835,7 @@ Implement this function and specify STRINGS in a call to
`call-next-method' to provide additional summary information.
When passing in extra strings from child classes, always remember
to prepend a space."
- (object-name this (apply 'concat strings)))
+ (eieio-object-name this (apply 'concat strings)))
(defvar eieio-print-depth 0
"When printing, keep track of the current indentation depth.")
@@ -2823,11 +2852,11 @@ object are discouraged from being written.
this object."
(when comment
(princ ";; Object ")
- (princ (object-name-string this))
+ (princ (eieio-object-name-string this))
(princ "\n")
(princ comment)
(princ "\n"))
- (let* ((cl (object-class this))
+ (let* ((cl (eieio-object-class this))
(cv (class-v cl)))
;; Now output readable lisp to recreate this object
;; It should look like this:
@@ -2835,14 +2864,14 @@ this object."
;; Each slot's slot is writen using its :writer.
(princ (make-string (* eieio-print-depth 2) ? ))
(princ "(")
- (princ (symbol-name (class-constructor (object-class this))))
+ (princ (symbol-name (class-constructor (eieio-object-class this))))
(princ " ")
- (prin1 (object-name-string this))
+ (prin1 (eieio-object-name-string this))
(princ "\n")
;; Loop over all the public slots
- (let ((publa (aref cv class-public-a))
- (publd (aref cv class-public-d))
- (publp (aref cv class-public-printer))
+ (let ((publa (eieio--class-public-a cv))
+ (publd (eieio--class-public-d cv))
+ (publp (eieio--class-public-printer cv))
(eieio-print-depth (1+ eieio-print-depth)))
(while publa
(when (slot-boundp this (car publa))
@@ -2877,7 +2906,7 @@ this object."
((consp thing)
(eieio-list-prin1 thing))
((class-p thing)
- (princ (class-name thing)))
+ (princ (eieio-class-name thing)))
((or (keywordp thing) (booleanp thing))
(prin1 thing))
((symbolp thing)
@@ -2921,34 +2950,30 @@ of `eq'."
(let ((key nil) (body nil) (firstarg nil) (argfix nil) (argclass nil) loopa)
;; find optional keys
(setq key
- (cond ((or (eq ':BEFORE (car args))
- (eq ':before (car args)))
+ (cond ((memq (car args) '(:BEFORE :before))
(setq args (cdr args))
method-before)
- ((or (eq ':AFTER (car args))
- (eq ':after (car args)))
+ ((memq (car args) '(:AFTER :after))
(setq args (cdr args))
method-after)
- ((or (eq ':PRIMARY (car args))
- (eq ':primary (car args)))
- (setq args (cdr args))
- method-primary)
- ((or (eq ':STATIC (car args))
- (eq ':static (car args)))
+ ((memq (car args) '(:STATIC :static))
(setq args (cdr args))
method-static)
- ;; Primary key
+ ((memq (car args) '(:PRIMARY :primary))
+ (setq args (cdr args))
+ method-primary)
+ ;; Primary key.
(t method-primary)))
- ;; get body, and fix contents of args to be the arguments of the fn.
+ ;; Get body, and fix contents of args to be the arguments of the fn.
(setq body (cdr args)
args (car args))
(setq loopa args)
- ;; Create a fixed version of the arguments
+ ;; Create a fixed version of the arguments.
(while loopa
(setq argfix (cons (if (listp (car loopa)) (car (car loopa)) (car loopa))
argfix))
(setq loopa (cdr loopa)))
- ;; make sure there is a generic
+ ;; Make sure there is a generic.
(eieio-defgeneric
method
(if (stringp (car body))
@@ -2965,11 +2990,9 @@ of `eq'."
(if (not (class-p argclass))
(error "Unknown class type %s in method parameters"
(nth 1 firstarg))))
- (if (= key -1)
- (signal 'wrong-type-argument (list :static 'non-class-arg)))
- ;; generics are higher
+ ;; Generics are higher.
(setq key (eieio-specialized-key-to-generic-key key)))
- ;; Put this lambda into the symbol so we can find it
+ ;; Put this lambda into the symbol so we can find it.
(if (byte-code-function-p (car-safe body))
(eieiomt-add method (car-safe body) key argclass)
(eieiomt-add method (append (list 'lambda (reverse argfix)) body)
@@ -3019,7 +3042,7 @@ of `eq'."
"Display EIEIO OBJECT in fancy format.
Overrides the edebug default.
Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate."
- (cond ((class-p object) (class-name object))
+ (cond ((class-p object) (eieio-class-name object))
((eieio-object-p object) (object-print object))
((and (listp object) (or (class-p (car object))
(eieio-object-p (car object))))
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index b0711fed26c..0632c7d2fc0 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -23,7 +23,7 @@
;; This package lets you add behavior (which we call "piece of advice") to
;; existing functions, like the old `advice.el' package, but with much fewer
-;; bells ans whistles. It comes in 2 parts:
+;; bells and whistles. It comes in 2 parts:
;;
;; - The first part lets you add/remove functions, similarly to
;; add/remove-hook, from any "place" (i.e. as accepted by `setf') that
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 6945e870604..3813c304de1 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -5085,12 +5085,12 @@ Mail anyway (y or n)? ")
(require 'reporter)
(set-window-configuration window-config)
- (reporter-submit-bug-report "kifer@cs.stonybrook.edu"
- (viper-version)
- varlist
- nil 'delete-other-windows
- salutation)
- ))
+ (reporter-submit-bug-report
+ "kifer@cs.stonybrook.edu, bug-gnu-emacs@gnu.org"
+ (viper-version)
+ varlist
+ nil 'delete-other-windows
+ salutation)))
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index 8520a9c83d2..91311deffcf 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -63,7 +63,7 @@
;; The list of possible completions can be viewed at any point by
;; pressing <M-?>.
;;
-;; Finally, context-related help can be accessed by pressing <C-c i>.
+;; Finally, context-related help can be accessed by pressing <C-c M-h>.
;; This only works well if the completion function has provided Eshell
;; with sufficient pointers to locate the relevant help text.
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index f6dd0d5e990..94508d71592 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -1040,6 +1040,7 @@ Show wall-clock time elapsed during execution of COMMAND.")
(defun eshell/su (&rest args)
"Alias \"su\" to call Tramp."
+ (require 'tramp)
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(let ((orig-args (copy-tree args)))
(eshell-eval-using-options
@@ -1077,6 +1078,7 @@ Become another USER during a login session.")
(defun eshell/sudo (&rest args)
"Alias \"sudo\" to call Tramp."
+ (require 'tramp)
(setq args (eshell-stringify-list (eshell-flatten-list args)))
(let ((orig-args (copy-tree args)))
(eshell-eval-using-options
@@ -1111,8 +1113,6 @@ Execute a COMMAND as the superuser or another USER.")
(format "%s|sudo:%s@%s:%s"
(substring prefix 0 -1) user host dir)
(format "/sudo:%s@%s:%s" user host dir))))
- ;; Ensure, that Tramp has connected to that construct already.
- (ignore (file-exists-p default-directory))
(eshell-named-command (car orig-args) (cdr orig-args))))))))
(put 'eshell/sudo 'eshell-no-numeric-conversions t)
diff --git a/lisp/files.el b/lisp/files.el
index f9ed65b8ac0..cbc6e59c442 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4563,39 +4563,21 @@ Before and after saving the buffer, this function runs
(not (file-exists-p buffer-file-name))))
(let ((recent-save (recent-auto-save-p))
setmodes)
- (if buffer-file-name
- (let ((dir (file-name-directory
- (expand-file-name buffer-file-name))))
- (unless (file-exists-p dir)
- (if (y-or-n-p
- (format "Directory `%s' does not exist; create? " dir))
- (make-directory dir t)
- (error "Canceled"))))
- ;; If buffer has no file name, ask user for one.
- (let ((filename
- (expand-file-name
- (read-file-name "File to save in: "
- nil (expand-file-name (buffer-name))))))
- (if (file-exists-p filename)
- (if (file-directory-p filename)
- ;; Signal an error if the user specified the name of an
- ;; existing directory.
- (error "%s is a directory" filename)
- (unless (y-or-n-p (format "File `%s' exists; overwrite? "
- filename))
- (error "Canceled")))
- ;; Signal an error if the specified name refers to a
- ;; non-existing directory.
- (let ((dir (file-name-directory filename)))
- (unless (file-directory-p dir)
- (if (file-exists-p dir)
- (error "%s is not a directory" dir)
- (if (y-or-n-p
- (format "Directory `%s' does not exist; create? "
- dir))
- (make-directory dir t)
- (error "Canceled"))))))
- (set-visited-file-name filename)))
+ ;; If buffer has no file name, ask user for one.
+ (or buffer-file-name
+ (let ((filename
+ (expand-file-name
+ (read-file-name "File to save in: "
+ nil (expand-file-name (buffer-name))))))
+ (if (file-exists-p filename)
+ (if (file-directory-p filename)
+ ;; Signal an error if the user specified the name of an
+ ;; existing directory.
+ (error "%s is a directory" filename)
+ (unless (y-or-n-p (format "File `%s' exists; overwrite? "
+ filename))
+ (error "Canceled"))))
+ (set-visited-file-name filename)))
(or (verify-visited-file-modtime (current-buffer))
(not (file-exists-p buffer-file-name))
(yes-or-no-p
@@ -4628,7 +4610,14 @@ Before and after saving the buffer, this function runs
(run-hook-with-args-until-success 'write-file-functions)
;; If a hook returned t, file is already "written".
;; Otherwise, write it the usual way now.
- (setq setmodes (basic-save-buffer-1)))
+ (let ((dir (file-name-directory
+ (expand-file-name buffer-file-name))))
+ (unless (file-exists-p dir)
+ (if (y-or-n-p
+ (format "Directory `%s' does not exist; create? " dir))
+ (make-directory dir t)
+ (error "Canceled")))
+ (setq setmodes (basic-save-buffer-1))))
;; Now we have saved the current buffer. Let's make sure
;; that buffer-file-coding-system is fixed to what
;; actually used for saving by binding it locally.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index e5ce4db171b..9436012ee59 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2336,9 +2336,9 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
(1 font-lock-constant-face prepend))
;; Constant values.
- ("\\<:\\(?:\\sw\\|\\s_\\)+\\>" 0 font-lock-builtin-face)
+ ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
;; ELisp and CLisp `&' keywords as types.
- ("\\<\\&\\(?:\\sw\\|\\s_\\)+\\>" . font-lock-type-face)
+ ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face)
;; ELisp regexp grouping constructs
((lambda (bound)
(catch 'found
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 8de9e89a23d..0fa870e595f 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,15 @@
+2013-02-25 Adam Sjøgren <asjo@koldfront.dk>
+
+ * mml2015-el (mml2015-epg-key-image): Wrap epg-gpg-program in
+ shell-quote-argument.
+
+2013-02-22 David Engster <deng@randomsample.de>
+
+ * gnus-registry.el (gnus-registry-save): Provide class name when
+ calling `eieio-persistent-read' to avoid "unsafe call" warning. Use
+ `condition-case' to stay compatible with older EIEIO versions which
+ only accept one argument.
+
2013-02-17 Daiki Ueno <ueno@gnu.org>
* mml2015.el (epg-key-user-id-list, epg-user-id-string)
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index e808b1975b4..5a7dfd82d28 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -87,6 +87,12 @@
(require 'easymenu)
(require 'registry)
+;; Silence XEmacs byte compiler, which will otherwise complain about
+;; call to `eieio-persistent-read'.
+(when (featurep 'xemacs)
+ (byte-compiler-options
+ (warnings (- callargs))))
+
(defvar gnus-adaptive-word-syntax-table)
(defvar gnus-registry-dirty t
@@ -296,8 +302,14 @@ This is not required after changing `gnus-registry-cache-file'."
(condition-case nil
(progn
(gnus-message 5 "Reading Gnus registry from %s..." file)
- (setq gnus-registry-db (gnus-registry-fixup-registry
- (eieio-persistent-read file)))
+ (setq gnus-registry-db
+ (gnus-registry-fixup-registry
+ (condition-case nil
+ (with-no-warnings
+ (eieio-persistent-read file 'registry-db))
+ ;; Older EIEIO versions do not check the class name.
+ ('wrong-number-of-arguments
+ (eieio-persistent-read file)))))
(gnus-message 5 "Reading Gnus registry from %s...done" file))
(error
(gnus-message
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index b20c02aa26f..39bce23e76c 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -865,7 +865,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
(coding-system-for-read 'binary)
(data (shell-command-to-string
(format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >/dev/null 2>&1"
- epg-gpg-program key-id))))
+ (shell-quote-argument epg-gpg-program) key-id))))
(when (> (length data) 0)
(insert (substring data 16))
(create-image (buffer-string) nil t)))))
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index df8ef86a3cd..768dda993e2 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -717,7 +717,7 @@ STYLE is the inline CSS stylesheet (or tag referring to an external sheet)."
--> </script>
</head>
<body onload=\"stripe('index'); return true;\">\n"
- file style))
+ (mapconcat 'hfy-html-quote (mapcar 'char-to-string file) "") style))
(defun hfy-default-footer (_file)
"Default value for `hfy-page-footer'.
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 7787a26cc08..ac090f020b3 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -329,6 +329,9 @@ call."
"The image type for the current Image mode buffer.")
(make-variable-buffer-local 'image-type)
+(defvar-local image-multi-frame nil
+ "Non-nil if image for the current Image mode buffer has multiple frames.")
+
(defvar image-mode-previous-major-mode nil
"Internal variable to keep the previous non-image major mode.")
@@ -390,7 +393,7 @@ call."
["Animate Image" image-toggle-animation :style toggle
:selected (let ((image (image-get-display-property)))
(and image (image-animate-timer image)))
- :active image-current-frame
+ :active image-multi-frame
:help "Toggle image animation"]
["Loop Animation"
(lambda () (interactive)
@@ -403,13 +406,13 @@ call."
(image-toggle-animation)
(image-toggle-animation)))
:style toggle :selected image-animate-loop
- :active image-current-frame
+ :active image-multi-frame
:help "Animate images once, or forever?"]
- ["Next Frame" image-next-frame :active image-current-frame
+ ["Next Frame" image-next-frame :active image-multi-frame
:help "Show the next frame of this image"]
- ["Previous Frame" image-previous-frame :active image-current-frame
+ ["Previous Frame" image-previous-frame :active image-multi-frame
:help "Show the previous frame of this image"]
- ["Goto Frame..." image-goto-frame :active image-current-frame
+ ["Goto Frame..." image-goto-frame :active image-multi-frame
:help "Show a specific frame of this image"]
))
map)
@@ -471,12 +474,24 @@ to toggle between display as an image and display as text."
((null image)
(message "%s" (concat msg1 "an image.")))
((setq animated (image-multi-frame-p image))
- (setq image-current-frame (or (plist-get (cdr image) :index) 0)
+ (setq image-multi-frame t
mode-line-process
- `(:eval (propertize (format " [%s/%s]"
- (1+ image-current-frame)
- ,(car animated))
- 'help-echo "Frame number")))
+ `(:eval
+ (concat " "
+ (propertize
+ (format "[%s/%s]"
+ (1+ (image-current-frame ',image))
+ ,(car animated))
+ 'help-echo "Frames
+mouse-1: Next frame
+mouse-3: Previous frame"
+ 'mouse-face 'mode-line-highlight
+ 'local-map
+ '(keymap
+ (mode-line
+ keymap
+ (down-mouse-1 . image-next-frame)
+ (down-mouse-3 . image-previous-frame)))))))
(message "%s"
(concat msg1 "text. This image has multiple frames.")))
;;; (substitute-command-keys
@@ -694,10 +709,13 @@ current frame. Frames are indexed from 1."
(cond
((null image)
(error "No image is present"))
- ((null image-current-frame)
+ ((null image-multi-frame)
(message "No image animation."))
(t
- (image-nth-frame image (if relative (+ n image-current-frame) (1- n)))))))
+ (image-show-frame image
+ (if relative
+ (+ n (image-current-frame image))
+ (1- n)))))))
(defun image-next-frame (&optional n)
"Switch to the next frame of a multi-frame image.
diff --git a/lisp/image.el b/lisp/image.el
index b91d136443d..ec7b41bf126 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -660,10 +660,11 @@ number, play until that number of seconds has elapsed."
(defconst image-minimum-frame-delay 0.01
"Minimum interval in seconds between frames of an animated image.")
-(defvar-local image-current-frame nil
- "The frame index of the current animated image.")
+(defun image-current-frame (image)
+ "The current frame number of IMAGE, indexed from 0."
+ (or (plist-get (cdr image) :index) 0))
-(defun image-nth-frame (image n &optional nocheck)
+(defun image-show-frame (image n &optional nocheck)
"Show frame N of IMAGE.
Frames are indexed from 0. Optional argument NOCHECK non-nil means
do not check N is within the range of frames present in the image."
@@ -671,7 +672,6 @@ do not check N is within the range of frames present in the image."
(if (< n 0) (setq n 0)
(setq n (min n (1- (car (image-multi-frame-p image)))))))
(plist-put (cdr image) :index n)
- (setq image-current-frame n)
(force-window-update))
;; FIXME? The delay may not be the same for different sub-images,
@@ -688,7 +688,7 @@ LIMIT determines when to stop. If t, loop forever. If nil, stop
after displaying the last animation frame. Otherwise, stop
after LIMIT seconds have elapsed.
The minimum delay between successive frames is `image-minimum-frame-delay'."
- (image-nth-frame image n t)
+ (image-show-frame image n t)
(setq n (1+ n))
(let* ((time (float-time))
(animation (image-multi-frame-p image))
diff --git a/lisp/imenu.el b/lisp/imenu.el
index c1077a49d1a..d79b0abeebc 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -405,11 +405,11 @@ Don't move point."
;; Regular expression to find C functions
(defvar imenu-example--function-name-regexp-c
(concat
- "^[a-zA-Z0-9]+[ \t]?" ; type specs; there can be no
+ "^[a-zA-Z0-9]+[ \t]?" ; Type specs; there can be no
"\\([a-zA-Z0-9_*]+[ \t]+\\)?" ; more than 3 tokens, right?
"\\([a-zA-Z0-9_*]+[ \t]+\\)?"
- "\\([*&]+[ \t]*\\)?" ; pointer
- "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; name
+ "\\([*&]+[ \t]*\\)?" ; Pointer.
+ "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; Name.
))
(defun imenu-example--create-c-index (&optional regexp)
@@ -556,7 +556,7 @@ NOT share structure with ALIST."
(defun imenu--truncate-items (menulist)
"Truncate all strings in MENULIST to `imenu-max-item-length'."
(mapc (lambda (item)
- ;; truncate if necessary
+ ;; Truncate if necessary.
(when (and (numberp imenu-max-item-length)
(> (length (car item)) imenu-max-item-length))
(setcar item (substring (car item) 0 imenu-max-item-length)))
@@ -575,7 +575,7 @@ See `imenu--index-alist' for the format of the index alist."
(or (not imenu-auto-rescan)
(and imenu-auto-rescan
(> (buffer-size) imenu-auto-rescan-maxout))))
- ;; Get the index; truncate if necessary
+ ;; Get the index; truncate if necessary.
(progn
(setq imenu--index-alist
(save-excursion
@@ -687,8 +687,9 @@ The alternate method, which is the one most often used, is to call
(save-excursion
(setq name (funcall imenu-extract-index-name-function)))
(and (stringp name)
- ;; [ydi] updated for imenu-use-markers
- (push (cons name (if imenu-use-markers (point-marker) (point)))
+ ;; [ydi] Updated for imenu-use-markers.
+ (push (cons name
+ (if imenu-use-markers (point-marker) (point)))
index-alist)))
index-alist))
;; Use generic expression if possible.
@@ -741,12 +742,12 @@ depending on PATTERNS."
(modify-syntax-entry c (cdr syn) table))
(car syn))))
(goto-char (point-max))
- (unwind-protect ; for syntax table
+ (unwind-protect ; For syntax table.
(save-match-data
(set-syntax-table table)
- ;; map over the elements of imenu-generic-expression
- ;; (typically functions, variables ...)
+ ;; Map over the elements of imenu-generic-expression
+ ;; (typically functions, variables ...).
(dolist (pat patterns)
(let ((menu-title (car pat))
(regexp (nth 1 pat))
@@ -1002,7 +1003,7 @@ The ignored args just make this function have the same interface as a
function placed in a special index-item."
(if (or (< position (point-min))
(> position (point-max)))
- ;; widen if outside narrowing
+ ;; Widen if outside narrowing.
(widen))
(goto-char position))
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 0b33dd51faf..afe4301c659 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -27,6 +27,14 @@
;; Really cool code to lookup info indexes.
;; Try especially info-lookup-symbol (aka C-h S).
+;; Some additional sources of (Tex)info files for non-GNU packages:
+;;
+;; Scheme: <URL:http://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz>
+;; LaTeX:
+;; <URL:ftp://ctan.tug.org/tex-archive/info/latex2e-help-texinfo/latex2e.texi>
+;; (or CTAN mirrors)
+;; Perl: <URL:ftp://ftp.cpan.org/pub/CPAN/doc/manual/texinfo/> (or CPAN mirrors)
+
;;; Code:
(require 'info)
diff --git a/lisp/info.el b/lisp/info.el
index 24a7181ff52..3792857d47a 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -59,15 +59,6 @@ to the user."
:group 'info
:version "24.1")
-(defcustom Info-enable-edit nil
- "Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
-This is convenient if you want to write Info files by hand.
-However, we recommend that you not do this.
-It is better to write a Texinfo file and generate the Info file from that,
-because that gives you a printed manual as well."
- :type 'boolean
- :group 'info)
-
(defvar Info-enable-active-nodes nil
"Non-nil allows Info to execute Lisp code associated with nodes.
The Lisp code is executed when the node is selected.")
@@ -375,6 +366,9 @@ with wrapping around the current Info node."
(defvar Info-edit-mode-hook nil
"Hooks run when `Info-edit-mode' is called.")
+(make-obsolete-variable 'Info-edit-mode-hook
+ "editing Info nodes by hand is not recommended." "24.4")
+
(defvar Info-current-file nil
"Info file that Info is now looking at, or nil.
This is the name that was specified in Info, not the actual file name.
@@ -4253,6 +4247,10 @@ Advanced commands:
map)
"Local keymap used within `e' command of Info.")
+(make-obsolete-variable 'Info-edit-map
+ "editing Info nodes by hand is not recommended."
+ "24.4")
+
;; Info-edit mode is suitable only for specially formatted data.
(put 'Info-edit-mode 'mode-class 'special)
@@ -4270,16 +4268,22 @@ which returns to Info mode for browsing.
(buffer-enable-undo (current-buffer))
(run-mode-hooks 'Info-edit-mode-hook))
+(make-obsolete 'Info-edit-mode
+ "editing Info nodes by hand is not recommended." "24.4")
+
(defun Info-edit ()
- "Edit the contents of this Info node.
-Allowed only if variable `Info-enable-edit' is non-nil."
+ "Edit the contents of this Info node."
(interactive)
- (or Info-enable-edit
- (error "Editing Info nodes is not enabled"))
(Info-edit-mode)
(message "%s" (substitute-command-keys
"Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
+(put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended.
+This feature will be removed in future.")
+
+(make-obsolete 'Info-edit
+ "editing Info nodes by hand is not recommended." "24.4")
+
(defun Info-cease-edit ()
"Finish editing Info node; switch back to Info proper."
(interactive)
@@ -4296,6 +4300,9 @@ Allowed only if variable `Info-enable-edit' is non-nil."
(and (marker-position Info-tag-table-marker)
(buffer-modified-p)
(message "Tags may have changed. Use Info-tagify if necessary")))
+
+(make-obsolete 'Info-cease-edit
+ "editing Info nodes by hand is not recommended." "24.4")
(defvar Info-file-list-for-emacs
'("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e")
diff --git a/lisp/informat.el b/lisp/informat.el
index d4412b8a86a..53b043fbbad 100644
--- a/lisp/informat.el
+++ b/lisp/informat.el
@@ -43,14 +43,17 @@
;; save-restrictions would not work
;; because it records the old max relative to the end.
;; We record it relative to the beginning.
- (if input-buffer-name
- (message "Tagifying region in %s ..." input-buffer-name)
- (message
- "Tagifying %s ..." (file-name-nondirectory (buffer-file-name))))
(let ((omin (point-min))
(omax (point-max))
(nomax (= (point-max) (1+ (buffer-size))))
- (opoint (point)))
+ (opoint (point))
+ (msg (format "Tagifying %s..."
+ (cond (input-buffer-name
+ (format "region in %s" input-buffer-name))
+ (buffer-file-name
+ (file-name-nondirectory (buffer-file-name)))
+ (t "buffer")))))
+ (message "%s" msg)
(unwind-protect
(progn
(widen)
@@ -148,11 +151,8 @@
(insert "\^_\nEnd tag table\n")))))
(goto-char opoint)
(narrow-to-region omin (if nomax (1+ (buffer-size))
- (min omax (point-max))))))
- (if input-buffer-name
- (message "Tagifying region in %s done" input-buffer-name)
- (message
- "Tagifying %s done" (file-name-nondirectory (buffer-file-name)))))
+ (min omax (point-max)))))
+ (message "%sdone" msg)))
;;;###autoload
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 31b1918429f..b36b250738a 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2961,8 +2961,15 @@ by other Emacs features."
(setq isearch-lazy-highlight-window (selected-window)
isearch-lazy-highlight-window-start (window-start)
isearch-lazy-highlight-window-end (window-end)
- isearch-lazy-highlight-start (point)
- isearch-lazy-highlight-end (point)
+ ;; Start lazy-highlighting at the beginning of the found
+ ;; match (`isearch-other-end'). If no match, use point.
+ ;; One of the next two variables (depending on search direction)
+ ;; is used to define the starting position of lazy-highlighting
+ ;; and also to remember the current position of point between
+ ;; calls of `isearch-lazy-highlight-update', and another variable
+ ;; is used to define where the wrapped search must stop.
+ isearch-lazy-highlight-start (or isearch-other-end (point))
+ isearch-lazy-highlight-end (or isearch-other-end (point))
isearch-lazy-highlight-wrapped nil
isearch-lazy-highlight-last-string isearch-string
isearch-lazy-highlight-case-fold-search isearch-case-fold-search
@@ -3060,6 +3067,9 @@ Attempt to do the search exactly the way the pending Isearch would."
(overlay-put ov 'priority 1000)
(overlay-put ov 'face lazy-highlight-face)
(overlay-put ov 'window (selected-window))))
+ ;; Remember the current position of point for
+ ;; the next call of `isearch-lazy-highlight-update'
+ ;; when `lazy-highlight-max-at-a-time' is too small.
(if isearch-lazy-highlight-forward
(setq isearch-lazy-highlight-end (point))
(setq isearch-lazy-highlight-start (point)))))
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index 7b36f7c1214..851bceccf30 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -234,6 +234,10 @@ options through Custom does this automatically."
"XZ compressing" "xz" ("-c" "-q")
"XZ uncompressing" "xz" ("-c" "-q" "-d")
t t "\3757zXZ\0"]
+ ["\\.txz\\'"
+ "XZ compressing" "xz" ("-c" "-q")
+ "XZ uncompressing" "xz" ("-c" "-q" "-d")
+ t nil "\3757zXZ\0"]
;; dzip is gzip with random access. Its compression program can't
;; read/write stdin/out, so .dz files can only be viewed without
;; saving, having their contents decompressed with gzip.
@@ -302,7 +306,9 @@ variables. Setting this through Custom does that automatically."
:group 'jka-compr)
(defcustom jka-compr-mode-alist-additions
- (list (cons (purecopy "\\.tgz\\'") 'tar-mode) (cons (purecopy "\\.tbz2?\\'") 'tar-mode))
+ (purecopy '(("\\.tgz\\'" . tar-mode)
+ ("\\.tbz2?\\'" . tar-mode)
+ ("\\.txz\\'" . 'tar-mode)))
"List of pairs added to `auto-mode-alist' when installing jka-compr.
Uninstalling jka-compr removes all pairs from `auto-mode-alist' that
installing added.
@@ -315,7 +321,7 @@ variables. Setting this through Custom does that automatically."
:set 'jka-compr-set
:group 'jka-compr)
-(defcustom jka-compr-load-suffixes (list (purecopy ".gz"))
+(defcustom jka-compr-load-suffixes (purecopy '(".gz"))
"List of compression related suffixes to try when loading files.
Enabling Auto Compression mode appends this list to `load-file-rep-suffixes',
which see. Disabling Auto Compression mode removes all suffixes
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 1c44195cae3..e58967d5a80 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -895,7 +895,7 @@ outline hot-spot navigation (see `allout-mode').
;;;***
;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;; "net/ange-ftp.el" (20743 44982 104196 0))
+;;;;;; "net/ange-ftp.el" (20763 30266 231060 0))
;;; Generated autoloads from net/ange-ftp.el
(defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
@@ -1152,8 +1152,8 @@ Returns list of symbols and documentation found.
;;;***
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (20759
+;;;;;; 33211 414988 0))
;;; Generated autoloads from arc-mode.el
(autoload 'archive-mode "arc-mode" "\
@@ -1245,8 +1245,8 @@ Entering array mode calls the function `array-mode-hook'.
;;;***
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (20777
+;;;;;; 63161 848428 0))
;;; Generated autoloads from textmodes/artist.el
(autoload 'artist-mode "artist" "\
@@ -1480,7 +1480,7 @@ Special commands:
;;;***
;;;### (autoloads (auth-source-cache-expiry) "auth-source" "gnus/auth-source.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20755 36154 171386 0))
;;; Generated autoloads from gnus/auth-source.el
(defvar auth-source-cache-expiry 7200 "\
@@ -1656,7 +1656,7 @@ should be non-nil).
;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
;;;;;; auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
-;;;;;; "autorevert" "autorevert.el" (20746 21181 635406 0))
+;;;;;; "autorevert" "autorevert.el" (20767 27320 533690 0))
;;; Generated autoloads from autorevert.el
(autoload 'auto-revert-mode "autorevert" "\
@@ -2713,7 +2713,7 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile
;;;;;; compile-defun byte-compile-file byte-recompile-directory
;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
-;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20709 26818 907104 0))
+;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20780 39352 990623 0))
;;; Generated autoloads from emacs-lisp/bytecomp.el
(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2872,8 +2872,8 @@ from the cursor position.
;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
;;;;;; calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
-;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (20721
-;;;;;; 17977 14204 0))
+;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (20759
+;;;;;; 33211 414988 0))
;;; Generated autoloads from calc/calc.el
(define-key ctl-x-map "*" 'calc-dispatch)
@@ -2980,8 +2980,8 @@ See the documentation for `calculator-mode' for more information.
;;;***
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20725
-;;;;;; 15032 264919 0))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20762
+;;;;;; 9398 526093 0))
;;; Generated autoloads from calendar/calendar.el
(autoload 'calendar "calendar" "\
@@ -3090,7 +3090,7 @@ Obsoletes `c-forward-into-nomenclature'.
;;;***
;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;; (20739 47925 957834 0))
+;;;;;; (20755 36154 171386 0))
;;; Generated autoloads from progmodes/cc-engine.el
(autoload 'c-guess-basic-syntax "cc-engine" "\
@@ -4125,8 +4125,8 @@ For example, the function `case' has an indent property
;;;***
-;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20709 26818
-;;;;;; 907104 0))
+;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20772 12071
+;;;;;; 425443 833000))
;;; Generated autoloads from emacs-lisp/cl-lib.el
(define-obsolete-variable-alias 'custom-print-functions 'cl-custom-print-functions "24.3")
@@ -4174,8 +4174,8 @@ For use inside Lisp programs, see also `c-macro-expansion'.
;;;***
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (20774
+;;;;;; 53405 584723 417000))
;;; Generated autoloads from cmuscheme.el
(autoload 'run-scheme "cmuscheme" "\
@@ -4355,27 +4355,24 @@ on third call it again advances points to the next difference and so on.
;;;;;; compilation-shell-minor-mode compilation-mode compilation-start
;;;;;; compile compilation-disable-input compile-command compilation-search-path
;;;;;; compilation-ask-about-save compilation-window-height compilation-start-hook
-;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20723
-;;;;;; 59703 12265 0))
+;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (20763
+;;;;;; 30266 231060 0))
;;; Generated autoloads from progmodes/compile.el
(defvar compilation-mode-hook nil "\
-List of hook functions run by `compilation-mode' (see `run-mode-hooks').")
+List of hook functions run by `compilation-mode'.")
(custom-autoload 'compilation-mode-hook "compile" t)
(defvar compilation-start-hook nil "\
-List of hook functions run by `compilation-start' on the compilation process.
-\(See `run-hook-with-args').
-If you use \"omake -P\" and do not want \\[save-buffers-kill-terminal] to ask whether you want
-the compilation to be killed, you can use this hook:
- (add-hook 'compilation-start-hook
- (lambda (process) (set-process-query-on-exit-flag process nil)) nil t)")
+Hook run after starting a new compilation process.
+The hook is run with one argument, the new process.")
(custom-autoload 'compilation-start-hook "compile" t)
(defvar compilation-window-height nil "\
-Number of lines in a compilation window. If nil, use Emacs default.")
+Number of lines in a compilation window.
+If nil, use Emacs default.")
(custom-autoload 'compilation-window-height "compile" t)
@@ -4792,7 +4789,7 @@ If FIX is non-nil, run `copyright-fix-years' instead.
;;;***
;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20709 26818 907104
+;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (20763 30266 231060
;;;;;; 0))
;;; Generated autoloads from progmodes/cperl-mode.el
(put 'cperl-indent-level 'safe-local-variable 'integerp)
@@ -4832,7 +4829,7 @@ and POD directives (Disabled by default, see `cperl-electric-keywords'.)
The user types the keyword immediately followed by a space, which
causes the construct to be expanded, and the point is positioned where
-she is most likely to want to be. eg. when the user types a space
+she is most likely to want to be. E.g., when the user types a space
following \"if\" the following appears in the buffer: if () { or if ()
} { } and the cursor is between the parentheses. The user can then
type some boolean expression within the parens. Having done that,
@@ -4992,7 +4989,7 @@ Run a `perldoc' on the word around point.
;;;***
;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20762 9398 526093 0))
;;; Generated autoloads from progmodes/cpp.el
(autoload 'cpp-highlight-buffer "cpp" "\
@@ -5144,7 +5141,7 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
;;;;;; customize-mode customize customize-push-and-save customize-save-variable
;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically
;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically)
-;;;;;; "cus-edit" "cus-edit.el" (20709 26818 907104 0))
+;;;;;; "cus-edit" "cus-edit.el" (20762 9398 526093 0))
;;; Generated autoloads from cus-edit.el
(defvar custom-browse-sort-alphabetically nil "\
@@ -5647,8 +5644,8 @@ If the HANDLER returns a `dbus-error', it is propagated as return message.
;;;***
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (20763
+;;;;;; 30266 231060 0))
;;; Generated autoloads from progmodes/dcl-mode.el
(autoload 'dcl-mode "dcl-mode" "\
@@ -5971,7 +5968,7 @@ the first time the mode is used.
;;;***
;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;; "descr-text.el" (20709 26818 907104 0))
+;;;;;; "descr-text.el" (20764 51137 83502 0))
;;; Generated autoloads from descr-text.el
(autoload 'describe-text-properties "descr-text" "\
@@ -6274,7 +6271,7 @@ Major mode for editing the diary file.
;;;### (autoloads (diff-buffer-with-file diff-latest-backup-file
;;;;;; diff-backup diff diff-command diff-switches) "diff" "vc/diff.el"
-;;;;;; (20721 17977 14204 0))
+;;;;;; (20760 54070 584283 0))
;;; Generated autoloads from vc/diff.el
(defvar diff-switches (purecopy "-c") "\
@@ -6323,7 +6320,7 @@ This requires the external program `diff' to be in your `exec-path'.
;;;***
;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "vc/diff-mode.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20784 36406 653593 0))
;;; Generated autoloads from vc/diff-mode.el
(autoload 'diff-mode "diff-mode" "\
@@ -6366,9 +6363,9 @@ Optional arguments are passed to `dig-invoke'.
;;;***
-;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window
-;;;;;; dired dired-listing-switches) "dired" "dired.el" (20731 53823
-;;;;;; 676680 0))
+;;;### (autoloads (dired-hide-details-mode dired-mode dired-noselect
+;;;;;; dired-other-frame dired-other-window dired dired-listing-switches)
+;;;;;; "dired" "dired.el" (20784 36406 653593 0))
;;; Generated autoloads from dired.el
(defvar dired-listing-switches (purecopy "-al") "\
@@ -6486,6 +6483,11 @@ Keybindings:
\(fn &optional DIRNAME SWITCHES)" nil nil)
(put 'dired-find-alternate-file 'disabled t)
+(autoload 'dired-hide-details-mode "dired" "\
+Hide details in `dired-mode'.
+
+\(fn &optional ARG)" t nil)
+
;;;***
;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
@@ -6723,8 +6725,8 @@ Locate SOA record and increment the serial field.
;;;***
;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe
-;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20737
-;;;;;; 6202 609148 0))
+;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (20783
+;;;;;; 15545 430927 0))
;;; Generated autoloads from doc-view.el
(autoload 'doc-view-mode-p "doc-view" "\
@@ -6811,7 +6813,7 @@ Switch to *dungeon* buffer and start game.
;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
;;;;;; define-globalized-minor-mode define-minor-mode) "easy-mmode"
-;;;;;; "emacs-lisp/easy-mmode.el" (20709 26818 907104 0))
+;;;;;; "emacs-lisp/easy-mmode.el" (20780 39352 990623 0))
;;; Generated autoloads from emacs-lisp/easy-mmode.el
(defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
@@ -6865,13 +6867,14 @@ BODY contains code to execute each time the mode is enabled or disabled.
:require SYM Same as in `defcustom'.
:variable PLACE The location to use instead of the variable MODE to store
the state of the mode. This can be simply a different
- named variable, or more generally anything that can be used
- with the CL macro `setf'. PLACE can also be of the form
- (GET . SET), where GET is an expression that returns the
- current state, and SET is a function that takes one argument,
- the new state, and sets it. If you specify a :variable,
- this function does not define a MODE variable (nor any of
- the terms used in :variable).
+ named variable, or a generalized variable.
+ PLACE can also be of the form (GET . SET), where GET is
+ an expression that returns the current state, and SET is
+ a function that takes one argument, the new state, and
+ sets it. If you specify a :variable, this function does
+ not define a MODE variable (nor any of the terms used
+ in :variable).
+
:after-hook A single lisp form which is evaluated after the mode hooks
have been run. It should not be quoted.
@@ -6907,6 +6910,10 @@ correctly with the current major mode. This is important to
prevent problems with derived modes, that is, major modes that
call another major mode in their body.
+When a major mode is initialized, MODE is actually turned on just
+after running the major mode's hook. However, MODE is not turned
+on if the hook has explicitly disabled it.
+
\(fn GLOBAL-MODE MODE TURN-ON &rest KEYS)" nil t)
(put 'define-globalized-minor-mode 'doc-string-elt '2)
@@ -7571,8 +7578,8 @@ With prefix arg NOCONFIRM, execute current line as-is without editing.
;;;***
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20709 26818
-;;;;;; 907104 0))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (20748 62911
+;;;;;; 684442 0))
;;; Generated autoloads from cedet/ede.el
(defvar global-ede-mode nil "\
@@ -7929,7 +7936,7 @@ Display Ediff's registry.
;;;***
;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;; "ediff-util" "vc/ediff-util.el" (20709 26818 907104 0))
+;;;;;; "ediff-util" "vc/ediff-util.el" (20777 63161 848428 0))
;;; Generated autoloads from vc/ediff-util.el
(autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -8017,7 +8024,7 @@ Turn on EDT Emulation.
;;;***
;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20762 9398 526093 0))
;;; Generated autoloads from ehelp.el
(autoload 'with-electric-help "ehelp" "\
@@ -8054,7 +8061,7 @@ BUFFER is put back into its original major mode.
;;;***
;;;### (autoloads (customize-object) "eieio-custom" "emacs-lisp/eieio-custom.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20771 24374 643644 0))
;;; Generated autoloads from emacs-lisp/eieio-custom.el
(autoload 'customize-object "eieio-custom" "\
@@ -8067,7 +8074,7 @@ Optional argument GROUP is the sub-group of slots to display.
;;;### (autoloads (eieio-describe-generic eieio-describe-constructor
;;;;;; eieio-describe-class eieio-browse) "eieio-opt" "emacs-lisp/eieio-opt.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20771 24374 643644 0))
;;; Generated autoloads from emacs-lisp/eieio-opt.el
(autoload 'eieio-browse "eieio-opt" "\
@@ -8101,7 +8108,7 @@ Also extracts information about all methods specific to this generic.
;;;***
;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;; "eldoc" "emacs-lisp/eldoc.el" (20709 26818 907104 0))
+;;;;;; "eldoc" "emacs-lisp/eldoc.el" (20770 3512 176098 0))
;;; Generated autoloads from emacs-lisp/eldoc.el
(defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
@@ -8336,7 +8343,7 @@ Other values are interpreted as usual.
;;;***
;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20759 33211 414988 0))
;;; Generated autoloads from mail/emacsbug.el
(autoload 'report-emacs-bug "emacsbug" "\
@@ -8452,8 +8459,8 @@ Commands:
;;;;;; epa-sign-region epa-verify-cleartext-in-region epa-verify-region
;;;;;; epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file
;;;;;; epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys
-;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20709
-;;;;;; 26818 907104 0))
+;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (20762
+;;;;;; 9398 526093 0))
;;; Generated autoloads from epa.el
(autoload 'epa-list-keys "epa" "\
@@ -8860,7 +8867,7 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
;;;***
;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;; "erc-dcc" "erc/erc-dcc.el" (20719 62656 824443 0))
+;;;;;; "erc-dcc" "erc/erc-dcc.el" (20759 33211 414988 0))
;;; Generated autoloads from erc/erc-dcc.el
(autoload 'erc-dcc-mode "erc-dcc")
@@ -9055,7 +9062,7 @@ You can save every individual message by putting this function on
;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host
;;;;;; erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool
;;;;;; erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20763 30266 231060 0))
;;; Generated autoloads from erc/erc-match.el
(autoload 'erc-match-mode "erc-match")
@@ -9298,7 +9305,7 @@ Add a file to `erc-xdcc-files'.
;;;### (autoloads (ert-describe-test ert-run-tests-interactively
;;;;;; ert-run-tests-batch-and-exit ert-run-tests-batch ert-deftest)
-;;;;;; "ert" "emacs-lisp/ert.el" (20719 62656 824443 0))
+;;;;;; "ert" "emacs-lisp/ert.el" (20751 39094 700824 0))
;;; Generated autoloads from emacs-lisp/ert.el
(autoload 'ert-deftest "ert" "\
@@ -10392,8 +10399,8 @@ Besides the choice of face, it is the same as `buffer-face-mode'.
;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
;;;;;; feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20566 63671
-;;;;;; 243798 0))
+;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (20759 33211
+;;;;;; 414988 0))
;;; Generated autoloads from mail/feedmail.el
(autoload 'feedmail-send-it "feedmail" "\
@@ -10448,7 +10455,7 @@ you can set `feedmail-queue-reminder-alist' to nil.
;;;### (autoloads (ffap-bindings ffap-guess-file-name-at-point dired-at-point
;;;;;; ffap-at-mouse ffap-menu find-file-at-point ffap-next) "ffap"
-;;;;;; "ffap.el" (20721 17977 14204 0))
+;;;;;; "ffap.el" (20752 26669 524456 0))
;;; Generated autoloads from ffap.el
(autoload 'ffap-next "ffap" "\
@@ -10674,7 +10681,7 @@ result is a string that should be ready for the command line.
;;;***
;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired"
-;;;;;; "find-dired.el" (20709 26818 907104 0))
+;;;;;; "find-dired.el" (20763 30266 231060 0))
;;; Generated autoloads from find-dired.el
(autoload 'find-dired "find-dired" "\
@@ -11357,8 +11364,8 @@ with no args, if that value is non-nil.
;;;***
;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (20709 26818
-;;;;;; 907104 0))
+;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (20765 36517
+;;;;;; 595445 191000))
;;; Generated autoloads from play/fortune.el
(autoload 'fortune-add-fortune "fortune" "\
@@ -11782,7 +11789,7 @@ If CLEAN, obsolete (ignore).
;;;***
;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;; (20719 62656 824443 0))
+;;;;;; (20763 30266 231060 0))
;;; Generated autoloads from gnus/gnus-art.el
(autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -12002,7 +12009,7 @@ If gravatars are already displayed, remove them.
;;;***
;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;; "gnus-group" "gnus/gnus-group.el" (20709 26818 907104 0))
+;;;;;; "gnus-group" "gnus/gnus-group.el" (20763 30266 231060 0))
;;; Generated autoloads from gnus/gnus-group.el
(autoload 'gnus-fetch-group "gnus-group" "\
@@ -12317,7 +12324,7 @@ Add NUM into sorted LIST by side effect.
;;;***
;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20709 26818 907104
+;;;;;; "gnus-registry" "gnus/gnus-registry.el" (20779 18487 859617
;;;;;; 0))
;;; Generated autoloads from gnus/gnus-registry.el
@@ -12374,7 +12381,7 @@ Update the format specification near point.
;;;***
;;;### (autoloads (gnus-declare-backend) "gnus-start" "gnus/gnus-start.el"
-;;;;;; (20721 17977 14204 0))
+;;;;;; (20763 30266 231060 0))
;;; Generated autoloads from gnus/gnus-start.el
(autoload 'gnus-declare-backend "gnus-start" "\
@@ -12385,7 +12392,7 @@ Declare back end NAME with ABILITIES as a Gnus back end.
;;;***
;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el"
-;;;;;; (20734 30007 218637 0))
+;;;;;; (20763 30266 231060 0))
;;; Generated autoloads from gnus/gnus-sum.el
(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
@@ -12468,8 +12475,8 @@ Use \\[describe-mode] for more info.
;;;***
;;;### (autoloads (goto-address-prog-mode goto-address-mode goto-address
-;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (20709
-;;;;;; 26818 907104 0))
+;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (20766
+;;;;;; 6456 368550 0))
;;; Generated autoloads from net/goto-addr.el
(define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
@@ -12529,8 +12536,8 @@ Retrieve MAIL-ADDRESS gravatar and returns it.
;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command
-;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20709 26818
-;;;;;; 907104 0))
+;;;;;; grep-window-height) "grep" "progmodes/grep.el" (20762 9398
+;;;;;; 526093 0))
;;; Generated autoloads from progmodes/grep.el
(defvar grep-window-height nil "\
@@ -12563,7 +12570,7 @@ List of hook functions run by `grep-process-setup' (see `run-hooks').")
(custom-autoload 'grep-setup-hook "grep" t)
-(defconst grep-regexp-alist '(("^\\(.+?\\)\\(:[ ]*\\)\\([1-9][0-9]*\\)\\2" 1 3 ((lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'match))) (when mbeg (- mbeg beg))))) lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face 'match)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\
+(defconst grep-regexp-alist '(("^\\(.+?\\)\\(:[ ]*\\)\\([1-9][0-9]*\\)\\2" 1 3 ((lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\
Regexp used to match grep hits. See `compilation-error-regexp-alist'.")
(defvar grep-program (purecopy "grep") "\
@@ -13122,7 +13129,7 @@ different regions. With numeric argument ARG, behaves like
;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories
;;;;;; describe-syntax describe-variable variable-at-point describe-function-1
;;;;;; find-lisp-object-file-name help-C-file-name describe-function)
-;;;;;; "help-fns" "help-fns.el" (20709 26818 907104 0))
+;;;;;; "help-fns" "help-fns.el" (20764 51137 83502 0))
;;; Generated autoloads from help-fns.el
(autoload 'describe-function "help-fns" "\
@@ -13335,7 +13342,7 @@ Provide help for current mode.
;;;***
;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;; "hexl.el" (20709 26818 907104 0))
+;;;;;; "hexl.el" (20763 30266 231060 0))
;;; Generated autoloads from hexl.el
(autoload 'hexl-mode "hexl" "\
@@ -13378,8 +13385,8 @@ A sample format:
000000c0: 7265 6769 6f6e 2e0a region..
Movement is as simple as movement in a normal Emacs text buffer. Most
-cursor movement bindings are the same (ie. Use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
-to move the cursor left, right, down, and up).
+cursor movement bindings are the same: use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line]
+to move the cursor left, right, down, and up.
Advanced cursor movement commands (ala \\[hexl-beginning-of-line], \\[hexl-end-of-line], \\[hexl-beginning-of-buffer], and \\[hexl-end-of-buffer]) are
also supported.
@@ -14070,7 +14077,7 @@ Convert HTML to plain text in the current buffer.
;;;***
;;;### (autoloads (htmlfontify-copy-and-link-dir htmlfontify-buffer)
-;;;;;; "htmlfontify" "htmlfontify.el" (20709 26818 907104 0))
+;;;;;; "htmlfontify" "htmlfontify.el" (20774 51822 616889 64000))
;;; Generated autoloads from htmlfontify.el
(autoload 'htmlfontify-buffer "htmlfontify" "\
@@ -14286,8 +14293,8 @@ buffer `*icalendar-errors*'.
;;;***
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20710
-;;;;;; 47669 981323 0))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20766
+;;;;;; 59066 666084 0))
;;; Generated autoloads from icomplete.el
(defvar icomplete-mode nil "\
@@ -14511,8 +14518,8 @@ The main features of this mode are
;;;;;; ido-find-alternate-file ido-find-file-other-window ido-find-file
;;;;;; ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
;;;;;; ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
-;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20709
-;;;;;; 26818 907104 0))
+;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (20766
+;;;;;; 59066 666084 0))
;;; Generated autoloads from ido.el
(defvar ido-mode nil "\
@@ -14804,7 +14811,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
;;;;;; create-image image-type-auto-detected-p image-type-available-p
;;;;;; image-type image-type-from-file-name image-type-from-file-header
;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20772 45239 494620 0))
;;; Generated autoloads from image.el
(autoload 'image-type-from-data "image" "\
@@ -15004,7 +15011,7 @@ If Emacs is compiled without ImageMagick support, this does nothing.
;;;;;; image-dired-jump-thumbnail-buffer image-dired-delete-tag
;;;;;; image-dired-tag-files image-dired-show-all-from-dir image-dired-display-thumbs
;;;;;; image-dired-dired-with-window-configuration image-dired-dired-toggle-marked-thumbs)
-;;;;;; "image-dired" "image-dired.el" (20709 26818 907104 0))
+;;;;;; "image-dired" "image-dired.el" (20768 48184 78670 0))
;;; Generated autoloads from image-dired.el
(autoload 'image-dired-dired-toggle-marked-thumbs "image-dired" "\
@@ -15069,7 +15076,7 @@ displayed.
(defalias 'image-dired 'image-dired-show-all-from-dir)
-(defalias 'tumme 'image-dired-show-all-from-dir)
+(define-obsolete-function-alias 'tumme 'image-dired "24.4")
(autoload 'image-dired-tag-files "image-dired" "\
Tag marked file(s) in dired. With prefix ARG, tag file at point.
@@ -15205,8 +15212,8 @@ An image file is one whose name has an extension in
;;;***
;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
-;;;;;; image-mode) "image-mode" "image-mode.el" (20731 53823 676680
-;;;;;; 0))
+;;;;;; image-mode) "image-mode" "image-mode.el" (20774 51931 214714
+;;;;;; 829000))
;;; Generated autoloads from image-mode.el
(autoload 'image-mode "image-mode" "\
@@ -15251,7 +15258,7 @@ on these modes.
;;;***
;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;; imenu-sort-function) "imenu" "imenu.el" (20747 42040 139863
+;;;;;; imenu-sort-function) "imenu" "imenu.el" (20784 36406 653593
;;;;;; 0))
;;; Generated autoloads from imenu.el
@@ -15423,7 +15430,7 @@ Convert old Emacs Devanagari characters to UCS.
;;;***
;;;### (autoloads (inferior-lisp) "inf-lisp" "progmodes/inf-lisp.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20774 53405 644725 888000))
;;; Generated autoloads from progmodes/inf-lisp.el
(autoload 'inferior-lisp "inf-lisp" "\
@@ -15445,7 +15452,7 @@ of `inferior-lisp-program'). Runs the hooks from
;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node
;;;;;; Info-mode info-finder info-apropos Info-index Info-directory
;;;;;; Info-on-current-buffer info-standalone info-emacs-bug info-emacs-manual
-;;;;;; info info-other-window) "info" "info.el" (20721 17977 14204
+;;;;;; info info-other-window) "info" "info.el" (20774 566 676067
;;;;;; 0))
;;; Generated autoloads from info.el
@@ -15659,7 +15666,7 @@ Otherwise, visit the manual in a new Info buffer.
;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
;;;;;; info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20771 24374 643644 0))
;;; Generated autoloads from info-look.el
(autoload 'info-lookup-reset "info-look" "\
@@ -15791,8 +15798,7 @@ the sources handy.
;;;***
;;;### (autoloads (batch-info-validate Info-validate Info-split Info-split-threshold
-;;;;;; Info-tagify) "informat" "informat.el" (20709 26818 907104
-;;;;;; 0))
+;;;;;; Info-tagify) "informat" "informat.el" (20774 566 676067 0))
;;; Generated autoloads from informat.el
(autoload 'Info-tagify "informat" "\
@@ -15991,7 +15997,7 @@ Add submenus to the File menu, to convert to and from various formats.
;;;;;; ispell-buffer ispell-comments-and-strings ispell-region ispell-change-dictionary
;;;;;; ispell-kill-ispell ispell-help ispell-pdict-save ispell-word
;;;;;; ispell-personal-dictionary) "ispell" "textmodes/ispell.el"
-;;;;;; (20734 30007 218637 0))
+;;;;;; (20784 36406 653593 0))
;;; Generated autoloads from textmodes/ispell.el
(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
@@ -16224,8 +16230,8 @@ You can bind this to the key C-c i in GNUS or mail by adding to
;;;***
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (20766
+;;;;;; 59066 666084 0))
;;; Generated autoloads from iswitchb.el
(defvar iswitchb-mode nil "\
@@ -16332,7 +16338,7 @@ If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
;;;***
;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;; "jka-compr.el" (20709 26818 907104 0))
+;;;;;; "jka-compr.el" (20759 33211 414988 0))
;;; Generated autoloads from jka-compr.el
(defvar jka-compr-inhibit nil "\
@@ -16355,7 +16361,7 @@ by `jka-compr-installed'.
;;;***
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20730 32949 736763
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (20763 30266 231060
;;;;;; 0))
;;; Generated autoloads from progmodes/js.el
@@ -16839,7 +16845,7 @@ something strange, such as redefining an Emacs function.
;;;***
;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;; "locate" "locate.el" (20709 26818 907104 0))
+;;;;;; "locate" "locate.el" (20763 30266 231060 0))
;;; Generated autoloads from locate.el
(defvar locate-ls-subdir-switches (purecopy "-al") "\
@@ -17419,7 +17425,7 @@ The mail client is taken to be the handler of mailto URLs.
;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;; "make-mode" "progmodes/make-mode.el" (20746 21181 635406
+;;;;;; "make-mode" "progmodes/make-mode.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from progmodes/make-mode.el
@@ -17550,7 +17556,7 @@ Previous contents of that buffer are killed first.
;;;***
;;;### (autoloads (Man-bookmark-jump man-follow man) "man" "man.el"
-;;;;;; (20719 62656 824443 0))
+;;;;;; (20762 9398 526093 0))
;;; Generated autoloads from man.el
(defalias 'manual-entry 'man)
@@ -18106,7 +18112,7 @@ to its second argument TM.
;;;***
;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;; "minibuf-eldef.el" (20709 26818 907104 0))
+;;;;;; "minibuf-eldef.el" (20760 54070 584283 0))
;;; Generated autoloads from minibuf-eldef.el
(defvar minibuffer-electric-default-mode nil "\
@@ -18383,7 +18389,7 @@ body) or \"attachment\" (separate from the body).
;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;; "mml2015" "gnus/mml2015.el" (20709 26818 907104 0))
+;;;;;; "mml2015" "gnus/mml2015.el" (20780 39352 990623 0))
;;; Generated autoloads from gnus/mml2015.el
(autoload 'mml2015-decrypt "mml2015" "\
@@ -18938,8 +18944,8 @@ of the piece of advice.
;;;### (autoloads (network-connection network-connection-to-service
;;;;;; whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
;;;;;; nslookup nslookup-host ping traceroute route arp netstat
-;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20709
-;;;;;; 26818 907104 0))
+;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (20784
+;;;;;; 36406 653593 0))
;;; Generated autoloads from net/net-utils.el
(autoload 'ifconfig "net-utils" "\
@@ -19047,7 +19053,7 @@ listed in the PORTS list.
;;;***
;;;### (autoloads (open-network-stream) "network-stream" "net/network-stream.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20770 3512 176098 0))
;;; Generated autoloads from net/network-stream.el
(autoload 'open-network-stream "network-stream" "\
@@ -19160,7 +19166,7 @@ Run `newsticker-start-hook' if newsticker was not running already.
;;;***
;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20762 9398 526093 0))
;;; Generated autoloads from net/newst-plainview.el
(autoload 'newsticker-plainview "newst-plainview" "\
@@ -19324,8 +19330,8 @@ Return nil if the face cannot display a glyph for N.
;;;***
-;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (20763
+;;;;;; 30266 231060 0))
;;; Generated autoloads from nxml/nxml-mode.el
(autoload 'nxml-mode "nxml-mode" "\
@@ -19559,7 +19565,7 @@ with no args, if that value is non-nil.
;;;;;; org-run-like-in-org-mode turn-on-orgstruct++ turn-on-orgstruct
;;;;;; orgstruct-mode org-global-cycle org-cycle org-mode org-clock-persistence-insinuate
;;;;;; turn-on-orgtbl org-version org-babel-do-load-languages) "org"
-;;;;;; "org/org.el" (20723 59703 12265 0))
+;;;;;; "org/org.el" (20783 15545 430927 0))
;;; Generated autoloads from org/org.el
(autoload 'org-babel-do-load-languages "org" "\
@@ -19785,7 +19791,7 @@ Call the customize function with org as argument.
;;;;;; org-search-view org-agenda-list org-batch-store-agenda-views
;;;;;; org-store-agenda-views org-batch-agenda-csv org-batch-agenda
;;;;;; org-agenda org-toggle-sticky-agenda) "org-agenda" "org/org-agenda.el"
-;;;;;; (20723 59703 12265 0))
+;;;;;; (20783 15545 430927 0))
;;; Generated autoloads from org/org-agenda.el
(autoload 'org-toggle-sticky-agenda "org-agenda" "\
@@ -20034,7 +20040,7 @@ By default `org-agenda-to-appt' will use :deadline, :scheduled
and :timestamp entries. See the docstring of `org-diary' for
details and examples.
-If an entry as a APPT_WARNTIME property, its value will be used
+If an entry has a APPT_WARNTIME property, its value will be used
to override `appt-message-warning-time'.
\(fn &optional REFRESH FILTER &rest ARGS)" t nil)
@@ -20162,7 +20168,7 @@ Try very hard to provide sensible version strings.
;;;***
;;;### (autoloads (org-git-version org-release) "org-version" "org/org-version.el"
-;;;;;; (20723 59703 12265 0))
+;;;;;; (20783 15545 430927 0))
;;; Generated autoloads from org/org-version.el
(autoload 'org-release "org-version" "\
@@ -20183,7 +20189,7 @@ The location of ODT styles.")
;;;***
;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20773 35190 350513 0))
;;; Generated autoloads from outline.el
(put 'outline-regexp 'safe-local-variable 'stringp)
(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
@@ -20247,7 +20253,7 @@ See the command `outline-mode' for more information on this mode.
;;;### (autoloads (list-packages describe-package package-initialize
;;;;;; package-refresh-contents package-install-file package-install-from-buffer
;;;;;; package-install package-enable-at-startup) "package" "emacs-lisp/package.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20764 51137 83502 0))
;;; Generated autoloads from emacs-lisp/package.el
(defvar package-enable-at-startup t "\
@@ -21649,7 +21655,7 @@ Proced buffers.
;;;### (autoloads (profiler-find-profile-other-frame profiler-find-profile-other-window
;;;;;; profiler-find-profile profiler-start) "profiler" "profiler.el"
-;;;;;; (20738 27061 124069 0))
+;;;;;; (20752 27211 244736 501000))
;;; Generated autoloads from profiler.el
(autoload 'profiler-start "profiler" "\
@@ -21725,8 +21731,8 @@ The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
;;;***
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (20777
+;;;;;; 63161 848428 0))
;;; Generated autoloads from progmodes/ps-mode.el
(autoload 'ps-mode "ps-mode" "\
@@ -21975,7 +21981,7 @@ If EXTENSION is any other symbol, it is ignored.
;;;***
;;;### (autoloads (python-mode run-python) "python" "progmodes/python.el"
-;;;;;; (20746 21181 635406 0))
+;;;;;; (20774 51843 230245 0))
;;; Generated autoloads from progmodes/python.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
@@ -22265,8 +22271,8 @@ of each directory.
;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
;;;;;; quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20709
-;;;;;; 26818 907104 0))
+;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20764
+;;;;;; 51137 83502 0))
;;; Generated autoloads from net/quickurl.el
(defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@@ -22338,7 +22344,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
;;;***
;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;; "net/rcirc.el" (20709 26818 907104 0))
+;;;;;; "net/rcirc.el" (20770 3512 176098 0))
;;; Generated autoloads from net/rcirc.el
(autoload 'rcirc "rcirc" "\
@@ -22594,8 +22600,8 @@ For true \"word wrap\" behavior, use `visual-line-mode' instead.
;;;***
;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20709 26818
-;;;;;; 907104 0))
+;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (20777 63161
+;;;;;; 848428 0))
;;; Generated autoloads from textmodes/reftex.el
(autoload 'turn-on-reftex "reftex" "\
@@ -22779,7 +22785,7 @@ This means the number of non-shy regexp grouping constructs
;;;### (autoloads (remember-diary-extract-entries remember-clipboard
;;;;;; remember-other-frame remember) "remember" "textmodes/remember.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20748 62911 684442 0))
;;; Generated autoloads from textmodes/remember.el
(autoload 'remember "remember" "\
@@ -22798,8 +22804,7 @@ Call `remember' in another frame.
(autoload 'remember-clipboard "remember" "\
Remember the contents of the current clipboard.
-Most useful for remembering things from Netscape or other X Windows
-application.
+Most useful for remembering things from other applications.
\(fn)" t nil)
@@ -22994,8 +22999,8 @@ variable.
;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p rmail-spool-directory
-;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20723 59924 854722
-;;;;;; 212000))
+;;;;;; rmail-file-name) "rmail" "mail/rmail.el" (20762 9398 526093
+;;;;;; 0))
;;; Generated autoloads from mail/rmail.el
(defvar rmail-file-name (purecopy "~/RMAIL") "\
@@ -23446,7 +23451,7 @@ for modes derived from Text mode, like Mail mode.
;;;***
;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
-;;;;;; (20742 24117 440849 0))
+;;;;;; (20764 51137 83502 0))
;;; Generated autoloads from progmodes/ruby-mode.el
(autoload 'ruby-mode "ruby-mode" "\
@@ -23941,7 +23946,7 @@ vertically fixed relative to window boundaries during scrolling.
;;;***
;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;; "cedet/semantic.el" (20745 310 425822 0))
+;;;;;; "cedet/semantic.el" (20748 62911 684442 0))
;;; Generated autoloads from cedet/semantic.el
(defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
@@ -24309,8 +24314,8 @@ Like `mail' command, but display mail buffer in another frame.
;;;***
;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;; server-force-delete server-start) "server" "server.el" (20721
-;;;;;; 17977 14204 0))
+;;;;;; server-force-delete server-start) "server" "server.el" (20763
+;;;;;; 30266 231060 0))
;;; Generated autoloads from server.el
(put 'server-host 'risky-local-variable t)
@@ -24396,7 +24401,7 @@ These are active only in the minibuffer, when entering or editing a formula:
;;;***
;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;; (20721 17977 14204 0))
+;;;;;; (20784 36406 653593 0))
;;; Generated autoloads from textmodes/sgml-mode.el
(autoload 'sgml-mode "sgml-mode" "\
@@ -24664,8 +24669,8 @@ Otherwise, one argument `-i' is passed to the shell.
;;;***
-;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (20768
+;;;;;; 48184 78670 0))
;;; Generated autoloads from gnus/shr.el
(autoload 'shr-insert-document "shr" "\
@@ -24720,8 +24725,8 @@ Turning on Sieve mode runs `sieve-mode-hook'.
;;;***
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (20777
+;;;;;; 63161 848428 0))
;;; Generated autoloads from progmodes/simula.el
(autoload 'simula-mode "simula" "\
@@ -26796,7 +26801,7 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
;;;***
;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;; "progmodes/tcl.el" (20709 26818 907104 0))
+;;;;;; "progmodes/tcl.el" (20774 53405 704746 172000))
;;; Generated autoloads from progmodes/tcl.el
(autoload 'tcl-mode "tcl" "\
@@ -26956,7 +26961,7 @@ tetris-mode keybindings:
;;;;;; tex-start-commands tex-start-options slitex-run-command latex-run-command
;;;;;; tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp
;;;;;; tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20774 53405 754743 8000))
;;; Generated autoloads from textmodes/tex-mode.el
(defvar tex-shell-file-name nil "\
@@ -27413,7 +27418,7 @@ Compose Thai characters in the current buffer.
;;;### (autoloads (list-at-point number-at-point symbol-at-point
;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;; "thingatpt" "thingatpt.el" (20709 26818 907104 0))
+;;;;;; "thingatpt" "thingatpt.el" (20752 26669 524456 0))
;;; Generated autoloads from thingatpt.el
(autoload 'forward-thing "thingatpt" "\
@@ -27959,7 +27964,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\".
;;;***
;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;; "tmm.el" (20709 26818 907104 0))
+;;;;;; "tmm.el" (20764 51137 83502 0))
;;; Generated autoloads from tmm.el
(define-key global-map "\M-`" 'tmm-menubar)
(define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -28245,7 +28250,7 @@ changing the window configuration.
;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
;;;;;; tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
;;;;;; tramp-file-name-handler tramp-syntax tramp-mode) "tramp"
-;;;;;; "net/tramp.el" (20746 21181 635406 0))
+;;;;;; "net/tramp.el" (20784 36406 653593 0))
;;; Generated autoloads from net/tramp.el
(defvar tramp-mode t "\
@@ -28388,8 +28393,8 @@ Discard Tramp from loading remote files.
;;;***
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (20760
+;;;;;; 54070 584283 0))
;;; Generated autoloads from tutorial.el
(autoload 'help-with-tutorial "tutorial" "\
@@ -28425,7 +28430,7 @@ resumed later.
;;;***
;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;; "textmodes/two-column.el" (20709 26818 907104 0))
+;;;;;; "textmodes/two-column.el" (20763 30266 231060 0))
;;; Generated autoloads from textmodes/two-column.el
(autoload '2C-command "two-column" () t 'keymap)
(global-set-key "\C-x6" '2C-command)
@@ -28836,7 +28841,7 @@ RATING a rating between 1 and 10 of the strength of the authentication.
;;;***
;;;### (autoloads (url-cache-extract url-is-cached url-store-in-cache)
-;;;;;; "url-cache" "url/url-cache.el" (20709 26818 907104 0))
+;;;;;; "url-cache" "url/url-cache.el" (20751 39094 700824 0))
;;; Generated autoloads from url/url-cache.el
(autoload 'url-store-in-cache "url-cache" "\
@@ -28989,8 +28994,8 @@ accessible.
;;;***
-;;;### (autoloads nil "url-http" "url/url-http.el" (20709 26818 907104
-;;;;;; 0))
+;;;### (autoloads nil "url-http" "url/url-http.el" (20766 59628 334727
+;;;;;; 618000))
;;; Generated autoloads from url/url-http.el
(autoload 'url-default-expander "url-expand")
@@ -29491,8 +29496,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME.
;;;;;; vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers
;;;;;; vc-revision-other-window vc-root-diff vc-ediff vc-version-ediff
;;;;;; vc-diff vc-version-diff vc-register vc-next-action vc-before-checkin-hook
-;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20713
-;;;;;; 23861 754849 0))
+;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (20752
+;;;;;; 26669 524456 0))
;;; Generated autoloads from vc/vc.el
(defvar vc-checkout-hook nil "\
@@ -29811,18 +29816,18 @@ mode-specific menu. `vc-annotate-color-map' and
;;;***
-;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20709 26818 907104
+;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from vc/vc-arch.el
(defun vc-arch-registered (file)
(if (vc-find-root file "{arch}/=tagging-method")
(progn
- (load "vc-arch")
+ (load "vc-arch" nil t)
(vc-arch-registered file))))
;;;***
-;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20721 17977 14204
+;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from vc/vc-bzr.el
@@ -29834,19 +29839,19 @@ Name of the format file in a .bzr directory.")
(defun vc-bzr-registered (file)
(if (vc-find-root file vc-bzr-admin-checkout-format-file)
(progn
- (load "vc-bzr")
+ (load "vc-bzr" nil t)
(vc-bzr-registered file))))
;;;***
-;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20709 26818 907104
+;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from vc/vc-cvs.el
(defun vc-cvs-registered (f)
"Return non-nil if file F is registered with CVS."
(when (file-readable-p (expand-file-name
"CVS/Entries" (file-name-directory f)))
- (load "vc-cvs")
+ (load "vc-cvs" nil t)
(vc-cvs-registered f)))
;;;***
@@ -29939,30 +29944,30 @@ case, and the process object in the asynchronous case.
;;;***
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20709 26818 907104
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from vc/vc-git.el
(defun vc-git-registered (file)
"Return non-nil if FILE is registered with git."
(if (vc-find-root file ".git") ; Short cut.
(progn
- (load "vc-git")
+ (load "vc-git" nil t)
(vc-git-registered file))))
;;;***
-;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20709 26818 907104 0))
+;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (20748 62911 684442 0))
;;; Generated autoloads from vc/vc-hg.el
(defun vc-hg-registered (file)
"Return non-nil if FILE is registered with hg."
(if (vc-find-root file ".hg") ; short cut
(progn
- (load "vc-hg")
+ (load "vc-hg" nil t)
(vc-hg-registered file))))
;;;***
-;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20709 26818 907104
+;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (20748 62911 684442
;;;;;; 0))
;;; Generated autoloads from vc/vc-mtn.el
@@ -29974,7 +29979,7 @@ Name of the monotone directory's format file.")
(defun vc-mtn-registered (file)
(if (vc-find-root file vc-mtn-admin-format)
(progn
- (load "vc-mtn")
+ (load "vc-mtn" nil t)
(vc-mtn-registered file))))
;;;***
@@ -30012,7 +30017,7 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
;;;***
-;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20709 26818 907104
+;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (20760 54070 584283
;;;;;; 0))
;;; Generated autoloads from vc/vc-svn.el
(defun vc-svn-registered (f)
@@ -30021,13 +30026,13 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
"_svn")
(t ".svn"))))
(when (vc-find-root f admin-dir)
- (load "vc-svn")
+ (load "vc-svn" nil t)
(vc-svn-registered f))))
;;;***
;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20777 63161 848428 0))
;;; Generated autoloads from progmodes/vera-mode.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode))
@@ -30085,7 +30090,7 @@ Key bindings:
;;;***
;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;; (20709 26818 907104 0))
+;;;;;; (20763 30266 231060 0))
;;; Generated autoloads from progmodes/verilog-mode.el
(autoload 'verilog-mode "verilog-mode" "\
@@ -30882,7 +30887,7 @@ Convert Vietnamese characters of the current buffer to `VIQR' mnemonics.
;;;;;; view-mode view-buffer-other-frame view-buffer-other-window
;;;;;; view-buffer view-file-other-frame view-file-other-window
;;;;;; view-file kill-buffer-if-not-modified view-remove-frame-by-deleting)
-;;;;;; "view" "view.el" (20710 47669 981323 0))
+;;;;;; "view" "view.el" (20762 9398 526093 0))
;;; Generated autoloads from view.el
(defvar view-remove-frame-by-deleting t "\
@@ -31044,8 +31049,8 @@ Digits provide prefix arguments.
\\[View-scroll-to-buffer-end] scroll so that buffer end is at last line of window.
SPC scroll forward \"page size\" lines.
With prefix scroll forward prefix lines.
-DEL scroll backward \"page size\" lines.
- With prefix scroll backward prefix lines.
+DEL, S-SPC scroll backward \"page size\" lines.
+ With prefix scroll backward prefix lines.
\\[View-scroll-page-forward-set-page-size] like \\[View-scroll-page-forward] but with prefix sets \"page size\" to prefix.
\\[View-scroll-page-backward-set-page-size] like \\[View-scroll-page-backward] but with prefix sets \"page size\" to prefix.
\\[View-scroll-half-page-forward] scroll forward \"half page size\" lines. With prefix, sets
@@ -31138,8 +31143,8 @@ Exit View mode and make the current buffer editable.
;;;***
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20709
-;;;;;; 26818 907104 0))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (20762
+;;;;;; 9398 526093 0))
;;; Generated autoloads from emulation/vip.el
(autoload 'vip-setup "vip" "\
@@ -32065,7 +32070,7 @@ Example:
;;;***
;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;; (20738 27061 124069 0))
+;;;;;; (20766 6456 368550 0))
;;; Generated autoloads from xml.el
(autoload 'xml-parse-file "xml" "\
@@ -32186,33 +32191,6 @@ Extract file name from an yenc header.
;;;***
-;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;; yow) "yow" "play/yow.el" (20709 26818 907104 0))
-;;; Generated autoloads from play/yow.el
-
-(autoload 'yow "yow" "\
-Return or display a random Zippy quotation. With prefix arg, insert it.
-
-\(fn &optional INSERT DISPLAY)" t nil)
-
-(autoload 'insert-zippyism "yow" "\
-Prompt with completion for a known Zippy quotation, and insert it at point.
-
-\(fn &optional ZIPPYISM)" t nil)
-
-(autoload 'apropos-zippy "yow" "\
-Return a list of all Zippy quotes matching REGEXP.
-If called interactively, display a list of matches.
-
-\(fn REGEXP)" t nil)
-
-(autoload 'psychoanalyze-pinhead "yow" "\
-Zippy goes to the analyst.
-
-\(fn)" t nil)
-
-;;;***
-
;;;### (autoloads (zone) "zone" "play/zone.el" (20709 26818 907104
;;;;;; 0))
;;; Generated autoloads from play/zone.el
@@ -32433,8 +32411,8 @@ Zone out, completely.
;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el"
-;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20747 42275 915429
-;;;;;; 589000))
+;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (20784 36426 559404
+;;;;;; 170000))
;;;***
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 28fd5c67ff8..82c1ce010b8 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -285,7 +285,8 @@ This variable is only used if the variable
(define-derived-mode net-utils-mode special-mode "NetworkUtil"
"Major mode for interacting with an external network utility."
(set (make-local-variable 'font-lock-defaults)
- '((net-utils-font-lock-keywords))))
+ '((net-utils-font-lock-keywords)))
+ (setq-local revert-buffer-function #'net-utils--revert-function))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Utility functions
@@ -354,20 +355,39 @@ This variable is only used if the variable
;; General network utilities (diagnostic)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defun net-utils-run-simple (buffer-name program-name args)
+;; Todo: This data could be saved in a bookmark.
+(defvar net-utils--revert-cmd nil)
+
+(defun net-utils-run-simple (buffer program-name args &optional nodisplay)
"Run a network utility for diagnostic output only."
- (interactive)
- (when (get-buffer buffer-name)
- (kill-buffer buffer-name))
- (get-buffer-create buffer-name)
- (with-current-buffer buffer-name
+ (with-current-buffer (if (stringp buffer) (get-buffer-create buffer) buffer)
+ (let ((proc (get-buffer-process (current-buffer))))
+ (when proc
+ (set-process-filter proc nil)
+ (delete-process proc)))
+ (let ((inhibit-read-only t))
+ (erase-buffer))
(net-utils-mode)
+ (setq-local net-utils--revert-cmd
+ `(net-utils-run-simple ,(current-buffer)
+ ,program-name ,args nodisplay))
(set-process-filter
- (apply 'start-process (format "%s" program-name)
- buffer-name program-name args)
- 'net-utils-remove-ctrl-m-filter)
- (goto-char (point-min)))
- (display-buffer buffer-name))
+ (apply 'start-process program-name
+ (current-buffer) program-name args)
+ 'net-utils-remove-ctrl-m-filter)
+ (goto-char (point-min))
+ (unless nodisplay (display-buffer (current-buffer)))))
+
+(defun net-utils--revert-function (&optional ignore-auto noconfirm)
+ (message "Reverting `%s'..." (buffer-name))
+ (apply (car net-utils--revert-cmd) (cdr net-utils--revert-cmd))
+ (let ((proc (get-buffer-process (current-buffer))))
+ (when proc
+ (set-process-sentinel
+ proc
+ (lambda (process event)
+ (when (string= event "finished\n")
+ (message "Reverting `%s' done" (process-buffer process))))))))
;;;###autoload
(defun ifconfig ()
@@ -428,9 +448,8 @@ This variable is only used if the variable
(if traceroute-program-options
(append traceroute-program-options (list target))
(list target))))
- (net-utils-run-program
+ (net-utils-run-simple
(concat "Traceroute" " " target)
- (concat "** Traceroute ** " traceroute-program " ** " target)
traceroute-program
options)))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 0974c62c56e..910356fbb6c 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -23,10 +23,11 @@
;;; Commentary:
-;; The Android Debug Bridge must be installed on your local machine.
-;; Add the following form into your .emacs:
+;; The Android Debug Bridge "adb" must be installed on your local
+;; machine. If it is not in your $PATH, add the following form into
+;; your .emacs:
;;
-;; (setq tramp-adb-sdk-dir "/path/to/android/sdk")
+;; (setq tramp-adb-program "/path/to/adb")
;;
;; Due to security it is not possible to access non-root devices.
@@ -37,18 +38,18 @@
(defvar dired-move-to-filename-regexp)
-(defcustom tramp-adb-sdk-dir "~/Android/sdk"
- "Set to the directory containing the Android SDK."
- :type 'string
+(defcustom tramp-adb-program "adb"
+ "Name of the Android Debug Bridge program."
+ :group 'tramp
:version "24.4"
- :group 'tramp)
+ :type 'string)
;;;###tramp-autoload
(defconst tramp-adb-method "adb"
"*When this method name is used, forward all calls to Android Debug Bridge.")
(defcustom tramp-adb-prompt
- "^\\(?:[[:alnum:]]*@[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+ "^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]]*@[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
"Regexp used as prompt in almquist shell."
:type 'string
:version "24.4"
@@ -149,21 +150,17 @@ pass to the OPERATION."
(save-match-data (apply (cdr fn) args))
(tramp-run-real-handler operation args))))
-;; This cannot be a constant, because `tramp-adb-sdk-dir' is customizable.
-(defun tramp-adb-program ()
- "The Android Debug Bridge."
- (expand-file-name "platform-tools/adb" tramp-adb-sdk-dir))
-
;;;###tramp-autoload
(defun tramp-adb-parse-device-names (ignore)
"Return a list of (nil host) tuples allowed to access."
- (with-temp-buffer
- (when (zerop (call-process (tramp-adb-program) nil t nil "devices"))
- (let (result)
- (goto-char (point-min))
- (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
- (add-to-list 'result (list nil (match-string 1))))
- result))))
+ (with-timeout (10)
+ (with-temp-buffer
+ (when (zerop (call-process tramp-adb-program nil t nil "devices"))
+ (let (result)
+ (goto-char (point-min))
+ (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
+ (add-to-list 'result (list nil (match-string 1))))
+ result)))))
(defun tramp-adb-handle-expand-file-name (name &optional dir)
"Like `expand-file-name' for Tramp files."
@@ -778,13 +775,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; directory.
(condition-case nil
(progn
- (setq ret 0
- ret
- (tramp-adb-barf-unless-okay
- v (format "(cd %s; %s)"
- (tramp-shell-quote-argument localname)
- command)
- ""))
+ (setq ret 0)
+ (tramp-adb-barf-unless-okay
+ v (format "(cd %s; %s)"
+ (tramp-shell-quote-argument localname) command)
+ "")
;; We should show the output anyway.
(when outbuf
(with-current-buffer outbuf
@@ -981,11 +976,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq args (append (list "-s" (tramp-file-name-host vec)) args)))
(with-temp-buffer
(prog1
- (unless (zerop (apply 'call-process (tramp-adb-program) nil t nil args))
+ (unless (zerop (apply 'call-process tramp-adb-program nil t nil args))
(buffer-string))
(tramp-message
vec 6 "%s %s\n%s"
- (tramp-adb-program) (mapconcat 'identity args " ") (buffer-string)))))
+ tramp-adb-program (mapconcat 'identity args " ") (buffer-string)))))
(defun tramp-adb-find-test-command (vec)
"Checks, whether the ash has a builtin \"test\" command.
@@ -1014,34 +1009,31 @@ This happens for Android >= 4.0."
(while (re-search-forward "\r+$" nil t)
(replace-match "" nil nil)))))
-(defun tramp-adb-barf-unless-okay (vec command fmt &rest args)
- "Run COMMAND, check exit status, throw error if exit status not okay.
-FMT and ARGS are passed to `error'."
- (tramp-adb-send-command vec (format "%s; echo tramp_exit_status $?" command))
- (with-current-buffer (tramp-get-connection-buffer vec)
- (goto-char (point-max))
- (unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
- (tramp-error
- vec 'file-error "Couldn't find exit status of `%s'" command))
- (skip-chars-forward "^ ")
- (unless (zerop (read (current-buffer)))
- (apply 'tramp-error vec 'file-error fmt args))
- (let (buffer-read-only)
- (delete-region (match-beginning 0) (point-max)))))
-
(defun tramp-adb-command-exit-status
(vec command)
"Run COMMAND and return its exit status.
Sends `echo $?' along with the COMMAND for checking the exit status. If
COMMAND is nil, just sends `echo $?'. Returns the exit status found."
- (tramp-adb-send-command vec (format "%s; echo tramp_exit_status $?" command))
+ (tramp-adb-send-command
+ vec (if command
+ (format "%s; echo tramp_exit_status $?" command)
+ "echo tramp_exit_status $?"))
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-max))
(unless (re-search-backward "tramp_exit_status [0-9]+" nil t)
(tramp-error
vec 'file-error "Couldn't find exit status of `%s'" command))
(skip-chars-forward "^ ")
- (read (current-buffer))))
+ (prog1
+ (read (current-buffer))
+ (let (buffer-read-only)
+ (delete-region (match-beginning 0) (point-max))))))
+
+(defun tramp-adb-barf-unless-okay (vec command fmt &rest args)
+ "Run COMMAND, check exit status, throw error if exit status not okay.
+FMT and ARGS are passed to `error'."
+ (unless (zerop (tramp-adb-command-exit-status vec command))
+ (apply 'tramp-error vec 'file-error fmt args)))
(defun tramp-adb-wait-for-output (proc &optional timeout)
"Wait for output from remote command."
@@ -1080,6 +1072,7 @@ connection if a previous connection has died for some reason."
(let* ((buf (tramp-get-connection-buffer vec))
(p (get-buffer-process buf))
(host (tramp-file-name-host vec))
+ (user (tramp-file-name-user vec))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
(unless
(and p (processp p) (memq (process-status p) '(run open)))
@@ -1102,11 +1095,11 @@ connection if a previous connection has died for some reason."
(p (let ((default-directory
(tramp-compat-temporary-file-directory)))
(apply 'start-process (tramp-get-connection-name vec) buf
- (tramp-adb-program) args))))
+ tramp-adb-program args))))
(tramp-message
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
;; Wait for initial prompt.
- (tramp-adb-wait-for-output p)
+ (tramp-adb-wait-for-output p 30)
(unless (eq 'run (process-status p))
(tramp-error vec 'file-error "Terminated!"))
(tramp-compat-set-process-query-on-exit-flag p nil)
@@ -1135,6 +1128,13 @@ connection if a previous connection has died for some reason."
old-getprop new-getprop)
(tramp-adb-maybe-open-connection vec)))
+ ;; Change user if indicated.
+ (when user
+ (tramp-adb-send-command vec (format "su %s" user))
+ (unless (zerop (tramp-adb-command-exit-status vec nil))
+ (delete-process p)
+ (tramp-error vec 'file-error "Cannot switch to user %s" user)))
+
;; Set "remote-path" connection property. This is needed
;; for eshell.
(tramp-adb-send-command vec "echo \\\"$PATH\\\"")
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index dc45a57b7c6..13a955ff579 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -98,16 +98,30 @@ matching entry in for PROPERTY in `tramp-cache-data'."
(defvar tramp-cache-data-changed nil
"Whether persistent cache data have been changed.")
+(defun tramp-get-hash-table (key)
+ "Returns the hash table for KEY.
+If it doesn't exist yet, it is created and initialized with
+matching entries of `tramp-connection-properties'."
+ (or (gethash key tramp-cache-data)
+ (let ((hash
+ (puthash key (make-hash-table :test 'equal) tramp-cache-data)))
+ (when (vectorp key)
+ (dolist (elt tramp-connection-properties)
+ (when (string-match
+ (or (nth 0 elt) "")
+ (tramp-make-tramp-file-name
+ (aref key 0) (aref key 1) (aref key 2) nil))
+ (tramp-set-connection-property key (nth 1 elt) (nth 2 elt)))))
+ hash)))
+
;;;###tramp-autoload
-(defun tramp-get-file-property (vec file property default)
- "Get the PROPERTY of FILE from the cache context of VEC.
+(defun tramp-get-file-property (key file property default)
+ "Get the PROPERTY of FILE from the cache context of KEY.
Returns DEFAULT if not set."
;; Unify localname.
- (setq vec (copy-sequence vec))
- (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file)))
- (let* ((hash (or (gethash vec tramp-cache-data)
- (puthash vec (make-hash-table :test 'equal)
- tramp-cache-data)))
+ (setq key (copy-sequence key))
+ (aset key 3 (tramp-run-real-handler 'directory-file-name (list file)))
+ (let* ((hash (tramp-get-hash-table key))
(value (when (hash-table-p hash) (gethash property hash))))
(if
;; We take the value only if there is any, and
@@ -125,7 +139,7 @@ Returns DEFAULT if not set."
(setq value (cdr value))
(setq value default))
- (tramp-message vec 8 "%s %s %s" file property value)
+ (tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-get-count-" property)))
(val (or (ignore-errors (symbol-value var)) 0)))
@@ -133,18 +147,16 @@ Returns DEFAULT if not set."
value))
;;;###tramp-autoload
-(defun tramp-set-file-property (vec file property value)
- "Set the PROPERTY of FILE to VALUE, in the cache context of VEC.
+(defun tramp-set-file-property (key file property value)
+ "Set the PROPERTY of FILE to VALUE, in the cache context of KEY.
Returns VALUE."
;; Unify localname.
- (setq vec (copy-sequence vec))
- (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file)))
- (let ((hash (or (gethash vec tramp-cache-data)
- (puthash vec (make-hash-table :test 'equal)
- tramp-cache-data))))
+ (setq key (copy-sequence key))
+ (aset key 3 (tramp-run-real-handler 'directory-file-name (list file)))
+ (let ((hash (tramp-get-hash-table key)))
;; We put the timestamp there.
(puthash property (cons (current-time) value) hash)
- (tramp-message vec 8 "%s %s %s" file property value)
+ (tramp-message key 8 "%s %s %s" file property value)
(when (>= tramp-verbose 10)
(let* ((var (intern (concat "tramp-cache-set-count-" property)))
(val (or (ignore-errors (symbol-value var)) 0)))
@@ -152,26 +164,26 @@ Returns VALUE."
value))
;;;###tramp-autoload
-(defun tramp-flush-file-property (vec file)
- "Remove all properties of FILE in the cache context of VEC."
+(defun tramp-flush-file-property (key file)
+ "Remove all properties of FILE in the cache context of KEY."
;; Remove file property of symlinks.
- (let ((truename (tramp-get-file-property vec file "file-truename" nil)))
+ (let ((truename (tramp-get-file-property key file "file-truename" nil)))
(when (and (stringp truename)
(not (string-equal file truename)))
- (tramp-flush-file-property vec truename)))
+ (tramp-flush-file-property key truename)))
;; Unify localname.
- (setq vec (copy-sequence vec))
- (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file)))
- (tramp-message vec 8 "%s" file)
- (remhash vec tramp-cache-data))
+ (setq key (copy-sequence key))
+ (aset key 3 (tramp-run-real-handler 'directory-file-name (list file)))
+ (tramp-message key 8 "%s" file)
+ (remhash key tramp-cache-data))
;;;###tramp-autoload
-(defun tramp-flush-directory-property (vec directory)
- "Remove all properties of DIRECTORY in the cache context of VEC.
+(defun tramp-flush-directory-property (key directory)
+ "Remove all properties of DIRECTORY in the cache context of KEY.
Remove also properties of all files in subdirectories."
(let ((directory (tramp-run-real-handler
'directory-file-name (list directory))))
- (tramp-message vec 8 "%s" directory)
+ (tramp-message key 8 "%s" directory)
(maphash
(lambda (key value)
(when (and (stringp (tramp-file-name-localname key))
@@ -216,28 +228,10 @@ If the value is not set for the connection, returns DEFAULT."
(when (vectorp key)
(setq key (copy-sequence key))
(aset key 3 nil))
- (let* ((hash (gethash key tramp-cache-data))
- (value
- (catch 'result
- (or
- ;; Check for dynamic properties.
- (and
- (hash-table-p hash)
- (maphash
- (lambda (x y) (when (equal x property) (throw 'result y)))
- hash))
- ;; Check for static properties.
- (and
- (vectorp key)
- (dolist (elt tramp-connection-properties)
- (when (and (string-match
- (or (nth 0 elt) "")
- (tramp-make-tramp-file-name
- (aref key 0) (aref key 1) (aref key 2) nil))
- (string-equal (or (nth 1 elt) "") (or property "")))
- (throw 'result (nth 2 elt)))))
- ;; The default value.
- default))))
+ (let* ((hash (tramp-get-hash-table key))
+ (value (if (hash-table-p hash)
+ (gethash property hash default)
+ default)))
(tramp-message key 7 "%s %s" property value)
value))
@@ -251,15 +245,19 @@ PROPERTY is set persistent when KEY is a vector."
(when (vectorp key)
(setq key (copy-sequence key))
(aset key 3 nil))
- (let ((hash (or (gethash key tramp-cache-data)
- (puthash key (make-hash-table :test 'equal)
- tramp-cache-data))))
+ (let ((hash (tramp-get-hash-table key)))
(puthash property value hash)
(setq tramp-cache-data-changed t)
(tramp-message key 7 "%s %s" property value)
value))
;;;###tramp-autoload
+(defun tramp-connection-property-p (key property)
+ "Check whether named PROPERTY of a connection is defined.
+KEY identifies the connection, it is either a process or a vector."
+ (not (eq (tramp-get-connection-property key property 'undef) 'undef)))
+
+;;;###tramp-autoload
(defun tramp-flush-connection-property (key)
"Remove all properties identified by KEY.
KEY identifies the connection, it is either a process or a vector."
@@ -272,10 +270,8 @@ KEY identifies the connection, it is either a process or a vector."
key 7 "%s %s" key
(let ((hash (gethash key tramp-cache-data))
properties)
- (if (hash-table-p hash)
- (maphash
- (lambda (x y) (add-to-list 'properties x 'append))
- (gethash key tramp-cache-data)))
+ (when (hash-table-p hash)
+ (maphash (lambda (x y) (add-to-list 'properties x 'append)) hash))
properties))
(setq tramp-cache-data-changed t)
(remhash key tramp-cache-data))
@@ -396,7 +392,11 @@ for all methods. Resulting data are derived from connection history."
(while (setq element (pop list))
(setq key (pop element))
(while (setq item (pop element))
- (tramp-set-connection-property key (pop item) (car item)))))
+ ;; We set only values which are not contained in
+ ;; `tramp-connection-properties'. The cache is
+ ;; initialized properly by side effect.
+ (unless (tramp-connection-property-p key (car item))
+ (tramp-set-connection-property key (pop item) (car item))))))
(setq tramp-cache-data-changed nil))
(file-error
;; Most likely because the file doesn't exist yet. No message.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 9be22352b23..9dd37fdf63a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -109,17 +109,15 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-copy-keep-date t)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp"
+ '("scp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -128,55 +126,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp1"
+ '("scpx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
- ("-1") ("-e" "none") ("%h")))
- (tramp-async-args (("-q")))
- (tramp-remote-shell "/bin/sh")
- (tramp-remote-shell-args ("-c"))
- (tramp-copy-program "scp")
- (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
- (tramp-copy-keep-date t)
- (tramp-copy-recursive t)
- (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
- ("-o" "UserKnownHostsFile=/dev/null")
- ("-o" "StrictHostKeyChecking=no")))
- (tramp-default-port 22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
- `("scp2"
- (tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
- ("-2") ("-e" "none") ("%h")))
- (tramp-async-args (("-q")))
- (tramp-remote-shell "/bin/sh")
- (tramp-remote-shell-args ("-c"))
- (tramp-copy-program "scp")
- (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
- (tramp-copy-keep-date t)
- (tramp-copy-recursive t)
- (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
- ("-o" "UserKnownHostsFile=/dev/null")
- ("-o" "StrictHostKeyChecking=no")))
- (tramp-default-port 22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
- `("scpx"
- (tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -185,34 +144,27 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("sftp"
+ '("sftp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "sftp")
- (tramp-copy-args ,tramp-ssh-controlmaster-template)))
+ (tramp-copy-args ("%c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("rsync"
+ '("rsync"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "rsync")
(tramp-copy-args (("-t" "%k") ("-r")))
- (tramp-copy-env (("RSYNC_RSH")
- (,(mapconcat
- 'identity
- (append
- '("ssh") tramp-ssh-controlmaster-template)
- " "))))
+ (tramp-copy-env (("RSYNC_RSH") ("ssh" "%c")))
(tramp-copy-keep-date t)
(tramp-copy-keep-tmpfile t)
(tramp-copy-recursive t)))
@@ -232,10 +184,9 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-remote-shell-args ("-c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh"
+ '("ssh"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -246,38 +197,9 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh1"
+ '("sshx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
- ("-1") ("-e" "none") ("%h")))
- (tramp-async-args (("-q")))
- (tramp-remote-shell "/bin/sh")
- (tramp-remote-shell-args ("-c"))
- (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
- ("-o" "UserKnownHostsFile=/dev/null")
- ("-o" "StrictHostKeyChecking=no")))
- (tramp-default-port 22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
- `("ssh2"
- (tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
- ("-2") ("-e" "none") ("%h")))
- (tramp-async-args (("-q")))
- (tramp-remote-shell "/bin/sh")
- (tramp-remote-shell-args ("-c"))
- (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
- ("-o" "UserKnownHostsFile=/dev/null")
- ("-o" "StrictHostKeyChecking=no")))
- (tramp-default-port 22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
- `("sshx"
- (tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -332,14 +254,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- '("plink1"
- (tramp-login-program "plink")
- (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h")))
- (tramp-remote-shell "/bin/sh")
- (tramp-remote-shell-args ("-c"))
- (tramp-default-port 22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
`("plinkx"
(tramp-login-program "plink")
;; ("%h") must be a single element, see
@@ -452,16 +366,12 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
- (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
- (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
- (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
- (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"telnet" tramp-completion-function-alist-telnet)
@@ -472,8 +382,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
"krlogin" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
- "plink1" tramp-completion-function-alist-ssh)
- (tramp-set-completion-function
"plinkx" tramp-completion-function-alist-putty)
(tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh)))
@@ -1410,7 +1318,7 @@ of."
(utc (not (featurep 'xemacs))))
(tramp-send-command-and-check
v (format "%s touch -t %s %s"
- (if utc "TZ=UTC; export TZ;" "")
+ (if utc "env TZ=UTC" "")
(if utc
(format-time-string "%Y%m%d%H%M.%S" time t)
(format-time-string "%Y%m%d%H%M.%S" time))
@@ -2274,7 +2182,7 @@ The method used must be an out-of-band method."
(t2 (tramp-tramp-file-p newname))
(orig-vec (tramp-dissect-file-name (if t1 filename newname)))
copy-program copy-args copy-env copy-keep-date port spec
- source target)
+ options source target)
(with-parsed-tramp-file-name (if t1 filename newname) nil
(if (and t1 t2)
@@ -2342,9 +2250,11 @@ The method used must be an out-of-band method."
user (or user "")
port (or port "")
spec (format-spec-make
- ?h host ?u user ?p port
?t (tramp-get-connection-property
- (tramp-get-connection-process v) "temp-file" "")
+ (tramp-get-connection-process v) "temp-file" ""))
+ options (format-spec tramp-ssh-controlmaster-options spec)
+ spec (format-spec-make
+ ?h host ?u user ?p port ?c options
?k (if keep-date " " ""))
copy-program (tramp-get-method-parameter
method 'tramp-copy-program)
@@ -2606,10 +2516,13 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(if full-directory-p "yes" "no"))
;; If `full-directory-p', we just say `ls -l FILENAME'.
;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
+ ;; "--dired" returns byte positions. Therefore, the file names
+ ;; must be encoded, which is guaranteed by "LC_ALL=en_US.utf8
+ ;; LC_CTYPE=''".
(if full-directory-p
(tramp-send-command
v
- (format "%s %s %s 2>/dev/null"
+ (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
(tramp-get-ls-command v)
switches
(if wildcard
@@ -2625,7 +2538,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(tramp-run-real-handler 'file-name-directory (list localname))))
(tramp-send-command
v
- (format "%s %s %s"
+ (format "env LC_ALL=en_US.utf8 LC_CTYPE='' %s %s %s 2>/dev/null"
(tramp-get-ls-command v)
switches
(if (or wildcard
@@ -2671,6 +2584,11 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(while (re-search-forward tramp-color-escape-sequence-regexp nil t)
(replace-match "")))
+ ;; Decode the output, it could be multibyte.
+ (decode-coding-region
+ beg (point-max)
+ (or file-name-coding-system default-file-name-coding-system))
+
;; The inserted file could be from somewhere else.
(when (and (not wildcard) (not full-directory-p))
(goto-char (point-max))
@@ -2784,7 +2702,11 @@ the result will be a local, non-Tramp, filename."
(or (null program) tramp-process-connection-type))
(bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
(name1 name)
- (i 0))
+ (i 0)
+ ;; We do not want to raise an error when
+ ;; `start-file-process' has been started several time in
+ ;; `eshell' and friends.
+ (tramp-current-connection nil))
(unless buffer
;; BUFFER can be nil. We use a temporary buffer.
@@ -4392,6 +4314,9 @@ connection if a previous connection has died for some reason."
(setenv "PROMPT_COMMAND")
(setenv "PS1" tramp-initial-end-of-output)
(let* ((target-alist (tramp-compute-multi-hops vec))
+ ;; We will apply `tramp-ssh-controlmaster-options'
+ ;; only for the first hop.
+ (options tramp-ssh-controlmaster-options)
(process-connection-type tramp-process-connection-type)
(process-adaptive-read-buffering nil)
(coding-system-for-read nil)
@@ -4496,8 +4421,10 @@ connection if a previous connection has died for some reason."
l-host (or l-host "")
l-user (or l-user "")
l-port (or l-port "")
+ spec (format-spec-make ?t tmpfile)
+ options (format-spec options spec)
spec (format-spec-make
- ?h l-host ?u l-user ?p l-port ?t tmpfile)
+ ?h l-host ?u l-user ?p l-port ?c options)
command
(concat
;; We do not want to see the trailing local
@@ -4524,7 +4451,8 @@ connection if a previous connection has died for some reason."
(tramp-message
vec 3 "Found remote shell prompt on `%s'" l-host))
;; Next hop.
- (setq target-alist (cdr target-alist)))
+ (setq options ""
+ target-alist (cdr target-alist)))
;; Make initial shell settings.
(tramp-open-connection-setup-interactive-shell p vec))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 89648b0e9a9..d959cfc854a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -220,7 +220,8 @@ pair of the form (KEY VALUE). The following KEYs are defined:
argument. By this, arguments like (\"-l\" \"%u\") are optional.
\"%t\" is replaced by the temporary file name produced with
`tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date
- parameter of a program, if exists.
+ parameter of a program, if exists. \"%c\" adds additional
+ `tramp-ssh-controlmaster-options' options for the first hop.
* `tramp-async-args'
When an asynchronous process is started, we know already that
the connection works. Therefore, we can pass additional
@@ -281,17 +282,23 @@ started on the local host. You should specify a remote host
useful only in combination with `tramp-default-proxies-alist'.")
;;;###tramp-autoload
-(defvar tramp-ssh-controlmaster-template
+(defconst tramp-ssh-controlmaster-options
+ (let ((result ""))
(ignore-errors
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlMaster")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlMaster argument" nil t)
- '("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=auto"
- "-o" "ControlPersist=no"))))
- "Call ssh to detect whether it supports the ControlMaster argument.
-Return a template to be used in `tramp-methods'.")
+ (setq result "-o ControlPath=%t.%%r@%%h:%%p -o ControlMaster=auto")))
+ (when result
+ (with-temp-buffer
+ (call-process "ssh" nil t nil "-o" "ControlPersist")
+ (goto-char (point-min))
+ (when (search-forward-regexp "Missing ControlPersist argument" nil t)
+ (setq result (concat result " -o ControlPersist=no"))))))
+ result)
+ "Call ssh to detect whether it supports the Control* arguments.
+Return a string to be used in `tramp-methods'.")
(defcustom tramp-default-method
;; An external copy method seems to be preferred, because it performs
@@ -325,7 +332,7 @@ Return a template to be used in `tramp-methods'.")
(getenv "SSH_AUTH_SOCK")
(getenv "SSH_AGENT_PID")
;; We could reuse the connection.
- tramp-ssh-controlmaster-template)
+ (> (length tramp-ssh-controlmaster-options) 0))
"scp"
"ssh"))
;; Fallback.
@@ -1158,28 +1165,50 @@ If the `tramp-methods' entry does not exist, return nil."
;;;###tramp-autoload
(defun tramp-tramp-file-p (name)
- "Return t if NAME is a string with Tramp file name syntax.
-It checks also, whether NAME is unibyte encoded."
+ "Return t if NAME is a string with Tramp file name syntax."
(save-match-data
(and (stringp name)
-; (string-equal name (string-as-unibyte name))
(string-match tramp-file-name-regexp name))))
+;; Obsoleted with Tramp 2.2.7.
+(defconst tramp-obsolete-methods
+ '("ssh1" "ssh2" "scp1" "scp2" "scpc" "rsyncc" "plink1")
+ "Obsolete methods.")
+
+(defvar tramp-warned-obsolete-methods nil
+ "Which methods the user has been warned to be obsolete.")
+
(defun tramp-find-method (method user host)
"Return the right method string to use.
This is METHOD, if non-nil. Otherwise, do a lookup in
-`tramp-default-method-alist'."
- (or method
- (let ((choices tramp-default-method-alist)
- lmethod item)
- (while choices
- (setq item (pop choices))
- (when (and (string-match (or (nth 0 item) "") (or host ""))
- (string-match (or (nth 1 item) "") (or user "")))
- (setq lmethod (nth 2 item))
- (setq choices nil)))
- lmethod)
- tramp-default-method))
+`tramp-default-method-alist'. It maps also obsolete methods to
+their replacement."
+ (let ((result
+ (or method
+ (let ((choices tramp-default-method-alist)
+ lmethod item)
+ (while choices
+ (setq item (pop choices))
+ (when (and (string-match (or (nth 0 item) "") (or host ""))
+ (string-match (or (nth 1 item) "") (or user "")))
+ (setq lmethod (nth 2 item))
+ (setq choices nil)))
+ lmethod)
+ tramp-default-method)))
+ ;; This is needed for a transition period only.
+ (when (member result tramp-obsolete-methods)
+ (unless (member result tramp-warned-obsolete-methods)
+ (if noninteractive
+ (warn "Method %s is obsolete, using %s"
+ result (substring result 0 -1))
+ (unless (y-or-n-p (format "Method %s is obsolete, use %s? "
+ result (substring result 0 -1)))
+ (error 'file-error "Method \"%s\" not supported" result)))
+ (add-to-list 'tramp-warned-obsolete-methods result))
+ ;; This works with the current set of `tramp-obsolete-methods'.
+ ;; Must be improved, if their are more sophisticated replacements.
+ (setq result (substring result 0 -1)))
+ result))
(defun tramp-find-user (method user host)
"Return the right user string to use.
@@ -1346,6 +1375,8 @@ The outline level is equal to the verbosity of the Tramp message."
(get-buffer-create (tramp-debug-buffer-name vec))
(when (bobp)
(setq buffer-undo-list t)
+ ;; So it does not get loaded while `outline-regexp' is let-bound.
+ (require 'outline)
;; Activate `outline-mode'. This runs `text-mode-hook' and
;; `outline-mode-hook'. We must prevent that local processes
;; die. Yes: I've seen `flyspell-mode', which starts "ispell".
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 16d456ed51f..5626b611f0d 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,73 @@
+2013-02-28 Achim Gratz <Stromeko@Stromeko.DE>
+
+ * org.el (org-org-menu): Use correct key "C-u C-c C-x !" to do
+ org-reload uncompiled in the menu.
+
+2013-02-28 Bastien Guerry <bzg@gnu.org>
+
+ * org-indent.el (org-indent-add-properties): Bugfix: prevent
+ negative value for `added-ind-per-lvl'.
+
+ * org.el (org-mode): Add `org-fix-ellipsis-at-bol' to
+ `isearch-mode-end-hook' so that any isearch fixes the problem with
+ ellipsis on the first line.
+ (org-fix-ellipsis-at-bol): New defsubst.
+ (org-show-context, org-isearch-end): Use it.
+
+ * org.el (org-show-context): Remove useless catch.
+ Make sure the top of the window is a visible headline.
+ (org-activate-plain-links): Remove unused catch.
+
+ * org-macs.el (org-get-alist-option): Return nil, not (nil),
+ so that `org-show-context' DTRT.
+
+ * org.el (org-imenu-get-tree): Fix bug when matching against empty
+ headlines.
+
+ * org.el (org-overview): Stay on current line.
+ (org-map-entries): Fix docstring.
+ (org-at-clock-log-p): Delete.
+ * org-clock.el (org-at-clock-log-p): Move here.
+
+ * org.el (org-tsr-regexp-both): Don't activate dates in links.
+ (org-activate-dates): Change match boundaries according to the new
+ value of `org-tsr-regexp-both'.
+
+ * org-agenda.el (org-agenda-to-appt): Fix typos.
+
+ * org-agenda.el (org-agenda-local-vars): Don't include
+ `org-agenda-show-window' as it needs to be checked outside of the
+ agenda window.
+
+ * org.el (org-set-tags-command): Fix bug when setting tags for
+ multiple headlines in an active region.
+
+ * org-mobile.el (org-mobile-edit): DTRT when inserting a heading
+ in an invisible region.
+
+ * org.el (org-insert-heading-respect-content): Add docstring.
+ New `invisible-ok' parameter.
+ (org-insert-todo-heading-respect-content): Add docstring.
+
+ * ob-tangle.el (org-babel-tangle-collect-blocks):
+ Bugfix: remove code references from blocks.
+
+ * org-agenda.el (org-agenda-schedule, org-agenda-deadline):
+ Cosmetic changes.
+ (org-agenda-show-new-time): Fix bug when displaying a temporary
+ overlay with the scheduled/deadline information.
+
+ * org.el (org-fill-paragraph-with-timestamp-nobreak-p): New function.
+ (org-setup-filling): Use it to prevent breaking a timestamp when
+ filling a paragraph.
+
+ * org-id.el (org-id-get-with-outline-path-completion): Fix docstring.
+
+2013-02-28 Tim Burt <tcburt@rochester.rr.com> (tiny change)
+
+ * org-datetree.el (org-datetree-find-year-create):
+ Match headlines with tags.
+
2013-02-07 Bastien Guerry <bzg@gnu.org>
* org-agenda.el (org-agenda-get-deadlines)
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el
index 89457f19141..c3b6a483ee6 100644
--- a/lisp/org/ob-tangle.el
+++ b/lisp/org/ob-tangle.el
@@ -371,6 +371,10 @@ code blocks by language."
(unless (and language (not (string= language src-lang)))
(let* ((info (org-babel-get-src-block-info))
(params (nth 2 info))
+ (extra (nth 3 info))
+ (cref-fmt (or (and (string-match "-l \"\\(.+\\)\"" extra)
+ (match-string 1 extra))
+ org-coderef-label-format))
(link ((lambda (link)
(and (string-match org-bracket-link-regexp link)
(match-string 1 link)))
@@ -388,6 +392,11 @@ code blocks by language."
((lambda (body) ;; run the tangle-body-hook
(with-temp-buffer
(insert body)
+ (when (string-match "-r" extra)
+ (goto-char (point-min))
+ (while (re-search-forward
+ (replace-regexp-in-string "%s" ".+" cref-fmt) nil t)
+ (replace-match "")))
(run-hooks 'org-babel-tangle-body-hook)
(buffer-string)))
((lambda (body) ;; expand the body in language specific manner
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 9b6dcaed8c2..79217b6a6e6 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -1934,11 +1934,6 @@ When nil, `q' will kill the single agenda buffer."
(message "Sticky agenda was %s"
(if org-agenda-sticky "enabled" "disabled"))))))
-(autoload 'org-toggle-sticky-agenda "org-agenda" "\
-Toggle `org-agenda-sticky'.
-
-\(fn &optional ARG)" t nil)
-
(defvar org-agenda-buffer nil
"Agenda buffer currently being generated.")
@@ -1971,7 +1966,6 @@ Toggle `org-agenda-sticky'.
org-agenda-last-search-view-search-was-boolean
org-agenda-filtered-by-category
org-agenda-filter-form
- org-agenda-show-window
org-agenda-cycle-counter
org-agenda-last-prefix-arg)
"Variables that must be local in agenda buffers to allow multiple buffers.")
@@ -2615,43 +2609,6 @@ Pressing `<' twice means to restrict to the current subtree or region
((equal org-keys "!") (customize-variable 'org-stuck-projects))
(t (error "Invalid agenda key"))))))
-(autoload 'org-agenda "org-agenda" "\
-Dispatch agenda commands to collect entries to the agenda buffer.
-Prompts for a command to execute. Any prefix arg will be passed
-on to the selected command. The default selections are:
-
-a Call `org-agenda-list' to display the agenda for current day or week.
-t Call `org-todo-list' to display the global todo list.
-T Call `org-todo-list' to display the global todo list, select only
- entries with a specific TODO keyword (the user gets a prompt).
-m Call `org-tags-view' to display headlines with tags matching
- a condition (the user is prompted for the condition).
-M Like `m', but select only TODO entries, no ordinary headlines.
-L Create a timeline for the current buffer.
-e Export views to associated files.
-s Search entries for keywords.
-S Search entries for keywords, only with TODO keywords.
-/ Multi occur across all agenda files and also files listed
- in `org-agenda-text-search-extra-files'.
-< Restrict agenda commands to buffer, subtree, or region.
- Press several times to get the desired effect.
-> Remove a previous restriction.
-# List \"stuck\" projects.
-! Configure what \"stuck\" means.
-C Configure custom agenda commands.
-
-More commands can be added by configuring the variable
-`org-agenda-custom-commands'. In particular, specific tags and TODO keyword
-searches can be pre-defined in this way.
-
-If the current buffer is in Org-mode and visiting a file, you can also
-first press `<' once to indicate that the agenda should be temporarily
-\(until the next use of \\[org-agenda]) restricted to the current file.
-Pressing `<' twice means to restrict to the current subtree or region
-\(if active).
-
-\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil)
-
(defun org-agenda-append-agenda ()
"Append another agenda view to the current one.
This function allows interactive building of block agendas.
@@ -2947,17 +2904,6 @@ before running the agenda command."
(set-buffer org-agenda-buffer-name)
(princ (buffer-string)))
-(autoload 'org-batch-agenda "org-agenda" "\
-Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command.
-
-\(fn CMD-KEY &rest PARAMETERS)" nil t)
-(def-edebug-spec org-batch-agenda (form &rest sexp))
-
(defvar org-agenda-info nil)
;;;###autoload
@@ -3015,44 +2961,6 @@ agenda-day The day in the agenda where this is listed"
","))
(princ "\n")))))
-(autoload 'org-batch-agenda-csv "org-agenda" "\
-Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command.
-
-The output gives a line for each selected agenda item. Each
-item is a list of comma-separated values, like this:
-
-category,head,type,todo,tags,date,time,extra,priority-l,priority-n
-
-category The category of the item
-head The headline, without TODO kwd, TAGS and PRIORITY
-type The type of the agenda entry, can be
- todo selected in TODO match
- tagsmatch selected in tags match
- diary imported from diary
- deadline a deadline on given date
- scheduled scheduled on given date
- timestamp entry has timestamp on given date
- closed entry was closed on given date
- upcoming-deadline warning about deadline
- past-scheduled forwarded scheduled item
- block entry has date block including g. date
-todo The todo keyword, if any
-tags All tags including inherited ones, separated by colons
-date The relevant date, like 2007-2-14
-time The time, like 15:00-16:50
-extra Sting with extra planning info
-priority-l The priority letter if any was given
-priority-n The computed numerical priority
-agenda-day The day in the agenda where this is listed
-
-\(fn CMD-KEY &rest PARAMETERS)" nil t)
-(def-edebug-spec org-batch-agenda-csv (form &rest sexp))
-
(defun org-fix-agenda-info (props)
"Make sure all properties on an agenda item have a canonical form.
This ensures the export commands can easily use it."
@@ -3100,11 +3008,6 @@ This ensures the export commands can easily use it."
(interactive)
(eval (list 'org-batch-store-agenda-views)))
-(autoload 'org-store-agenda-views "org-agenda" "\
-
-
-\(fn &rest PARAMETERS)" t nil)
-
;;;###autoload
(defmacro org-batch-store-agenda-views (&rest parameters)
"Run all custom agenda commands that have a file argument."
@@ -3140,12 +3043,6 @@ This ensures the export commands can easily use it."
(and (get-buffer bufname)
(kill-buffer bufname)))))))
-(autoload 'org-batch-store-agenda-views "org-agenda" "\
-Run all custom agenda commands that have a file argument.
-
-\(fn &rest PARAMETERS)" nil t)
-(def-edebug-spec org-batch-store-agenda-views (&rest sexp))
-
(defvar org-agenda-current-span nil
"The current span used in the agenda view.") ; local variable in the agenda buffer
(defun org-agenda-mark-header-line (pos)
@@ -4204,20 +4101,6 @@ given in `org-agenda-start-on-weekday'."
(setq buffer-read-only t)
(message ""))))
-(autoload 'org-agenda-list "org-agenda" "\
-Produce a daily/weekly view from all files in variable `org-agenda-files'.
-The view will be for the current day or week, but from the overview buffer
-you will be able to go to other days/weeks.
-
-With a numeric prefix argument in an interactive call, the agenda will
-span ARG days. Lisp programs should instead specify SPAN to change
-the number of days. SPAN defaults to `org-agenda-span'.
-
-START-DAY defaults to TODAY, or to the most recent match for the weekday
-given in `org-agenda-start-on-weekday'.
-
-\(fn &optional ARG START-DAY SPAN)" t nil)
-
(defun org-agenda-ndays-to-span (n)
"Return a span symbol for a span of N days, or N if none matches."
(cond ((symbolp n) n)
@@ -4527,52 +4410,6 @@ in `org-agenda-text-search-extra-files'."
(org-agenda-finalize)
(setq buffer-read-only t))))
-(autoload 'org-search-view "org-agenda" "\
-Show all entries that contain a phrase or words or regular expressions.
-
-With optional prefix argument TODO-ONLY, only consider entries that are
-TODO entries. The argument STRING can be used to pass a default search
-string into this function. If EDIT-AT is non-nil, it means that the
-user should get a chance to edit this string, with cursor at position
-EDIT-AT.
-
-The search string can be viewed either as a phrase that should be found as
-is, or it can be broken into a number of snippets, each of which must match
-in a Boolean way to select an entry. The default depends on the variable
-`org-agenda-search-view-always-boolean'.
-Even if this is turned off (the default) you can always switch to
-Boolean search dynamically by preceding the first word with \"+\" or \"-\".
-
-The default is a direct search of the whole phrase, where each space in
-the search string can expand to an arbitrary amount of whitespace,
-including newlines.
-
-If using a Boolean search, the search string is split on whitespace and
-each snippet is searched separately, with logical AND to select an entry.
-Words prefixed with a minus must *not* occur in the entry. Words without
-a prefix or prefixed with a plus must occur in the entry. Matching is
-case-insensitive. Words are enclosed by word delimiters (i.e. they must
-match whole words, not parts of a word) if
-`org-agenda-search-view-force-full-words' is set (default is nil).
-
-Boolean search snippets enclosed by curly braces are interpreted as
-regular expressions that must or (when preceded with \"-\") must not
-match in the entry. Snippets enclosed into double quotes will be taken
-as a whole, to include whitespace.
-
-- If the search string starts with an asterisk, search only in headlines.
-- If (possibly after the leading star) the search string starts with an
- exclamation mark, this also means to look at TODO entries only, an effect
- that can also be achieved with a prefix argument.
-- If (possibly after star and exclamation mark) the search string starts
- with a colon, this will mean that the (non-regexp) snippets of the
- Boolean search must match as full words.
-
-This command searches the agenda files, and in addition the files listed
-in `org-agenda-text-search-extra-files'.
-
-\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil)
-
;;; Agenda TODO list
(defvar org-select-this-todo-keyword nil)
@@ -4663,15 +4500,6 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
(org-agenda-finalize)
(setq buffer-read-only t))))
-(autoload 'org-todo-list "org-agenda" "\
-Show all (not done) TODO entries from all agenda file in a single list.
-The prefix arg can be used to select a specific TODO keyword and limit
-the list to these. When using \\[universal-argument], you will be prompted
-for a keyword. A numeric prefix directly selects the Nth keyword in
-`org-todo-keywords-1'.
-
-\(fn &optional ARG)" t nil)
-
;;; Agenda tags match
;;;###autoload
@@ -4757,12 +4585,6 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
(org-agenda-finalize)
(setq buffer-read-only t))))
-(autoload 'org-tags-view "org-agenda" "\
-Show all headlines for all `org-agenda-files' matching a TAGS criterion.
-The prefix arg TODO-ONLY limits the search to TODO entries.
-
-\(fn &optional TODO-ONLY MATCH)" t nil)
-
;;; Agenda Finding stuck projects
(defvar org-agenda-skip-regexp nil
@@ -4991,14 +4813,6 @@ of what a project is and how to check if it stuck, customize the variable
(setq org-agenda-redo-command
`(org-agenda-list-stuck-projects ,current-prefix-arg)))))
-(autoload 'org-agenda-list-stuck-projects "org-agenda" "\
-Create agenda view for projects that are stuck.
-Stuck projects are project that have no next actions. For the definitions
-of what a project is and how to check if it stuck, customize the variable
-`org-stuck-projects'.
-
-\(fn &rest IGNORE)" t nil)
-
;;; Diary integration
(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
@@ -5177,35 +4991,6 @@ function from a program - use `org-agenda-get-day-entries' instead."
(if results
(concat (org-agenda-finalize-entries results) "\n"))))
-(autoload 'org-diary "org-agenda" "\
-Return diary information from org files.
-This function can be used in a \"sexp\" diary entry in the Emacs calendar.
-It accesses org files and extracts information from those files to be
-listed in the diary. The function accepts arguments specifying what
-items should be listed. For a list of arguments allowed here, see the
-variable `org-agenda-entry-types'.
-
-The call in the diary file should look like this:
-
- &%%(org-diary) ~/path/to/some/orgfile.org
-
-Use a separate line for each org file to check. Or, if you omit the file name,
-all files listed in `org-agenda-files' will be checked automatically:
-
- &%%(org-diary)
-
-If you don't give any arguments (as in the example above), the default
-arguments (:deadline :scheduled :timestamp :sexp) are used.
-So the example above may also be written as
-
- &%%(org-diary :deadline :timestamp :sexp :scheduled)
-
-The function expects the lisp variables `entry' and `date' to be provided
-by the caller, because this is how the calendar works. Don't use this
-function from a program - use `org-agenda-get-day-entries' instead.
-
-\(fn &rest ARGS)" nil nil)
-
;;; Agenda entry finders
(defun org-agenda-get-day-entries (file date &rest args)
@@ -5401,11 +5186,6 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
(match-string 1) org-agenda-todo-ignore-timestamp))
(t))))))))))
-(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\
-Do we have a reason to ignore this TODO entry because it has a time stamp?
-
-\(fn &optional END)" nil nil)
-
(defun org-agenda-get-timestamps (&optional deadline-results)
"Return the date stamp information for agenda display."
(let* ((props (list 'face 'org-agenda-calendar-event
@@ -8686,9 +8466,8 @@ Called with a universal prefix arg, show the priority instead of setting it."
(defun org-agenda-show-new-time (marker stamp &optional prefix)
"Show new date stamp via text properties."
;; We use text properties to make this undoable
- (let ((inhibit-read-only t)
- (buffer-invisibility-spec))
- (setq stamp (concat " " prefix " => " stamp))
+ (let ((inhibit-read-only t))
+ (setq stamp (concat prefix " => " stamp " "))
(save-excursion
(goto-char (point-max))
(while (not (bobp))
@@ -8750,7 +8529,7 @@ ARG is passed through to `org-schedule'."
(widen)
(goto-char pos)
(setq ts (org-schedule arg time)))
- (org-agenda-show-new-time marker ts "S"))
+ (org-agenda-show-new-time marker ts " S"))
(message "%s" ts)))
(defun org-agenda-deadline (arg &optional time)
@@ -8770,7 +8549,7 @@ ARG is passed through to `org-deadline'."
(widen)
(goto-char pos)
(setq ts (org-deadline arg time)))
- (org-agenda-show-new-time marker ts "D"))
+ (org-agenda-show-new-time marker ts " D"))
(message "%s" ts)))
(defun org-agenda-clock-in (&optional arg)
@@ -9131,12 +8910,6 @@ This is a command that has to be installed in `calendar-mode-map'."
(calendar-cursor-to-date))
nil))
-(autoload 'org-calendar-goto-agenda "org-agenda" "\
-Compute the Org-mode agenda for the calendar date displayed at the cursor.
-This is a command that has to be installed in `calendar-mode-map'.
-
-\(fn)" t nil)
-
(defun org-agenda-convert-date ()
(interactive)
(org-agenda-check-type t 'agenda 'timeline)
@@ -9519,7 +9292,7 @@ By default `org-agenda-to-appt' will use :deadline, :scheduled
and :timestamp entries. See the docstring of `org-diary' for
details and examples.
-If an entry as a APPT_WARNTIME property, its value will be used
+If an entry has a APPT_WARNTIME property, its value will be used
to override `appt-message-warning-time'."
(interactive "P")
(if refresh (setq appt-time-msg-list nil))
@@ -9579,40 +9352,6 @@ to override `appt-message-warning-time'."
(message "No event to add")
(message "Added %d event%s for today" cnt (if (> cnt 1) "s" "")))))
-(autoload 'org-agenda-to-appt "org-agenda" "\
-Activate appointments found in `org-agenda-files'.
-With a \\[universal-argument] prefix, refresh the list of
-appointments.
-
-If FILTER is t, interactively prompt the user for a regular
-expression, and filter out entries that don't match it.
-
-If FILTER is a string, use this string as a regular expression
-for filtering entries out.
-
-If FILTER is a function, filter out entries against which
-calling the function returns nil. This function takes one
-argument: an entry from `org-agenda-get-day-entries'.
-
-FILTER can also be an alist with the car of each cell being
-either 'headline or 'category. For example:
-
- '((headline \"IMPORTANT\")
- (category \"Work\"))
-
-will only add headlines containing IMPORTANT or headlines
-belonging to the \"Work\" category.
-
-ARGS are symbols indicating what kind of entries to consider.
-By default `org-agenda-to-appt' will use :deadline, :scheduled
-and :timestamp entries. See the docstring of `org-diary' for
-details and examples.
-
-If an entry as a APPT_WARNTIME property, its value will be used
-to override `appt-message-warning-time'.
-
-\(fn &optional REFRESH FILTER &rest ARGS)" t nil)
-
(defun org-agenda-todayp (date)
"Does DATE mean today, when considering `org-extend-today-until'?"
(let ((today (org-today))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index bc0c431ddd3..a536d025c04 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1545,12 +1545,6 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(org-remove-empty-drawer-at clock-drawer (point))
(forward-line 1))))))
-(defun org-at-clock-log-p nil
- "Is the cursor on the clock log line?"
- (save-excursion
- (move-beginning-of-line 1)
- (looking-at "^[ \t]*CLOCK:")))
-
(defun org-clock-timestamps-up nil
"Increase CLOCK timestamps at cursor."
(interactive)
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index f2e35fa2dfd..e0f4d10bc2d 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -72,7 +72,7 @@ tree can be found."
(goto-char (prog1 (point) (widen))))))
(defun org-datetree-find-year-create (year)
- (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)\\s-*$")
+ (let ((re "^\\*+[ \t]+\\([12][0-9]\\{3\\}\\)\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:\\)?\\s-*$\\)")
match)
(goto-char (point-min))
(while (and (setq match (re-search-forward re nil t))
diff --git a/lisp/org/org-docview.el b/lisp/org/org-docview.el
index 64c215d8db5..be99ad99a69 100644
--- a/lisp/org/org-docview.el
+++ b/lisp/org/org-docview.el
@@ -49,7 +49,7 @@
(declare-function image-mode-window-get "ext:image-mode"
(prop &optional winprops))
-(autoload 'doc-view-goto-page "doc-view")
+(org-autoload "doc-view" '(doc-view-goto-page))
(org-add-link-type "docview" 'org-docview-open)
(add-hook 'org-store-link-functions 'org-docview-store-link)
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 6e865b50c2c..ecf67f72f3a 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -259,11 +259,11 @@ In any case, the ID of the entry is returned."
id)))))
(defun org-id-get-with-outline-path-completion (&optional targets)
- "Use outline-path-completion to retrieve the ID of an entry.
-TARGETS may be a setting for `org-refile-targets' to define the eligible
-headlines. When omitted, all headlines in all agenda files are
-eligible.
-It returns the ID of the entry. If necessary, the ID is created."
+ "Use `outline-path-completion' to retrieve the ID of an entry.
+TARGETS may be a setting for `org-refile-targets' to define
+eligible headlines. When omitted, all headlines in the current
+file are eligible. This function returns the ID of the entry.
+If necessary, the ID is created."
(let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10)))))
(org-refile-use-outline-path
(if (caar org-refile-targets) 'file t))
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index d5f17b2cb69..6e6f2bf1589 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -328,7 +328,7 @@ stopped."
;; inline task or not.
(let* ((case-fold-search t)
(limited-re (org-get-limited-outline-regexp))
- (added-ind-per-lvl (1- org-indent-indentation-per-level))
+ (added-ind-per-lvl (abs (1- org-indent-indentation-per-level)))
(pf (save-excursion
(and (ignore-errors (let ((outline-regexp limited-re))
(org-back-to-heading t)))
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index ceee30601bd..57b2d8a577e 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -263,7 +263,8 @@ in `org-rm-props'."
(cond ((eq key t) t)
((eq option t) t)
((assoc key option) (cdr (assoc key option)))
- (t (cdr (assq 'default option)))))
+ (t (let ((r (cdr (assq 'default option))))
+ (if (listp r) (delq nil r) r)))))
(defsubst org-check-external-command (cmd &optional use no-error)
"Check if external program CMD for USE exists, error if not.
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index a410de0d775..293d2a000c0 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -1064,7 +1064,7 @@ be returned that indicates what went wrong."
(if (org-on-heading-p) ; if false we are in top-level of file
(progn
(end-of-line 1)
- (org-insert-heading-respect-content)
+ (org-insert-heading-respect-content t)
(org-demote))
(beginning-of-line)
(insert "* "))
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 1910d3f7b4f..4fa865308e9 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -5,13 +5,13 @@
(defun org-release ()
"The release version of org-mode.
Inserted by installing org-mode or when a release is made."
- (let ((org-release "7.9.3e"))
+ (let ((org-release "7.9.3f"))
org-release))
;;;###autoload
(defun org-git-version ()
"The Git version of org-mode.
Inserted by installing org-mode or when a release is made."
- (let ((org-git-version "7.9.3e-3-gb07a9b"))
+ (let ((org-git-version "release_7.9.3f-17-g7524ef"))
org-git-version))
;;;###autoload
(defvar org-odt-data-dir "/usr/share/emacs/etc/org"
diff --git a/lisp/org/org.el b/lisp/org/org.el
index ede633a0a93..cc4c93f22eb 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -114,7 +114,6 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
-(declare-function org-at-clock-log-p "org-clock" ())
(declare-function org-clock-timestamps-up "org-clock" ())
(declare-function org-clock-timestamps-down "org-clock" ())
(declare-function org-clock-sum-current-item "org-clock" (&optional tstart))
@@ -467,7 +466,11 @@ the following lines anywhere in the buffer:
#+STARTUP: fold (or `overview', this is equivalent)
#+STARTUP: nofold (or `showall', this is equivalent)
#+STARTUP: content
- #+STARTUP: showeverything"
+ #+STARTUP: showeverything
+
+By default, this option is ignored when Org opens agenda files
+for the first time. If you want the agenda to honor the startup
+option, set `org-agenda-inhibit-startup' to nil."
:group 'org-startup
:type '(choice
(const :tag "nofold: show all" nil)
@@ -3913,6 +3916,7 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
(save-excursion
(goto-char (org-table-begin 'any))
(looking-at org-table1-hline-regexp))))
+
(defun org-table-recognize-table.el ()
"If there is a table.el table nearby, recognize it and move into it."
(if org-table-tab-recognizes-table.el
@@ -3948,7 +3952,6 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
nil))
(defvar org-table-clean-did-remove-column nil)
-
(defun org-table-map-tables (function &optional quietly)
"Apply FUNCTION to the start of all tables in the buffer."
(save-excursion
@@ -4969,7 +4972,8 @@ The following commands are available:
(org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local)
;; Emacs 22 deals with this through a special variable
(org-set-local 'outline-isearch-open-invisible-function
- (lambda (&rest ignore) (org-show-context 'isearch))))
+ (lambda (&rest ignore) (org-show-context 'isearch)))
+ (org-add-hook 'isearch-mode-end-hook 'org-fix-ellipsis-at-bol 'append 'local))
;; Setup the pcomplete hooks
(set (make-local-variable 'pcomplete-command-completion-function)
@@ -5008,6 +5012,8 @@ The following commands are available:
(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
+(defsubst org-fix-ellipsis-at-bol ()
+ (save-excursion (goto-char (window-start)) (recenter 0)))
(defun org-find-invisible-foreground ()
(let ((candidates (remove
@@ -5205,8 +5211,9 @@ on a string that terminates immediately after the date.")
(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
org-ts-regexp "\\)?")
"Regular expression matching a time stamp or time stamp range.")
-(defconst org-tsr-regexp-both (concat org-ts-regexp-both "\\(--?-?"
- org-ts-regexp-both "\\)?")
+(defconst org-tsr-regexp-both
+ (concat org-ts-regexp-both "\\(--?-?"
+ org-ts-regexp-both "\\)?")
"Regular expression matching a time stamp or time stamp range.
The time stamps may be either active or inactive.")
@@ -5298,21 +5305,20 @@ will be prompted for."
(defun org-activate-plain-links (limit)
"Run through the buffer and add overlays to links."
- (catch 'exit
- (let (f)
- (when (and (re-search-forward (concat org-plain-link-re) limit t)
- (not (org-in-src-block-p)))
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (setq f (get-text-property (match-beginning 0) 'face))
- (unless (or (org-in-src-block-p)
- (eq f 'org-tag)
- (and (listp f) (memq 'org-tag f)))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'face 'org-link
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0)))
- t))))
+ (let (f)
+ (when (and (re-search-forward (concat org-plain-link-re) limit t)
+ (not (org-in-src-block-p)))
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (setq f (get-text-property (match-beginning 0) 'face))
+ (unless (or (org-in-src-block-p)
+ (eq f 'org-tag)
+ (and (listp f) (memq 'org-tag f)))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ (list 'mouse-face 'highlight
+ 'face 'org-link
+ 'keymap org-mouse-map))
+ (org-rear-nonsticky-at (match-end 0)))
+ t)))
(defun org-activate-code (limit)
(if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)
@@ -5510,7 +5516,8 @@ by a #."
(defun org-activate-dates (limit)
"Run through the buffer and add overlays to dates."
- (if (re-search-forward org-tsr-regexp-both limit t)
+ (if (and (re-search-forward org-tsr-regexp-both limit t)
+ (not (equal (char-before (match-beginning 0)) 91)))
(progn
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(add-text-properties (match-beginning 0) (match-end 0)
@@ -6431,13 +6438,16 @@ of the first headline in the buffer. This is important, because if the
first headline is not level one, then (hide-sublevels 1) gives confusing
results."
(interactive)
- (let ((level (save-excursion
+ (let ((l (org-current-line))
+ (level (save-excursion
(goto-char (point-min))
(if (re-search-forward (concat "^" outline-regexp) nil t)
(progn
(goto-char (match-beginning 0))
(funcall outline-level))))))
- (and level (hide-sublevels level))))
+ (and level (hide-sublevels level))
+ (recenter '(4))
+ (org-goto-line l)))
(defun org-content (&optional arg)
"Show all headlines in the buffer, like a table of contents.
@@ -7231,12 +7241,14 @@ This is a list with the following elements:
(org-move-subtree-down)
(end-of-line 1))
-(defun org-insert-heading-respect-content ()
- (interactive)
+(defun org-insert-heading-respect-content (invisible-ok)
+ "Insert heading with `org-insert-heading-respect-content' set to t."
+ (interactive "P")
(let ((org-insert-heading-respect-content t))
- (org-insert-heading t)))
+ (org-insert-heading t invisible-ok)))
(defun org-insert-todo-heading-respect-content (&optional force-state)
+ "Insert TODO heading with `org-insert-heading-respect-content' set to t."
(interactive "P")
(let ((org-insert-heading-respect-content t))
(org-insert-todo-heading force-state t)))
@@ -12835,27 +12847,27 @@ How much context is shown depends upon the variables
(following-p (org-get-alist-option org-show-following-heading key))
(entry-p (org-get-alist-option org-show-entry-below key))
(siblings-p (org-get-alist-option org-show-siblings key)))
- (catch 'exit
- ;; Show heading or entry text
- (if (and heading-p (not entry-p))
- (org-flag-heading nil) ; only show the heading
- (and (or entry-p (outline-invisible-p) (org-invisible-p2))
- (org-show-hidden-entry))) ; show entire entry
- (when following-p
- ;; Show next sibling, or heading below text
- (save-excursion
- (and (if heading-p (org-goto-sibling) (outline-next-heading))
- (org-flag-heading nil))))
- (when siblings-p (org-show-siblings))
- (when hierarchy-p
- ;; show all higher headings, possibly with siblings
- (save-excursion
- (while (and (condition-case nil
- (progn (org-up-heading-all 1) t)
- (error nil))
- (not (bobp)))
- (org-flag-heading nil)
- (when siblings-p (org-show-siblings))))))))
+ ;; Show heading or entry text
+ (if (and heading-p (not entry-p))
+ (org-flag-heading nil) ; only show the heading
+ (and (or entry-p (outline-invisible-p) (org-invisible-p2))
+ (org-show-hidden-entry))) ; show entire entry
+ (when following-p
+ ;; Show next sibling, or heading below text
+ (save-excursion
+ (and (if heading-p (org-goto-sibling) (outline-next-heading))
+ (org-flag-heading nil))))
+ (when siblings-p (org-show-siblings))
+ (when hierarchy-p
+ ;; show all higher headings, possibly with siblings
+ (save-excursion
+ (while (and (condition-case nil
+ (progn (org-up-heading-all 1) t)
+ (error nil))
+ (not (bobp)))
+ (org-flag-heading nil)
+ (when siblings-p (org-show-siblings)))))
+ (org-fix-ellipsis-at-bol)))
(defvar org-reveal-start-hook nil
"Hook run before revealing a location.")
@@ -13597,7 +13609,9 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
(if (or (org-at-heading-p) (and arg (org-before-first-heading-p)))
(org-set-tags arg just-align)
(save-excursion
- (org-back-to-heading t)
+ (unless (and (org-region-active-p)
+ org-loop-over-headlines-in-active-region)
+ (org-back-to-heading t))
(org-set-tags arg just-align))))
(defun org-set-tags-to (data)
@@ -14101,13 +14115,13 @@ agenda-with-archives
The remaining args are treated as settings for the skipping facilities of
the scanner. The following items can be given here:
- archive skip trees with the archive tag.
+ archive skip trees with the archive tag
comment skip trees with the COMMENT keyword
function or Emacs Lisp form:
- will be used as value for `org-agenda-skip-function', so whenever
- the function returns t, FUNC will not be called for that
- entry and search will continue from the point where the
- function leaves it.
+ will be used as value for `org-agenda-skip-function', so
+ whenever the function returns a position, FUNC will not be
+ called for that entry and search will continue from the
+ position returned
If your function needs to retrieve the tags including inherited tags
at the *current* entry, you can use the value of the variable
@@ -16401,6 +16415,12 @@ With prefix ARG, change that many days."
(message "Timestamp is now %sactive"
(if (equal (char-after beg) ?<) "" "in")))))
+(defun org-at-clock-log-p nil
+ "Is the cursor on the clock log line?"
+ (save-excursion
+ (move-beginning-of-line 1)
+ (looking-at "^[ \t]*CLOCK:")))
+
(defvar org-clock-history) ; defined in org-clock.el
(defvar org-clock-adjust-closest nil) ; defined in org-clock.el
(defun org-timestamp-change (n &optional what updown)
@@ -18737,8 +18757,7 @@ this function returns t, nil otherwise."
(throw 'exit t))))
nil))))
-(autoload 'org-element-at-point "org-element")
-(autoload 'org-element-type "org-element")
+(org-autoload "org-element" '(org-element-at-point org-element-type))
(declare-function org-element-at-point "org-element" (&optional keep-trail))
(declare-function org-element-type "org-element" (element))
@@ -19840,7 +19859,7 @@ See the individual commands for more information."
("Refresh/Reload"
["Refresh setup current buffer" org-mode-restart t]
["Reload Org (after update)" org-reload t]
- ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x r"])
+ ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x !"])
))
(defun org-info (&optional node)
@@ -20970,7 +20989,8 @@ hierarchy of headlines by UP levels before marking the subtree."
(org-uniquify
(append fill-nobreak-predicate
'(org-fill-paragraph-separate-nobreak-p
- org-fill-line-break-nobreak-p)))))
+ org-fill-line-break-nobreak-p
+ org-fill-paragraph-with-timestamp-nobreak-p)))))
(org-set-local 'fill-paragraph-function 'org-fill-paragraph)
(org-set-local 'auto-fill-inhibit-regexp nil)
(org-set-local 'adaptive-fill-function 'org-adaptive-fill-function)
@@ -20989,6 +21009,11 @@ hierarchy of headlines by UP levels before marking the subtree."
(skip-chars-backward "\\\\")
(looking-at "\\\\\\\\\\($\\|[^\\\\]\\)")))
+(defun org-fill-paragraph-with-timestamp-nobreak-p ()
+ "Non-nil when a line break at point would insert a new item."
+ (and (org-at-timestamp-p t)
+ (not (looking-at org-ts-regexp-both))))
+
(declare-function message-in-body-p "message" ())
(defvar org-element--affiliated-re) ; From org-element.el
(defvar orgtbl-line-start-regexp) ; From org-table.el
@@ -22159,7 +22184,8 @@ Show the heading too, if it is currently invisible."
isearch-mode-end-hook-quit)
;; Only when the isearch was not quitted.
(org-add-hook 'post-command-hook 'org-isearch-post-command
- 'append 'local)))))
+ 'append 'local)))
+ (org-fix-ellipsis-at-bol)))
(defun org-isearch-post-command ()
"Remove self from hook, and show context."
@@ -22190,7 +22216,7 @@ Show the heading too, if it is currently invisible."
(re (concat "^" (org-get-limited-outline-regexp)))
(subs (make-vector (1+ n) nil))
(last-level 0)
- m level head)
+ m level head0 head)
(save-excursion
(save-restriction
(widen)
@@ -22198,9 +22224,9 @@ Show the heading too, if it is currently invisible."
(while (re-search-backward re nil t)
(setq level (org-reduced-level (funcall outline-level)))
(when (and (<= level n)
- (looking-at org-complex-heading-regexp))
- (setq head (org-link-display-format
- (org-match-string-no-properties 4))
+ (looking-at org-complex-heading-regexp)
+ (setq head0 (org-match-string-no-properties 4)))
+ (setq head (org-link-display-format head0)
m (org-imenu-new-marker))
(org-add-props head nil 'org-imenu-marker m 'org-imenu t)
(if (>= level last-level)
diff --git a/lisp/outline.el b/lisp/outline.el
index 24f25fd2fb7..0ec5227a286 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -43,25 +43,21 @@
:prefix "outline-"
:group 'wp)
-(defcustom outline-regexp "[*\^L]+"
+(defvar outline-regexp "[*\^L]+"
"Regular expression to match the beginning of a heading.
Any line whose beginning matches this regexp is considered to start a heading.
Note that Outline mode only checks this regexp at the start of a line,
so the regexp need not (and usually does not) start with `^'.
The recommended way to set this is with a Local Variables: list
-in the file it applies to. See also `outline-heading-end-regexp'."
- :type 'regexp
- :group 'outlines)
+in the file it applies to. See also `outline-heading-end-regexp'.")
;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp)
-(defcustom outline-heading-end-regexp "\n"
+(defvar outline-heading-end-regexp "\n"
"Regular expression to match the end of a heading line.
You can assume that point is at the beginning of a heading when this
regexp is searched for. The heading ends at the end of the match.
The recommended way to set this is with a `Local Variables:' list
-in the file it applies to."
- :type 'regexp
- :group 'outlines)
+in the file it applies to.")
;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
(defvar outline-mode-prefix-map
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 069f5a32a9e..d73e9489d7c 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -201,8 +201,8 @@ This process selection is performed by function `inferior-lisp-proc'.
Whenever \\[inferior-lisp] fires up a new process, it resets
`inferior-lisp-buffer' to be the new process's buffer. If you only run
one process, this does the right thing. If you run multiple
-processes, you can change `inferior-lisp-buffer' to another process
-buffer with \\[set-variable].")
+processes, you might need to change `inferior-lisp-buffer' to
+whichever process buffer you want to use.")
(defvar inferior-lisp-mode-hook '()
"Hook for customizing Inferior Lisp mode.")
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index 184de99302e..0f994a8422b 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -5,7 +5,7 @@
;; Author: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Maintainer: Peter Kleiweg <p.c.j.kleiweg@rug.nl>
;; Created: 20 Aug 1997
-;; Version: 1.1h
+;; Version: 1.1i
;; Keywords: PostScript, languages
;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
@@ -35,8 +35,9 @@
;;; Code:
-(defconst ps-mode-version "1.1h, 16 Jun 2005")
-(defconst ps-mode-maintainer-address "Peter Kleiweg <p.c.j.kleiweg@rug.nl>")
+(defconst ps-mode-version "1.1i, 17 May 2008")
+(defconst ps-mode-maintainer-address
+ "Peter Kleiweg <p.c.j.kleiweg@rug.nl>, bug-gnu-emacs@gnu.org")
(require 'comint)
(require 'easymenu)
@@ -805,7 +806,7 @@ Only one `%' is removed, and it has to be in the first column."
(while (re-search-forward "[\200-\377]" (marker-position endm) t)
(setq i (1+ i))
(backward-char)
- (insert (format "\\%03o" (string-to-char (buffer-substring (point) (1+ (point))))))
+ (insert (format "\\%03o" (string-to-char (string-make-unibyte (buffer-substring (point) (1+ (point)))))))
(delete-char 1))
(message "%d change%s made" i (if (= i 1) "" "s"))
(set-marker endm nil)))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index eadb06fa61e..f0f67d01845 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -708,10 +708,9 @@ START is the buffer position where the sexp starts."
;; After backslash
((setq start (when (not (or (python-syntax-context 'string ppss)
(python-syntax-context 'comment ppss)))
- (let ((line-beg-pos (line-beginning-position)))
- (when (python-info-line-ends-backslash-p
- (1- line-beg-pos))
- (- line-beg-pos 2)))))
+ (let ((line-beg-pos (line-number-at-pos)))
+ (python-info-line-ends-backslash-p
+ (1- line-beg-pos)))))
'after-backslash)
;; After beginning of block
((setq start (save-excursion
@@ -2960,39 +2959,40 @@ not inside a defun."
(type))
(catch 'exit
(while (python-nav-beginning-of-defun 1)
- (when (and
- (or (not last-indent)
- (< (current-indentation) last-indent))
- (or
- (and first-run
+ (when (save-match-data
+ (and
+ (or (not last-indent)
+ (< (current-indentation) last-indent))
+ (or
+ (and first-run
+ (save-excursion
+ ;; If this is the first run, we may add
+ ;; the current defun at point.
+ (setq first-run nil)
+ (goto-char starting-pos)
+ (python-nav-beginning-of-statement)
+ (beginning-of-line 1)
+ (looking-at-p
+ python-nav-beginning-of-defun-regexp)))
+ (< starting-pos
(save-excursion
- ;; If this is the first run, we may add
- ;; the current defun at point.
- (setq first-run nil)
- (goto-char starting-pos)
- (python-nav-beginning-of-statement)
- (beginning-of-line 1)
- (looking-at-p
- python-nav-beginning-of-defun-regexp)))
- (< starting-pos
- (save-excursion
- (let ((min-indent
- (+ (current-indentation)
- python-indent-offset)))
- (if (< starting-indentation min-indent)
- ;; If the starting indentation is not
- ;; within the min defun indent make the
- ;; check fail.
- starting-pos
- ;; Else go to the end of defun and add
- ;; up the current indentation to the
- ;; ending position.
- (python-nav-end-of-defun)
- (+ (point)
- (if (>= (current-indentation) min-indent)
- (1+ (current-indentation))
- 0))))))))
- (setq last-indent (current-indentation))
+ (let ((min-indent
+ (+ (current-indentation)
+ python-indent-offset)))
+ (if (< starting-indentation min-indent)
+ ;; If the starting indentation is not
+ ;; within the min defun indent make the
+ ;; check fail.
+ starting-pos
+ ;; Else go to the end of defun and add
+ ;; up the current indentation to the
+ ;; ending position.
+ (python-nav-end-of-defun)
+ (+ (point)
+ (if (>= (current-indentation) min-indent)
+ (1+ (current-indentation))
+ 0)))))))))
+ (save-match-data (setq last-indent (current-indentation)))
(if (or (not include-type) type)
(setq names (cons (match-string-no-properties 1) names))
(let ((match (split-string (match-string-no-properties 0))))
@@ -3115,7 +3115,7 @@ With optional argument LINE-NUMBER, check that line instead."
(save-restriction
(widen)
(when line-number
- (goto-char line-number))
+ (python-util-goto-line line-number))
(while (and (not (eobp))
(goto-char (line-end-position))
(python-syntax-context 'paren)
@@ -3131,7 +3131,7 @@ Optional argument LINE-NUMBER forces the line number to check against."
(save-restriction
(widen)
(when line-number
- (goto-char line-number))
+ (python-util-goto-line line-number))
(when (python-info-line-ends-backslash-p)
(while (save-excursion
(goto-char (line-beginning-position))
@@ -3210,7 +3210,9 @@ operator."
(defun python-info-current-line-comment-p ()
"Check if current line is a comment line."
- (char-equal (or (char-after (+ (point) (current-indentation))) ?_) ?#))
+ (char-equal
+ (or (char-after (+ (line-beginning-position) (current-indentation))) ?_)
+ ?#))
(defun python-info-current-line-empty-p ()
"Check if current line is empty, ignoring whitespace."
@@ -3225,12 +3227,10 @@ operator."
;;; Utility functions
-(defun python-util-position (item seq)
- "Find the first occurrence of ITEM in SEQ.
-Return the index of the matching item, or nil if not found."
- (let ((member-result (member item seq)))
- (when member-result
- (- (length seq) (length member-result)))))
+(defun python-util-goto-line (line-number)
+ "Move point to LINE-NUMBER."
+ (goto-char (point-min))
+ (forward-line (1- line-number)))
;; Stolen from org-mode
(defun python-util-clone-local-variables (from-buffer &optional regexp)
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el
index d71c9adbef4..77732ed3241 100644
--- a/lisp/progmodes/simula.el
+++ b/lisp/progmodes/simula.el
@@ -244,8 +244,7 @@ for SIMULA mode to function correctly."
; it determines the flavor of the Emacs running
(defvar simula-mode-menu
- '(["Report Bug" simula-submit-bug-report t]
- ["Indent Line" simula-indent-line t]
+ '(["Indent Line" simula-indent-line t]
["Backward Statement" simula-previous-statement t]
["Forward Statement" simula-next-statement t]
["Backward Up Level" simula-backward-up-level t]
@@ -286,10 +285,6 @@ for SIMULA mode to function correctly."
;; Emacs 19 defines menus in the mode map
(define-key map [menu-bar simula]
(cons "SIMULA" (make-sparse-keymap "SIMULA")))
- (define-key map [menu-bar simula bug-report]
- '("Submit Bug Report" . simula-submit-bug-report))
- (define-key map [menu-bar simula separator-indent]
- '("--"))
(define-key map [menu-bar simula indent-exp]
'("Indent Expression" . simula-indent-exp))
(define-key map [menu-bar simula indent-line]
@@ -1622,28 +1617,11 @@ If not nil and not t, move to limit of search and return nil."
(defconst simula-mode-help-address "bug-gnu-emacs@gnu.org"
"Address accepting submission of `simula-mode' bug reports.")
-(defun simula-submit-bug-report ()
- "Submit via mail a bug report on `simula-mode'."
- (interactive)
- (and
- (y-or-n-p "Do you want to submit a report on simula-mode? ")
- (reporter-submit-bug-report
- simula-mode-help-address
- (concat "simula-mode from Emacs " emacs-version)
- (list
- ;; report only the vars that affect indentation
- 'simula-indent-level
- 'simula-substatement-offset
- 'simula-continued-statement-offset
- 'simula-label-offset
- 'simula-if-indent
- 'simula-inspect-indent
- 'simula-electric-indent
- 'simula-abbrev-keyword
- 'simula-abbrev-stdproc
- 'simula-abbrev-file
- 'simula-tab-always-indent
- ))))
+(make-obsolete-variable 'simula-mode-help-address 'report-emacs-bug-address
+ "24.4")
+
+(define-obsolete-function-alias 'simula-submit-bug-report
+ 'report-emacs-bug "24.4")
(provide 'simula)
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index a32cd969757..9169a433015 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -332,8 +332,8 @@ This process selection is performed by function `inferior-tcl-proc'.
Whenever \\[inferior-tcl] fires up a new process, it resets
`inferior-tcl-buffer' to be the new process's buffer. If you only run
one process, this does the right thing. If you run multiple
-processes, you can change `inferior-tcl-buffer' to another process
-buffer with \\[set-variable].")
+processes, you might need to set `inferior-tcl-buffer' to
+whichever process buffer you want to use.")
;;
;; Hooks and other customization.
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 0c456d3b944..7b59faca261 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -1423,7 +1423,8 @@ If `vera-intelligent-tab' is nil, always indent line."
;;; Bug reports
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defconst vera-mode-help-address "Reto Zimmermann <reto@gnu.org>"
+(defconst vera-mode-help-address
+ "Reto Zimmermann <reto@gnu.org>, bug-gnu-emacs@gnu.org"
"Address for Vera Mode bug reports.")
;; get reporter-submit-bug-report when byte-compiling
diff --git a/lisp/replace.el b/lisp/replace.el
index 0b8aaa7d349..86b1aa27069 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -583,34 +583,39 @@ of `history-length', which see.")
(defun read-regexp (prompt &optional defaults history)
"Read and return a regular expression as a string.
When PROMPT doesn't end with a colon and space, it adds a final \": \".
-If DEFAULTS is non-nil, it displays the first default in the prompt.
-
-Optional arg DEFAULTS is a string or a list of strings that are
-prepended to a list of standard default values, which include the
-tag at point, the last isearch regexp, the last isearch string,
+If the first element of DEFAULTS is non-nil, it's added to the prompt.
+
+Optional arg DEFAULTS has the form (DEFAULT . SUGGESTIONS)
+or simply DEFAULT where DEFAULT, if non-nil, should be a string that
+is returned as the default value when the user enters empty input.
+SUGGESTIONS is a list of strings that can be inserted into
+the minibuffer using \\<minibuffer-local-map>\\[next-history-element]. \
+The values supplied in SUGGESTIONS
+are prepended to the list of standard suggestions that include
+the tag at point, the last isearch regexp, the last isearch string,
and the last replacement regexp.
-Non-nil HISTORY is a symbol to use for the history list.
+Optional arg HISTORY is a symbol to use for the history list.
If HISTORY is nil, `regexp-history' is used."
- (let* ((defaults
- (append
- (if (listp defaults) defaults (list defaults))
- (list
- ;; Regexp for tag at point.
- (let* ((tagf (or find-tag-default-function
- (get major-mode 'find-tag-default-function)
- 'find-tag-default))
- (tag (funcall tagf)))
- (cond ((not tag) "")
- ((eq tagf 'find-tag-default)
- (format "\\_<%s\\_>" (regexp-quote tag)))
- (t (regexp-quote tag))))
- (car regexp-search-ring)
- (regexp-quote (or (car search-ring) ""))
- (car (symbol-value
- query-replace-from-history-variable)))))
- (defaults (delete-dups (delq nil (delete "" defaults))))
- (default (car defaults))
+ (let* ((default (if (consp defaults) (car defaults) defaults))
+ (suggestions (if (listp defaults) defaults (list defaults)))
+ (suggestions
+ (append
+ suggestions
+ (list
+ ;; Regexp for tag at point.
+ (let* ((tagf (or find-tag-default-function
+ (get major-mode 'find-tag-default-function)
+ 'find-tag-default))
+ (tag (funcall tagf)))
+ (cond ((not tag) "")
+ ((eq tagf 'find-tag-default)
+ (format "\\_<%s\\_>" (regexp-quote tag)))
+ (t (regexp-quote tag))))
+ (car regexp-search-ring)
+ (regexp-quote (or (car search-ring) ""))
+ (car (symbol-value query-replace-from-history-variable)))))
+ (suggestions (delete-dups (delq nil (delete "" suggestions))))
;; Do not automatically add default to the history for empty input.
(history-add-new-input nil)
(input (read-from-minibuffer
@@ -621,9 +626,11 @@ If HISTORY is nil, `regexp-history' is used."
(query-replace-descr default)))
(t
(format "%s: " prompt)))
- nil nil nil (or history 'regexp-history) defaults t)))
+ nil nil nil (or history 'regexp-history) suggestions t)))
(if (equal input "")
+ ;; Return the default value when the user enters empty input.
(or default input)
+ ;; Otherwise, add non-empty input to the history and return input.
(prog1 input
(add-to-history (or history 'regexp-history) input)))))
@@ -2203,6 +2210,7 @@ make, or the user didn't cancel the call."
replace-regexp-lax-whitespace)
(isearch-case-fold-search case-fold-search)
(isearch-forward t)
+ (isearch-other-end match-beg)
(isearch-error nil))
(isearch-lazy-highlight-new-loop range-beg range-end))))
diff --git a/lisp/simple.el b/lisp/simple.el
index 138c2420309..3ef700a6058 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1400,6 +1400,8 @@ to get different commands to edit and resubmit."
(error "Argument %d is beyond length of command history" arg)
(error "There are no previous complex commands to repeat")))))
+(defvar extended-command-history nil)
+
(defun read-extended-command ()
"Read command name to invoke in `execute-extended-command'."
(minibuffer-with-setup-hook
@@ -1489,6 +1491,53 @@ give to the command you invoke, if it asks for an argument."
(sit-for (if (numberp suggest-key-bindings)
suggest-key-bindings
2))))))))
+
+(defun command-execute (cmd &optional record-flag keys special)
+ ;; BEWARE: Called directly from the C code.
+ "Execute CMD as an editor command.
+CMD must be a symbol that satisfies the `commandp' predicate.
+Optional second arg RECORD-FLAG non-nil
+means unconditionally put this command in the variable `command-history'.
+Otherwise, that is done only if an arg is read using the minibuffer.
+The argument KEYS specifies the value to use instead of (this-command-keys)
+when reading the arguments; if it is nil, (this-command-keys) is used.
+The argument SPECIAL, if non-nil, means that this command is executing
+a special event, so ignore the prefix argument and don't clear it."
+ (setq debug-on-next-call nil)
+ (let ((prefixarg (unless special
+ (prog1 prefix-arg
+ (setq current-prefix-arg prefix-arg)
+ (setq prefix-arg nil)))))
+ (and (symbolp cmd)
+ (get cmd 'disabled)
+ ;; FIXME: Weird calling convention!
+ (run-hooks 'disabled-command-function))
+ (let ((final cmd))
+ (while
+ (progn
+ (setq final (indirect-function final))
+ (if (autoloadp final)
+ (setq final (autoload-do-load final cmd)))))
+ (cond
+ ((arrayp final)
+ ;; If requested, place the macro in the command history. For
+ ;; other sorts of commands, call-interactively takes care of this.
+ (when record-flag
+ (push `(execute-kbd-macro ,final ,prefixarg) command-history)
+ ;; Don't keep command history around forever.
+ (when (and (numberp history-length) (> history-length 0))
+ (let ((cell (nthcdr history-length command-history)))
+ (if (consp cell) (setcdr cell nil)))))
+ (execute-kbd-macro final prefixarg))
+ (t
+ ;; Pass `cmd' rather than `final', for the backtrace's sake.
+ (prog1 (call-interactively cmd record-flag keys)
+ (when (and (symbolp cmd)
+ (get cmd 'byte-obsolete-info)
+ (not (get cmd 'command-execute-obsolete-warned)))
+ (put cmd 'command-execute-obsolete-warned t)
+ (message "%s" (macroexp--obsolete-warning
+ cmd (get cmd 'byte-obsolete-info) "command")))))))))
(defvar minibuffer-history nil
"Default minibuffer history list.
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index c2978b0ea40..2bd7283676e 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -198,7 +198,7 @@
;; Variables
(defconst artist-version "1.2.6")
-(defconst artist-maintainer-address "tab@lysator.liu.se")
+(defconst artist-maintainer-address "tab@lysator.liu.se, bug-gnu-emacs@gnu.org")
(defvar x-pointer-crosshair)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index dbcf3910db8..92e21c300c7 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -749,8 +749,10 @@ OTHERCHARS slots of the alist should contain the same character
set as casechars and otherchars in the LANGUAGE.aff file \(e.g.,
english.aff\). aspell and hunspell don't have this limitation.")
-(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions.
-(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions.
+(defvar ispell-really-aspell nil
+ "Non-nil if we can use aspell extensions.")
+(defvar ispell-really-hunspell nil
+ "Non-nil if we can use hunspell extensions.")
(defvar ispell-encoding8-command nil
"Command line option prefix to select encoding if supported, nil otherwise.
If setting the encoding is supported by spellchecker and is selectable from
@@ -860,7 +862,7 @@ Otherwise returns the library directory name, if that is defined."
(if (string-match "\\`aspell" speller) "-v" "-vv"))))
(goto-char (point-min))
(if interactivep
- ;; report version information of ispell and ispell.el
+ ;; Report version information of ispell and ispell.el
(progn
(end-of-line)
(setq result (concat (buffer-substring-no-properties (point-min)
@@ -955,11 +957,12 @@ See `ispell-buffer-with-debug' for an example of use."
(erase-buffer)))
ispell-debug-buffer))
-(defsubst ispell-print-if-debug (string)
- "Print STRING to `ispell-debug-buffer' buffer if enabled."
+(defsubst ispell-print-if-debug (format &rest args)
+ "Print message to `ispell-debug-buffer' buffer if enabled."
(if (boundp 'ispell-debug-buffer)
(with-current-buffer ispell-debug-buffer
- (insert string))))
+ (goto-char (point-max))
+ (insert (apply #'format format args)))))
;; The preparation of the menu bar menu must be autoloaded
@@ -1129,6 +1132,176 @@ Return the new dictionary alist."
(push (cons aliasname (cdr realdict)) alist))))))
alist))
+;; Make ispell.el work better with hunspell.
+
+(defvar ispell-hunspell-dict-paths-alist nil
+ "Alist of parsed hunspell dicts and associated affix files.
+Will be used to parse corresponding .aff file and create associated
+parameters to be inserted into `ispell-hunspell-dictionary-alist'.
+Internal use.")
+
+(defvar ispell-hunspell-dictionary-alist nil
+ "Alist of parsed hunspell dicts and associated parameters.
+This alist will initially contain names of found dicts. Associated
+parameters will be added when dict is used for the first time.
+Internal use.")
+
+(defun ispell-hunspell-fill-dictionary-entry (dict)
+ "Fill `ispell-dictionary-alist' uninitialized entries for `DICT' and aliases.
+Value will be extracted from hunspell affix file and used for
+all uninitialized dicts using that affix file."
+ (if (cadr (assoc dict ispell-dictionary-alist))
+ (message "ispell-hfde: Non void entry for %s. Skipping.\n" dict)
+ (let ((dict-alias
+ (cadr (assoc dict ispell-hunspell-dictionary-equivs-alist)))
+ (use-for-dicts (list dict))
+ (dict-args-cdr (cdr (ispell-parse-hunspell-affix-file dict)))
+ newlist)
+ ;; Get a list of unitialized dicts using the same affix file.
+ (dolist (dict-equiv-alist-entry ispell-hunspell-dictionary-equivs-alist)
+ (let ((dict-equiv-key (car dict-equiv-alist-entry))
+ (dict-equiv-value (cadr dict-equiv-alist-entry)))
+ (if (or (member dict dict-equiv-alist-entry)
+ (member dict-alias dict-equiv-alist-entry))
+ (dolist ( tmp-dict (list dict-equiv-key dict-equiv-value))
+ (if (cadr (assoc tmp-dict ispell-dictionary-alist))
+ (ispell-print-if-debug
+ "ispell-hfde: %s already expanded. Skipping.\n" tmp-dict)
+ (add-to-list 'use-for-dicts tmp-dict))))))
+ (ispell-print-if-debug
+ "ispell-hfde: Filling %s entry. Use for %s.\n" dict use-for-dicts)
+ ;; The final loop.
+ (dolist (entry ispell-dictionary-alist)
+ (if (member (car entry) use-for-dicts)
+ (add-to-list 'newlist
+ (append (list (car entry)) dict-args-cdr))
+ (add-to-list 'newlist entry)))
+ (setq ispell-dictionary-alist newlist))))
+
+(defun ispell-parse-hunspell-affix-file (dict-key)
+ "Parse hunspell affix file to extract parameters for `DICT-KEY'.
+Return a list in `ispell-dictionary-alist' format."
+ (let ((affix-file (cadr (assoc dict-key ispell-hunspell-dict-paths-alist))))
+ (unless affix-file
+ (error "ispell-phaf: No matching entry for %s.\n" dict-key))
+ (if (not (file-exists-p affix-file))
+ (error "ispell-phaf: File \"%s\" not found.\n" affix-file))
+ (let ((dict-name (file-name-sans-extension
+ (file-name-nondirectory affix-file)))
+ otherchars-string otherchars-list)
+ (with-temp-buffer
+ (insert-file-contents affix-file)
+ (setq otherchars-string
+ (save-excursion
+ (goto-char (point-min))
+ (if (search-forward-regexp "^WORDCHARS +" nil t )
+ (buffer-substring (point)
+ (progn (end-of-line) (point))))))
+ ;; Remove trailing whitespace and extra stuff. Make list if
+ ;; non-nil.
+ (setq otherchars-list
+ (if otherchars-string
+ (split-string
+ (if (string-match " +.*$" otherchars-string)
+ (replace-match "" nil nil otherchars-string)
+ otherchars-string)
+ "" t)))
+
+ ;; Fill dict entry
+ (list dict-key
+ "[[:alpha:]]"
+ "[^[:alpha:]]"
+ (if otherchars-list
+ (regexp-opt otherchars-list)
+ "")
+ t ; many-otherchars-p: We can't tell, set to t.
+ (list "-d" dict-name)
+ nil ; extended-char-mode: not supported by hunspell!
+ 'utf-8)))))
+
+(defun ispell-find-hunspell-dictionaries ()
+ "Look for installed hunspell dictionaries.
+Will initialize `ispell-hunspell-dictionary-alist' and
+`ispell-hunspell-dictionary-alist' after values found
+and remove `ispell-hunspell-dictionary-equivs-alist'
+entries if a specific dict was found."
+ (let ((hunspell-found-dicts
+ (split-string
+ (with-temp-buffer
+ (ispell-call-process ispell-program-name
+ null-device
+ t
+ nil
+ "-D")
+ (buffer-string))
+ "[\n\r]+"
+ t))
+ hunspell-default-dict
+ hunspell-default-dict-entry)
+ (dolist (dict hunspell-found-dicts)
+ (let* ((full-name (file-name-nondirectory dict))
+ (basename (file-name-sans-extension full-name))
+ (affix-file (concat dict ".aff")))
+ (if (string-match "\\.aff$" dict)
+ ;; Found default dictionary
+ (if hunspell-default-dict
+ (error "ispell-fhd: Default dict already defined as %s. Not using %s.\n"
+ hunspell-default-dict dict)
+ (setq affix-file dict)
+ (setq hunspell-default-dict (list basename affix-file)))
+ (if (and (not (assoc basename ispell-hunspell-dict-paths-alist))
+ (file-exists-p affix-file))
+ ;; Entry has an associated .aff file and no previous value.
+ (let ((affix-file (expand-file-name affix-file)))
+ (ispell-print-if-debug
+ "++ ispell-fhd: dict-entry:%s name:%s basename:%s affix-file:%s\n"
+ dict full-name basename affix-file)
+ (add-to-list 'ispell-hunspell-dict-paths-alist
+ (list basename affix-file)))
+ (ispell-print-if-debug
+ "-- ispell-fhd: Skipping entry: %s\n" dict)))))
+ ;; Remove entry from aliases alist if explicit dict was found.
+ (let (newlist)
+ (dolist (dict ispell-hunspell-dictionary-equivs-alist)
+ (if (assoc (car dict) ispell-hunspell-dict-paths-alist)
+ (ispell-print-if-debug
+ "-- ispell-fhd: Excluding %s alias. Standalone dict found.\n"
+ (car dict))
+ (add-to-list 'newlist dict)))
+ (setq ispell-hunspell-dictionary-equivs-alist newlist))
+ ;; Add known hunspell aliases
+ (dolist (dict-equiv ispell-hunspell-dictionary-equivs-alist)
+ (let ((dict-equiv-key (car dict-equiv))
+ (dict-equiv-value (cadr dict-equiv))
+ (exclude-aliases (list ;; Exclude TeX aliases
+ "esperanto-tex"
+ "francais7"
+ "francais-tex"
+ "norsk7-tex")))
+ (if (and (assoc dict-equiv-value ispell-hunspell-dict-paths-alist)
+ (not (assoc dict-equiv-key ispell-hunspell-dict-paths-alist))
+ (not (member dict-equiv-key exclude-aliases)))
+ (let ((affix-file (cadr (assoc dict-equiv-value
+ ispell-hunspell-dict-paths-alist))))
+ (ispell-print-if-debug "++ ispell-fhd: Adding alias %s -> %s.\n"
+ dict-equiv-key affix-file)
+ (add-to-list
+ 'ispell-hunspell-dict-paths-alist
+ (list dict-equiv-key affix-file))))))
+ ;; Parse and set values for default dictionary.
+ (setq hunspell-default-dict (car hunspell-default-dict))
+ (setq hunspell-default-dict-entry
+ (ispell-parse-hunspell-affix-file hunspell-default-dict))
+ ;; Create an alist of found dicts with only names, except for default dict.
+ (setq ispell-hunspell-dictionary-alist
+ (list (append (list nil) (cdr hunspell-default-dict-entry))))
+ (dolist (dict (mapcar 'car ispell-hunspell-dict-paths-alist))
+ (if (string= dict hunspell-default-dict)
+ (add-to-list 'ispell-hunspell-dictionary-alist
+ hunspell-default-dict-entry)
+ (add-to-list 'ispell-hunspell-dictionary-alist
+ (list dict))))))
+
;; Set params according to the selected spellchecker
(defvar ispell-last-program-name nil
@@ -1154,20 +1327,30 @@ aspell is used along with Emacs).")
(setq ispell-library-directory (ispell-check-version))
t)
(error nil))
- ispell-really-aspell
ispell-encoding8-command
ispell-emacs-alpha-regexp)
- (unless ispell-aspell-dictionary-alist
- (ispell-find-aspell-dictionaries)))
-
- ;; Substitute ispell-dictionary-alist with the list of dictionaries
- ;; corresponding to the given spellchecker. If a recent aspell, use
- ;; the list of really installed dictionaries and add to it elements
- ;; of the original list that are not present there. Allow distro info.
+ ;; auto-detection will only be used if spellchecker is not
+ ;; ispell, supports a way to set communication to UTF-8 and
+ ;; Emacs flavor supports [:alpha:]
+ (if ispell-really-aspell
+ (or ispell-aspell-dictionary-alist
+ (ispell-find-aspell-dictionaries))
+ (if ispell-really-hunspell
+ (or ispell-hunspell-dictionary-alist
+ (ispell-find-hunspell-dictionaries)))))
+
+ ;; Substitute ispell-dictionary-alist with the list of
+ ;; dictionaries corresponding to the given spellchecker.
+ ;; If a recent aspell or hunspell, use the list of really
+ ;; installed dictionaries and add to it elements of the original
+ ;; list that are not present there. Allow distro info.
(let ((found-dicts-alist
- (if (and ispell-really-aspell
- ispell-encoding8-command)
- ispell-aspell-dictionary-alist
+ (if (and ispell-encoding8-command
+ ispell-emacs-alpha-regexp)
+ (if ispell-really-aspell
+ ispell-aspell-dictionary-alist
+ (if ispell-really-hunspell
+ ispell-hunspell-dictionary-alist))
nil))
(ispell-dictionary-base-alist ispell-dictionary-base-alist)
ispell-base-dicts-override-alist ; Override only base-dicts-alist
@@ -1237,19 +1420,21 @@ aspell is used along with Emacs).")
(if ispell-emacs-alpha-regexp
(let (tmp-dicts-alist)
(dolist (adict ispell-dictionary-alist)
- (add-to-list 'tmp-dicts-alist
- (list
- (nth 0 adict) ; dict name
- "[[:alpha:]]" ; casechars
- "[^[:alpha:]]" ; not-casechars
- (nth 3 adict) ; otherchars
- (nth 4 adict) ; many-otherchars-p
- (nth 5 adict) ; ispell-args
- (nth 6 adict) ; extended-character-mode
- (if ispell-encoding8-command
- 'utf-8
- (nth 7 adict)))))
- (setq ispell-dictionary-alist tmp-dicts-alist)))))
+ (if (cadr adict) ;; Do not touch hunspell uninitialized entries
+ (add-to-list 'tmp-dicts-alist
+ (list
+ (nth 0 adict) ; dict name
+ "[[:alpha:]]" ; casechars
+ "[^[:alpha:]]" ; not-casechars
+ (nth 3 adict) ; otherchars
+ (nth 4 adict) ; many-otherchars-p
+ (nth 5 adict) ; ispell-args
+ (nth 6 adict) ; extended-character-mode
+ (if ispell-encoding8-command
+ 'utf-8
+ (nth 7 adict))))
+ (add-to-list 'tmp-dicts-alist adict)))
+ (setq ispell-dictionary-alist tmp-dicts-alist)))))
(defun ispell-valid-dictionary-list ()
"Return a list of valid dictionaries.
@@ -2602,7 +2787,10 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
(regexp-quote (buffer-substring-no-properties start end))
"\\b"))
(isearch-regexp t)
- (isearch-case-fold-search nil))
+ (isearch-case-fold-search nil)
+ (isearch-forward t)
+ (isearch-other-end start)
+ (isearch-error nil))
(isearch-lazy-highlight-new-loop
(if (boundp 'reg-start) reg-start)
(if (boundp 'reg-end) reg-end)))
@@ -2734,6 +2922,12 @@ When asynchronous processes are not supported, `run' is always returned."
Keeps argument list for future Ispell invocations for no async support."
;; `ispell-current-dictionary' and `ispell-current-personal-dictionary'
;; are properly set in `ispell-internal-change-dictionary'.
+
+ ;; Parse hunspell affix file if using hunspell and entry is uninitialized.
+ (if ispell-really-hunspell
+ (or (cadr (assoc ispell-current-dictionary ispell-dictionary-alist))
+ (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))
+
(let* ((default-directory
(if (and (file-directory-p default-directory)
(file-readable-p default-directory))
@@ -3021,29 +3215,25 @@ amount for last line processed."
(query-fcc t)
in-comment key)
(ispell-print-if-debug
- (concat
- (format
- "ispell-region: (ispell-skip-region-list):\n%s\n"
- (ispell-skip-region-list))
- (format
- "ispell-region: (ispell-begin-skip-region-regexp):\n%s\n"
- (ispell-begin-skip-region-regexp))
- "ispell-region: Search for first region to skip after (ispell-begin-skip-region-regexp)\n"))
+ "ispell-region: (ispell-skip-region-list):\n%s
+ispell-region: (ispell-begin-skip-region-regexp):\n%s
+ispell-region: Search for first region to skip after (ispell-begin-skip-region-regexp)\n"
+ (ispell-skip-region-list)
+ (ispell-begin-skip-region-regexp))
(if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t)
(progn
(setq key (match-string-no-properties 0))
(set-marker skip-region-start (- (point) (length key)))
(goto-char reg-start)
(ispell-print-if-debug
- (format "ispell-region: First skip: %s at (pos,line,column): (%s,%s,%s).\n"
- key
- (save-excursion (goto-char skip-region-start) (point))
- (line-number-at-pos skip-region-start)
- (save-excursion (goto-char skip-region-start) (current-column))))))
+ "ispell-region: First skip: %s at (pos,line,column): (%s,%s,%s).\n"
+ key
+ (save-excursion (goto-char skip-region-start) (point))
+ (line-number-at-pos skip-region-start)
+ (save-excursion (goto-char skip-region-start) (current-column)))))
(ispell-print-if-debug
- (format
- "ispell-region: Continue spell-checking with %s and %s dictionary...\n"
- program-basename dictionary))
+ "ispell-region: Continue spell-checking with %s and %s dictionary...\n"
+ program-basename dictionary)
(set-marker rstart reg-start)
(set-marker ispell-region-end reg-end)
(while (and (not ispell-quit)
@@ -3078,11 +3268,11 @@ amount for last line processed."
(- (point) (length key)))
(goto-char rstart)
(ispell-print-if-debug
- (format "ispell-region: Next skip: %s at (pos,line,column): (%s,%s,%s).\n"
- key
- (save-excursion (goto-char skip-region-start) (point))
- (line-number-at-pos skip-region-start)
- (save-excursion (goto-char skip-region-start) (current-column)))))
+ "ispell-region: Next skip: %s at (pos,line,column): (%s,%s,%s).\n"
+ key
+ (save-excursion (goto-char skip-region-start) (point))
+ (line-number-at-pos skip-region-start)
+ (save-excursion (goto-char skip-region-start) (current-column))))
(set-marker skip-region-start nil))))
(setq reg-end (max (point)
(if (marker-position skip-region-start)
@@ -3101,9 +3291,8 @@ amount for last line processed."
(string (ispell-get-line
ispell-start ispell-end add-comment)))
(ispell-print-if-debug
- (format
- "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n"
- ispell-start ispell-end (point-at-eol) in-comment add-comment string))
+ "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n"
+ ispell-start ispell-end (point-at-eol) in-comment add-comment string)
(if add-comment ; account for comment chars added
(setq ispell-start (- ispell-start (length add-comment))
add-comment nil))
@@ -3390,118 +3579,118 @@ Returns the sum SHIFT due to changes in word replacements."
(let* ((ispell-pipe-word (car poss))
(actual-point (marker-position word-start))
(actual-line (line-number-at-pos actual-point))
- (actual-column (save-excursion (goto-char actual-point) (current-column))))
+ (actual-column (save-excursion (goto-char actual-point)
+ (current-column))))
(ispell-print-if-debug
- (concat
- "ispell-process-line: Ispell misalignment error:\n"
- (format " [Word from ispell pipe]: [%s], actual (point,line,column): (%s,%s,%s)\n"
- ispell-pipe-word actual-point actual-line actual-column)))
- (error (concat "Ispell misalignment: word "
- "`%s' point %d; probably incompatible versions")
- ispell-pipe-word actual-point)))
- ;; ispell-cmd-loop can go recursive & change buffer
- (if ispell-keep-choices-win
- (setq replace (ispell-command-loop
- (car (cdr (cdr poss)))
- (car (cdr (cdr (cdr poss))))
- (car poss) (marker-position word-start)
- (+ word-len (marker-position word-start))))
- (save-window-excursion
- (setq replace (ispell-command-loop
- (car (cdr (cdr poss)))
- (car (cdr (cdr (cdr poss))))
- (car poss) (marker-position word-start)
- (+ word-len (marker-position word-start))))))
-
- (goto-char word-start)
- ;; Recheck when query replace edit changes misspelled word.
- ;; Error in tex mode when a potential math mode change exists.
- (if (and replace (listp replace) (= 2 (length replace)))
- (if (and (eq ispell-parser 'tex)
- (string-match "[\\\\][]()[]\\|\\\\begin\\|\\$"
- (regexp-quote string)))
- (error
- "Don't start query replace on a line with math characters"
- )
- (set-marker line-end (point))
- (setq ispell-filter nil
- recheck-region t)))
-
- ;; insert correction if needed
- (cond
- ((or (null replace)
- (equal 0 replace)) ; ACCEPT/INSERT
- (if (equal 0 replace) ; BUFFER-LOCAL DICT ADD
- (ispell-add-per-file-word-list (car poss)))
- ;; do not recheck accepted word on this line
- (setq accept-list (cons (car poss) accept-list)))
- (t ; replacement word selected or entered
- (delete-region (point) (+ word-len (point)))
- (if (not (listp replace))
- (progn
- (insert replace) ; insert dictionary word
- (ispell-send-replacement (car poss) replace)
- (setq accept-list (cons replace accept-list)))
- (let ((replace-word (car replace)))
- ;; Recheck hand entered replacement word
- (insert replace-word)
- (ispell-send-replacement (car poss) replace-word)
- (if (car (cdr replace))
- (save-window-excursion
- (delete-other-windows) ; to correctly show help.
- ;; Assume case-replace &
- ;; case-fold-search correct?
- (query-replace (car poss) (car replace) t)))
- (goto-char word-start)
- ;; do not recheck if already accepted
- (if (member replace-word accept-list)
- (setq accept-list (cons replace-word accept-list)
- replace replace-word)
- (let ((region-end (copy-marker ispell-region-end)))
- (setq recheck-region ispell-filter
- ispell-filter nil ; save filter
- shift 0 ; already accounted
- shift (ispell-region
- word-start
- (+ word-start (length replace-word))
- t shift))
- (if (null shift) ; quitting check.
- (setq shift 0))
- (set-marker ispell-region-end region-end)
- (set-marker region-end nil)
- (setq ispell-filter recheck-region
- recheck-region nil
- replace replace-word)))))
-
- (setq shift (+ shift (- (length replace) word-len)))
-
- ;; Move line-start across word...
- ;; new shift function does this now...
- ;;(set-marker line-start (+ line-start
- ;; (- (length replace)
- ;; (length (car poss)))))
- ))
- (if (not ispell-quit)
+ "ispell-process-line: Ispell misalignment error:
+ [Word from ispell pipe]: [%s], actual (point,line,column): (%s,%s,%s)\n"
+ ispell-pipe-word actual-point actual-line actual-column)
+ (error (concat "Ispell misalignment: word "
+ "`%s' point %d; probably incompatible versions")
+ ispell-pipe-word actual-point)))
+ ;; ispell-cmd-loop can go recursive & change buffer
+ (if ispell-keep-choices-win
+ (setq replace (ispell-command-loop
+ (car (cdr (cdr poss)))
+ (car (cdr (cdr (cdr poss))))
+ (car poss) (marker-position word-start)
+ (+ word-len (marker-position word-start))))
+ (save-window-excursion
+ (setq replace (ispell-command-loop
+ (car (cdr (cdr poss)))
+ (car (cdr (cdr (cdr poss))))
+ (car poss) (marker-position word-start)
+ (+ word-len (marker-position word-start))))))
+
+ (goto-char word-start)
+ ;; Recheck when query replace edit changes misspelled word.
+ ;; Error in tex mode when a potential math mode change exists.
+ (if (and replace (listp replace) (= 2 (length replace)))
+ (if (and (eq ispell-parser 'tex)
+ (string-match "[\\\\][]()[]\\|\\\\begin\\|\\$"
+ (regexp-quote string)))
+ (error
+ "Don't start query replace on a line with math characters"
+ )
+ (set-marker line-end (point))
+ (setq ispell-filter nil
+ recheck-region t)))
+
+ ;; Insert correction if needed.
+ (cond
+ ((or (null replace)
+ (equal 0 replace)) ; ACCEPT/INSERT
+ (if (equal 0 replace) ; BUFFER-LOCAL DICT ADD
+ (ispell-add-per-file-word-list (car poss)))
+ ;; Do not recheck accepted word on this line.
+ (setq accept-list (cons (car poss) accept-list)))
+ (t ; Replacement word selected or entered.
+ (delete-region (point) (+ word-len (point)))
+ (if (not (listp replace))
+ (progn
+ (insert replace) ; Insert dictionary word.
+ (ispell-send-replacement (car poss) replace)
+ (setq accept-list (cons replace accept-list)))
+ (let ((replace-word (car replace)))
+ ;; Recheck hand entered replacement word.
+ (insert replace-word)
+ (ispell-send-replacement (car poss) replace-word)
+ (if (car (cdr replace))
+ (save-window-excursion
+ (delete-other-windows) ; to correctly show help.
+ ;; Assume case-replace &
+ ;; case-fold-search correct?
+ (query-replace (car poss) (car replace) t)))
+ (goto-char word-start)
+ ;; Do not recheck if already accepted.
+ (if (member replace-word accept-list)
+ (setq accept-list (cons replace-word accept-list)
+ replace replace-word)
+ (let ((region-end (copy-marker ispell-region-end)))
+ (setq recheck-region ispell-filter
+ ispell-filter nil ; Save filter.
+ shift 0 ; Already accounted.
+ shift (ispell-region
+ word-start
+ (+ word-start (length replace-word))
+ t shift))
+ (if (null shift) ; Quitting check.
+ (setq shift 0))
+ (set-marker ispell-region-end region-end)
+ (set-marker region-end nil)
+ (setq ispell-filter recheck-region
+ recheck-region nil
+ replace replace-word)))))
+
+ (setq shift (+ shift (- (length replace) word-len)))
+
+ ;; Move line-start across word...
+ ;; new shift function does this now...
+ ;;(set-marker line-start (+ line-start
+ ;; (- (length replace)
+ ;; (length (car poss)))))
+ ))
+ (if (not ispell-quit)
;; FIXME: remove redundancy with identical code above.
- (let (message-log-max)
- (message
+ (let (message-log-max)
+ (message
"Continuing spelling check using %s with %s dictionary..."
(file-name-nondirectory ispell-program-name)
(or ispell-current-dictionary "default"))))
- (sit-for 0)
- (setq ispell-start (marker-position line-start)
- ispell-end (marker-position line-end))
- ;; Adjust markers when end of region lost from highlighting.
- (if (and (not recheck-region)
+ (sit-for 0)
+ (setq ispell-start (marker-position line-start)
+ ispell-end (marker-position line-end))
+ ;; Adjust markers when end of region lost from highlighting.
+ (if (and (not recheck-region)
(< ispell-end (+ word-start word-len)))
- (setq ispell-end (+ word-start word-len)))
- (if (= word-start ispell-region-end)
- (set-marker ispell-region-end (+ word-start word-len)))
- ;; going out of scope - unneeded
- (set-marker line-start nil)
- (set-marker word-start nil)
- (set-marker line-end nil)))
- ;; finished with misspelling!
+ (setq ispell-end (+ word-start word-len)))
+ (if (= word-start ispell-region-end)
+ (set-marker ispell-region-end (+ word-start word-len)))
+ ;; Going out of scope - unneeded.
+ (set-marker line-start nil)
+ (set-marker word-start nil)
+ (set-marker line-end nil)))
+ ;; Finished with misspelling!
(setq ispell-filter (cdr ispell-filter)))
shift))
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 4e17af1acb4..e773b53a73f 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -379,8 +379,8 @@ the number of paragraphs marked equals ARG.
If ARG is negative, point is put at end of this paragraph, mark is put
at beginning of this or a previous paragraph.
-Interactively, if this command is repeated
-or (in Transient Mark mode) if the mark is active,
+Interactively (or if ALLOW-EXTEND is non-nil), if this command is
+repeated or (in Transient Mark mode) if the mark is active,
it marks the next ARG paragraphs after the ones already marked."
(interactive "p\np")
(unless arg (setq arg 1))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index a41409fc897..d5bb0170cd9 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2464,7 +2464,7 @@ information about your RefTeX version and configuration."
(require 'reporter)
(let ((reporter-prompt-for-summary-p "Bug report subject: "))
(reporter-submit-bug-report
- "bug-auctex@gnu.org"
+ "bug-auctex@gnu.org, bug-gnu-emacs@gnu.org"
reftex-version
(list 'window-system
'reftex-plug-into-AUCTeX)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index b7288772034..33dfa277330 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -46,9 +46,26 @@
:type 'integer
:group 'sgml)
+(defcustom sgml-xml-mode nil
+ "When non-nil, tag insertion functions will be XML-compliant.
+It is set to be buffer-local when the file has
+a DOCTYPE or an XML declaration."
+ :type 'boolean
+ :version "22.1"
+ :group 'sgml)
+
(defcustom sgml-transformation-function 'identity
"Default value for `skeleton-transformation-function' in SGML mode."
:type 'function
+ :initialize 'custom-initialize-default
+ :set (lambda (sym val)
+ (set-default sym val)
+ (mapc (lambda (buff)
+ (with-current-buffer buff
+ (and (derived-mode-p 'sgml-mode)
+ (not sgml-xml-mode)
+ (setq skeleton-transformation-function val))))
+ (buffer-list)))
:group 'sgml)
(put 'sgml-transformation-function 'variable-interactive
@@ -295,8 +312,8 @@ Any terminating `>' or `/' is not matched.")
(defconst sgml-syntax-propertize-function
(syntax-propertize-rules
- ;; Use the `b' style of comments to avoid interference with the -- ... --
- ;; comments recognized when `sgml-specials' includes ?-.
+ ;; Use the `b' style of comments to avoid interference with the -- ... --
+ ;; comments recognized when `sgml-specials' includes ?-.
;; FIXME: beware of <!--> blabla <!--> !!
("\\(<\\)!--" (1 "< b"))
("--[ \t\n]*\\(>\\)" (1 "> b"))
@@ -305,7 +322,7 @@ Any terminating `>' or `/' is not matched.")
;; going to change, so as not to need to flush the data we just computed.
("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0))))
(goto-char (match-end 0)))
- "."))))
+ (string-to-syntax ".")))))
"Syntactic keywords for `sgml-mode'.")
;; internal
@@ -364,14 +381,6 @@ an optional alist of possible values."
(string :tag "Description")))
:group 'sgml)
-(defcustom sgml-xml-mode nil
- "When non-nil, tag insertion functions will be XML-compliant.
-It is set to be buffer-local when the file has
-a DOCTYPE or an XML declaration."
- :type 'boolean
- :version "22.1"
- :group 'sgml)
-
(defvar sgml-empty-tags nil
"List of tags whose !ELEMENT definition says EMPTY.")
@@ -635,10 +644,8 @@ This only works for Latin-1 input."
(define-skeleton sgml-tag
"Prompt for a tag and insert it, optionally with attributes.
Completion and configuration are done according to `sgml-tag-alist'.
-If you like tags and attributes in uppercase do \\[set-variable]
-`skeleton-transformation-function' RET `upcase' RET, or put this
-in your `.emacs':
- (setq sgml-transformation-function 'upcase)"
+If you like tags and attributes in uppercase, customize
+`sgml-transformation-function' to 'upcase."
(funcall (or skeleton-transformation-function 'identity)
(setq sgml-tag-last
(completing-read
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 480ab8a581a..7b16262233d 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -271,9 +271,7 @@ otherwise the value of `tex-start-options', the \(shell-quoted\)
value of `tex-start-commands', and the file name are added at the end
with blanks as separators.
-In TeX, LaTeX, and SliTeX Mode this variable becomes buffer local.
-In these modes, use \\[set-variable] if you want to change it for the
-current buffer.")
+In TeX, LaTeX, and SliTeX Mode this variable becomes buffer local.")
(defvar tex-trailer nil
"String appended after the end of a region sent to TeX by \\[tex-region].")
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 940457b6cc0..d9224b29c2e 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -821,9 +821,11 @@ If the OLD prefix arg is passed, tell the file NAME of the old file."
(progn (diff-hunk-prev) (point))
(error (point-min)))))
(header-files
- (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)")
- (list (if old (match-string 1) (match-string 3))
- (if old (match-string 3) (match-string 1)))
+ ;; handle filenames with spaces;
+ ;; cf. diff-font-lock-keywords / diff-file-header-face
+ (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)")
+ (list (if old (match-string 1) (match-string 2))
+ (if old (match-string 2) (match-string 1)))
(forward-line 1) nil)))
(delq nil
(append
@@ -832,6 +834,7 @@ If the OLD prefix arg is passed, tell the file NAME of the old file."
(re-search-backward "^Index: \\(.+\\)" limit t)))
(list (match-string 1)))
header-files
+ ;; this assumes that there are no spaces in filenames
(when (re-search-backward
"^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?"
nil t)
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index fd53aabd33c..81146c0c931 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -4024,7 +4024,7 @@ Mail anyway? (y or n) ")
(set-buffer ctl-buf))
(setq buffer-name (buffer-name))
(require 'reporter)
- (reporter-submit-bug-report "kifer@cs.stonybrook.edu"
+ (reporter-submit-bug-report "kifer@cs.stonybrook.edu, bug-gnu-emacs@gnu.org"
(ediff-version)
varlist
nil
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 5880d4f4545..0152f29326b 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -18,13 +18,16 @@ AC_DEFUN([gl_EXTERN_INLINE],
_GL_INLINE_HEADER_END contains useful stuff to put
in the same include file, after uses of _GL_INLINE.
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
Suppress the use of extern inline on Apple's platforms,
as Libc-825.25 (2012-09-19) is incompatible with it; see
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
#if ((__GNUC__ \
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__) \
+ : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \
&& !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index a7987120c50..6c3012d827f 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -271,6 +271,7 @@ AC_DEFUN([gl_INIT],
gl_FUNC_PUTENV
if test $REPLACE_PUTENV = 1; then
AC_LIBOBJ([putenv])
+ gl_PREREQ_PUTENV
fi
gl_STDLIB_MODULE_INDICATOR([putenv])
gl_FUNC_READLINK
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index 9de53527a73..03ed4f97dbe 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -48,3 +48,9 @@ AC_DEFUN([gl_FUNC_PUTENV],
;;
esac
])
+
+# Prerequisites of lib/putenv.c.
+AC_DEFUN([gl_PREREQ_PUTENV],
+[
+ AC_CHECK_FUNCS([_putenv])
+])
diff --git a/nt/ChangeLog b/nt/ChangeLog
index a8bb8c74c91..fab143fcddc 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-25 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/ms-w32.h (BOOT_TIME_FILE): Define.
+
+ * config.nt (CLASH_DETECTION): Define to 1.
+
2013-02-16 Eli Zaretskii <eliz@gnu.org>
* inc/ms-w32.h (__STDC__): Fiddle with value only for MSVC.
diff --git a/nt/config.nt b/nt/config.nt
index 61e56174bb4..cc4e91d9af0 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -75,7 +75,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you want lock files to be written, so that Emacs can tell
instantly when you try to modify a file that someone else has modified in
his/her Emacs. */
-#undef CLASH_DETECTION
+#define CLASH_DETECTION 1
/* Short copyright string for this version of Emacs. */
#define COPYRIGHT "Copyright (C) 2013 Free Software Foundation, Inc."
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 66f586a4f76..9473fbe3ca6 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -70,6 +70,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define HAVE___BUILTIN_UNWIND_INIT 1
#endif
+/* This isn't perfect, as some systems might have the page file in
+ another place. Also, I suspect that the time stamp of that file
+ might also change when Windows enlarges the file due to
+ insufficient VM. Still, this seems to be the most reliable way;
+ the alternative (of using GetSystemTimes) won't work on laptops
+ that hibernate, because the system clock is stopped then. Other
+ possibility would be to run "net statistics workstation" and parse
+ the output, but that's gross. So this should do; if the file is
+ not there, the boot time will be returned as zero, and filelock.c
+ already handles that. */
+#define BOOT_TIME_FILE "C:/pagefile.sys"
+
/* ============================================================ */
/* Here, add any special hacks needed to make Emacs work on this
diff --git a/src/ChangeLog b/src/ChangeLog
index e945e221593..adff00f7189 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,231 @@
+2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
+ The old approach, which fell back on DIR/.#FILE.0 through
+ DIR/.#FILE.9, had race conditions that could not be easily fixed.
+ If DIR/.#FILE is a non-symlink file, Emacs now does not create a
+ lock file for DIR/FILE; that is, DIR/FILE is no longer partly
+ protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
+ because the locking mechanism was never reliable in that case).
+ This patch fixes this and other bugs discovered by a code
+ inspection that was prompted by
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
+ Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
+ to avoid interoperability problems between the MS-Windows and
+ non-MS-Windows implementations. MS-Windows and non-MS-Windows
+ instances of Emacs now ignore each others' locks.
+ * filelock.c (defined_WINDOWSNT): New constant.
+ (MAKE_LOCK_NAME, fill_in_lock_file_name):
+ Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
+ DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
+ regular files on MS-Windows hosts.
+ (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
+ Use SAFE_ALLOCA to avoid problems with long file names.
+ (MAX_LFINFO): Now a local constant, not a global macro.
+ (IS_LOCK_FILE): Remove.
+ (lock_file_1): Don't inspect errno if symlink call succeeds;
+ that's not portable.
+ (lock_file): Document that this function can return if lock
+ creation fails.
+ (lock_file): Don't access freed storage.
+
+2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
+
+ * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
+
+2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * textprop.c: Use bool for booleans.
+ (validate_interval_range, Fadd_text_properties)
+ (Fremove_text_properties): Prefer bool to int when either works.
+
+2013-03-02 Eli Zaretskii <eliz@gnu.org>
+
+ * textprop.c (Fadd_text_properties, Fremove_text_properties): If
+ the interval tree changes as a side effect of calling
+ modify_region, re-do processing starting from the call to
+ validate_interval_range. (Bug#13743)
+
+2013-02-28 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
+ (Bug#13546).
+
+2013-02-27 Eli Zaretskii <eliz@gnu.org>
+
+ * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
+ _SH_DENYRW flag, instead of emacs_open, to deny any other process
+ access to the lock file until it is written and closed.
+ (Bug#13807)
+
+2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * callint.c (Qcall_interactively):
+ * macros.c (Qexecute_kbd_macro):
+ Now static.
+
+2013-02-26 Bastien Guerry <bzg@gnu.org>
+
+ * window.c (Frecenter): Tiny docstring enhancement.
+
+2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor textprop integer cleanup.
+ * intervals.h, textprop.c (add_text_properties_from_list):
+ Return void, not int, since nobody uses the return value.
+ * textprop.c (validate_plist, add_properties, remove_properties)
+ (Fadd_text_properties):
+ Don't assume list length fits in int.
+ (interval_has_all_properties, interval_has_some_properties)
+ (interval_has_some_properties_list, add_properties, remove_properties)
+ (Fadd_text_properties, Fremove_text_properties)
+ (Fremove_list_of_text_properties, text_property_stickiness):
+ Use bool for booleans.
+ (Fadd_text_properties, Fremove_text_properties):
+ (Fremove_list_of_text_properties):
+ Reindent do-while as per GNU style.
+
+2013-02-25 Eli Zaretskii <eliz@gnu.org>
+
+ Implement CLASH_DETECTION for MS-Windows.
+
+ * filelock.c [WINDOWSNT]: Include w32.h.
+ (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
+ function of that name. Up-case the macro arguments.
+ (IS_LOCK_FILE): New macro.
+ (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
+ (create_lock_file): New function, with body extracted from
+ lock_file_1.
+ [WINDOWSNT]: Implement lock files by writing a regular file with
+ the lock information as its contents.
+ (read_lock_data): New function, on Posix platforms just calls
+ emacs_readlinkat.
+ [WINDOWSNT]: Read the lock info from the file.
+ (current_lock_owner): Call read_lock_data instead of calling
+ emacs_readlinkat directly.
+ (lock_file) [WINDOWSNT]: Run the file name through
+ dostounix_filename.
+
+ * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
+ just check if the process by that PID exists.
+
+ * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
+ also present, as doing so will fail to error out if the file
+ already exists.
+
+ * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
+
+ * textprop.c (Fadd_text_properties, Fremove_text_properties)
+ (Fremove_list_of_text_properties): Skip all of the intervals in
+ the region between START and END that already have resp. don't
+ have the requested properties, not just the first one. Add
+ assertions that the loop afterwards always modifies the
+ properties. (Bug#13743)
+
+2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * callint.c (Fcall_interactively): Use the right lexical environment
+ for `interactive' specs (bug#13811).
+ * eval.c (Feval): Accept a lexical environment.
+
+2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Simplify data_start configuration (Bug#13783).
+ This is a followon simplification to the fix for Bug#13650.
+ * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
+ (START_FILES): Remove. All uses removed.
+ (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
+ (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
+ (buildobj.h): Use it.
+ ($(ALLOBJS)): Depend on globals.h.
+ (temacs$(EXEEXT)): Use $(ALLOBJS).
+ * autodeps.mk (ALLOBJS): Move to Makefile.in.
+ * deps.mk (vm-limit.o):
+ * makefile.w32-in ($(BLD)/vm-limit.$(O)):
+ Do not depend on mem-limits.h.
+ * emacs.c (__do_global_ctors, __do_global_ctors_aux)
+ (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
+ [__GNUC__ && !ORDINARY_LINK]: Remove.
+ * mem-limits.h, pre-crt0.c: Remove.
+ * unexaix.c, unexcoff.c: Don't include mem-limits.h.
+ * unexcoff.c (etext): New decl.
+ (make_hdr): Use DATA_START instead of start_of_data.
+ * vm-limit.c: Move most of mem-limits.h's contents here.
+ (data_start): New decl. It's OK if this is approximate,
+ so simplify-away some unnecessary exactness.
+ (POINTER): Remove; all uses removed.
+ (data_space_start): Now char *, to avoid casts.
+ (exceeds_lisp_ptr): New function, replacing the old
+ EXCEEDS_LISP_PTR macro. All uses changed.
+ (check_memory_limits): Simplify and remove casts.
+ (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
+ (memory_warnings): Use data_start instead of start_of_data.
+
+2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
+
+ * xdisp.c (set_message): Only check for debug-on-message if STRING
+ is a string. (Bug#13797)
+
+2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix regression introduced by July 10 filelock.c patch.
+ * filelock.c (fill_in_lock_file_name): Fix crash caused by the
+ 2012-07-10 patch to this file. Reported by Eli Zaretskii in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
+ and diagnosed by Andreas Schwab in
+ <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
+
+2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ Assume C89 or better.
+ * ralloc.c (SIZE, POINTER, NIL):
+ * vm-limit.c (POINTER):
+ Remove, replacing all uses with C89 equivalents. These old
+ symbols were present only for porting to pre-C89 platforms.
+
+2013-02-22 Claudio Bley <claudio.bley@gmail.com>
+
+ * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
+ This avoids warning messages reported as part of Bug#13546.
+
+2013-02-21 Ken Brown <kbrown@cornell.edu>
+
+ * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
+
+2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * sheap.c (report_sheap_usage): Prefer message1_nolog.
+
+ * keyboard.c (Qcommand_execute): New var.
+ (command_loop_1, read_char): Use it.
+ (Fcommand_execute): Remove, replace by an Elisp implementation.
+ (syms_of_keyboard): Adjust accordingly.
+
+2013-02-19 Daniel Colascione <dancol@dancol.org>
+
+ * sheap.c (report_sheap_usage): Use message, not message1, so
+ that we don't try to create a buffer while we're in the middle
+ of dumping Emacs. Explain why.
+
+2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
+ * search.c (find_newline): Return byte position in bytepos.
+ Adjust comment.
+ (find_next_newline_no_quit, find_before_next_newline):
+ Add bytepos argument.
+ * lisp.h (find_newline, find_next_newline_no_quit)
+ (find_before_next_newline): Adjust prototypes.
+ * bidi.c (bidi_find_paragraph_start):
+ * editfns.c (Fconstrain_to_field, Fline_end_position):
+ * indent.c (compute_motion, vmotion):
+ * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
+ (get_visually_first_element, move_it_vertically_backward):
+ Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
+
+2013-02-19 Eli Zaretskii <eliz@gnu.org>
+
+ * w32proc.c (new_child): Avoid leaking handles if the subprocess
+ resources were not orderly released.
+
2013-02-17 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (x_draw_vertical_border): For a window that is neither
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index c878c48a4f4..508a2a9dd4c 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -19171,7 +19171,7 @@
* coding.c (code_convert_region_unwind):
Set Vlast_coding_system_used to the argument.
(code_convert_region): If post-read-conversion function changed
- the value of last-coding-sytem, keep the new value in
+ the value of last-coding-system, keep the new value in
coding->symbol so that it won't be overridden.
(run_pre_post_conversion_on_str): Likewise.
(coding_system_accept_latin_extra_p): New function.
diff --git a/src/Makefile.in b/src/Makefile.in
index 6ee03177861..b2034a3379d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -36,7 +36,6 @@ WINDRES = @WINDRES@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
-LD_FIRSTFLAG=@LD_FIRSTFLAG@
EXEEXT = @EXEEXT@
version = @version@
# Substitute an assignment for the MAKE variable, because
@@ -102,10 +101,8 @@ LD_SWITCH_X_SITE_RPATH=@LD_SWITCH_X_SITE_RPATH@
## System-specific LDFLAGS.
LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
-## This holds any special options for linking temacs only (ie, not
-## used by configure). Not used elsewhere because it sometimes
-## contains options that have to do with using Emacs's crt0,
-## which are only good with temacs.
+## This holds any special options for linking temacs only (i.e., not
+## used by configure).
LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
## Flags to pass to ld only for temacs.
@@ -120,14 +117,6 @@ PAXCTL = @PAXCTL@
## Some systems define this to request special libraries.
LIBS_SYSTEM=@LIBS_SYSTEM@
-## Where to find libgcc.a, if using gcc and necessary.
-LIB_GCC=@LIB_GCC@
-
-CRT_DIR=@CRT_DIR@
-## May use $CRT_DIR.
-LIB_STANDARD=@LIB_STANDARD@
-START_FILES = @START_FILES@
-
## -lm, or empty.
LIB_MATH=@LIB_MATH@
@@ -389,17 +378,16 @@ POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
## List of object files that make-docfile should not be told about.
otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
- $(POST_ALLOC_OBJ) $(VMLIMIT_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
+ $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
+## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
+ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj)
## Configure inserts the file lisp.mk at this point, defining $lisp.
@lisp_frag@
## Construct full set of libraries to be linked.
-## Note that SunOS needs -lm to come before -lc; otherwise, you get
-## duplicated symbols. If the standard libraries were compiled
-## with GCC, we might need LIB_GCC again after them.
LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBX_OTHER) $(LIBSOUND) \
$(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \
@@ -409,7 +397,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
$(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
$(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
$(LIBACL_LIBS) $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
- $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
+ $(LIB_MATH)
all: emacs$(EXEEXT) $(OTHER_FILES)
.PHONY: all
@@ -456,7 +444,7 @@ $(libsrc)/make-docfile$(EXEEXT):
cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
buildobj.h: Makefile
- echo "#define BUILDOBJ \"$(obj) $(otherobj) " "\"" > buildobj.h
+ echo "#define BUILDOBJ \"$(ALLOBJS) " "\"" >$@
globals.h: gl-stamp; @true
@@ -468,15 +456,15 @@ gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
$(srcdir)/../build-aux/move-if-change gl-tmp globals.h
echo timestamp > $@
-$(obj) $(otherobj): globals.h
+$(ALLOBJS): globals.h
$(lib)/libgnu.a: $(config_h)
cd $(lib) && $(MAKE) libgnu.a
-temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
+temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
$(lib)/libgnu.a $(W32_RES)
- $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
- -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
+ $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
+ -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES) \
$(W32_RES_LINK)
test "$(CANNOT_DUMP)" = "yes" || \
test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
diff --git a/src/autodeps.mk b/src/autodeps.mk
index fb0e21366c7..8b014a7508c 100644
--- a/src/autodeps.mk
+++ b/src/autodeps.mk
@@ -2,5 +2,4 @@
## This is inserted in src/Makefile if AUTO_DEPEND=yes.
-ALLOBJS=$(START_FILES) ${obj} ${otherobj}
-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
diff --git a/src/bidi.c b/src/bidi.c
index db2e48a2ca7..364d7e500ba 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1104,14 +1104,11 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte)
while (pos_byte > BEGV_BYTE
&& n++ < MAX_PARAGRAPH_SEARCH
&& fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0)
- {
- /* FIXME: What if the paragraph beginning is covered by a
- display string? And what if a display string covering some
- of the text over which we scan back includes
- paragraph_start_re? */
- pos = find_next_newline_no_quit (pos - 1, -1);
- pos_byte = CHAR_TO_BYTE (pos);
- }
+ /* FIXME: What if the paragraph beginning is covered by a
+ display string? And what if a display string covering some
+ of the text over which we scan back includes
+ paragraph_start_re? */
+ pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte);
if (n >= MAX_PARAGRAPH_SEARCH)
pos_byte = BEGV_BYTE;
return pos_byte;
diff --git a/src/callint.c b/src/callint.c
index 3e295a3b26b..212dd2e3d62 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -29,7 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keymap.h"
Lisp_Object Qminus, Qplus;
-Lisp_Object Qcall_interactively;
+static Lisp_Object Qcall_interactively;
static Lisp_Object Qcommand_debug_status;
static Lisp_Object Qenable_recursive_minibuffers;
@@ -342,8 +342,8 @@ invoke it. If KEYS is omitted or nil, the return value of
/* Compute the arg values using the user's expression. */
GCPRO2 (input, filter_specs);
specs = Feval (specs,
- CONSP (funval) && EQ (Qclosure, XCAR (funval))
- ? Qt : Qnil);
+ CONSP (funval) && EQ (Qclosure, XCAR (funval))
+ ? CAR_SAFE (XCDR (funval)) : Qnil);
UNGCPRO;
if (events != num_input_events || !NILP (record_flag))
{
diff --git a/src/deps.mk b/src/deps.mk
index 47185c9262c..83444474c59 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -144,7 +144,7 @@ macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h msdos.h \
dispextern.h lisp.h globals.h $(config_h) systime.h coding.h composite.h
gmalloc.o: gmalloc.c $(config_h)
ralloc.o: ralloc.c lisp.h $(config_h)
-vm-limit.o: vm-limit.c mem-limits.h lisp.h globals.h $(config_h)
+vm-limit.o: vm-limit.c lisp.h globals.h $(config_h)
marker.o: marker.c buffer.h character.h lisp.h globals.h $(config_h)
minibuf.o: minibuf.c syntax.h frame.h window.h keyboard.h systime.h \
buffer.h commands.h character.h msdos.h $(INTERVALS_H) keymap.h \
diff --git a/src/editfns.c b/src/editfns.c
index bee0bcc158d..831c8359fab 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -736,7 +736,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
FIELD_BOUND are on the same line by seeing whether
there's an intervening newline or not. */
|| (find_newline (XFASTINT (new_pos), XFASTINT (field_bound),
- fwd ? -1 : 1, &shortage, 1),
+ fwd ? -1 : 1, &shortage, NULL, 1),
shortage != 0)))
/* Constrain NEW_POS to FIELD_BOUND. */
new_pos = field_bound;
@@ -821,7 +821,8 @@ This function does not move point. */)
CHECK_NUMBER (n);
clipped_n = clip_to_bounds (PTRDIFF_MIN + 1, XINT (n), PTRDIFF_MAX);
- end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0));
+ end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0),
+ NULL);
/* Return END_POS constrained to the current input field. */
return Fconstrain_to_field (make_number (end_pos), make_number (orig),
diff --git a/src/emacs.c b/src/emacs.c
index c494dff8cac..b96076b1340 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -521,32 +521,6 @@ DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory,
static char const dump_tz[] = "UtC0";
#endif
-#ifndef ORDINARY_LINK
-/* We don't include crtbegin.o and crtend.o in the link,
- so these functions and variables might be missed.
- Provide dummy definitions to avoid error.
- (We don't have any real constructors or destructors.) */
-#ifdef __GNUC__
-
-/* Define a dummy function F. Declare F too, to pacify gcc
- -Wmissing-prototypes. */
-#define DEFINE_DUMMY_FUNCTION(f) \
- void f (void) ATTRIBUTE_CONST EXTERNALLY_VISIBLE; void f (void) {}
-
-#ifndef GCC_CTORS_IN_LIBC
-DEFINE_DUMMY_FUNCTION (__do_global_ctors)
-DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
-DEFINE_DUMMY_FUNCTION (__do_global_dtors)
-/* GNU/Linux has a bug in its library; avoid an error. */
-#ifndef GNU_LINUX
-char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
-#endif
-char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
-#endif /* GCC_CTORS_IN_LIBC */
-DEFINE_DUMMY_FUNCTION (__main)
-#endif /* __GNUC__ */
-#endif /* ORDINARY_LINK */
-
/* Test whether the next argument in ARGV matches SSTR or a prefix of
LSTR (at least MINLEN characters). If so, then if VALPTR is non-null
(the argument is supposed to have a value) store in *VALPTR either
diff --git a/src/eval.c b/src/eval.c
index 030bf14bcea..5db6f9d0bf3 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1898,7 +1898,7 @@ If LEXICAL is t, evaluate using lexical scoping. */)
{
ptrdiff_t count = SPECPDL_INDEX ();
specbind (Qinternal_interpreter_environment,
- NILP (lexical) ? Qnil : Fcons (Qt, Qnil));
+ CONSP (lexical) || NILP (lexical) ? lexical : Fcons (Qt, Qnil));
return unbind_to (count, eval_sub (form));
}
diff --git a/src/filelock.c b/src/filelock.c
index 228fe98e8c7..14b9d4aaca5 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -43,6 +43,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "buffer.h"
#include "coding.h"
#include "systime.h"
+#ifdef WINDOWSNT
+#include <share.h>
+#include "w32.h" /* for dostounix_filename */
+#endif
#ifdef CLASH_DETECTION
@@ -60,7 +64,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define WTMP_FILE "/var/log/wtmp"
#endif
-/* The strategy: to lock a file FN, create a symlink .#FN in FN's
+/* On non-MS-Windows systems, use a symbolic link to represent a lock.
+ The strategy: to lock a file FN, create a symlink .#FN in FN's
directory, with link data `user@host.pid'. This avoids a single
mount (== failure) point for lock files.
@@ -93,7 +98,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
has contributed this implementation for Emacs), and was designed by
Ethan Jacobson, Kimbo Mundy, and others.
- --karl@cs.umb.edu/karl@hq.ileaf.com. */
+ --karl@cs.umb.edu/karl@hq.ileaf.com.
+
+ On MS-Windows, symbolic links do not work well, so instead of a
+ symlink .#FN -> 'user@host.pid', the lock is a regular file .#-FN
+ with contents 'user@host.pid'. MS-Windows and non-MS-Windows
+ versions of Emacs ignore each other's locks. */
/* Return the time of the last system boot. */
@@ -287,46 +297,79 @@ typedef struct
/* Free the two dynamically-allocated pieces in PTR. */
#define FREE_LOCK_INFO(i) do { xfree ((i).user); xfree ((i).host); } while (0)
+#ifdef WINDOWSNT
+enum { defined_WINDOWSNT = 1 };
+#else
+enum { defined_WINDOWSNT = 0 };
+#endif
-/* Write the name of the lock file for FN into LFNAME. Length will be
- that of FN plus two more for the leading `.#' plus 1 for the
- trailing period plus one for the digit after it plus one for the
- null. */
-#define MAKE_LOCK_NAME(lock, file) \
- (lock = alloca (SBYTES (file) + 2 + 1 + 1 + 1), \
- fill_in_lock_file_name (lock, (file)))
+/* Write the name of the lock file for FNAME into LOCKNAME. Length
+ will be that of FNAME plus two more for the leading ".#",
+ plus one for "-" if MS-Windows, plus one for the null. */
+#define MAKE_LOCK_NAME(lockname, fname) \
+ (lockname = SAFE_ALLOCA (SBYTES (fname) + 2 + defined_WINDOWSNT + 1), \
+ fill_in_lock_file_name (lockname, fname))
static void
-fill_in_lock_file_name (register char *lockfile, register Lisp_Object fn)
+fill_in_lock_file_name (char *lockfile, Lisp_Object fn)
{
- ptrdiff_t length = SBYTES (fn);
- register char *p;
- struct stat st;
- int count = 0;
-
- strcpy (lockfile, SSDATA (fn));
-
- /* Shift the nondirectory part of the file name (including the null)
- right two characters. Here is one of the places where we'd have to
- do something to support 14-character-max file names. */
- for (p = lockfile + length; p != lockfile && *p != '/'; p--)
- p[2] = *p;
+ char *last_slash = memrchr (SSDATA (fn), '/', SBYTES (fn));
+ char *base = last_slash + 1;
+ ptrdiff_t dirlen = base - SSDATA (fn);
+ memcpy (lockfile, SSDATA (fn), dirlen);
+ lockfile[dirlen] = '.';
+ lockfile[dirlen + 1] = '#';
+ if (defined_WINDOWSNT)
+ lockfile[dirlen + 2] = '-';
+ strcpy (lockfile + dirlen + 2 + defined_WINDOWSNT, base);
+}
- /* Insert the `.#'. */
- p[1] = '.';
- p[2] = '#';
+static int
+create_lock_file (char *lfname, char *lock_info_str, bool force)
+{
+ int err;
- p = p + length + 2;
+#ifdef WINDOWSNT
+ /* Symlinks are supported only by latest versions of Windows, and
+ creating them is a privileged operation that often triggers UAC
+ elevation prompts. Therefore, instead of using symlinks, we
+ create a regular file with the lock info written as its
+ contents. */
+ {
+ /* Deny everybody else any kind of access to the file until we are
+ done writing it and close the handle. This makes the entire
+ open/write/close operation atomic, as far as other WINDOWSNT
+ processes are concerned. */
+ int fd = _sopen (lfname,
+ _O_WRONLY | _O_BINARY | _O_CREAT | _O_EXCL | _O_NOINHERIT,
+ _SH_DENYRW, S_IREAD | S_IWRITE);
+
+ if (fd < 0 && errno == EEXIST && force)
+ fd = _sopen (lfname, _O_WRONLY | _O_BINARY | _O_TRUNC |_O_NOINHERIT,
+ _SH_DENYRW, S_IREAD | S_IWRITE);
+ if (fd >= 0)
+ {
+ ssize_t lock_info_len = strlen (lock_info_str);
- while (lstat (lockfile, &st) == 0 && !S_ISLNK (st.st_mode))
+ err = 0;
+ if (emacs_write (fd, lock_info_str, lock_info_len) != lock_info_len)
+ err = -1;
+ if (emacs_close (fd))
+ err = -1;
+ }
+ else
+ err = -1;
+ }
+#else
+ err = symlink (lock_info_str, lfname);
+ if (err != 0 && errno == EEXIST && force)
{
- if (count > 9)
- {
- *p = '\0';
- return;
- }
- sprintf (p, ".%d", count++);
+ unlink (lfname);
+ err = symlink (lock_info_str, lfname);
}
+#endif
+
+ return err;
}
/* Lock the lock file named LFNAME.
@@ -355,13 +398,7 @@ lock_file_1 (char *lfname, bool force)
esprintf (lock_info_str, boot ? "%s@%s.%"pMd":%"pMd : "%s@%s.%"pMd,
user_name, host_name, pid, boot);
-
- err = symlink (lock_info_str, lfname);
- if (errno == EEXIST && force)
- {
- unlink (lfname);
- err = symlink (lock_info_str, lfname);
- }
+ err = create_lock_file (lfname, lock_info_str, force);
symlink_errno = errno;
SAFE_FREE ();
@@ -377,6 +414,34 @@ within_one_second (time_t a, time_t b)
return (a - b >= -1 && a - b <= 1);
}
+static Lisp_Object
+read_lock_data (char *lfname)
+{
+#ifndef WINDOWSNT
+ return emacs_readlinkat (AT_FDCWD, lfname);
+#else
+ int fd = emacs_open (lfname, O_RDONLY | O_BINARY, S_IREAD);
+ ssize_t nbytes;
+ /* 256 chars for user, 1024 chars for host, 10 digits for each of 2 int's. */
+ enum { MAX_LFINFO = 256 + 1024 + 10 + 10 + 2 };
+ char lfinfo[MAX_LFINFO + 1];
+
+ if (fd < 0)
+ return Qnil;
+
+ nbytes = emacs_read (fd, lfinfo, MAX_LFINFO);
+ emacs_close (fd);
+
+ if (nbytes > 0)
+ {
+ lfinfo[nbytes] = '\0';
+ return build_string (lfinfo);
+ }
+ else
+ return Qnil;
+#endif
+}
+
/* Return 0 if nobody owns the lock file LFNAME or the lock is obsolete,
1 if another process owns it (and set OWNER (if non-null) to info),
2 if the current process owns it,
@@ -390,7 +455,7 @@ current_lock_owner (lock_info_type *owner, char *lfname)
lock_info_type local_owner;
intmax_t n;
char *at, *dot, *colon;
- Lisp_Object lfinfo_object = emacs_readlinkat (AT_FDCWD, lfname);
+ Lisp_Object lfinfo_object = read_lock_data (lfname);
char *lfinfo;
struct gcpro gcpro1;
@@ -520,6 +585,7 @@ lock_if_free (lock_info_type *clasher, register char *lfname)
decided to go ahead without locking.
When this returns, either the lock is locked for us,
+ or lock creation failed,
or the user has said to go ahead without locking.
If the file is locked by someone else, this calls
@@ -531,11 +597,9 @@ lock_if_free (lock_info_type *clasher, register char *lfname)
void
lock_file (Lisp_Object fn)
{
- register Lisp_Object attack, orig_fn, encoded_fn;
- register char *lfname, *locker;
- ptrdiff_t locker_size;
+ Lisp_Object orig_fn, encoded_fn;
+ char *lfname;
lock_info_type lock_info;
- printmax_t pid;
struct gcpro gcpro1;
USE_SAFE_ALLOCA;
@@ -552,6 +616,12 @@ lock_file (Lisp_Object fn)
orig_fn = fn;
GCPRO1 (fn);
fn = Fexpand_file_name (fn, Qnil);
+#ifdef WINDOWSNT
+ /* Ensure we have only '/' separators, to avoid problems with
+ looking (inside fill_in_lock_file_name) for backslashes in file
+ names encoded by some DBCS codepage. */
+ dostounix_filename (SSDATA (fn), 1);
+#endif
encoded_fn = ENCODE_FILE (fn);
/* Create the name of the lock-file for file fn */
@@ -570,38 +640,36 @@ lock_file (Lisp_Object fn)
call1 (intern ("ask-user-about-supersession-threat"), fn);
}
- UNGCPRO;
-
- /* Try to lock the lock. */
- if (lock_if_free (&lock_info, lfname) <= 0)
- /* Return now if we have locked it, or if lock creation failed */
- return;
- /* Else consider breaking the lock */
- locker_size = (strlen (lock_info.user) + strlen (lock_info.host)
- + INT_STRLEN_BOUND (printmax_t)
- + sizeof "@ (pid )");
- locker = SAFE_ALLOCA (locker_size);
- pid = lock_info.pid;
- esprintf (locker, "%s@%s (pid %"pMd")",
- lock_info.user, lock_info.host, pid);
- FREE_LOCK_INFO (lock_info);
-
- attack = call2 (intern ("ask-user-about-lock"), fn, build_string (locker));
- SAFE_FREE ();
- if (!NILP (attack))
- /* User says take the lock */
+ /* Try to lock the lock. */
+ if (0 < lock_if_free (&lock_info, lfname))
{
- lock_file_1 (lfname, 1);
- return;
+ /* Someone else has the lock. Consider breaking it. */
+ ptrdiff_t locker_size = (strlen (lock_info.user) + strlen (lock_info.host)
+ + INT_STRLEN_BOUND (printmax_t)
+ + sizeof "@ (pid )");
+ char *locker = SAFE_ALLOCA (locker_size);
+ printmax_t pid = lock_info.pid;
+ Lisp_Object attack;
+ esprintf (locker, "%s@%s (pid %"pMd")",
+ lock_info.user, lock_info.host, pid);
+ FREE_LOCK_INFO (lock_info);
+
+ attack = call2 (intern ("ask-user-about-lock"), fn, build_string (locker));
+ /* Take the lock if the user said so. */
+ if (!NILP (attack))
+ lock_file_1 (lfname, 1);
}
- /* User says ignore the lock */
+
+ UNGCPRO;
+ SAFE_FREE ();
}
void
-unlock_file (register Lisp_Object fn)
+unlock_file (Lisp_Object fn)
{
- register char *lfname;
+ char *lfname;
+ USE_SAFE_ALLOCA;
fn = Fexpand_file_name (fn, Qnil);
fn = ENCODE_FILE (fn);
@@ -610,6 +678,8 @@ unlock_file (register Lisp_Object fn)
if (current_lock_owner (0, lfname) == 2)
unlink (lfname);
+
+ SAFE_FREE ();
}
void
@@ -675,9 +745,10 @@ t if it is locked by you, else a string saying which user has locked it. */)
(Lisp_Object filename)
{
Lisp_Object ret;
- register char *lfname;
+ char *lfname;
int owner;
lock_info_type locker;
+ USE_SAFE_ALLOCA;
filename = Fexpand_file_name (filename, Qnil);
@@ -694,6 +765,7 @@ t if it is locked by you, else a string saying which user has locked it. */)
if (owner > 0)
FREE_LOCK_INFO (locker);
+ SAFE_FREE ();
return ret;
}
diff --git a/src/indent.c b/src/indent.c
index ce1639eae1e..9bf75bc6d95 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1328,8 +1328,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
TO (we need to go back below). */
if (pos <= to)
{
- pos = find_before_next_newline (pos, to, 1);
- pos_byte = CHAR_TO_BYTE (pos);
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
hpos = width;
/* If we just skipped next_boundary,
loop around in the main while
@@ -1583,10 +1582,9 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
/* Skip any number of invisible lines all at once */
do
{
- pos = find_before_next_newline (pos, to, 1);
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
if (pos < to)
- pos++;
- pos_byte = CHAR_TO_BYTE (pos);
+ INC_BOTH (pos, pos_byte);
}
while (pos < to
&& indented_beyond_p (pos, pos_byte,
@@ -1622,10 +1620,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
everything from a ^M to the end of the line is invisible.
Stop *before* the real newline. */
if (pos < to)
- {
- pos = find_before_next_newline (pos, to, 1);
- pos_byte = CHAR_TO_BYTE (pos);
- }
+ pos = find_before_next_newline (pos, to, 1, &pos_byte);
/* If we just skipped next_boundary,
loop around in the main while
and handle it. */
@@ -1845,21 +1840,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
while ((vpos > vtarget || first) && from > BEGV)
{
+ ptrdiff_t bytepos;
Lisp_Object propval;
- prevline = find_next_newline_no_quit (from - 1, -1);
+ prevline = find_next_newline_no_quit (from - 1, -1, &bytepos);
while (prevline > BEGV
&& ((selective > 0
- && indented_beyond_p (prevline,
- CHAR_TO_BYTE (prevline),
- selective))
+ && indented_beyond_p (prevline, bytepos, selective))
/* Watch out for newlines with `invisible' property.
When moving upward, check the newline before. */
|| (propval = Fget_char_property (make_number (prevline - 1),
Qinvisible,
text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))))
- prevline = find_next_newline_no_quit (prevline - 1, -1);
+ prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
pos = *compute_motion (prevline, 0,
lmargin,
0,
@@ -1897,21 +1891,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
from_byte = CHAR_TO_BYTE (from);
if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n')
{
+ ptrdiff_t bytepos;
Lisp_Object propval;
- prevline = find_next_newline_no_quit (from, -1);
+ prevline = find_next_newline_no_quit (from, -1, &bytepos);
while (prevline > BEGV
&& ((selective > 0
- && indented_beyond_p (prevline,
- CHAR_TO_BYTE (prevline),
- selective))
+ && indented_beyond_p (prevline, bytepos, selective))
/* Watch out for newlines with `invisible' property.
When moving downward, check the newline after. */
|| (propval = Fget_char_property (make_number (prevline),
Qinvisible,
text_prop_object),
TEXT_PROP_MEANS_INVISIBLE (propval))))
- prevline = find_next_newline_no_quit (prevline - 1, -1);
+ prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
pos = *compute_motion (prevline, 0,
lmargin,
0,
diff --git a/src/intervals.h b/src/intervals.h
index cded8c0abb2..a38e83cf10e 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -259,7 +259,7 @@ extern Lisp_Object get_local_map (ptrdiff_t, struct buffer *, Lisp_Object);
extern INTERVAL update_interval (INTERVAL, ptrdiff_t);
extern void set_intervals_multibyte (bool);
extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *,
- Lisp_Object *, int);
+ Lisp_Object *, bool);
extern INTERVAL interval_of (ptrdiff_t, Lisp_Object);
/* Defined in xdisp.c. */
@@ -293,7 +293,7 @@ extern void set_text_properties_1 (Lisp_Object, Lisp_Object,
Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object);
-int add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
+void add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object);
Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object*);
diff --git a/src/keyboard.c b/src/keyboard.c
index 77037f647e9..9cb9dd0b47b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -367,7 +367,7 @@ Lisp_Object Qmenu_bar;
static Lisp_Object recursive_edit_unwind (Lisp_Object buffer);
static Lisp_Object command_loop (void);
-static Lisp_Object Qextended_command_history;
+static Lisp_Object Qcommand_execute;
EMACS_TIME timer_check (void);
static void echo_now (void);
@@ -1583,11 +1583,11 @@ command_loop_1 (void)
= (EQ (undo, BVAR (current_buffer, undo_list))
? Qnil : BVAR (current_buffer, undo_list));
}
- Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
+ call1 (Qcommand_execute, Vthis_command);
#ifdef HAVE_WINDOW_SYSTEM
/* Do not check display_hourglass_p here, because
- Fcommand_execute could change it, but we should cancel
+ `command-execute' could change it, but we should cancel
hourglass cursor anyway.
But don't cancel the hourglass within a macro
just because a command in the macro finishes. */
@@ -2842,7 +2842,7 @@ read_char (int commandflag, Lisp_Object map,
{
struct buffer *prev_buffer = current_buffer;
last_input_event = c;
- Fcommand_execute (tem, Qnil, Fvector (1, &last_input_event), Qt);
+ call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt);
if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time)
/* We stopped being idle for this event; undo that. This
@@ -9876,95 +9876,6 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
return unbind_to (count, Fvector (i, keybuf));
}
-DEFUN ("command-execute", Fcommand_execute, Scommand_execute, 1, 4, 0,
- doc: /* Execute CMD as an editor command.
-CMD must be a symbol that satisfies the `commandp' predicate.
-Optional second arg RECORD-FLAG non-nil
-means unconditionally put this command in the variable `command-history'.
-Otherwise, that is done only if an arg is read using the minibuffer.
-The argument KEYS specifies the value to use instead of (this-command-keys)
-when reading the arguments; if it is nil, (this-command-keys) is used.
-The argument SPECIAL, if non-nil, means that this command is executing
-a special event, so ignore the prefix argument and don't clear it. */)
- (Lisp_Object cmd, Lisp_Object record_flag, Lisp_Object keys, Lisp_Object special)
-{
- register Lisp_Object final;
- register Lisp_Object tem;
- Lisp_Object prefixarg;
-
- debug_on_next_call = 0;
-
- if (NILP (special))
- {
- prefixarg = KVAR (current_kboard, Vprefix_arg);
- Vcurrent_prefix_arg = prefixarg;
- kset_prefix_arg (current_kboard, Qnil);
- }
- else
- prefixarg = Qnil;
-
- if (SYMBOLP (cmd))
- {
- tem = Fget (cmd, Qdisabled);
- if (!NILP (tem))
- {
- tem = Fsymbol_value (Qdisabled_command_function);
- if (!NILP (tem))
- return Frun_hooks (1, &Qdisabled_command_function);
- }
- }
-
- while (1)
- {
- final = Findirect_function (cmd, Qnil);
-
- if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload)))
- {
- struct gcpro gcpro1, gcpro2;
-
- GCPRO2 (cmd, prefixarg);
- Fautoload_do_load (final, cmd, Qnil);
- UNGCPRO;
- }
- else
- break;
- }
-
- if (STRINGP (final) || VECTORP (final))
- {
- /* If requested, place the macro in the command history. For
- other sorts of commands, call-interactively takes care of
- this. */
- if (!NILP (record_flag))
- {
- Vcommand_history
- = Fcons (Fcons (Qexecute_kbd_macro,
- Fcons (final, Fcons (prefixarg, Qnil))),
- Vcommand_history);
-
- /* Don't keep command history around forever. */
- if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0)
- {
- tem = Fnthcdr (Vhistory_length, Vcommand_history);
- if (CONSP (tem))
- XSETCDR (tem, Qnil);
- }
- }
-
- return Fexecute_kbd_macro (final, prefixarg, Qnil);
- }
-
- if (CONSP (final) || SUBRP (final) || COMPILEDP (final))
- /* Don't call Fcall_interactively directly because we want to make
- sure the backtrace has an entry for `call-interactively'.
- For the same reason, pass `cmd' rather than `final'. */
- return call3 (Qcall_interactively, cmd, record_flag, keys);
-
- return Qnil;
-}
-
-
-
/* Return true if input events are pending. */
bool
@@ -11195,8 +11106,7 @@ syms_of_keyboard (void)
raw_keybuf = Fmake_vector (make_number (30), Qnil);
staticpro (&raw_keybuf);
- DEFSYM (Qextended_command_history, "extended-command-history");
- Fset (Qextended_command_history, Qnil);
+ DEFSYM (Qcommand_execute, "command-execute");
accent_key_syms = Qnil;
staticpro (&accent_key_syms);
@@ -11235,7 +11145,6 @@ syms_of_keyboard (void)
defsubr (&Srecursive_edit);
defsubr (&Strack_mouse);
defsubr (&Sinput_pending_p);
- defsubr (&Scommand_execute);
defsubr (&Srecent_keys);
defsubr (&Sthis_command_keys);
defsubr (&Sthis_command_keys_vector);
diff --git a/src/lisp.h b/src/lisp.h
index 44a5bd571ff..01574a5fe03 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -507,7 +507,7 @@ static EMACS_INT const VALMASK
/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
which were stored in a Lisp_Object. */
-#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS))
+#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK) | DATA_SEG_BITS))
#endif /* not USE_LSB_TAG */
@@ -3048,7 +3048,7 @@ extern Lisp_Object Qautomatic_gc;
extern Lisp_Object Qchar_table_extra_slots;
extern struct Lisp_Vector *allocate_vector (EMACS_INT);
-/* Make an unitialized vector for SIZE objects. NOTE: you must
+/* Make an uninitialized vector for SIZE objects. NOTE: you must
be sure that GC cannot happen until the vector is completely
initialized. E.g. the following code is likely to crash:
@@ -3343,12 +3343,13 @@ extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, Lisp_Object);
extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t,
- ptrdiff_t *, bool);
+ ptrdiff_t *, ptrdiff_t *, bool);
extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
EMACS_INT, bool);
extern ptrdiff_t find_next_newline (ptrdiff_t, int);
-extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t);
-extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t);
+extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
+extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t,
+ ptrdiff_t, ptrdiff_t *);
extern void syms_of_search (void);
extern void clear_regexp_cache (void);
@@ -3365,7 +3366,7 @@ extern void syms_of_minibuf (void);
extern Lisp_Object Qminus, Qplus;
extern Lisp_Object Qwhen;
-extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
+extern Lisp_Object Qmouse_leave_buffer_hook;
extern void syms_of_callint (void);
/* Defined in casefiddle.c. */
@@ -3526,7 +3527,6 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object, ptrdiff_t, Lisp_Object *);
/* Defined in macros.c. */
-extern Lisp_Object Qexecute_kbd_macro;
extern void init_macros (void);
extern void syms_of_macros (void);
diff --git a/src/macros.c b/src/macros.c
index 0dcfbe5532c..48d23a977b1 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "keyboard.h"
-Lisp_Object Qexecute_kbd_macro;
+static Lisp_Object Qexecute_kbd_macro;
static Lisp_Object Qkbd_macro_termination_hook;
/* Number of successful iterations so far
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 6e1873f8e49..93f12900dde 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -864,6 +864,7 @@ $(BLD)/fileio.$(O) : \
$(BLD)/filelock.$(O) : \
$(SRC)/filelock.c \
+ $(SRC)/w32.h \
$(NT_INC)/pwd.h \
$(NT_INC)/sys/file.h \
$(NT_INC)/sys/stat.h \
@@ -1492,7 +1493,6 @@ $(BLD)/unexw32.$(O) : \
$(BLD)/vm-limit.$(O) : \
$(SRC)/vm-limit.c \
- $(SRC)/mem-limits.h \
$(SRC)/w32heap.h \
$(NT_INC)/unistd.h \
$(CONFIG_H) \
diff --git a/src/marker.c b/src/marker.c
index 0d992c0abfa..63027d3be5e 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -500,7 +500,7 @@ set_marker_internal (Lisp_Object marker, Lisp_Object position,
register ptrdiff_t charpos, bytepos;
/* Do not use CHECK_NUMBER_COERCE_MARKER because we
- don't want to call buf_charpos_to_bytepos if POSTION
+ don't want to call buf_charpos_to_bytepos if POSITION
is a marker and so we know the bytepos already. */
if (INTEGERP (position))
charpos = XINT (position), bytepos = -1;
diff --git a/src/mem-limits.h b/src/mem-limits.h
deleted file mode 100644
index 941ccf5f121..00000000000
--- a/src/mem-limits.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Includes for memory limit warnings.
- Copyright (C) 1990, 1993-1996, 2001-2013 Free Software Foundation,
- Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifdef MSDOS
-#include <dpmi.h>
-extern int etext;
-#endif
-
-/* Some systems need this before <sys/resource.h>. */
-#include <sys/types.h>
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/time.h>
-# include <sys/resource.h>
-#else
-# if HAVE_SYS_VLIMIT_H
-# include <sys/vlimit.h> /* Obsolete, says glibc */
-# endif
-#endif
-
-extern char *start_of_data (void) ATTRIBUTE_CONST;
-#if USE_LSB_TAG || UINTPTR_MAX <= VAL_MAX
-#define EXCEEDS_LISP_PTR(ptr) 0
-#else
-#define EXCEEDS_LISP_PTR(ptr) \
- (((uintptr_t) (ptr) & ~DATA_SEG_BITS) >> VALBITS)
-#endif
diff --git a/src/pre-crt0.c b/src/pre-crt0.c
deleted file mode 100644
index 6b9618c8dc3..00000000000
--- a/src/pre-crt0.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* This file is loaded before crt0.o on machines where we do not
- remap part of the data space into text space in unexec.
- On these machines, there is no problem with standard crt0.o's
- that make environ an initialized variable. However, we do
- need to make sure the label data_start exists anyway. */
-
-/* Create a label to appear at the beginning of data space.
- Its value is nonzero so that it cannot be put into bss. */
-
-int data_start = 1;
diff --git a/src/ralloc.c b/src/ralloc.c
index ec1ac40414c..13fd65cbb0c 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -52,10 +52,6 @@ extern size_t __malloc_extra_blocks;
#include "getpagesize.h"
-typedef size_t SIZE;
-typedef void *POINTER;
-#define NIL ((POINTER) 0)
-
/* A flag to indicate whether we have initialized ralloc yet. For
Emacs's sake, please do not make this local to malloc_init; on some
machines, the dumping procedure makes all static variables
@@ -72,14 +68,14 @@ static void r_alloc_init (void);
/* Declarations for working with the malloc, ralloc, and system breaks. */
/* Function to set the real break value. */
-POINTER (*real_morecore) (ptrdiff_t);
+void *(*real_morecore) (ptrdiff_t);
/* The break value, as seen by malloc. */
-static POINTER virtual_break_value;
+static void *virtual_break_value;
/* The address of the end of the last data in use by ralloc,
including relocatable blocs as well as malloc data. */
-static POINTER break_value;
+static void *break_value;
/* This is the size of a page. We round memory requests to this boundary. */
static int page_size;
@@ -92,17 +88,17 @@ static int extra_bytes;
by changing the definition of PAGE. */
#define PAGE (getpagesize ())
#define ROUNDUP(size) (((size_t) (size) + page_size - 1) \
- & ~((size_t)(page_size - 1)))
+ & ~((size_t) (page_size - 1)))
#define MEM_ALIGN sizeof (double)
-#define MEM_ROUNDUP(addr) (((size_t)(addr) + MEM_ALIGN - 1) \
+#define MEM_ROUNDUP(addr) (((size_t) (addr) + MEM_ALIGN - 1) \
& ~(MEM_ALIGN - 1))
/* The hook `malloc' uses for the function which gets more space
from the system. */
#ifndef SYSTEM_MALLOC
-extern POINTER (*__morecore) (ptrdiff_t);
+extern void *(*__morecore) (ptrdiff_t);
#endif
@@ -131,13 +127,13 @@ typedef struct heap
struct heap *next;
struct heap *prev;
/* Start of memory range of this heap. */
- POINTER start;
+ void *start;
/* End of memory range of this heap. */
- POINTER end;
+ void *end;
/* Start of relocatable data in this heap. */
- POINTER bloc_start;
+ void *bloc_start;
/* Start of unused space in this heap. */
- POINTER free;
+ void *free;
/* First bloc in this heap. */
struct bp *first_bloc;
/* Last bloc in this heap. */
@@ -159,7 +155,7 @@ static heap_ptr first_heap, last_heap;
The data blocks abut each other; if b->next is non-nil, then
b->data + b->size == b->next->data.
- An element with variable==NIL denotes a freed block, which has not yet
+ An element with variable==NULL denotes a freed block, which has not yet
been collected. They may only appear while r_alloc_freeze_level > 0,
and will be freed when the arena is thawed. Currently, these blocs are
not reusable, while the arena is frozen. Very inefficient. */
@@ -168,10 +164,10 @@ typedef struct bp
{
struct bp *next;
struct bp *prev;
- POINTER *variable;
- POINTER data;
- SIZE size;
- POINTER new_data; /* temporarily used for relocation */
+ void **variable;
+ void *data;
+ size_t size;
+ void *new_data; /* temporarily used for relocation */
struct heap *heap; /* Heap this bloc is in. */
} *bloc_ptr;
@@ -192,7 +188,7 @@ static int r_alloc_freeze_level;
/* Find the heap that ADDRESS falls within. */
static heap_ptr
-find_heap (POINTER address)
+find_heap (void *address)
{
heap_ptr heap;
@@ -223,11 +219,11 @@ find_heap (POINTER address)
Return the address of the space if all went well, or zero if we couldn't
allocate the memory. */
-static POINTER
-obtain (POINTER address, SIZE size)
+static void *
+obtain (void *address, size_t size)
{
heap_ptr heap;
- SIZE already_available;
+ size_t already_available;
/* Find the heap that ADDRESS falls within. */
for (heap = last_heap; heap; heap = heap->prev)
@@ -253,19 +249,19 @@ obtain (POINTER address, SIZE size)
get more space. */
if (heap == NIL_HEAP)
{
- POINTER new = (*real_morecore)(0);
- SIZE get;
+ void *new = real_morecore (0);
+ size_t get;
- already_available = (char *)last_heap->end - (char *)address;
+ already_available = (char *) last_heap->end - (char *) address;
if (new != last_heap->end)
{
/* Someone else called sbrk. Make a new heap. */
heap_ptr new_heap = (heap_ptr) MEM_ROUNDUP (new);
- POINTER bloc_start = (POINTER) MEM_ROUNDUP ((POINTER)(new_heap + 1));
+ void *bloc_start = (void *) MEM_ROUNDUP ((void *) (new_heap + 1));
- if ((*real_morecore) ((char *) bloc_start - (char *) new) != new)
+ if (real_morecore ((char *) bloc_start - (char *) new) != new)
return 0;
new_heap->start = new;
@@ -287,10 +283,10 @@ obtain (POINTER address, SIZE size)
Get some extra, so we can come here less often. */
get = size + extra_bytes - already_available;
- get = (char *) ROUNDUP ((char *)last_heap->end + get)
+ get = (char *) ROUNDUP ((char *) last_heap->end + get)
- (char *) last_heap->end;
- if ((*real_morecore) (get) != last_heap->end)
+ if (real_morecore (get) != last_heap->end)
return 0;
last_heap->end = (char *) last_heap->end + get;
@@ -319,13 +315,13 @@ relinquish (void)
? h->bloc_start : break_value);
}
- if (excess > extra_bytes * 2 && (*real_morecore) (0) == last_heap->end)
+ if (excess > extra_bytes * 2 && real_morecore (0) == last_heap->end)
{
/* Keep extra_bytes worth of empty space.
And don't free anything unless we can free at least extra_bytes. */
excess -= extra_bytes;
- if ((char *)last_heap->end - (char *)last_heap->bloc_start <= excess)
+ if ((char *) last_heap->end - (char *) last_heap->bloc_start <= excess)
{
heap_ptr lh_prev;
@@ -336,12 +332,12 @@ relinquish (void)
return;
/* Return the last heap, with its header, to the system. */
- excess = (char *)last_heap->end - (char *)last_heap->start;
+ excess = (char *) last_heap->end - (char *) last_heap->start;
lh_prev = last_heap->prev;
/* If the system doesn't want that much memory back, leave
last_heap unaltered to reflect that. This can occur if
break_value is still within the original data segment. */
- if ((*real_morecore) (- excess) != 0)
+ if (real_morecore (- excess) != 0)
{
last_heap = lh_prev;
last_heap->next = NIL_HEAP;
@@ -349,13 +345,13 @@ relinquish (void)
}
else
{
- excess = (char *) last_heap->end
- - (char *) ROUNDUP ((char *)last_heap->end - excess);
+ excess = ((char *) last_heap->end
+ - (char *) ROUNDUP ((char *) last_heap->end - excess));
/* If the system doesn't want that much memory back, leave
the end of the last heap unchanged to reflect that. This
can occur if break_value is still within the original
data segment. */
- if ((*real_morecore) (- excess) != 0)
+ if (real_morecore (- excess) != 0)
last_heap->end = (char *) last_heap->end - excess;
}
}
@@ -367,9 +363,9 @@ relinquish (void)
to that block. */
static bloc_ptr
-find_bloc (POINTER *ptr)
+find_bloc (void **ptr)
{
- register bloc_ptr p = first_bloc;
+ bloc_ptr p = first_bloc;
while (p != NIL_BLOC)
{
@@ -392,10 +388,10 @@ find_bloc (POINTER *ptr)
memory for the new block. */
static bloc_ptr
-get_bloc (SIZE size)
+get_bloc (size_t size)
{
- register bloc_ptr new_bloc;
- register heap_ptr heap;
+ bloc_ptr new_bloc;
+ heap_ptr heap;
if (! (new_bloc = malloc (BLOC_PTR_SIZE))
|| ! (new_bloc->data = obtain (break_value, size)))
@@ -409,7 +405,7 @@ get_bloc (SIZE size)
new_bloc->size = size;
new_bloc->next = NIL_BLOC;
- new_bloc->variable = (POINTER *) NIL;
+ new_bloc->variable = NULL;
new_bloc->new_data = 0;
/* Record in the heap that this space is in use. */
@@ -447,9 +443,9 @@ get_bloc (SIZE size)
Do not touch the contents of blocs or break_value. */
static int
-relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address)
+relocate_blocs (bloc_ptr bloc, heap_ptr heap, void *address)
{
- register bloc_ptr b = bloc;
+ bloc_ptr b = bloc;
/* No need to ever call this if arena is frozen, bug somewhere! */
if (r_alloc_freeze_level)
@@ -471,8 +467,8 @@ relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address)
get enough new space to hold BLOC and all following blocs. */
if (heap == NIL_HEAP)
{
- register bloc_ptr tb = b;
- register SIZE s = 0;
+ bloc_ptr tb = b;
+ size_t s = 0;
/* Add up the size of all the following blocs. */
while (tb != NIL_BLOC)
@@ -568,12 +564,12 @@ update_heap_bloc_correspondence (bloc_ptr bloc, heap_ptr heap)
that come after BLOC in memory. */
static int
-resize_bloc (bloc_ptr bloc, SIZE size)
+resize_bloc (bloc_ptr bloc, size_t size)
{
- register bloc_ptr b;
+ bloc_ptr b;
heap_ptr heap;
- POINTER address;
- SIZE old_size;
+ void *address;
+ size_t old_size;
/* No need to ever call this if arena is frozen, bug somewhere! */
if (r_alloc_freeze_level)
@@ -675,7 +671,7 @@ free_bloc (bloc_ptr bloc)
if (r_alloc_freeze_level)
{
- bloc->variable = (POINTER *) NIL;
+ bloc->variable = NULL;
return;
}
@@ -752,17 +748,17 @@ free_bloc (bloc_ptr bloc)
__morecore hook values - in particular, __default_morecore in the
GNU malloc package. */
-static POINTER
+static void *
r_alloc_sbrk (ptrdiff_t size)
{
- register bloc_ptr b;
- POINTER address;
+ bloc_ptr b;
+ void *address;
if (! r_alloc_initialized)
r_alloc_init ();
if (use_relocatable_buffers <= 0)
- return (*real_morecore) (size);
+ return real_morecore (size);
if (size == 0)
return virtual_break_value;
@@ -772,19 +768,19 @@ r_alloc_sbrk (ptrdiff_t size)
/* Allocate a page-aligned space. GNU malloc would reclaim an
extra space if we passed an unaligned one. But we could
not always find a space which is contiguous to the previous. */
- POINTER new_bloc_start;
+ void *new_bloc_start;
heap_ptr h = first_heap;
- SIZE get = ROUNDUP (size);
+ size_t get = ROUNDUP (size);
- address = (POINTER) ROUNDUP (virtual_break_value);
+ address = (void *) ROUNDUP (virtual_break_value);
/* Search the list upward for a heap which is large enough. */
- while ((char *) h->end < (char *) MEM_ROUNDUP ((char *)address + get))
+ while ((char *) h->end < (char *) MEM_ROUNDUP ((char *) address + get))
{
h = h->next;
if (h == NIL_HEAP)
break;
- address = (POINTER) ROUNDUP (h->start);
+ address = (void *) ROUNDUP (h->start);
}
/* If not found, obtain more space. */
@@ -796,19 +792,19 @@ r_alloc_sbrk (ptrdiff_t size)
return 0;
if (first_heap == last_heap)
- address = (POINTER) ROUNDUP (virtual_break_value);
+ address = (void *) ROUNDUP (virtual_break_value);
else
- address = (POINTER) ROUNDUP (last_heap->start);
+ address = (void *) ROUNDUP (last_heap->start);
h = last_heap;
}
- new_bloc_start = (POINTER) MEM_ROUNDUP ((char *)address + get);
+ new_bloc_start = (void *) MEM_ROUNDUP ((char *) address + get);
if (first_heap->bloc_start < new_bloc_start)
{
/* This is no clean solution - no idea how to do it better. */
if (r_alloc_freeze_level)
- return NIL;
+ return NULL;
/* There is a bug here: if the above obtain call succeeded, but the
relocate_blocs call below does not succeed, we need to free
@@ -818,7 +814,7 @@ r_alloc_sbrk (ptrdiff_t size)
if (! relocate_blocs (first_bloc, h, new_bloc_start))
return 0;
- /* Note that (POINTER)(h+1) <= new_bloc_start since
+ /* Note that (char *) (h + 1) <= (char *) new_bloc_start since
get >= page_size, so the following does not destroy the heap
header. */
for (b = last_bloc; b != NIL_BLOC; b = b->prev)
@@ -855,8 +851,8 @@ r_alloc_sbrk (ptrdiff_t size)
}
else /* size < 0 */
{
- SIZE excess = (char *)first_heap->bloc_start
- - ((char *)virtual_break_value + size);
+ size_t excess = ((char *) first_heap->bloc_start
+ - ((char *) virtual_break_value + size));
address = virtual_break_value;
@@ -864,7 +860,7 @@ r_alloc_sbrk (ptrdiff_t size)
{
excess -= extra_bytes;
first_heap->bloc_start
- = (POINTER) MEM_ROUNDUP ((char *)first_heap->bloc_start - excess);
+ = (void *) MEM_ROUNDUP ((char *) first_heap->bloc_start - excess);
relocate_blocs (first_bloc, first_heap, first_heap->bloc_start);
@@ -876,14 +872,14 @@ r_alloc_sbrk (ptrdiff_t size)
}
}
- if ((char *)virtual_break_value + size < (char *)first_heap->start)
+ if ((char *) virtual_break_value + size < (char *) first_heap->start)
{
/* We found an additional space below the first heap */
- first_heap->start = (POINTER) ((char *)virtual_break_value + size);
+ first_heap->start = (void *) ((char *) virtual_break_value + size);
}
}
- virtual_break_value = (POINTER) ((char *)address + size);
+ virtual_break_value = (void *) ((char *) address + size);
break_value = (last_bloc
? (char *) last_bloc->data + last_bloc->size
: (char *) first_heap->bloc_start);
@@ -905,10 +901,10 @@ r_alloc_sbrk (ptrdiff_t size)
If we can't allocate the necessary memory, set *PTR to zero, and
return zero. */
-POINTER
-r_alloc (POINTER *ptr, SIZE size)
+void *
+r_alloc (void **ptr, size_t size)
{
- register bloc_ptr new_bloc;
+ bloc_ptr new_bloc;
if (! r_alloc_initialized)
r_alloc_init ();
@@ -929,9 +925,9 @@ r_alloc (POINTER *ptr, SIZE size)
Store 0 in *PTR to show there's no block allocated. */
void
-r_alloc_free (register POINTER *ptr)
+r_alloc_free (void **ptr)
{
- register bloc_ptr dead_bloc;
+ bloc_ptr dead_bloc;
if (! r_alloc_initialized)
r_alloc_init ();
@@ -962,10 +958,10 @@ r_alloc_free (register POINTER *ptr)
If more memory cannot be allocated, then leave *PTR unchanged, and
return zero. */
-POINTER
-r_re_alloc (POINTER *ptr, SIZE size)
+void *
+r_re_alloc (void **ptr, size_t size)
{
- register bloc_ptr bloc;
+ bloc_ptr bloc;
if (! r_alloc_initialized)
r_alloc_init ();
@@ -1004,15 +1000,15 @@ r_re_alloc (POINTER *ptr, SIZE size)
{
new_bloc->variable = ptr;
*ptr = new_bloc->data;
- bloc->variable = (POINTER *) NIL;
+ bloc->variable = NULL;
}
else
- return NIL;
+ return NULL;
}
else
{
if (! resize_bloc (bloc, MEM_ROUNDUP (size)))
- return NIL;
+ return NULL;
}
}
return *ptr;
@@ -1052,27 +1048,27 @@ r_alloc_check (void)
return;
assert (first_heap);
- assert (last_heap->end <= (POINTER) sbrk (0));
- assert ((POINTER) first_heap < first_heap->start);
+ assert (last_heap->end <= (void *) sbrk (0));
+ assert ((void *) first_heap < first_heap->start);
assert (first_heap->start <= virtual_break_value);
assert (virtual_break_value <= first_heap->end);
for (h = first_heap; h; h = h->next)
{
assert (h->prev == ph);
- assert ((POINTER) ROUNDUP (h->end) == h->end);
+ assert ((void *) ROUNDUP (h->end) == h->end);
#if 0 /* ??? The code in ralloc.c does not really try to ensure
the heap start has any sort of alignment.
Perhaps it should. */
- assert ((POINTER) MEM_ROUNDUP (h->start) == h->start);
+ assert ((void *) MEM_ROUNDUP (h->start) == h->start);
#endif
- assert ((POINTER) MEM_ROUNDUP (h->bloc_start) == h->bloc_start);
+ assert ((void *) MEM_ROUNDUP (h->bloc_start) == h->bloc_start);
assert (h->start <= h->bloc_start && h->bloc_start <= h->end);
if (ph)
{
assert (ph->end < h->start);
- assert (h->start <= (POINTER)h && (POINTER)(h+1) <= h->bloc_start);
+ assert (h->start <= (void *) h && (void *) (h + 1) <= h->bloc_start);
}
if (h->bloc_start <= break_value && break_value <= h->end)
@@ -1087,8 +1083,8 @@ r_alloc_check (void)
for (b = first_bloc; b; b = b->next)
{
assert (b->prev == pb);
- assert ((POINTER) MEM_ROUNDUP (b->data) == b->data);
- assert ((SIZE) MEM_ROUNDUP (b->size) == b->size);
+ assert ((void *) MEM_ROUNDUP (b->data) == b->data);
+ assert ((size_t) MEM_ROUNDUP (b->size) == b->size);
ph = 0;
for (h = first_heap; h; h = h->next)
@@ -1137,7 +1133,7 @@ r_alloc_check (void)
is checked to ensure that memory corruption does not occur due to
misuse. */
void
-r_alloc_reset_variable (POINTER *old, POINTER *new)
+r_alloc_reset_variable (void **old, void **new)
{
bloc_ptr bloc = first_bloc;
@@ -1192,8 +1188,8 @@ r_alloc_init (void)
first_heap = last_heap = &heap_base;
first_heap->next = first_heap->prev = NIL_HEAP;
first_heap->start = first_heap->bloc_start
- = virtual_break_value = break_value = (*real_morecore) (0);
- if (break_value == NIL)
+ = virtual_break_value = break_value = real_morecore (0);
+ if (break_value == NULL)
emacs_abort ();
extra_bytes = ROUNDUP (50000);
@@ -1218,7 +1214,7 @@ r_alloc_init (void)
#endif
#ifndef SYSTEM_MALLOC
- first_heap->end = (POINTER) ROUNDUP (first_heap->start);
+ first_heap->end = (void *) ROUNDUP (first_heap->start);
/* The extra call to real_morecore guarantees that the end of the
address space is a multiple of page_size, even if page_size is
@@ -1226,7 +1222,7 @@ r_alloc_init (void)
which page_size is stored. This allows a binary to be built on a
system with one page size and run on a system with a smaller page
size. */
- (*real_morecore) ((char *) first_heap->end - (char *) first_heap->start);
+ real_morecore ((char *) first_heap->end - (char *) first_heap->start);
/* Clear the rest of the last page; this memory is in our address space
even though it is after the sbrk value. */
diff --git a/src/search.c b/src/search.c
index d4508004bf6..1c0f57487f9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -638,15 +638,18 @@ newline_cache_on_off (struct buffer *buf)
If we don't find COUNT instances before reaching END, set *SHORTAGE
to the number of newlines left unfound, and return END.
+ If BYTEPOS is not NULL, set *BYTEPOS to the byte position corresponding
+ to the returned character position.
+
If ALLOW_QUIT, set immediate_quit. That's good to do
except when inside redisplay. */
ptrdiff_t
-find_newline (ptrdiff_t start, ptrdiff_t end,
- ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit)
+find_newline (ptrdiff_t start, ptrdiff_t end, ptrdiff_t count,
+ ptrdiff_t *shortage, ptrdiff_t *bytepos, bool allow_quit)
{
struct region_cache *newline_cache;
- ptrdiff_t end_byte = -1;
+ ptrdiff_t start_byte = -1, end_byte = -1;
int direction;
if (count > 0)
@@ -680,9 +683,7 @@ find_newline (ptrdiff_t start, ptrdiff_t end,
the position of the last character before the next such
obstacle --- the last character the dumb search loop should
examine. */
- ptrdiff_t ceiling_byte = end_byte - 1;
- ptrdiff_t start_byte;
- ptrdiff_t tem;
+ ptrdiff_t tem, ceiling_byte = end_byte - 1;
/* If we're looking for a newline, consult the newline cache
to see where we can avoid some scanning. */
@@ -745,21 +746,22 @@ find_newline (ptrdiff_t start, ptrdiff_t end,
if (--count == 0)
{
immediate_quit = 0;
+ if (bytepos)
+ *bytepos = nl + 1 - base + start_byte;
return BYTE_TO_CHAR (nl + 1 - base + start_byte);
}
cursor = nl + 1;
}
- start = BYTE_TO_CHAR (ceiling_addr - base + start_byte);
+ start_byte += ceiling_addr - base;
+ start = BYTE_TO_CHAR (start_byte);
}
}
else
while (start > end)
{
/* The last character to check before the next obstacle. */
- ptrdiff_t ceiling_byte = end_byte;
- ptrdiff_t start_byte;
- ptrdiff_t tem;
+ ptrdiff_t tem, ceiling_byte = end_byte;
/* Consult the newline cache, if appropriate. */
if (newline_cache)
@@ -816,18 +818,26 @@ find_newline (ptrdiff_t start, ptrdiff_t end,
if (++count >= 0)
{
immediate_quit = 0;
+ if (bytepos)
+ *bytepos = nl - base + start_byte;
return BYTE_TO_CHAR (nl - base + start_byte);
}
cursor = nl - 1;
}
- start = BYTE_TO_CHAR (ceiling_addr - 1 - base + start_byte);
+ start_byte += ceiling_addr - 1 - base;
+ start = BYTE_TO_CHAR (start_byte);
}
}
immediate_quit = 0;
- if (shortage != 0)
+ if (shortage)
*shortage = count * direction;
+ if (bytepos)
+ {
+ *bytepos = start_byte == -1 ? CHAR_TO_BYTE (start) : start_byte;
+ eassert (*bytepos == CHAR_TO_BYTE (start));
+ }
return start;
}
@@ -932,9 +942,9 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte,
}
ptrdiff_t
-find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt)
+find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos)
{
- return find_newline (from, 0, cnt, (ptrdiff_t *) 0, 0);
+ return find_newline (from, 0, cnt, NULL, bytepos, 0);
}
/* Like find_next_newline, but returns position before the newline,
@@ -942,14 +952,19 @@ find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt)
find_next_newline (...)-1, because you might hit TO. */
ptrdiff_t
-find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt)
+find_before_next_newline (ptrdiff_t from, ptrdiff_t to,
+ ptrdiff_t cnt, ptrdiff_t *bytepos)
{
ptrdiff_t shortage;
- ptrdiff_t pos = find_newline (from, to, cnt, &shortage, 1);
+ ptrdiff_t pos = find_newline (from, to, cnt, &shortage, bytepos, 1);
if (shortage == 0)
- pos--;
-
+ {
+ if (bytepos)
+ DEC_BOTH (pos, *bytepos);
+ else
+ pos--;
+ }
return pos;
}
diff --git a/src/sheap.c b/src/sheap.c
index 06e205bc0e5..f8eec753268 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -91,5 +91,7 @@ report_sheap_usage (int die_if_pure_storage_exceeded)
char buf[200];
sprintf (buf, "Static heap usage: %d of %d bytes",
bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE);
- message1 (buf);
+ /* Don't log messages, cause at this point, we're not allowed to create
+ buffers. */
+ message1_nolog (buf);
}
diff --git a/src/textprop.c b/src/textprop.c
index c1f6e59bf2e..18e893b3ef2 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -125,9 +125,10 @@ modify_region (Lisp_Object buffer, Lisp_Object start, Lisp_Object end)
#define hard 1
INTERVAL
-validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force)
+validate_interval_range (Lisp_Object object, Lisp_Object *begin,
+ Lisp_Object *end, bool force)
{
- register INTERVAL i;
+ INTERVAL i;
ptrdiff_t searchpos;
CHECK_STRING_OR_BUFFER (object);
@@ -198,14 +199,14 @@ validate_plist (Lisp_Object list)
if (CONSP (list))
{
- register int i;
- register Lisp_Object tail;
- for (i = 0, tail = list; CONSP (tail); i++)
+ bool odd_length = 0;
+ Lisp_Object tail;
+ for (tail = list; CONSP (tail); tail = XCDR (tail))
{
- tail = XCDR (tail);
+ odd_length ^= 1;
QUIT;
}
- if (i & 1)
+ if (odd_length)
error ("Odd length text property list");
return list;
}
@@ -213,20 +214,19 @@ validate_plist (Lisp_Object list)
return Fcons (list, Fcons (Qnil, Qnil));
}
-/* Return nonzero if interval I has all the properties,
+/* Return true if interval I has all the properties,
with the same values, of list PLIST. */
-static int
+static bool
interval_has_all_properties (Lisp_Object plist, INTERVAL i)
{
- register Lisp_Object tail1, tail2, sym1;
- register int found;
+ Lisp_Object tail1, tail2;
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
{
- sym1 = XCAR (tail1);
- found = 0;
+ Lisp_Object sym1 = XCAR (tail1);
+ bool found = 0;
/* Go through I's plist, looking for sym1 */
for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@@ -249,13 +249,13 @@ interval_has_all_properties (Lisp_Object plist, INTERVAL i)
return 1;
}
-/* Return nonzero if the plist of interval I has any of the
+/* Return true if the plist of interval I has any of the
properties of PLIST, regardless of their values. */
-static int
+static bool
interval_has_some_properties (Lisp_Object plist, INTERVAL i)
{
- register Lisp_Object tail1, tail2, sym;
+ Lisp_Object tail1, tail2, sym;
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
@@ -274,10 +274,10 @@ interval_has_some_properties (Lisp_Object plist, INTERVAL i)
/* Return nonzero if the plist of interval I has any of the
property names in LIST, regardless of their values. */
-static int
+static bool
interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
{
- register Lisp_Object tail1, tail2, sym;
+ Lisp_Object tail1, tail2, sym;
/* Go through each element of LIST. */
for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
@@ -358,15 +358,14 @@ set_properties (Lisp_Object properties, INTERVAL interval, Lisp_Object object)
OBJECT should be the string or buffer the interval is in.
- Return nonzero if this changes I (i.e., if any members of PLIST
+ Return true if this changes I (i.e., if any members of PLIST
are actually added to I's plist) */
-static int
+static bool
add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
{
Lisp_Object tail1, tail2, sym1, val1;
- register int changed = 0;
- register int found;
+ bool changed = 0;
struct gcpro gcpro1, gcpro2, gcpro3;
tail1 = plist;
@@ -380,9 +379,9 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
/* Go through each element of PLIST. */
for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
{
+ bool found = 0;
sym1 = XCAR (tail1);
val1 = Fcar (XCDR (tail1));
- found = 0;
/* Go through I's plist, looking for sym1 */
for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
@@ -410,7 +409,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
/* I's property has a different value -- change it */
Fsetcar (this_cdr, val1);
- changed++;
+ changed = 1;
break;
}
@@ -423,7 +422,7 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
sym1, Qnil, object);
}
set_interval_plist (i, Fcons (sym1, Fcons (val1, i->plist)));
- changed++;
+ changed = 1;
}
}
@@ -437,14 +436,14 @@ add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
(If PLIST is non-nil, use that, otherwise use LIST.)
OBJECT is the string or buffer containing I. */
-static int
+static bool
remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object)
{
- register Lisp_Object tail1, tail2, sym, current_plist;
- register int changed = 0;
+ Lisp_Object tail1, tail2, sym, current_plist;
+ bool changed = 0;
- /* Nonzero means tail1 is a plist, otherwise it is a list. */
- int use_plist;
+ /* True means tail1 is a plist, otherwise it is a list. */
+ bool use_plist;
current_plist = i->plist;
@@ -467,7 +466,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
object);
current_plist = XCDR (XCDR (current_plist));
- changed++;
+ changed = 1;
}
/* Go through I's plist, looking for SYM. */
@@ -483,7 +482,7 @@ remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object
sym, XCAR (XCDR (this)), object);
Fsetcdr (XCDR (tail2), XCDR (XCDR (this)));
- changed++;
+ changed = 1;
}
tail2 = this;
}
@@ -1129,10 +1128,11 @@ If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property value actually changed, nil otherwise. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
- register INTERVAL i, unchanged;
- register ptrdiff_t s, len;
- register int modified = 0;
+ INTERVAL i, unchanged;
+ ptrdiff_t s, len;
+ bool modified = 0;
struct gcpro gcpro1;
+ bool first_time = 1;
properties = validate_plist (properties);
if (NILP (properties))
@@ -1141,6 +1141,7 @@ Return t if any property value actually changed, nil otherwise. */)
if (NILP (object))
XSETBUFFER (object, current_buffer);
+ retry:
i = validate_interval_range (object, &start, &end, hard);
if (!i)
return Qnil;
@@ -1152,31 +1153,50 @@ Return t if any property value actually changed, nil otherwise. */)
and live buffers are always protected. */
GCPRO1 (properties);
- /* If we're not starting on an interval boundary, we have to
- split this interval. */
- if (i->position != s)
+ /* If this interval already has the properties, we can skip it. */
+ if (interval_has_all_properties (properties, i))
{
- /* If this interval already has the properties, we can
- skip it. */
- if (interval_has_all_properties (properties, i))
+ ptrdiff_t got = LENGTH (i) - (s - i->position);
+
+ do
{
- ptrdiff_t got = (LENGTH (i) - (s - i->position));
if (got >= len)
RETURN_UNGCPRO (Qnil);
len -= got;
i = next_interval (i);
+ got = LENGTH (i);
}
- else
+ while (interval_has_all_properties (properties, i));
+ }
+ else if (i->position != s)
+ {
+ /* If we're not starting on an interval boundary, we have to
+ split this interval. */
+ unchanged = i;
+ i = split_interval_right (unchanged, s - unchanged->position);
+ copy_properties (unchanged, i);
+ }
+
+ if (BUFFERP (object) && first_time)
+ {
+ ptrdiff_t prev_total_length = TOTAL_LENGTH (i);
+ ptrdiff_t prev_pos = i->position;
+
+ modify_region (object, start, end);
+ /* If someone called us recursively as a side effect of
+ modify_region, and changed the intervals behind our back
+ (could happen if lock_file, called by prepare_to_modify_buffer,
+ triggers redisplay, and that calls add-text-properties again
+ in the same buffer), we cannot continue with I, because its
+ data changed. So we restart the interval analysis anew. */
+ if (TOTAL_LENGTH (i) != prev_total_length
+ || i->position != prev_pos)
{
- unchanged = i;
- i = split_interval_right (unchanged, s - unchanged->position);
- copy_properties (unchanged, i);
+ first_time = 0;
+ goto retry;
}
}
- if (BUFFERP (object))
- modify_region (object, start, end);
-
/* We are at the beginning of interval I, with LEN chars to scan. */
for (;;)
{
@@ -1195,7 +1215,8 @@ Return t if any property value actually changed, nil otherwise. */)
signal_after_change (XINT (start), XINT (end) - XINT (start),
XINT (end) - XINT (start));
- return modified ? Qt : Qnil;
+ eassert (modified);
+ return Qt;
}
if (LENGTH (i) == len)
@@ -1219,7 +1240,7 @@ Return t if any property value actually changed, nil otherwise. */)
}
len -= LENGTH (i);
- modified += add_properties (properties, i, object);
+ modified |= add_properties (properties, i, object);
i = next_interval (i);
}
}
@@ -1423,13 +1444,15 @@ Return t if any property was actually removed, nil otherwise.
Use `set-text-properties' if you want to remove all text properties. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
- register INTERVAL i, unchanged;
- register ptrdiff_t s, len;
- register int modified = 0;
+ INTERVAL i, unchanged;
+ ptrdiff_t s, len;
+ bool modified = 0;
+ bool first_time = 1;
if (NILP (object))
XSETBUFFER (object, current_buffer);
+ retry:
i = validate_interval_range (object, &start, &end, soft);
if (!i)
return Qnil;
@@ -1437,31 +1460,50 @@ Use `set-text-properties' if you want to remove all text properties. */)
s = XINT (start);
len = XINT (end) - s;
- if (i->position != s)
+ /* If there are no properties on this entire interval, return. */
+ if (! interval_has_some_properties (properties, i))
{
- /* No properties on this first interval -- return if
- it covers the entire region. */
- if (! interval_has_some_properties (properties, i))
+ ptrdiff_t got = LENGTH (i) - (s - i->position);
+
+ do
{
- ptrdiff_t got = (LENGTH (i) - (s - i->position));
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
+ got = LENGTH (i);
}
- /* Split away the beginning of this interval; what we don't
- want to modify. */
- else
+ while (! interval_has_some_properties (properties, i));
+ }
+ /* Split away the beginning of this interval; what we don't
+ want to modify. */
+ else if (i->position != s)
+ {
+ unchanged = i;
+ i = split_interval_right (unchanged, s - unchanged->position);
+ copy_properties (unchanged, i);
+ }
+
+ if (BUFFERP (object) && first_time)
+ {
+ ptrdiff_t prev_total_length = TOTAL_LENGTH (i);
+ ptrdiff_t prev_pos = i->position;
+
+ modify_region (object, start, end);
+ /* If someone called us recursively as a side effect of
+ modify_region, and changed the intervals behind our back
+ (could happen if lock_file, called by prepare_to_modify_buffer,
+ triggers redisplay, and that calls add-text-properties again
+ in the same buffer), we cannot continue with I, because its
+ data changed. So we restart the interval analysis anew. */
+ if (TOTAL_LENGTH (i) != prev_total_length
+ || i->position != prev_pos)
{
- unchanged = i;
- i = split_interval_right (unchanged, s - unchanged->position);
- copy_properties (unchanged, i);
+ first_time = 0;
+ goto retry;
}
}
- if (BUFFERP (object))
- modify_region (object, start, end);
-
/* We are at the beginning of an interval, with len to scan */
for (;;)
{
@@ -1470,7 +1512,13 @@ Use `set-text-properties' if you want to remove all text properties. */)
if (LENGTH (i) >= len)
{
if (! interval_has_some_properties (properties, i))
- return modified ? Qt : Qnil;
+ {
+ eassert (modified);
+ if (BUFFERP (object))
+ signal_after_change (XINT (start), XINT (end) - XINT (start),
+ XINT (end) - XINT (start));
+ return Qt;
+ }
if (LENGTH (i) == len)
{
@@ -1493,7 +1541,7 @@ Use `set-text-properties' if you want to remove all text properties. */)
}
len -= LENGTH (i);
- modified += remove_properties (properties, Qnil, i, object);
+ modified |= remove_properties (properties, Qnil, i, object);
i = next_interval (i);
}
}
@@ -1508,9 +1556,9 @@ markers). If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property was actually removed, nil otherwise. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
{
- register INTERVAL i, unchanged;
- register ptrdiff_t s, len;
- register int modified = 0;
+ INTERVAL i, unchanged;
+ ptrdiff_t s, len;
+ bool modified = 0;
Lisp_Object properties;
properties = list_of_properties;
@@ -1524,26 +1572,28 @@ Return t if any property was actually removed, nil otherwise. */)
s = XINT (start);
len = XINT (end) - s;
- if (i->position != s)
+ /* If there are no properties on the interval, return. */
+ if (! interval_has_some_properties_list (properties, i))
{
- /* No properties on this first interval -- return if
- it covers the entire region. */
- if (! interval_has_some_properties_list (properties, i))
+ ptrdiff_t got = LENGTH (i) - (s - i->position);
+
+ do
{
- ptrdiff_t got = (LENGTH (i) - (s - i->position));
if (got >= len)
return Qnil;
len -= got;
i = next_interval (i);
+ got = LENGTH (i);
}
- /* Split away the beginning of this interval; what we don't
- want to modify. */
- else
- {
- unchanged = i;
- i = split_interval_right (unchanged, s - unchanged->position);
- copy_properties (unchanged, i);
- }
+ while (! interval_has_some_properties_list (properties, i));
+ }
+ /* Split away the beginning of this interval; what we don't
+ want to modify. */
+ else if (i->position != s)
+ {
+ unchanged = i;
+ i = split_interval_right (unchanged, s - unchanged->position);
+ copy_properties (unchanged, i);
}
/* We are at the beginning of an interval, with len to scan.
@@ -1690,7 +1740,7 @@ int
text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
{
Lisp_Object prev_pos, front_sticky;
- int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
+ bool is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
if (NILP (buffer))
@@ -1765,7 +1815,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
Lisp_Object stuff;
Lisp_Object plist;
ptrdiff_t s, e, e2, p, len;
- int modified = 0;
+ bool modified = 0;
struct gcpro gcpro1, gcpro2;
i = validate_interval_range (src, &start, &end, soft);
@@ -1836,7 +1886,7 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)),
Fcar (Fcdr (Fcdr (res))), dest);
if (! NILP (res))
- modified++;
+ modified = 1;
stuff = Fcdr (stuff);
}
@@ -1907,33 +1957,28 @@ text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp
/* Add text properties to OBJECT from LIST. LIST is a list of triples
(START END PLIST), where START and END are positions and PLIST is a
property list containing the text properties to add. Adjust START
- and END positions by DELTA before adding properties. Value is
- non-zero if OBJECT was modified. */
+ and END positions by DELTA before adding properties. */
-int
+void
add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
{
struct gcpro gcpro1, gcpro2;
- int modified_p = 0;
GCPRO2 (list, object);
for (; CONSP (list); list = XCDR (list))
{
- Lisp_Object item, start, end, plist, tem;
+ Lisp_Object item, start, end, plist;
item = XCAR (list);
start = make_number (XINT (XCAR (item)) + XINT (delta));
end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta));
plist = XCAR (XCDR (XCDR (item)));
- tem = Fadd_text_properties (start, end, plist, object);
- if (!NILP (tem))
- modified_p = 1;
+ Fadd_text_properties (start, end, plist, object);
}
UNGCPRO;
- return modified_p;
}
diff --git a/src/unexaix.c b/src/unexaix.c
index da44480fdca..44a824b8c12 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -59,8 +59,6 @@ what you give them. Help stamp out software-hoarding! */
#include <unistd.h>
#include <fcntl.h>
-#include "mem-limits.h"
-
extern char _data[];
extern char _text[];
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 466a5c0e491..2e662a34145 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -99,7 +99,7 @@ struct aouthdr
#include <sys/file.h>
-#include "mem-limits.h"
+extern int etext;
static long block_copy_start; /* Old executable start point */
static struct filehdr f_hdr; /* File header */
@@ -168,7 +168,7 @@ make_hdr (int new, int a_out,
pagemask = getpagesize () - 1;
/* Adjust text/data boundary. */
- data_start = (int) start_of_data ();
+ data_start = (int) DATA_START;
data_start = ADDR_CORRECT (data_start);
data_start = data_start & ~pagemask; /* (Down) to page boundary. */
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 9dbb1b884b7..3fca8bd26c1 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -19,7 +19,37 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <unistd.h> /* for 'environ', on AIX */
#include "lisp.h"
-#include "mem-limits.h"
+
+#ifdef MSDOS
+#include <dpmi.h>
+extern int etext;
+#endif
+
+/* Some systems need this before <sys/resource.h>. */
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/time.h>
+# include <sys/resource.h>
+#else
+# if HAVE_SYS_VLIMIT_H
+# include <sys/vlimit.h> /* Obsolete, says glibc */
+# endif
+#endif
+
+/* Start of data. It is OK if this is approximate; it's used only as
+ a heuristic. */
+#ifdef DATA_START
+# define data_start ((char *) DATA_START)
+#else
+extern char data_start[];
+# ifndef HAVE_DATA_START
+/* Initialize to nonzero, so that it's put into data and not bss.
+ Link this file's object code first, so that this symbol is near the
+ start of data. */
+char data_start[1] = { 1 };
+# endif
+#endif
/*
Level number of warnings already issued.
@@ -31,18 +61,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
enum warnlevel { not_warned, warned_75, warned_85, warned_95 };
static enum warnlevel warnlevel;
-typedef void *POINTER;
-
/* Function to call to issue a warning;
0 means don't issue them. */
static void (*warn_function) (const char *);
-/* Start of data space; can be changed by calling malloc_init. */
-static POINTER data_space_start;
+/* Start of data space; can be changed by calling memory_warnings. */
+static char *data_space_start;
/* Number of bytes of writable memory we can expect to be able to get. */
static size_t lim_data;
+/* Return true if PTR cannot be represented as an Emacs Lisp object. */
+static bool
+exceeds_lisp_ptr (void *ptr)
+{
+ return (! USE_LSB_TAG
+ && VAL_MAX < UINTPTR_MAX
+ && ((uintptr_t) ptr & ~DATA_SEG_BITS) >> VALBITS != 0);
+}
#ifdef HAVE_GETRLIMIT
@@ -123,11 +159,13 @@ static void
check_memory_limits (void)
{
#ifdef REL_ALLOC
- extern POINTER (*real_morecore) (ptrdiff_t);
+ extern void *(*real_morecore) (ptrdiff_t);
+#else
+ void *(*real_morecore) (ptrdiff_t) = 0;
#endif
- extern POINTER (*__morecore) (ptrdiff_t);
+ extern void *(*__morecore) (ptrdiff_t);
- register POINTER cp;
+ char *cp;
size_t five_percent;
size_t data_size;
enum warnlevel new_warnlevel;
@@ -137,13 +175,8 @@ check_memory_limits (void)
five_percent = lim_data / 20;
/* Find current end of memory and issue warning if getting near max */
-#ifdef REL_ALLOC
- if (real_morecore)
- cp = (char *) (*real_morecore) (0);
- else
-#endif
- cp = (char *) (*__morecore) (0);
- data_size = (char *) cp - (char *) data_space_start;
+ cp = (real_morecore ? real_morecore : __morecore) (0);
+ data_size = cp - data_space_start;
if (!warn_function)
return;
@@ -190,62 +223,20 @@ check_memory_limits (void)
warnlevel = warned_85;
}
- if (EXCEEDS_LISP_PTR (cp))
+ if (exceeds_lisp_ptr (cp))
(*warn_function) ("Warning: memory in use exceeds lisp pointer size");
}
-#if !defined (CANNOT_DUMP) || !defined (SYSTEM_MALLOC)
-/* Some systems that cannot dump also cannot implement these. */
-
-/*
- * Return the address of the start of the data segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further information and definition of data_start.
- *
- * Apparently, on BSD systems this is etext at startup. On
- * USG systems (swapping) this is highly mmu dependent and
- * is also dependent on whether or not the program is running
- * with shared text. Generally there is a (possibly large)
- * gap between end of text and start of data with shared text.
- *
- */
-
-char *
-start_of_data (void)
-{
-#ifdef BSD_SYSTEM
- extern char etext;
- return (POINTER)(&etext);
-#elif defined DATA_START
- return ((POINTER) DATA_START);
-#elif defined ORDINARY_LINK
- /*
- * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
- * data_start isn't defined. We take the address of environ, which
- * is known to live at or near the start of the system crt0.c, and
- * we don't sweat the handful of bytes that might lose.
- */
- return ((POINTER) &environ);
-#else
- extern int data_start;
- return ((POINTER) &data_start);
-#endif
-}
-#endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */
-
/* Enable memory usage warnings.
START says where the end of pure storage is.
WARNFUN specifies the function to call to issue a warning. */
void
-memory_warnings (POINTER start, void (*warnfun) (const char *))
+memory_warnings (void *start, void (*warnfun) (const char *))
{
extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
- if (start)
- data_space_start = start;
- else
- data_space_start = start_of_data ();
+ data_space_start = start ? start : data_start;
warn_function = warnfun;
__after_morecore_hook = check_memory_limits;
diff --git a/src/w32.c b/src/w32.c
index ed86b1238ae..f42b83af605 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3402,14 +3402,15 @@ int
sys_open (const char * path, int oflag, int mode)
{
const char* mpath = map_w32_filename (path, NULL);
- /* Try to open file without _O_CREAT, to be able to write to hidden
- and system files. Force all file handles to be
- non-inheritable. */
- int res = _open (mpath, (oflag & ~_O_CREAT) | _O_NOINHERIT, mode);
+ int res = -1;
+
+ /* If possible, try to open file without _O_CREAT, to be able to
+ write to existing hidden and system files. Force all file
+ handles to be non-inheritable. */
+ if ((oflag & (_O_CREAT | _O_EXCL)) != (_O_CREAT | _O_EXCL))
+ res = _open (mpath, (oflag & ~_O_CREAT) | _O_NOINHERIT, mode);
if (res < 0)
res = _open (mpath, oflag | _O_NOINHERIT, mode);
- if (res >= 0 && res < MAXDESC)
- fd_info[res].flags = 0;
return res;
}
@@ -7822,47 +7823,26 @@ serial_configure (struct Lisp_Process *p, Lisp_Object contact)
ssize_t
emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz)
{
- int n, sc, err;
+ int n, err;
SELECT_TYPE fdset;
EMACS_TIME timeout;
struct Lisp_Process *process = (struct Lisp_Process *)p;
int fd = process->infd;
- for (;;)
- {
- n = sys_read (fd, (char*)buf, sz);
+ n = sys_read (fd, (char*)buf, sz);
- if (n >= 0)
- return n;
+ if (n >= 0)
+ return n;
- err = errno;
+ err = errno;
- if (err == EWOULDBLOCK)
- {
- /* Set a small timeout. */
- timeout = make_emacs_time (1, 0);
- FD_ZERO (&fdset);
- FD_SET ((int)fd, &fdset);
-
- /* Use select with the timeout to poll the selector. */
- sc = select (fd + 1, &fdset, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
- &timeout, NULL);
-
- if (sc > 0)
- continue; /* Try again. */
-
- /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN.
- Also accept select return 0 as an indicator to EAGAIN. */
- if (sc == 0 || errno == EWOULDBLOCK)
- err = EAGAIN;
- else
- err = errno; /* Other errors are just passed on. */
- }
+ /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN. */
+ if (err == EWOULDBLOCK)
+ err = EAGAIN;
- emacs_gnutls_transport_set_errno (process->gnutls_state, err);
+ emacs_gnutls_transport_set_errno (process->gnutls_state, err);
- return -1;
- }
+ return -1;
}
ssize_t
diff --git a/src/w32proc.c b/src/w32proc.c
index 3f3e97c77a0..84589388cd7 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -849,6 +849,12 @@ new_child (void)
cp = &child_procs[child_proc_count++];
Initialize:
+ /* Last opportunity to avoid leaking handles before we forget them
+ for good. */
+ if (cp->procinfo.hProcess)
+ CloseHandle (cp->procinfo.hProcess);
+ if (cp->procinfo.hThread)
+ CloseHandle (cp->procinfo.hThread);
memset (cp, 0, sizeof (*cp));
cp->fd = -1;
cp->pid = -1;
@@ -2257,12 +2263,42 @@ sys_kill (pid_t pid, int sig)
pid = -pid;
/* Only handle signals that will result in the process dying */
- if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP)
+ if (sig != 0
+ && sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP)
{
errno = EINVAL;
return -1;
}
+ if (sig == 0)
+ {
+ /* It will take _some_ time before PID 4 or less on Windows will
+ be Emacs... */
+ if (pid <= 4)
+ {
+ errno = EPERM;
+ return -1;
+ }
+ proc_hand = OpenProcess (PROCESS_QUERY_INFORMATION, 0, pid);
+ if (proc_hand == NULL)
+ {
+ DWORD err = GetLastError ();
+
+ switch (err)
+ {
+ case ERROR_ACCESS_DENIED: /* existing process, but access denied */
+ errno = EPERM;
+ return -1;
+ case ERROR_INVALID_PARAMETER: /* process PID does not exist */
+ errno = ESRCH;
+ return -1;
+ }
+ }
+ else
+ CloseHandle (proc_hand);
+ return 0;
+ }
+
cp = find_child_pid (pid);
if (cp == NULL)
{
diff --git a/src/window.c b/src/window.c
index ea1dd93711c..c2da2e8637a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5173,7 +5173,7 @@ displayed_window_lines (struct window *w)
DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
doc: /* Center point in selected window and maybe redisplay frame.
-With prefix argument ARG, recenter putting point on screen line ARG
+With a numeric prefix argument ARG, recenter putting point on screen line ARG
relative to the selected window. If ARG is negative, it counts up from the
bottom of the window. (ARG should be less than the height of the window.)
diff --git a/src/xdisp.c b/src/xdisp.c
index 08958f44575..f304ad0915c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5905,8 +5905,9 @@ pop_it (struct it *it)
static void
back_to_previous_line_start (struct it *it)
{
- IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
- IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
+ IT_CHARPOS (*it)
+ = find_next_newline_no_quit (IT_CHARPOS (*it) - 1,
+ -1, &IT_BYTEPOS (*it));
}
@@ -5977,8 +5978,8 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
short-cut. */
if (!newline_found_p)
{
- ptrdiff_t start = IT_CHARPOS (*it);
- ptrdiff_t limit = find_next_newline_no_quit (start, 1);
+ ptrdiff_t bytepos, start = IT_CHARPOS (*it);
+ ptrdiff_t limit = find_next_newline_no_quit (start, 1, &bytepos);
Lisp_Object pos;
eassert (!STRINGP (it->string));
@@ -5996,7 +5997,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p,
if (!it->bidi_p)
{
IT_CHARPOS (*it) = limit;
- IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit);
+ IT_BYTEPOS (*it) = bytepos;
}
else
{
@@ -7432,11 +7433,9 @@ get_visually_first_element (struct it *it)
if (string_p)
it->bidi_it.charpos = it->bidi_it.bytepos = 0;
else
- {
- it->bidi_it.charpos = find_next_newline_no_quit (IT_CHARPOS (*it),
- -1);
- it->bidi_it.bytepos = CHAR_TO_BYTE (it->bidi_it.charpos);
- }
+ it->bidi_it.charpos
+ = find_next_newline_no_quit (IT_CHARPOS (*it), -1,
+ &it->bidi_it.bytepos);
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
do
{
@@ -9071,7 +9070,7 @@ move_it_vertically_backward (struct it *it, int dy)
&& FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
{
ptrdiff_t nl_pos =
- find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
+ find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1, NULL);
move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS);
}
@@ -10526,6 +10525,7 @@ set_message (Lisp_Object string)
help_echo_showing_p = 0;
if (STRINGP (Vdebug_on_message)
+ && STRINGP (string)
&& fast_string_match (Vdebug_on_message, string) >= 0)
call_debugger (list2 (Qerror, string));
}
@@ -28244,7 +28244,7 @@ x_draw_vertical_border (struct window *w)
if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
return;
- /* Note: It is necessary to redraw bot the left and the right
+ /* Note: It is necessary to redraw both the left and the right
borders, for when only this single window W is being
redisplayed. */
if (!WINDOW_RIGHTMOST_P (w)
diff --git a/test/ChangeLog b/test/ChangeLog
index 7fed4f29408..fbd27021b5c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,26 @@
+2013-02-28 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * automated/python-tests.el (python-tests-with-temp-buffer): Doc fix.
+ (python-tests-with-temp-file): New macro.
+ (python-tests-shell-interpreter): New var.
+ (python-shell-get-process-name-1)
+ (python-shell-internal-get-process-name-1)
+ (python-shell-parse-command-1)
+ (python-shell-calculate-process-environment-1)
+ (python-shell-calculate-process-environment-2)
+ (python-shell-calculate-process-environment-3)
+ (python-shell-calculate-exec-path-1)
+ (python-shell-calculate-exec-path-2)
+ (python-shell-make-comint-1)
+ (python-shell-make-comint-2)
+ (python-shell-get-process-1)
+ (python-shell-get-or-create-process-1)
+ (python-shell-internal-get-or-create-process-1): New tests.
+
+2013-02-21 Fabián Ezequiel Gallina <fgallina@cuca>
+
+ * automated/python-tests.el: New file.
+
2013-02-14 Dmitry Gutov <dgutov@yandex.ru>
* automated/ruby-mode-tests.el
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
new file mode 100644
index 00000000000..ab8eb4816d3
--- /dev/null
+++ b/test/automated/python-tests.el
@@ -0,0 +1,2216 @@
+;;; python-tests.el --- Test suite for python.el
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'python)
+
+(defmacro python-tests-with-temp-buffer (contents &rest body)
+ "Create a `python-mode' enabled temp buffer with CONTENTS.
+BODY is code to be executed within the temp buffer. Point is
+always located at the beginning of buffer."
+ (declare (indent 1) (debug t))
+ `(with-temp-buffer
+ (python-mode)
+ (insert ,contents)
+ (goto-char (point-min))
+ ,@body))
+
+(defmacro python-tests-with-temp-file (contents &rest body)
+ "Create a `python-mode' enabled file with CONTENTS.
+BODY is code to be executed within the temp buffer. Point is
+always located at the beginning of buffer."
+ (declare (indent 1) (debug t))
+ `(let* ((temp-file (concat (make-temp-file "python-tests") ".py"))
+ (buffer (find-file-noselect temp-file)))
+ (unwind-protect
+ (with-current-buffer buffer
+ (python-mode)
+ (insert ,contents)
+ (goto-char (point-min))
+ ,@body)
+ (and buffer (kill-buffer buffer)))))
+
+(defun python-tests-look-at (string &optional num restore-point)
+ "Move point at beginning of STRING in the current buffer.
+Optional argument NUM defaults to 1 and is an integer indicating
+how many occurrences must be found, when positive the search is
+done forwards, otherwise backwards. When RESTORE-POINT is
+non-nil the point is not moved but the position found is still
+returned. When searching forward and point is already looking at
+STRING, it is skipped so the next STRING occurrence is selected."
+ (let* ((num (or num 1))
+ (starting-point (point))
+ (string (regexp-quote string))
+ (search-fn (if (> num 0) #'re-search-forward #'re-search-backward))
+ (deinc-fn (if (> num 0) #'1- #'1+))
+ (found-point))
+ (prog2
+ (catch 'exit
+ (while (not (= num 0))
+ (when (and (> num 0)
+ (looking-at string))
+ ;; Moving forward and already looking at STRING, skip it.
+ (forward-char (length (match-string-no-properties 0))))
+ (and (not (funcall search-fn string nil t))
+ (throw 'exit t))
+ (when (> num 0)
+ ;; `re-search-forward' leaves point at the end of the
+ ;; occurrence, move back so point is at the beginning
+ ;; instead.
+ (forward-char (- (length (match-string-no-properties 0)))))
+ (setq
+ num (funcall deinc-fn num)
+ found-point (point))))
+ found-point
+ (and restore-point (goto-char starting-point)))))
+
+
+;;; Tests for your tests, so you can test while you test.
+
+(ert-deftest python-tests-look-at-1 ()
+ "Test forward movement."
+ (python-tests-with-temp-buffer
+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+sed do eiusmod tempor incididunt ut labore et dolore magna
+aliqua."
+ (let ((expected (save-excursion
+ (dotimes (i 3)
+ (re-search-forward "et" nil t))
+ (forward-char -2)
+ (point))))
+ (should (= (python-tests-look-at "et" 3 t) expected))
+ ;; Even if NUM is bigger than found occurrences the point of last
+ ;; one should be returned.
+ (should (= (python-tests-look-at "et" 6 t) expected))
+ ;; If already looking at STRING, it should skip it.
+ (dotimes (i 2) (re-search-forward "et"))
+ (forward-char -2)
+ (should (= (python-tests-look-at "et") expected)))))
+
+(ert-deftest python-tests-look-at-2 ()
+ "Test backward movement."
+ (python-tests-with-temp-buffer
+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+sed do eiusmod tempor incididunt ut labore et dolore magna
+aliqua."
+ (let ((expected
+ (save-excursion
+ (re-search-forward "et" nil t)
+ (forward-char -2)
+ (point))))
+ (dotimes (i 3)
+ (re-search-forward "et" nil t))
+ (should (= (python-tests-look-at "et" -3 t) expected))
+ (should (= (python-tests-look-at "et" -6 t) expected)))))
+
+
+;;; Bindings
+
+
+;;; Python specialized rx
+
+
+;;; Font-lock and syntax
+
+
+;;; Indentation
+
+;; See: http://www.python.org/dev/peps/pep-0008/#indentation
+
+(ert-deftest python-indent-pep8-1 ()
+ "First pep8 case."
+ (python-tests-with-temp-buffer
+ "# Aligned with opening delimiter
+foo = long_function_name(var_one, var_two,
+ var_three, var_four)
+"
+ (should (eq (car (python-indent-context)) 'no-indent))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "foo = long_function_name(var_one, var_two,")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "var_three, var_four)")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 25))))
+
+(ert-deftest python-indent-pep8-2 ()
+ "Second pep8 case."
+ (python-tests-with-temp-buffer
+ "# More indentation included to distinguish this from the rest.
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (should (eq (car (python-indent-context)) 'no-indent))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "def long_function_name(")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "var_one, var_two, var_three,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "var_four):")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "print (var_one)")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 4))))
+
+(ert-deftest python-indent-pep8-3 ()
+ "Third pep8 case."
+ (python-tests-with-temp-buffer
+ "# Extra indentation is not necessary.
+foo = long_function_name(
+ var_one, var_two,
+ var_three, var_four)
+"
+ (should (eq (car (python-indent-context)) 'no-indent))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "foo = long_function_name(")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "var_one, var_two,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "var_three, var_four)")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))))
+
+(ert-deftest python-indent-inside-paren-1 ()
+ "The most simple inside-paren case that shouldn't fail."
+ (python-tests-with-temp-buffer
+ "
+data = {
+ 'key':
+ {
+ 'objlist': [
+ {
+ 'pk': 1,
+ 'name': 'first',
+ },
+ {
+ 'pk': 2,
+ 'name': 'second',
+ }
+ ]
+ }
+}
+"
+ (python-tests-look-at "data = {")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "'key':")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "{")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "'objlist': [")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "{")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "'pk': 1,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 16))
+ (python-tests-look-at "'name': 'first',")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 16))
+ (python-tests-look-at "},")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "{")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "'pk': 2,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 16))
+ (python-tests-look-at "'name': 'second',")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 16))
+ (python-tests-look-at "}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "]")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 0))))
+
+(ert-deftest python-indent-inside-paren-2 ()
+ "Another more compact paren group style."
+ (python-tests-with-temp-buffer
+ "
+data = {'key': {
+ 'objlist': [
+ {'pk': 1,
+ 'name': 'first'},
+ {'pk': 2,
+ 'name': 'second'}
+ ]
+}}
+"
+ (python-tests-look-at "data = {")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "'objlist': [")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "{'pk': 1,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "'name': 'first'},")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 9))
+ (python-tests-look-at "{'pk': 2,")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "'name': 'second'}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 9))
+ (python-tests-look-at "]")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "}}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "}")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 0))))
+
+(ert-deftest python-indent-after-block-1 ()
+ "The most simple after-block case that shouldn't fail."
+ (python-tests-with-temp-buffer
+ "
+def foo(a, b, c=True):
+"
+ (should (eq (car (python-indent-context)) 'no-indent))
+ (should (= (python-indent-calculate-indentation) 0))
+ (goto-char (point-max))
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 4))))
+
+(ert-deftest python-indent-after-block-2 ()
+ "A weird (malformed) multiline block statement."
+ (python-tests-with-temp-buffer
+ "
+def foo(a, b, c={
+ 'a':
+}):
+"
+ (goto-char (point-max))
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 4))))
+
+(ert-deftest python-indent-dedenters-1 ()
+ "Check all dedenters."
+ (python-tests-with-temp-buffer
+ "
+def foo(a, b, c):
+ if a:
+ print (a)
+ elif b:
+ print (b)
+ else:
+ try:
+ print (c.pop())
+ except (IndexError, AttributeError):
+ print (c)
+ finally:
+ print ('nor a, nor b are true')
+"
+ (python-tests-look-at "if a:")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "print (a)")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "elif b:")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "print (b)")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "else:")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "try:")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "print (c.pop())")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "except (IndexError, AttributeError):")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "print (c)")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 12))
+ (python-tests-look-at "finally:")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 8))
+ (python-tests-look-at "print ('nor a, nor b are true')")
+ (should (eq (car (python-indent-context)) 'after-beginning-of-block))
+ (should (= (python-indent-calculate-indentation) 12))))
+
+(ert-deftest python-indent-after-backslash-1 ()
+ "The most common case."
+ (python-tests-with-temp-buffer
+ "
+from foo.bar.baz import something, something_1 \\\\
+ something_2 something_3, \\\\
+ something_4, something_5
+"
+ (python-tests-look-at "from foo.bar.baz import something, something_1")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at "something_2 something_3,")
+ (should (eq (car (python-indent-context)) 'after-backslash))
+ (should (= (python-indent-calculate-indentation) 4))
+ (python-tests-look-at "something_4, something_5")
+ (should (eq (car (python-indent-context)) 'after-backslash))
+ (should (= (python-indent-calculate-indentation) 4))
+ (goto-char (point-max))
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))))
+
+(ert-deftest python-indent-after-backslash-2 ()
+ "A pretty extreme complicated case."
+ (python-tests-with-temp-buffer
+ "
+objects = Thing.objects.all() \\\\
+ .filter(
+ type='toy',
+ status='bought'
+ ) \\\\
+ .aggregate(
+ Sum('amount')
+ ) \\\\
+ .values_list()
+"
+ (python-tests-look-at "objects = Thing.objects.all()")
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))
+ (python-tests-look-at ".filter(")
+ (should (eq (car (python-indent-context)) 'after-backslash))
+ (should (= (python-indent-calculate-indentation) 23))
+ (python-tests-look-at "type='toy',")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 27))
+ (python-tests-look-at "status='bought'")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 27))
+ (python-tests-look-at ") \\\\")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 23))
+ (python-tests-look-at ".aggregate(")
+ (should (eq (car (python-indent-context)) 'after-backslash))
+ (should (= (python-indent-calculate-indentation) 23))
+ (python-tests-look-at "Sum('amount')")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 27))
+ (python-tests-look-at ") \\\\")
+ (should (eq (car (python-indent-context)) 'inside-paren))
+ (should (= (python-indent-calculate-indentation) 23))
+ (python-tests-look-at ".values_list()")
+ (should (eq (car (python-indent-context)) 'after-backslash))
+ (should (= (python-indent-calculate-indentation) 23))
+ (forward-line 1)
+ (should (eq (car (python-indent-context)) 'after-line))
+ (should (= (python-indent-calculate-indentation) 0))))
+
+
+;;; Navigation
+
+(ert-deftest python-nav-beginning-of-defun-1 ()
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+"
+ (python-tests-look-at "return wrap")
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def wrapped_f(*args):" -1)
+ (beginning-of-line)
+ (point))))
+ (python-tests-look-at "def wrapped_f(*args):" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def wwrap(f):" -1)
+ (beginning-of-line)
+ (point))))
+ (python-tests-look-at "def wwrap(f):" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def decoratorFunctionWithArguments" -1)
+ (beginning-of-line)
+ (point))))))
+
+(ert-deftest python-nav-beginning-of-defun-2 ()
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+
+ def m(self):
+ self.c()
+
+ def b():
+ pass
+
+ def a():
+ pass
+
+ def c(self):
+ pass
+"
+ ;; Nested defuns, are handled with care.
+ (python-tests-look-at "def c(self):")
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def m(self):" -1)
+ (beginning-of-line)
+ (point))))
+ ;; Defuns on same levels should be respected.
+ (python-tests-look-at "def a():" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def b():" -1)
+ (beginning-of-line)
+ (point))))
+ ;; Jump to a top level defun.
+ (python-tests-look-at "def b():" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def m(self):" -1)
+ (beginning-of-line)
+ (point))))
+ ;; Jump to a top level defun again.
+ (python-tests-look-at "def m(self):" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "class C(object):" -1)
+ (beginning-of-line)
+ (point))))))
+
+(ert-deftest python-nav-end-of-defun-1 ()
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+
+ def m(self):
+ self.c()
+
+ def b():
+ pass
+
+ def a():
+ pass
+
+ def c(self):
+ pass
+"
+ (should (= (save-excursion
+ (python-tests-look-at "class C(object):")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (point-max))))
+ (should (= (save-excursion
+ (python-tests-look-at "def m(self):")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def c(self):")
+ (forward-line -1)
+ (point))))
+ (should (= (save-excursion
+ (python-tests-look-at "def b():")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def b():")
+ (forward-line 2)
+ (point))))
+ (should (= (save-excursion
+ (python-tests-look-at "def c(self):")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (point-max))))))
+
+(ert-deftest python-nav-end-of-defun-2 ()
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+"
+ (should (= (save-excursion
+ (python-tests-look-at "def decoratorFunctionWithArguments")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (point-max))))
+ (should (= (save-excursion
+ (python-tests-look-at "@decoratorFunctionWithArguments")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (point-max))))
+ (should (= (save-excursion
+ (python-tests-look-at "def wwrap(f):")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "return wwrap")
+ (line-beginning-position))))
+ (should (= (save-excursion
+ (python-tests-look-at "def wrapped_f(*args):")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "return wrapped_f")
+ (line-beginning-position))))
+ (should (= (save-excursion
+ (python-tests-look-at "f(*args)")
+ (python-nav-end-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "return wrapped_f")
+ (line-beginning-position))))))
+
+
+(ert-deftest python-nav-beginning-of-statement-1 ()
+ (python-tests-with-temp-buffer
+ "
+v1 = 123 + \
+ 456 + \
+ 789
+v2 = (value1,
+ value2,
+
+ value3,
+ value4)
+v3 = ('this is a string'
+
+ 'that is continued'
+ 'between lines'
+ 'within a paren',
+ # this is a comment, yo
+ 'continue previous line')
+v4 = '''
+a very long
+string
+'''
+"
+ (python-tests-look-at "v2 =")
+ (python-util-forward-comment -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-statement)
+ (point))
+ (python-tests-look-at "v1 =" -1 t)))
+ (python-tests-look-at "v3 =")
+ (python-util-forward-comment -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-statement)
+ (point))
+ (python-tests-look-at "v2 =" -1 t)))
+ (python-tests-look-at "v4 =")
+ (python-util-forward-comment -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-statement)
+ (point))
+ (python-tests-look-at "v3 =" -1 t)))
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-statement)
+ (point))
+ (python-tests-look-at "v4 =" -1 t)))))
+
+(ert-deftest python-nav-end-of-statement-1 ()
+ (python-tests-with-temp-buffer
+ "
+v1 = 123 + \
+ 456 + \
+ 789
+v2 = (value1,
+ value2,
+
+ value3,
+ value4)
+v3 = ('this is a string'
+
+ 'that is continued'
+ 'between lines'
+ 'within a paren',
+ # this is a comment, yo
+ 'continue previous line')
+v4 = '''
+a very long
+string
+'''
+"
+ (python-tests-look-at "v1 =")
+ (should (= (save-excursion
+ (python-nav-end-of-statement)
+ (point))
+ (save-excursion
+ (python-tests-look-at "789")
+ (line-end-position))))
+ (python-tests-look-at "v2 =")
+ (should (= (save-excursion
+ (python-nav-end-of-statement)
+ (point))
+ (save-excursion
+ (python-tests-look-at "value4)")
+ (line-end-position))))
+ (python-tests-look-at "v3 =")
+ (should (= (save-excursion
+ (python-nav-end-of-statement)
+ (point))
+ (save-excursion
+ (python-tests-look-at
+ "'continue previous line')")
+ (line-end-position))))
+ (python-tests-look-at "v4 =")
+ (should (= (save-excursion
+ (python-nav-end-of-statement)
+ (point))
+ (save-excursion
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (point))))))
+
+(ert-deftest python-nav-forward-statement-1 ()
+ (python-tests-with-temp-buffer
+ "
+v1 = 123 + \
+ 456 + \
+ 789
+v2 = (value1,
+ value2,
+
+ value3,
+ value4)
+v3 = ('this is a string'
+
+ 'that is continued'
+ 'between lines'
+ 'within a paren',
+ # this is a comment, yo
+ 'continue previous line')
+v4 = '''
+a very long
+string
+'''
+"
+ (python-tests-look-at "v1 =")
+ (should (= (save-excursion
+ (python-nav-forward-statement)
+ (point))
+ (python-tests-look-at "v2 =")))
+ (should (= (save-excursion
+ (python-nav-forward-statement)
+ (point))
+ (python-tests-look-at "v3 =")))
+ (should (= (save-excursion
+ (python-nav-forward-statement)
+ (point))
+ (python-tests-look-at "v4 =")))
+ (should (= (save-excursion
+ (python-nav-forward-statement)
+ (point))
+ (point-max)))))
+
+(ert-deftest python-nav-backward-statement-1 ()
+ (python-tests-with-temp-buffer
+ "
+v1 = 123 + \
+ 456 + \
+ 789
+v2 = (value1,
+ value2,
+
+ value3,
+ value4)
+v3 = ('this is a string'
+
+ 'that is continued'
+ 'between lines'
+ 'within a paren',
+ # this is a comment, yo
+ 'continue previous line')
+v4 = '''
+a very long
+string
+'''
+"
+ (goto-char (point-max))
+ (should (= (save-excursion
+ (python-nav-backward-statement)
+ (point))
+ (python-tests-look-at "v4 =" -1)))
+ (should (= (save-excursion
+ (python-nav-backward-statement)
+ (point))
+ (python-tests-look-at "v3 =" -1)))
+ (should (= (save-excursion
+ (python-nav-backward-statement)
+ (point))
+ (python-tests-look-at "v2 =" -1)))
+ (should (= (save-excursion
+ (python-nav-backward-statement)
+ (point))
+ (python-tests-look-at "v1 =" -1)))))
+
+(ert-deftest python-nav-backward-statement-2 ()
+ :expected-result :failed
+ (python-tests-with-temp-buffer
+ "
+v1 = 123 + \
+ 456 + \
+ 789
+v2 = (value1,
+ value2,
+
+ value3,
+ value4)
+"
+ ;; FIXME: For some reason `python-nav-backward-statement' is moving
+ ;; back two sentences when starting from 'value4)'.
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (should (= (save-excursion
+ (python-nav-backward-statement)
+ (point))
+ (python-tests-look-at "v2 =" -1 t)))))
+
+(ert-deftest python-nav-beginning-of-block-1 ()
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+"
+ (python-tests-look-at "return wwrap")
+ (should (= (save-excursion
+ (python-nav-beginning-of-block)
+ (point))
+ (python-tests-look-at "def decoratorFunctionWithArguments" -1)))
+ (python-tests-look-at "print 'Inside wwrap()'")
+ (should (= (save-excursion
+ (python-nav-beginning-of-block)
+ (point))
+ (python-tests-look-at "def wwrap(f):" -1)))
+ (python-tests-look-at "print 'After f(*args)'")
+ (end-of-line)
+ (should (= (save-excursion
+ (python-nav-beginning-of-block)
+ (point))
+ (python-tests-look-at "def wrapped_f(*args):" -1)))
+ (python-tests-look-at "return wrapped_f")
+ (should (= (save-excursion
+ (python-nav-beginning-of-block)
+ (point))
+ (python-tests-look-at "def wwrap(f):" -1)))))
+
+(ert-deftest python-nav-end-of-block-1 ()
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+"
+ (python-tests-look-at "def decoratorFunctionWithArguments")
+ (should (= (save-excursion
+ (python-nav-end-of-block)
+ (point))
+ (save-excursion
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (point))))
+ (python-tests-look-at "def wwrap(f):")
+ (should (= (save-excursion
+ (python-nav-end-of-block)
+ (point))
+ (save-excursion
+ (python-tests-look-at "return wrapped_f")
+ (line-end-position))))
+ (end-of-line)
+ (should (= (save-excursion
+ (python-nav-end-of-block)
+ (point))
+ (save-excursion
+ (python-tests-look-at "return wrapped_f")
+ (line-end-position))))
+ (python-tests-look-at "f(*args)")
+ (should (= (save-excursion
+ (python-nav-end-of-block)
+ (point))
+ (save-excursion
+ (python-tests-look-at "print 'After f(*args)'")
+ (line-end-position))))))
+
+(ert-deftest python-nav-forward-block-1 ()
+ "This also accounts as a test for `python-nav-backward-block'."
+ (python-tests-with-temp-buffer
+ "
+if request.user.is_authenticated():
+ # def block():
+ # pass
+ try:
+ profile = request.user.get_profile()
+ except Profile.DoesNotExist:
+ profile = Profile.objects.create(user=request.user)
+ else:
+ if profile.stats:
+ profile.recalculate_stats()
+ else:
+ profile.clear_stats()
+ finally:
+ profile.views += 1
+ profile.save()
+"
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "if request.user.is_authenticated():")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "try:")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "except Profile.DoesNotExist:")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "else:")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "if profile.stats:")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "else:")))
+ (should (= (save-excursion (python-nav-forward-block))
+ (python-tests-look-at "finally:")))
+ ;; When point is at the last block, leave it there and return nil
+ (should (not (save-excursion (python-nav-forward-block))))
+ ;; Move backwards, and even if the number of moves is less than the
+ ;; provided argument return the point.
+ (should (= (save-excursion (python-nav-forward-block -10))
+ (python-tests-look-at
+ "if request.user.is_authenticated():" -1)))))
+
+(ert-deftest python-nav-lisp-forward-sexp-safe-1 ()
+ (python-tests-with-temp-buffer
+ "
+profile = Profile.objects.create(user=request.user)
+profile.notify()
+"
+ (python-tests-look-at "profile =")
+ (python-nav-lisp-forward-sexp-safe 4)
+ (should (looking-at "(user=request.user)"))
+ (python-tests-look-at "user=request.user")
+ (python-nav-lisp-forward-sexp-safe -1)
+ (should (looking-at "(user=request.user)"))
+ (python-nav-lisp-forward-sexp-safe -4)
+ (should (looking-at "profile ="))
+ (python-tests-look-at "user=request.user")
+ (python-nav-lisp-forward-sexp-safe 3)
+ (should (looking-at ")"))
+ (python-nav-lisp-forward-sexp-safe 1)
+ (should (looking-at "$"))
+ (python-nav-lisp-forward-sexp-safe 1)
+ (should (looking-at ".notify()"))))
+
+(ert-deftest python-nav-forward-sexp-1 ()
+ (python-tests-with-temp-buffer
+ "
+a()
+b()
+c()
+"
+ (python-tests-look-at "a()")
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (beginning-of-line)
+ (looking-at "a()")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (beginning-of-line)
+ (looking-at "b()")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (beginning-of-line)
+ (looking-at "c()")))
+ ;; Movement next to a paren should do what lisp does and
+ ;; unfortunately It can't change, because otherwise
+ ;; `blink-matching-open' breaks.
+ (python-nav-forward-sexp -1)
+ (should (looking-at "()"))
+ (should (save-excursion
+ (beginning-of-line)
+ (looking-at "c()")))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "c()"))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "b()"))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "a()"))))
+
+(ert-deftest python-nav-forward-sexp-2 ()
+ (python-tests-with-temp-buffer
+ "
+def func():
+ if True:
+ aaa = bbb
+ ccc = ddd
+ eee = fff
+ return ggg
+"
+ (python-tests-look-at "aa =")
+ (python-nav-forward-sexp)
+ (should (looking-at " = bbb"))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (back-to-indentation)
+ (looking-at "aaa = bbb")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (back-to-indentation)
+ (looking-at "ccc = ddd")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (back-to-indentation)
+ (looking-at "eee = fff")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should (save-excursion
+ (back-to-indentation)
+ (looking-at "return ggg")))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "def func():"))))
+
+(ert-deftest python-nav-forward-sexp-3 ()
+ (python-tests-with-temp-buffer
+ "
+from some_module import some_sub_module
+from another_module import another_sub_module
+
+def another_statement():
+ pass
+"
+ (python-tests-look-at "some_module")
+ (python-nav-forward-sexp)
+ (should (looking-at " import"))
+ (python-nav-forward-sexp)
+ (should (looking-at " some_sub_module"))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should
+ (save-excursion
+ (back-to-indentation)
+ (looking-at
+ "from some_module import some_sub_module")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should
+ (save-excursion
+ (back-to-indentation)
+ (looking-at
+ "from another_module import another_sub_module")))
+ (python-nav-forward-sexp)
+ (should (looking-at "$"))
+ (should
+ (save-excursion
+ (back-to-indentation)
+ (looking-at
+ "pass")))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "def another_statement():"))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "from another_module import another_sub_module"))
+ (python-nav-forward-sexp -1)
+ (should (looking-at "from some_module import some_sub_module"))))
+
+(ert-deftest python-nav-up-list-1 ()
+ (python-tests-with-temp-buffer
+ "
+def f():
+ if True:
+ return [i for i in range(3)]
+"
+ (python-tests-look-at "3)]")
+ (python-nav-up-list)
+ (should (looking-at "]"))
+ (python-nav-up-list)
+ (should (looking-at "$"))))
+
+(ert-deftest python-nav-backward-up-list-1 ()
+ :expected-result :failed
+ (python-tests-with-temp-buffer
+ "
+def f():
+ if True:
+ return [i for i in range(3)]
+"
+ (python-tests-look-at "3)]")
+ (python-nav-backward-up-list)
+ (should (looking-at "(3)\\]"))
+ (python-nav-backward-up-list)
+ (should (looking-at
+ "\\[i for i in range(3)\\]"))
+ ;; FIXME: Need to move to beginning-of-statement.
+ (python-nav-backward-up-list)
+ (should (looking-at
+ "return \\[i for i in range(3)\\]"))
+ (python-nav-backward-up-list)
+ (should (looking-at "if True:"))
+ (python-nav-backward-up-list)
+ (should (looking-at "def f():"))))
+
+
+;;; Shell integration
+
+(defvar python-tests-shell-interpreter "python")
+
+(ert-deftest python-shell-get-process-name-1 ()
+ "Check process name calculation on different scenarios."
+ (python-tests-with-temp-buffer
+ ""
+ (should (string= (python-shell-get-process-name nil)
+ python-shell-buffer-name))
+ ;; When the `current-buffer' doesn't have `buffer-file-name', even
+ ;; if dedicated flag is non-nil should not include its name.
+ (should (string= (python-shell-get-process-name t)
+ python-shell-buffer-name)))
+ (python-tests-with-temp-file
+ ""
+ ;; `buffer-file-name' is non-nil but the dedicated flag is nil and
+ ;; should be respected.
+ (should (string= (python-shell-get-process-name nil)
+ python-shell-buffer-name))
+ (should (string=
+ (python-shell-get-process-name t)
+ (format "%s[%s]" python-shell-buffer-name buffer-file-name)))))
+
+(ert-deftest python-shell-internal-get-process-name-1 ()
+ "Check the internal process name is config-unique."
+ (let* ((python-shell-interpreter python-tests-shell-interpreter)
+ (python-shell-interpreter-args "")
+ (python-shell-prompt-regexp ">>> ")
+ (python-shell-prompt-block-regexp "[.][.][.] ")
+ (python-shell-setup-codes "")
+ (python-shell-process-environment "")
+ (python-shell-extra-pythonpaths "")
+ (python-shell-exec-path "")
+ (python-shell-virtualenv-path "")
+ (expected (python-tests-with-temp-buffer
+ "" (python-shell-internal-get-process-name))))
+ ;; Same configurations should match.
+ (should
+ (string= expected
+ (python-tests-with-temp-buffer
+ "" (python-shell-internal-get-process-name))))
+ (let ((python-shell-interpreter-args "-B"))
+ ;; A minimal change should generate different names.
+ (should
+ (not (string=
+ expected
+ (python-tests-with-temp-buffer
+ "" (python-shell-internal-get-process-name))))))))
+
+(ert-deftest python-shell-parse-command-1 ()
+ "Check the command to execute is calculated correctly.
+Using `python-shell-interpreter' and
+`python-shell-interpreter-args'."
+ :expected-result (if (executable-find python-tests-shell-interpreter)
+ :passed
+ :failed)
+ (let ((python-shell-interpreter (executable-find
+ python-tests-shell-interpreter))
+ (python-shell-interpreter-args "-B"))
+ (should (string=
+ (format "%s %s"
+ python-shell-interpreter
+ python-shell-interpreter-args)
+ (python-shell-parse-command)))))
+
+(ert-deftest python-shell-calculate-process-environment-1 ()
+ "Test `python-shell-process-environment' modification."
+ (let* ((original-process-environment process-environment)
+ (python-shell-process-environment
+ '("TESTVAR1=value1" "TESTVAR2=value2"))
+ (process-environment
+ (python-shell-calculate-process-environment)))
+ (should (equal (getenv "TESTVAR1") "value1"))
+ (should (equal (getenv "TESTVAR2") "value2"))))
+
+(ert-deftest python-shell-calculate-process-environment-2 ()
+ "Test `python-shell-extra-pythonpaths' modification."
+ (let* ((original-process-environment process-environment)
+ (original-pythonpath (getenv "PYTHONPATH"))
+ (paths '("path1" "path2"))
+ (python-shell-extra-pythonpaths paths)
+ (process-environment
+ (python-shell-calculate-process-environment)))
+ (should (equal (getenv "PYTHONPATH")
+ (concat
+ (mapconcat 'identity paths path-separator)
+ path-separator original-pythonpath)))))
+
+(ert-deftest python-shell-calculate-process-environment-3 ()
+ "Test `python-shell-virtualenv-path' modification."
+ (let* ((original-process-environment process-environment)
+ (original-path (or (getenv "PATH") ""))
+ (python-shell-virtualenv-path
+ (directory-file-name user-emacs-directory))
+ (process-environment
+ (python-shell-calculate-process-environment)))
+ (should (not (getenv "PYTHONHOME")))
+ (should (string= (getenv "VIRTUAL_ENV") python-shell-virtualenv-path))
+ (should (equal (getenv "PATH")
+ (format "%s/bin%s%s"
+ python-shell-virtualenv-path
+ path-separator original-path)))))
+
+(ert-deftest python-shell-calculate-exec-path-1 ()
+ "Test `python-shell-exec-path' modification."
+ (let* ((original-exec-path exec-path)
+ (python-shell-exec-path '("path1" "path2"))
+ (exec-path (python-shell-calculate-exec-path)))
+ (should (equal
+ exec-path
+ (append python-shell-exec-path
+ original-exec-path)))))
+
+(ert-deftest python-shell-calculate-exec-path-2 ()
+ "Test `python-shell-exec-path' modification."
+ (let* ((original-exec-path exec-path)
+ (python-shell-virtualenv-path
+ (directory-file-name user-emacs-directory))
+ (exec-path (python-shell-calculate-exec-path)))
+ (should (equal
+ exec-path
+ (append (cons
+ (format "%s/bin" python-shell-virtualenv-path)
+ original-exec-path))))))
+
+(ert-deftest python-shell-make-comint-1 ()
+ "Check comint creation for global shell buffer."
+ :expected-result (if (executable-find python-tests-shell-interpreter)
+ :passed
+ :failed)
+ (let* ((python-shell-interpreter
+ (executable-find python-tests-shell-interpreter))
+ (proc-name (python-shell-get-process-name nil))
+ (shell-buffer
+ (python-tests-with-temp-buffer
+ "" (python-shell-make-comint
+ (python-shell-parse-command) proc-name)))
+ (process (get-buffer-process shell-buffer)))
+ (unwind-protect
+ (progn
+ (set-process-query-on-exit-flag process nil)
+ (should (process-live-p process))
+ (with-current-buffer shell-buffer
+ (should (eq major-mode 'inferior-python-mode))
+ (should (string= (buffer-name) (format "*%s*" proc-name)))))
+ (kill-buffer shell-buffer))))
+
+(ert-deftest python-shell-make-comint-2 ()
+ "Check comint creation for internal shell buffer."
+ :expected-result (if (executable-find python-tests-shell-interpreter)
+ :passed
+ :failed)
+ (let* ((python-shell-interpreter
+ (executable-find python-tests-shell-interpreter))
+ (proc-name (python-shell-internal-get-process-name))
+ (shell-buffer
+ (python-tests-with-temp-buffer
+ "" (python-shell-make-comint
+ (python-shell-parse-command) proc-name nil t)))
+ (process (get-buffer-process shell-buffer)))
+ (unwind-protect
+ (progn
+ (set-process-query-on-exit-flag process nil)
+ (should (process-live-p process))
+ (with-current-buffer shell-buffer
+ (should (eq major-mode 'inferior-python-mode))
+ (should (string= (buffer-name) (format " *%s*" proc-name)))))
+ (kill-buffer shell-buffer))))
+
+(ert-deftest python-shell-get-process-1 ()
+ "Check dedicated shell process preference over global."
+ :expected-result (if (executable-find python-tests-shell-interpreter)
+ :passed
+ :failed)
+ (python-tests-with-temp-file
+ ""
+ (let* ((python-shell-interpreter
+ (executable-find python-tests-shell-interpreter))
+ (global-proc-name (python-shell-get-process-name nil))
+ (dedicated-proc-name (python-shell-get-process-name t))
+ (global-shell-buffer
+ (python-shell-make-comint
+ (python-shell-parse-command) global-proc-name))
+ (dedicated-shell-buffer
+ (python-shell-make-comint
+ (python-shell-parse-command) dedicated-proc-name))
+ (global-process (get-buffer-process global-shell-buffer))
+ (dedicated-process (get-buffer-process dedicated-shell-buffer)))
+ (unwind-protect
+ (progn
+ (set-process-query-on-exit-flag global-process nil)
+ (set-process-query-on-exit-flag dedicated-process nil)
+ ;; Prefer dedicated if global also exists.
+ (should (equal (python-shell-get-process) dedicated-process))
+ (kill-buffer dedicated-shell-buffer)
+ ;; If there's only global, use it.
+ (should (equal (python-shell-get-process) global-process))
+ (kill-buffer global-shell-buffer)
+ ;; No buffer available.
+ (should (not (python-shell-get-process))))
+ (ignore-errors (kill-buffer global-shell-buffer))
+ (ignore-errors (kill-buffer dedicated-shell-buffer))))))
+
+(ert-deftest python-shell-get-or-create-process-1 ()
+ "Check shell process creation fallback."
+ :expected-result :failed
+ (python-tests-with-temp-file
+ ""
+ ;; XXX: Break early until we can skip stuff. We need to mimic
+ ;; user interaction because `python-shell-get-or-create-process'
+ ;; asks for all arguments interactively when a shell process
+ ;; doesn't exist.
+ (should nil)
+ (let* ((python-shell-interpreter
+ (executable-find python-tests-shell-interpreter))
+ (use-dialog-box)
+ (dedicated-process-name (python-shell-get-process-name t))
+ (dedicated-process (python-shell-get-or-create-process))
+ (dedicated-shell-buffer (process-buffer dedicated-process)))
+ (unwind-protect
+ (progn
+ (set-process-query-on-exit-flag dedicated-process nil)
+ ;; Prefer dedicated if not buffer exist.
+ (should (equal (process-name dedicated-process)
+ dedicated-process-name))
+ (kill-buffer dedicated-shell-buffer)
+ ;; No buffer available.
+ (should (not (python-shell-get-process))))
+ (ignore-errors (kill-buffer dedicated-shell-buffer))))))
+
+(ert-deftest python-shell-internal-get-or-create-process-1 ()
+ "Check internal shell process creation fallback."
+ :expected-result (if (executable-find python-tests-shell-interpreter)
+ :passed
+ :failed)
+ (python-tests-with-temp-file
+ ""
+ (should (not (process-live-p (python-shell-internal-get-process-name))))
+ (let* ((python-shell-interpreter
+ (executable-find python-tests-shell-interpreter))
+ (internal-process-name (python-shell-internal-get-process-name))
+ (internal-process (python-shell-internal-get-or-create-process))
+ (internal-shell-buffer (process-buffer internal-process)))
+ (unwind-protect
+ (progn
+ (set-process-query-on-exit-flag internal-process nil)
+ (should (equal (process-name internal-process)
+ internal-process-name))
+ (should (equal internal-process
+ (python-shell-internal-get-or-create-process)))
+ ;; No user buffer available.
+ (should (not (python-shell-get-process)))
+ (kill-buffer internal-shell-buffer))
+ (ignore-errors (kill-buffer internal-shell-buffer))))))
+
+
+;;; Shell completion
+
+
+;;; PDB Track integration
+
+
+;;; Symbol completion
+
+
+;;; Fill paragraph
+
+
+;;; Skeletons
+
+
+;;; FFAP
+
+
+;;; Code check
+
+
+;;; Eldoc
+
+
+;;; Imenu
+(ert-deftest python-imenu-prev-index-position-1 ()
+ (require 'imenu)
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+
+def test(): # Some comment
+ 'This is a test function'
+ print 'test'
+
+class C(object):
+
+ def m(self):
+ self.c()
+
+ def b():
+ pass
+
+ def a():
+ pass
+
+ def c(self):
+ pass
+"
+ (let ((expected
+ '(("*Rescan*" . -99)
+ ("decoratorFunctionWithArguments" . 2)
+ ("decoratorFunctionWithArguments.wwrap" . 224)
+ ("decoratorFunctionWithArguments.wwrap.wrapped_f" . 273)
+ ("test" . 500)
+ ("C" . 575)
+ ("C.m" . 593)
+ ("C.m.b" . 628)
+ ("C.m.a" . 663)
+ ("C.c" . 698))))
+ (mapc
+ (lambda (elt)
+ (should (= (cdr (assoc-string (car elt) expected))
+ (if (markerp (cdr elt))
+ (marker-position (cdr elt))
+ (cdr elt)))))
+ (imenu--make-index-alist)))))
+
+
+;;; Misc helpers
+
+(ert-deftest python-info-current-defun-1 ()
+ (python-tests-with-temp-buffer
+ "
+def foo(a, b):
+"
+ (forward-line 1)
+ (should (string= "foo" (python-info-current-defun)))
+ (should (string= "def foo" (python-info-current-defun t)))
+ (forward-line 1)
+ (should (not (python-info-current-defun)))
+ (indent-for-tab-command)
+ (should (string= "foo" (python-info-current-defun)))
+ (should (string= "def foo" (python-info-current-defun t)))))
+
+(ert-deftest python-info-current-defun-2 ()
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+
+ def m(self):
+ if True:
+ return [i for i in range(3)]
+ else:
+ return []
+
+ def b():
+ pass
+
+ def a():
+ pass
+
+ def c(self):
+ pass
+"
+ (forward-line 1)
+ (should (string= "C" (python-info-current-defun)))
+ (should (string= "class C" (python-info-current-defun t)))
+ (python-tests-look-at "return [i for ")
+ (should (string= "C.m" (python-info-current-defun)))
+ (should (string= "def C.m" (python-info-current-defun t)))
+ (python-tests-look-at "def b():")
+ (should (string= "C.m.b" (python-info-current-defun)))
+ (should (string= "def C.m.b" (python-info-current-defun t)))
+ (forward-line 2)
+ (indent-for-tab-command)
+ (python-indent-dedent-line-backspace 1)
+ (should (string= "C.m" (python-info-current-defun)))
+ (should (string= "def C.m" (python-info-current-defun t)))
+ (python-tests-look-at "def c(self):")
+ (forward-line -1)
+ (indent-for-tab-command)
+ (should (string= "C.m.a" (python-info-current-defun)))
+ (should (string= "def C.m.a" (python-info-current-defun t)))
+ (python-indent-dedent-line-backspace 1)
+ (should (string= "C.m" (python-info-current-defun)))
+ (should (string= "def C.m" (python-info-current-defun t)))
+ (python-indent-dedent-line-backspace 1)
+ (should (string= "C" (python-info-current-defun)))
+ (should (string= "class C" (python-info-current-defun t)))
+ (python-tests-look-at "def c(self):")
+ (should (string= "C.c" (python-info-current-defun)))
+ (should (string= "def C.c" (python-info-current-defun t)))
+ (python-tests-look-at "pass")
+ (should (string= "C.c" (python-info-current-defun)))
+ (should (string= "def C.c" (python-info-current-defun t)))))
+
+(ert-deftest python-info-current-defun-3 ()
+ (python-tests-with-temp-buffer
+ "
+def decoratorFunctionWithArguments(arg1, arg2, arg3):
+ '''print decorated function call data to stdout.
+
+ Usage:
+
+ @decoratorFunctionWithArguments('arg1', 'arg2')
+ def func(a, b, c=True):
+ pass
+ '''
+
+ def wwrap(f):
+ print 'Inside wwrap()'
+ def wrapped_f(*args):
+ print 'Inside wrapped_f()'
+ print 'Decorator arguments:', arg1, arg2, arg3
+ f(*args)
+ print 'After f(*args)'
+ return wrapped_f
+ return wwrap
+"
+ (python-tests-look-at "def wwrap(f):")
+ (forward-line -1)
+ (should (not (python-info-current-defun)))
+ (indent-for-tab-command 1)
+ (should (string= (python-info-current-defun)
+ "decoratorFunctionWithArguments"))
+ (should (string= (python-info-current-defun t)
+ "def decoratorFunctionWithArguments"))
+ (python-tests-look-at "def wrapped_f(*args):")
+ (should (string= (python-info-current-defun)
+ "decoratorFunctionWithArguments.wwrap.wrapped_f"))
+ (should (string= (python-info-current-defun t)
+ "def decoratorFunctionWithArguments.wwrap.wrapped_f"))
+ (python-tests-look-at "return wrapped_f")
+ (should (string= (python-info-current-defun)
+ "decoratorFunctionWithArguments.wwrap"))
+ (should (string= (python-info-current-defun t)
+ "def decoratorFunctionWithArguments.wwrap"))
+ (end-of-line 1)
+ (python-tests-look-at "return wwrap")
+ (should (string= (python-info-current-defun)
+ "decoratorFunctionWithArguments"))
+ (should (string= (python-info-current-defun t)
+ "def decoratorFunctionWithArguments"))))
+
+(ert-deftest python-info-current-symbol-1 ()
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+
+ def m(self):
+ self.c()
+
+ def c(self):
+ print ('a')
+"
+ (python-tests-look-at "self.c()")
+ (should (string= "self.c" (python-info-current-symbol)))
+ (should (string= "C.c" (python-info-current-symbol t)))))
+
+(ert-deftest python-info-current-symbol-2 ()
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+
+ class M(object):
+
+ def a(self):
+ self.c()
+
+ def c(self):
+ pass
+"
+ (python-tests-look-at "self.c()")
+ (should (string= "self.c" (python-info-current-symbol)))
+ (should (string= "C.M.c" (python-info-current-symbol t)))))
+
+(ert-deftest python-info-current-symbol-3 ()
+ "Keywords should not be considered symbols."
+ :expected-result :failed
+ (python-tests-with-temp-buffer
+ "
+class C(object):
+ pass
+"
+ ;; FIXME: keywords are not symbols.
+ (python-tests-look-at "class C")
+ (should (not (python-info-current-symbol)))
+ (should (not (python-info-current-symbol t)))
+ (python-tests-look-at "C(object)")
+ (should (string= "C" (python-info-current-symbol)))
+ (should (string= "class C" (python-info-current-symbol t)))))
+
+(ert-deftest python-info-statement-starts-block-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "def long_function_name")
+ (should (python-info-statement-starts-block-p))
+ (python-tests-look-at "print (var_one)")
+ (python-util-forward-comment -1)
+ (should (python-info-statement-starts-block-p))))
+
+(ert-deftest python-info-statement-starts-block-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError('sorry, you lose')
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (python-info-statement-starts-block-p))
+ (python-tests-look-at "raise ValueError(")
+ (python-util-forward-comment -1)
+ (should (python-info-statement-starts-block-p))))
+
+(ert-deftest python-info-statement-ends-block-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "print (var_one)")
+ (should (python-info-statement-ends-block-p))))
+
+(ert-deftest python-info-statement-ends-block-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "raise ValueError(")
+ (should (python-info-statement-ends-block-p))))
+
+(ert-deftest python-info-beginning-of-statement-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "def long_function_name")
+ (should (python-info-beginning-of-statement-p))
+ (forward-char 10)
+ (should (not (python-info-beginning-of-statement-p)))
+ (python-tests-look-at "print (var_one)")
+ (should (python-info-beginning-of-statement-p))
+ (goto-char (line-beginning-position))
+ (should (not (python-info-beginning-of-statement-p)))))
+
+(ert-deftest python-info-beginning-of-statement-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (python-info-beginning-of-statement-p))
+ (forward-char 10)
+ (should (not (python-info-beginning-of-statement-p)))
+ (python-tests-look-at "raise ValueError(")
+ (should (python-info-beginning-of-statement-p))
+ (goto-char (line-beginning-position))
+ (should (not (python-info-beginning-of-statement-p)))))
+
+(ert-deftest python-info-end-of-statement-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "def long_function_name")
+ (should (not (python-info-end-of-statement-p)))
+ (end-of-line)
+ (should (not (python-info-end-of-statement-p)))
+ (python-tests-look-at "print (var_one)")
+ (python-util-forward-comment -1)
+ (should (python-info-end-of-statement-p))
+ (python-tests-look-at "print (var_one)")
+ (should (not (python-info-end-of-statement-p)))
+ (end-of-line)
+ (should (python-info-end-of-statement-p))))
+
+(ert-deftest python-info-end-of-statement-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (not (python-info-end-of-statement-p)))
+ (end-of-line)
+ (should (not (python-info-end-of-statement-p)))
+ (python-tests-look-at "raise ValueError(")
+ (python-util-forward-comment -1)
+ (should (python-info-end-of-statement-p))
+ (python-tests-look-at "raise ValueError(")
+ (should (not (python-info-end-of-statement-p)))
+ (end-of-line)
+ (should (not (python-info-end-of-statement-p)))
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (should (python-info-end-of-statement-p))))
+
+(ert-deftest python-info-beginning-of-block-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "def long_function_name")
+ (should (python-info-beginning-of-block-p))
+ (python-tests-look-at "var_one, var_two, var_three,")
+ (should (not (python-info-beginning-of-block-p)))
+ (python-tests-look-at "print (var_one)")
+ (should (not (python-info-beginning-of-block-p)))))
+
+(ert-deftest python-info-beginning-of-block-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (python-info-beginning-of-block-p))
+ (python-tests-look-at "color == 'red' and emphasis")
+ (should (not (python-info-beginning-of-block-p)))
+ (python-tests-look-at "raise ValueError(")
+ (should (not (python-info-beginning-of-block-p)))))
+
+(ert-deftest python-info-end-of-block-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+def long_function_name(
+ var_one, var_two, var_three,
+ var_four):
+ print (var_one)
+"
+ (python-tests-look-at "def long_function_name")
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "var_one, var_two, var_three,")
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "var_four):")
+ (end-of-line)
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "print (var_one)")
+ (should (not (python-info-end-of-block-p)))
+ (end-of-line 1)
+ (should (python-info-end-of-block-p))))
+
+(ert-deftest python-info-end-of-block-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "color == 'red' and emphasis == 'strong' or")
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "highlight > 100:")
+ (end-of-line)
+ (should (not (python-info-end-of-block-p)))
+ (python-tests-look-at "raise ValueError(")
+ (should (not (python-info-end-of-block-p)))
+ (end-of-line 1)
+ (should (not (python-info-end-of-block-p)))
+ (goto-char (point-max))
+ (python-util-forward-comment -1)
+ (should (python-info-end-of-block-p))))
+
+(ert-deftest python-info-closing-block-1 ()
+ (python-tests-with-temp-buffer
+ "
+if request.user.is_authenticated():
+ try:
+ profile = request.user.get_profile()
+ except Profile.DoesNotExist:
+ profile = Profile.objects.create(user=request.user)
+ else:
+ if profile.stats:
+ profile.recalculate_stats()
+ else:
+ profile.clear_stats()
+ finally:
+ profile.views += 1
+ profile.save()
+"
+ (python-tests-look-at "try:")
+ (should (not (python-info-closing-block)))
+ (python-tests-look-at "except Profile.DoesNotExist:")
+ (should (= (python-tests-look-at "try:" -1 t)
+ (python-info-closing-block)))
+ (python-tests-look-at "else:")
+ (should (= (python-tests-look-at "except Profile.DoesNotExist:" -1 t)
+ (python-info-closing-block)))
+ (python-tests-look-at "if profile.stats:")
+ (should (not (python-info-closing-block)))
+ (python-tests-look-at "else:")
+ (should (= (python-tests-look-at "if profile.stats:" -1 t)
+ (python-info-closing-block)))
+ (python-tests-look-at "finally:")
+ (should (= (python-tests-look-at "else:" -2 t)
+ (python-info-closing-block)))))
+
+(ert-deftest python-info-closing-block-2 ()
+ (python-tests-with-temp-buffer
+ "
+if request.user.is_authenticated():
+ profile = Profile.objects.get_or_create(user=request.user)
+ if profile.stats:
+ profile.recalculate_stats()
+
+data = {
+ 'else': 'do it'
+}
+ 'else'
+"
+ (python-tests-look-at "'else': 'do it'")
+ (should (not (python-info-closing-block)))
+ (python-tests-look-at "'else'")
+ (should (not (python-info-closing-block)))))
+
+(ert-deftest python-info-line-ends-backslash-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+objects = Thing.objects.all() \\\\
+ .filter(
+ type='toy',
+ status='bought'
+ ) \\\\
+ .aggregate(
+ Sum('amount')
+ ) \\\\
+ .values_list()
+"
+ (should (python-info-line-ends-backslash-p 2)) ; .filter(...
+ (should (python-info-line-ends-backslash-p 3))
+ (should (python-info-line-ends-backslash-p 4))
+ (should (python-info-line-ends-backslash-p 5))
+ (should (python-info-line-ends-backslash-p 6)) ; ) \...
+ (should (python-info-line-ends-backslash-p 7))
+ (should (python-info-line-ends-backslash-p 8))
+ (should (python-info-line-ends-backslash-p 9))
+ (should (not (python-info-line-ends-backslash-p 10))))) ; .values_list()...
+
+(ert-deftest python-info-beginning-of-backslash-1 ()
+ (python-tests-with-temp-buffer
+ "
+objects = Thing.objects.all() \\\\
+ .filter(
+ type='toy',
+ status='bought'
+ ) \\\\
+ .aggregate(
+ Sum('amount')
+ ) \\\\
+ .values_list()
+"
+ (let ((first 2)
+ (second (python-tests-look-at ".filter("))
+ (third (python-tests-look-at ".aggregate(")))
+ (should (= first (python-info-beginning-of-backslash 2)))
+ (should (= second (python-info-beginning-of-backslash 3)))
+ (should (= second (python-info-beginning-of-backslash 4)))
+ (should (= second (python-info-beginning-of-backslash 5)))
+ (should (= second (python-info-beginning-of-backslash 6)))
+ (should (= third (python-info-beginning-of-backslash 7)))
+ (should (= third (python-info-beginning-of-backslash 8)))
+ (should (= third (python-info-beginning-of-backslash 9)))
+ (should (not (python-info-beginning-of-backslash 10))))))
+
+(ert-deftest python-info-continuation-line-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and height == 0 and")
+ (should (not (python-info-continuation-line-p)))
+ (python-tests-look-at "color == 'red' and emphasis == 'strong' or")
+ (should (python-info-continuation-line-p))
+ (python-tests-look-at "highlight > 100:")
+ (should (python-info-continuation-line-p))
+ (python-tests-look-at "raise ValueError(")
+ (should (not (python-info-continuation-line-p)))
+ (python-tests-look-at "'sorry, you lose'")
+ (should (python-info-continuation-line-p))
+ (forward-line 1)
+ (should (python-info-continuation-line-p))
+ (python-tests-look-at ")")
+ (should (python-info-continuation-line-p))
+ (forward-line 1)
+ (should (not (python-info-continuation-line-p)))))
+
+(ert-deftest python-info-block-continuation-line-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+if width == 0 and height == 0 and \\\\
+ color == 'red' and emphasis == 'strong' or \\\\
+ highlight > 100:
+ raise ValueError(
+'sorry, you lose'
+
+)
+"
+ (python-tests-look-at "if width == 0 and")
+ (should (not (python-info-block-continuation-line-p)))
+ (python-tests-look-at "color == 'red' and emphasis == 'strong' or")
+ (should (= (python-info-block-continuation-line-p)
+ (python-tests-look-at "if width == 0 and" -1 t)))
+ (python-tests-look-at "highlight > 100:")
+ (should (not (python-info-block-continuation-line-p)))))
+
+(ert-deftest python-info-block-continuation-line-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+def foo(a,
+ b,
+ c):
+ pass
+"
+ (python-tests-look-at "def foo(a,")
+ (should (not (python-info-block-continuation-line-p)))
+ (python-tests-look-at "b,")
+ (should (= (python-info-block-continuation-line-p)
+ (python-tests-look-at "def foo(a," -1 t)))
+ (python-tests-look-at "c):")
+ (should (not (python-info-block-continuation-line-p)))))
+
+(ert-deftest python-info-assignment-continuation-line-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+data = foo(), bar() \\\\
+ baz(), 4 \\\\
+ 5, 6
+"
+ (python-tests-look-at "data = foo(), bar()")
+ (should (not (python-info-assignment-continuation-line-p)))
+ (python-tests-look-at "baz(), 4")
+ (should (= (python-info-assignment-continuation-line-p)
+ (python-tests-look-at "foo()," -1 t)))
+ (python-tests-look-at "5, 6")
+ (should (not (python-info-assignment-continuation-line-p)))))
+
+(ert-deftest python-info-assignment-continuation-line-p-2 ()
+ (python-tests-with-temp-buffer
+ "
+data = (foo(), bar()
+ baz(), 4
+ 5, 6)
+"
+ (python-tests-look-at "data = (foo(), bar()")
+ (should (not (python-info-assignment-continuation-line-p)))
+ (python-tests-look-at "baz(), 4")
+ (should (= (python-info-assignment-continuation-line-p)
+ (python-tests-look-at "(foo()," -1 t)))
+ (python-tests-look-at "5, 6)")
+ (should (not (python-info-assignment-continuation-line-p)))))
+
+(ert-deftest python-info-looking-at-beginning-of-defun-1 ()
+ (python-tests-with-temp-buffer
+ "
+def decorat0r(deff):
+ '''decorates stuff.
+
+ @decorat0r
+ def foo(arg):
+ ...
+ '''
+ def wrap():
+ deff()
+ return wwrap
+"
+ (python-tests-look-at "def decorat0r(deff):")
+ (should (python-info-looking-at-beginning-of-defun))
+ (python-tests-look-at "def foo(arg):")
+ (should (not (python-info-looking-at-beginning-of-defun)))
+ (python-tests-look-at "def wrap():")
+ (should (python-info-looking-at-beginning-of-defun))
+ (python-tests-look-at "deff()")
+ (should (not (python-info-looking-at-beginning-of-defun)))))
+
+(ert-deftest python-info-current-line-comment-p-1 ()
+ (python-tests-with-temp-buffer
+ "
+# this is a comment
+foo = True # another comment
+'#this is a string'
+if foo:
+ # more comments
+ print ('bar') # print bar
+"
+ (python-tests-look-at "# this is a comment")
+ (should (python-info-current-line-comment-p))
+ (python-tests-look-at "foo = True # another comment")
+ (should (not (python-info-current-line-comment-p)))
+ (python-tests-look-at "'#this is a string'")
+ (should (not (python-info-current-line-comment-p)))
+ (python-tests-look-at "# more comments")
+ (should (python-info-current-line-comment-p))
+ (python-tests-look-at "print ('bar') # print bar")
+ (should (not (python-info-current-line-comment-p)))))
+
+(ert-deftest python-info-current-line-empty-p ()
+ (python-tests-with-temp-buffer
+ "
+# this is a comment
+
+foo = True # another comment
+"
+ (should (python-info-current-line-empty-p))
+ (python-tests-look-at "# this is a comment")
+ (should (not (python-info-current-line-empty-p)))
+ (forward-line 1)
+ (should (python-info-current-line-empty-p))))
+
+
+;;; Utility functions
+
+(ert-deftest python-util-goto-line-1 ()
+ (python-tests-with-temp-buffer
+ (concat
+ "# a comment
+# another comment
+def foo(a, b, c):
+ pass" (make-string 20 ?\n))
+ (python-util-goto-line 10)
+ (should (= (line-number-at-pos) 10))
+ (python-util-goto-line 20)
+ (should (= (line-number-at-pos) 20))))
+
+(ert-deftest python-util-clone-local-variables-1 ()
+ (let ((buffer (generate-new-buffer
+ "python-util-clone-local-variables-1"))
+ (varcons
+ '((python-fill-docstring-style . django)
+ (python-shell-interpreter . "python")
+ (python-shell-interpreter-args . "manage.py shell")
+ (python-shell-prompt-regexp . "In \\[[0-9]+\\]: ")
+ (python-shell-prompt-output-regexp . "Out\\[[0-9]+\\]: ")
+ (python-shell-extra-pythonpaths "/home/user/pylib/")
+ (python-shell-completion-setup-code
+ . "from IPython.core.completerlib import module_completion")
+ (python-shell-completion-module-string-code
+ . "';'.join(module_completion('''%s'''))\n")
+ (python-shell-completion-string-code
+ . "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
+ (python-shell-virtualenv-path
+ . "/home/user/.virtualenvs/project"))))
+ (with-current-buffer buffer
+ (kill-all-local-variables)
+ (dolist (ccons varcons)
+ (set (make-local-variable (car ccons)) (cdr ccons))))
+ (python-tests-with-temp-buffer
+ ""
+ (python-util-clone-local-variables buffer)
+ (dolist (ccons varcons)
+ (should
+ (equal (symbol-value (car ccons)) (cdr ccons)))))
+ (kill-buffer buffer)))
+
+(ert-deftest python-util-forward-comment-1 ()
+ (python-tests-with-temp-buffer
+ (concat
+ "# a comment
+# another comment
+ # bad indented comment
+# more comments" (make-string 9999 ?\n))
+ (python-util-forward-comment 1)
+ (should (= (point) (point-max)))
+ (python-util-forward-comment -1)
+ (should (= (point) (point-min)))))
+
+
+(provide 'python-tests)
+
+;; Local Variables:
+;; coding: utf-8
+;; indent-tabs-mode: nil
+;; End:
+
+;;; python-tests.el ends here