+++ /dev/null
-# Generated files
-precious ^(config\.status|config\.cache)$
-
-# Install-in-place makes these directories, so just ignore them
-backup ^(bin|data|lock|site-lisp)$
-
-# arch-tag: 6eeeaa4e-cc7e-4b22-b3d7-1089e155da14
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(bug-reference-url-format . "http://debbugs.gnu.org/%s")
- (mode . bug-reference))))
+ (mode . bug-reference)))
+ (diff-mode . ((mode . whitespace))))
;; arch-tag: fb93c160-e9fe-4184-aad1-e4f5daa11cbd
-2010-05-10 Miles Bader <miles@gnu.org>
+2010-05-24 Romain Francoise <romain@orebokech.com>
- * configure.in: Get rid of "unix" pre-defined macro when
- preprocessing Makefile. (Bug#5857) [Backport from trunk]
+ * make-dist: Look for version in src/emacs.c.
+ Use lisp/subr.el rather than lisp/version.el for location check.
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+2010-05-21 Glenn Morris <rgm@gnu.org>
- * Version 23.2 released.
+ * configure.in (MKDEPDIR): Parallel build tweak.
+
+ * configure.in (ns_frag): New output file.
+
+ * configure.in (OLDXMENU): Set to "nothing" if !HAVE_X11 || USE_GTK.
+ (OLDXMENU_TARGET): Set to empty if USE_GTK.
+
+ * configure.in (cannot_dump): New output variable.
+
+2010-05-20 enami tsugutomo <tsugutomo.enami@jp.sony.com>
+
+ * configure.in: On NetBSD, if terminfo is found, use it in
+ preference to termcap. (Bug#6190)
+
+2010-05-20 Glenn Morris <rgm@gnu.org>
+
+ * make-dist (src): Include *.mk.
+ * config.bat: Concatenate deps.mk onto the end of src/Makefile.
+ * configure.in (DEPFLAGS, MKDEPDIR): New output variables.
+ (deps_frag): New output file.
+ (AUTO_DEPEND): Remove this definition.
+
+ * configure.in (--with-gtk, --with-gcc): Remove option stubs.
+
+2010-05-19 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LINKER, YMF_PASS_LDFLAGS): New output variables.
+ (ORDINARY_LINK): New AC_DEFINE.
+ (LIB_GCC): No need to set if ORDINARY_LINK.
+
+2010-05-18 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (POST_ALLOC_OBJ) [cygwin]: Omit vm-limit.o.
+ (POST_ALLOC_OBJ) [!cygwin]: Set to empty.
+
+ * config.bat (RALLOC_OBJ): Edit to empty if sys_malloc.
+ * configure.in (REL_ALLOC): Unset on gnu, gnu-linux if DOUG_LEA_MALLOC.
+ (RALLOC_OBJ): New output variable.
+
+ * config.bat (GMALLOC_OBJ, VMLIMIT_OBJ): Edit to empty if sys_malloc.
+ * configure.in (GMALLOC_OBJ, VMLIMIT_OBJ): New output variables.
+
+2010-05-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * Makefile.in (src): Provide the name of the VCS file that witnesses
+ a pull.
+ ($(srcdir)/src/config.in): Handle accidental removal of src/config.in.
+
+2010-05-17 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (OLDXMENU_DEPS): New output variable.
+
+2010-05-16 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (ns_appbindir, ns_appresdir): Set using $ns_appdir.
+
+ * configure.in (ns_appdir, ns_appbindir): Add trailing "/" to value.
+ * Makefile.in (install-arch-dep): Update for above change.
+
+ * Makefile.in (ns_appdir): Remove.
+ (install-arch-dep): Test $ns_appresdir instead of $ns_appdir.
+
+ * configure.in (TEMACS_LDFLAGS2): New output variable.
+
+ * configure.in (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New output variable.
+ (START_FILES): Set to empty if NS_IMPL_GNUSTEP.
+ (GNUSTEP_SYSTEM_HEADERS, GNUSTEP_SYSTEM_LIBRARIES): Do not output,
+ nothing uses.
+
+2010-05-16 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in: Remove references to usg5-4 and bsd-common, $opsys
+ does not use them.
+ (X11R5_INHIBIT_I18N): Remove, unused.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIBXMENU): Set to empty if !HAVE_X_WINDOWS.
+
+ * configure.in (FONT_OBJ): Set to empty if !HAVE_X_WINDOWS.
+
+2010-05-15 Ken Raeburn <raeburn@raeburn.org>
+
+ * configure.in: Look for version string in its new location.
+
+2010-05-15 Eli Zaretskii <eliz@gnu.org>
+
+ * config.bat: Remove support for DJGPP v1.x.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (OLDXMENU_TARGET): New output variable.
-2010-05-03 Štěpán Němec <stepnem@gmail.com> (tiny change)
+ * Makefile.in (install-arch-dep): Update odd NS rule for Emacs version.
+
+ * Makefile.in (install-arch-indep): Remove references to RCS, CVS,
+ and other files that no longer exist.
+
+2010-05-14 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (cpp_undefs): Add mktime, register, X11.
+
+ * configure.in (GPM_MOUSE_SUPPORT): Remove.
+ (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): New output variables.
+ (HAVE_WINDOW_SYSTEM, HAVE_MOUSE): Move out of AC_BOTTOM.
+
+ * configure.in (NS_IMPL_GNUSTEP_INC): New output variable.
+ (GNUSTEP_MAKEFILES): Do not output.
+
+2010-05-13 Glenn Morris <rgm@gnu.org>
+
+ * configure.in: Fix some paren typos.
+
+ * configure.in (OLDXMENU, LIBXMENU): Set to empty if !HAVE_MENUS.
+
+ * configure.in (LD_SWITCH_X_SITE, C_SWITCH_X_SITE): Do not define.
+
+2010-05-12 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIB_SRC_EXTRA_INSTALLABLES): Remove, unused.
+
+ * configure.in (LIB_GCC): New output variable.
+
+2010-05-11 Glenn Morris <rgm@gnu.org>
+
+ * make-dist (msdos): No more mainmake.
+
+ * configure.in: Generate lib-src/Makefile directly, do not run cpp.
+ * config.bat: Do not run cpp on lib-src/Makefile.in.
+
+ * config.bat [HAVE_X11]: Run sed3x.inp on lib-src/Makefile.
+
+2010-05-10 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIBS_SYSTEM): New output variable, replacing cpp.
+
+ * configure.in (MAIL_USE_FLOCK, MAIL_USE_LOCKF): New AC_DEFINEs.
+ (BLESSMAIL_TARGET): New output variable.
+
+2010-05-08 Štěpán Němec <stepnem@gmail.com> (tiny change)
* INSTALL: Fix typos.
-2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* configure.in: Add check for buggy version of GCC (Bug#6031).
+2010-05-08 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (HAVE_LIBNCURSES): New local variable.
+ (TERMINFO, LIBS_TERMCAP, TERMCAP_OBJ): New output variables,
+ replacing cpp in src/s/*.h and src/Makefile.in.
+
+2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * Version 23.2 released.
+
+2010-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * configure.in: Add tests for `isnan' and `copysign'.
+
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ * config.bat: Allow for 2 leading `#'s in comments in
+ src/Makefile.in.
+
+2010-05-07 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+ Merges logic from src/s/* and src/Makefile.in.
+ (LD_SWITCH_SYSTEM_TEMACS): New output variable.
+
+2010-05-07 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Define START_FILES and LIB_STANDARD using autoconf.
+ * configure.in (START_FILES, LIB_STANDARD): New definitions, moved
+ here from src/s/*.h.
+ (HAVE_CRTIN): Remove, inline logic in the netbsd
+ START_FILES/LIB_STANDARD computation.
+
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (AC_PROG_LN_S): Remove test, nothing uses @LN_S@.
+
+ * Makefile.in (CPP, C_SWITCH_SYSTEM, ALLOCA, LN_S, C_SWITCH_X_SITE)
+ (LD_SWITCH_X_SITE): Remove unused variables.
+
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LD_SWITCH_X_SITE_AUX): Use AC_SUBST only, not AC_DEFINE
+ as well.
+ (LD_SWITCH_X_SITE_AUX_RPATH): New output variable.
+
+ * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable.
+
+ * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output
+ variables, replacing c_switch_machine, c_switch_system.
+ * Makefile.in (C_SWITCH_SYSTEM): Use @C_SWITCH_SYSTEM@ rather than
+ @c_switch_system@.
+
+2010-05-03 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIBXT_OTHER, LIBX_OTHER): New output variables.
+
+ * make-dist: There are no more src/m/*.inp files.
+
+2010-05-01 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in (LD_SWITCH_MACHINE, ld_switch_machine): Remove, unused.
+ (ac_link): Do not use ld_switch_machine.
+
+2010-05-01 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (OTHER_OBJ): Remove.
+ (PRE_ALLOC_OBJ, POST_ALLOC_OBJ): New output variables.
+
+2010-04-30 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (OTHER_OBJ): Always include vm-limit.o on Cygwin.
+ Elsewhere, maybe include it.
+
+ * configure.in (TOOLKIT_LIBW) [HAVE_GTK]: Set to $GTK_LIBS.
+ (OLDXMENU, LIBXMENU): New output variables.
+
+ * configure.in (OTHER_OBJ): New output variable.
+
+2010-04-28 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (CYGWIN_OBJ): New output variable.
+
+ * configure.in (GPM_MOUSE_SUPPORT): New output variable.
+
+ * configure.in (FONT_OBJ): New output variable.
+
+ * configure.in (LIBXMU): New output variable.
+
+ * configure.in (NS_OBJ, NS_SUPPORT): New output variables.
+
+ * configure.in (machine, canonical): On amdx86-64, check for a 32-bit
+ userland and maybe change values to i386 (move test from s/amdx86-64.h).
+
+2010-04-27 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIBXTR6): New output variable. Move unixware special
+ case here from src/s/unixware.h.
+
+ * configure.in (LUCID_LIBW, MOTIF_LIBW): No longer substitute
+ in Makefiles.
+ (TOOLKIT_LIBW): New output variable, replacing LUCID_LIBW/MOTIF_LIBW.
+
+ * configure.in (HAVE_MOTIF_2_1): Remove unused variable.
+ (LIBXP): No longer substitute in Makefiles.
+ (MOTIF_LIBW): New output variable. Move system-specific settings here
+ from src/s files.
+
+2010-04-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Reduce CPP usage.
+ * configure.in (LIB_X11_LIB): Remove, inline in the only user.
+ (unexec): Define unconditionally, all platforms define
+ UNEXEC. AC_SUBST it.
+ (UNEXEC_SRC): Remove, unused.
+ (C_SWITCH_X_SYSTEM): Define using autoconf, not cpp.
+
+2010-04-27 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (HAVE_MOTIF_2_1, HAVE_LIBXP): Remove unused AC_DEFINEs,
+ replaced by LIBXP.
+
+ * configure.in (--with-crt-dir): Doc fix (now valid for all platforms).
+ (CRT_DIR): On (powerpc64|sparc64)-*-linux-gnu*, default to /usr/lib64.
+ On hpux10-20, default to /lib.
+
+ * configure.in (LUCID_LIBW, LIBXP, WIDGET_OBJ): New output variables.
+
+2010-04-26 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in (LIBS_MACHINE): Remove, unused.
+
+ * configure.in (LIB_MATH): New output variable. Set it for some systems.
+
+2010-04-24 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (CRT_DIR): New output variable.
+ (--with-crt-dir): New option. (Bug#5655)
+ (HAVE_LIB64_DIR): Remove.
+
+2010-04-22 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in (REAL_CFLAGS, CFLAGS): Restore -g for gcc.
+
+2010-04-22 Miles Bader <miles@gnu.org>
+
+ * configure.in: Get rid of "unix" pre-defined macro when
+ preprocessing Makefile. (Bug#5857)
+
+2010-04-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ Avoid non-portable shell command negation
+ * configure.in: Revert last change.
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * configure.in: Change "if test ! -f" to "if ! test -f".
+
+2010-04-21 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (LIBSELINUX_LIBS): Always substitute in Makefiles.
+ (GTK_OBJ, DBUS_OBJ, LIBXSM, XMENU_OBJ, XOBJ): New output variables.
+
+2010-04-21 Karel Klíč <kklic@redhat.com>
+
+ * configure.in: New option: --with(out)-selinux, on by default.
+ Set HAVE_LIBSELINUX if we find libselinux, and substitute
+ LIBSELINUX_LIBS in Makefiles.
+
+2010-04-01 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in: Remove all references to LIBX11_SYSTEM.
+
+2010-03-30 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in: Remove all references to C_DEBUG_SWITCH.
+
+2010-03-27 Eli Zaretskii <eliz@gnu.org>
+
+ * config.bat <lib-src>: Edit out lines that begin with several #
+ characters.
+
+2010-03-20 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * configure.in: Remove support for old UNIX System V systems and
+ for Unixware on non-x86 machines.
+
+ * configure.in: Remove support for Solaris on PPC and for old versions.
+
+ * configure.in: Remove non-working lynxos port.
+
+2010-03-19 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * .dir-locals.el (c-mode): Turn on whitespace-mode for diff-mode.
+
+2010-03-19 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (HAVE_LIBNCURSES): Add a description to make autoheader
+ happy.
+
+2010-03-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * configure.in: Check for tputs and friends, abort if not
+ found (bug#5735).
+
+2010-03-18 Glenn Morris <rgm@gnu.org>
+
+ * configure.in (--with-x-toolkit): In the help text, say which options
+ are synonyms.
+
+ * configure.in (--with-mmdf, --with-mail-unlink):
+ New options, off by default.
+ (--with-mailhost): New option to set default POP host.
+ (LIBXPM, LIBJPEG, LIBPNG, LIBTIFF, LIBGIF, LIBGPM, LIBS_MAIL)
+ (LIBHESIOD, LIBRESOLV, COM_ERRLIB, CRYPTOLIB, KRB5LIB, DESLIB, KRB4LIB):
+ New variables, substituted in Makefiles.
+ (try_libungif, ac_gif_lib_name): Replace with HAVE_GIF=maybe, LIBGIF.
+ (LIBGIF): Use AC_SUBST rather than AC_DEFINE.
+ (HAVE_LIBMAIL, HAVE_LIBLOCKFILE, HAVE_LIBCOM_ERR, HAVE_LIBCRYPTO)
+ (HAVE_LIBK5CRYPTO, HAVE_LIBKRB5, HAVE_LIBDES425, HAVE_LIBDES)
+ (HAVE_LIBKRB4, HAVE_LIBKRB): New AC_DEFINEs.
+
+2010-03-18 Tetsurou Okazaki <okazaki@be.to> (tiny change)
+
+ * Makefile.in (uninstall): Handle the case where archlibdir does not
+ exist. (Bug#5720)
+
+2010-03-12 Eli Zaretskii <eliz@gnu.org>
+
+ These changes remove termcap.c from the build on Posix platforms.
+ * configure.in <AC_CHECK_HEADERS>: Remove termcap.h.
+
+ * configure: Regenerated.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-01-31 Juri Linkov <juri@jurta.org>
* .bzrignore: Add TAGS-LISP.
1994-05-09 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
* configure.in: Remove AC_LANG_C call. Not needed with Autoconf
- version > 1.8.
+ version > 1.8.
1994-05-08 Morten Welinder (terra@diku.dk)
# ==================== Things `configure' Might Edit ====================
CC=@CC@
-CPP=@CPP@
-C_SWITCH_SYSTEM=@c_switch_system@
-ALLOCA=@ALLOCA@
-LN_S=@LN_S@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
CPPFLAGS=@CPPFLAGS@
-C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
-LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
EXEEXT=@EXEEXT@
MAKEINFO=@MAKEINFO@
x_default_search_path=@x_default_search_path@
# Location to install Emacs.app under NeXT/Open/GNUstep / Cocoa
-ns_appdir=@ns_appdir@
ns_appbindir=@ns_appbindir@
ns_appresdir=@ns_appresdir@
CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \
fi;
+ if [ -r .bzr/checkout/dirstate ]; then \
+ vcswitness="$$(pwd)/.bzr/checkout/dirstate"; \
+ fi; \
cd $@; $(MAKE) all $(MFLAGS) \
CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
- LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS=""
+ LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" \
+ VCSWITNESS="$$vcswitness"
blessmail: Makefile src FRC
cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
cd ${srcdir} && autoconf
$(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
- @true
+ @ # Usually, there's no need to rebuild src/config.in just
+ @ # because stamp-h.in has changed (since building stamp-h.in
+ @ # refreshes config.in as well), but if config.in is missing
+ @ # then we really need to do something more.
+ [ -r "$@" ] || ( cd ${srcdir} && autoheader )
$(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
cd ${srcdir} && autoheader
rm -f $(srcdir)/src/stamp-h.in
${INSTALL_DATA} lib-src/$$f $(DESTDIR)${archlibdir}/$$f; \
else true; fi ; \
done
- if test "${ns_appdir}" != ""; then \
+ if test "${ns_appresdir}" != ""; then \
( cd ${ns_appresdir} ; \
if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
if test -d share/info ; then dir=share/info; $(MV_DIRS) ; fi ; \
rm -fr share ) ; \
- ( cd ${ns_appbindir}/libexec ; dir=emacs/*/*/* ; $(MV_DIRS); \
+ ( cd ${ns_appbindir}libexec ; dir=emacs/*/*/* ; $(MV_DIRS); \
rm -fr emacs ) ; \
- ( cd ${ns_appbindir}/bin ; rm -f emacs emacs-23* ; \
+ ( cd ${ns_appbindir}bin ; rm -f emacs emacs-24* ; \
ln -sf ../libexec/* .) ; \
else true ; fi
+## FIXME is the emacs-24* bit above really necessary and correct?
+## What if I have 24.1 and 24.2 installed at the same time?
+## In any case, it should use something like echo $version | sed 's/\..*//'
+## instead of hard-coding a version.
+
## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
## Needs to be the user running install, so configure can't set it.
set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
| (cd $${dest}; umask 022; \
tar -xvf - && cat > /dev/null) || exit 1; \
find $${dest} -exec chown $${installuser} {} ';' ;\
- for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
+ for subdir in `find $${dest} -type d -print` ; do \
chmod a+rx $${subdir} ; \
- rm -rf $${subdir}/RCS ; \
- rm -rf $${subdir}/CVS ; \
- rm -f $${subdir}/.cvsignore ; \
rm -f $${subdir}/.gitignore ; \
rm -f $${subdir}/.arch-inventory ; \
rm -f $${subdir}/.DS_Store ; \
rm -f $${subdir}/[mM]akefile*.c $${subdir}/[mM]akefile*[.-]in \
$${subdir}/[mM]akefile ; \
rm -f $${subdir}/ChangeLog* ; \
- rm -f $${subdir}/dired.todo ; \
done) ; \
done
-rm -f $(DESTDIR)${lispdir}/subdirs.el
esac ; \
fi ; \
done
- (cd $(DESTDIR)${archlibdir} && rm -f fns-*)
+ if [ -d $(DESTDIR)${archlibdir} ]; then \
+ (cd $(DESTDIR)${archlibdir} && rm -f fns-*) \
+ fi
-rm -rf $(DESTDIR)${libexecdir}/emacs/${version}
(cd $(DESTDIR)${infodir} && \
for elt in $(INFO_FILES); do \
See the end of the file for license conditions.
-This directory tree holds version 23.2.50 of GNU Emacs, the extensible,
+This directory tree holds version 24.0.50 of GNU Emacs, the extensible,
customizable, self-documenting real-time display editor.
The file INSTALL in this directory says how to build and install GNU
__CYGWIN__ Ditto
MSDOS Compiling the MS-DOS port.
__MSDOS__ Ditto.
-__DJGPP__ Major version number of the DJGPP library for the DOS port.
-__DJGPP_MINOR__ Minor version number of the DJGPP library.
-__GO32__ Compiling the DOS port with DJGPP v1.x (obsolete).
+__DJGPP_MINOR__ Minor version number of the DJGPP library; used only in msdos.c and dosfns.c.
DOS_NT Compiling for either the MS-DOS or native MS-Windows port.
WINDOWSNT Compiling the native MS-Windows (W32) port.
__MINGW32__ Compiling the W32 port with the MinGW port of GCC.
NS_IMPL_COCOA Compile support for Cocoa (Apple) implementation of NS GUI API.
HAVE_X11 Compile support for the X11 GUI.
HAVE_X_WINDOWS Compile support for X Window system
-X11 ?? Makefile.in suggests it's equivalent to HAVE_X11
+ (It looks like, nowadays, if HAVE_X11 is set, HAVE_X_WINDOWS must
+ be, and vice versa. At least, this is true for configure, and
+ msdos; not sure about nt.)
USE_LUCID Use the Lucid toolkit for menus&scrollbars. Requires HAVE_X11.
USE_MOTIF Use the Motif toolkit for menus&scrollbars. Requires HAVE_X11.
USE_GTK Use the Gtk toolkit for menus&scrollbars. Requires HAVE_X11.
HAVE_TERMIO
HAVE_TERMIOS
INTERRUPT_INPUT
-MAIL_USE_FLOCK
NARROWPROTO
-NOMULTIPLEJOBS
SEPCHAR
SIGTYPE
SYSTEM_TYPE
EXPLICIT_SIGN_EXTEND
LOAD_AVE_CVT
LOAD_AVE_TYPE
-NO_ARG_ARRAY
NO_REMAP
VIRT_ADDR_VARIES
WORDS_BIG_ENDIAN
-** Not used anymore by any port, can be cleaned up
-NO_SOCK_SIGIO
-
** Misc macros
USER_FULL_NAME If defined, overrides the default pw->pw_gecos for getting at the full user name. Only MSDOS overrides the default.
BCOPY_UPWARD_SAFE
BITS_PER_EMACS_INT
BITS_PER_LONG
+BITS_PER_CHAR
+BITS_PER_SHORT
+BITS_PER_INT
BROKEN_DATAGRAM_SOCKETS
BROKEN_FIONREAD
BROKEN_GET_CURRENT_DIR_NAME
BROKEN_SIGPTY
BSD4_2
BSD4_3
-BSD_PGRPS
BSD_SYSTEM
CLASH_DETECTION
-COFF_BSD_SYMBOLS
-CRT0_DUMMIES
-C_DEBUG_SWITCH
-C_SWITCH_MACHINE
-C_SWITCH_SYSTEM
-C_SWITCH_SYSTEM_TEMACS
-C_SWITCH_X_SYSTEM
DATA_SEG_BITS
DATA_START
DBL_MIN_REPLACEMENT
EMACS_CONFIG_OPTIONS
EMACS_INT
EMACS_UINT
-END_FILES_1
FILE_SYSTEM_CASE
FLOAT_CHECK_DOMAIN
FSCALE
HAVE_BCOPY
HAVE_CBRT
HAVE_CLOSEDIR
-HAVE_CRTIN
HAVE_DUP2
HAVE_EUIDACCESS
HAVE_FMOD
HAVE_INDEX
HAVE_INET_SOCKETS
HAVE_INVERSE_HYPERBOLIC
-HAVE_LIB64_DIR
HAVE_LIBKSTAT
-HAVE_LIBNCURSES
-HAVE_LIBPTHREADS
-HAVE_LIBXMU
HAVE_LIMITS_H
HAVE_LINUX_VERSION_H
HAVE_LOGB
HAVE_WORKING_VFORK
HAVE_XRMSETDATABASE
HPUX
-IBMR2AIX
INHIBIT_X11R6_XIM
INTERNAL_TERMINAL
IS_ANY_SEP
IS_DIRECTORY_SEP
KERNEL_FILE
LDAV_SYMBOL
-LD_SWITCH_MACHINE
-LD_SWITCH_MACHINE_TEMACS
-LD_SWITCH_SYSTEM
-LD_SWITCH_SYSTEM_TEMACS
-LD_SWITCH_SYSTEM_tmp
-LD_SWITCH_X_DEFAULT
-LIBS_DEBUG
-LIBS_MACHINE
-LIBS_SYSTEM
-LIBS_TERMCAP
-LIBX11_SYSTEM
-LIBXMU
-LIB_GCC
-LIB_MATH
-LIB_MOTIF
-LIB_STANDARD
LINKER
LINUX_VERSION_CODE
LISP_FLOAT_TYPE
LNOFLSH
LOCALTIME_CACHE
+MAIL_USE_FLOCK
MAIL_USE_LOCKF
MAIL_USE_POP
MAIL_USE_SYSTEM_LOCK
MIN_PTY_KERNEL_VERSION -- only used on Mac
MODE_LINE_BINARY_TEXT
MUST_UNDEF__STDC__
-NEED_BSDTTY
-NEED_ERRNO
-NEED_LIBW
-NEED_UNISTD_H
NLIST_STRUCT
NOT_C_CODE
-NOT_USING_MOTIF
NO_ABORT
-NO_DIR_LIBRARY
NO_EDITRES
NO_MATHERR
-NO_SHARED_LIBS
NO_TERMIO
NSIG
NSIG_MINIMUM
NULL
NULL_DEVICE
ORDINARY_LINK
-OTHER_FILES
O_APPEND
-O_BINARY
-O_CREAT
-O_EXCL
O_RDONLY
O_RDWR
-O_TEXT
-O_TRUNC
-O_WRONLY
PAGESIZE
PENDING_OUTPUT_COUNT
POSIX
-POSIX_SIGNALS
PREFER_VSUSP
PTY_ITERATION
PTY_NAME_SPRINTF
PURESIZE
RUN_TIME_REMAP
SA_RESTART
-SECTION_ALIGNMENT
+SECTION_ALIGNMENT -- was only used by s/lynxos.h, maybe all code depending on it can be removed.
SEGMENT_MASK
SETPGRP_RELEASES_CTTY
SETUP_SLAVE_PTY
SIGTRAP
SIGTYPE
SOLARIS2
-START_FILES
-START_FILES_1
STDC_HEADERS
SYMS_SYSTEM
SYSTEM_PURESIZE_EXTRA
SYSTEM_MALLOC
SYSV_SYSTEM_DIR
-Srandom
TAB3
TABDLY
TERM
-TERMINFO
TEXT_START
THIS_IS_CONFIGURE
-THIS_IS_MAKEFILE
TIME_WITH_SYS_TIME
TIOCSIGSEND
TM_IN_SYS_TIME
UNEXEC
UNIX98_PTYS
USE_CRT_DLL
-USE_MAC_IMAGE_IO
USE_TOOLKIT_SCROLL_BARS
USG
USG5
_WINSOCK_H
__ELF__
__FreeBSD__
-__FreeBSD_version
__GNUC__
__GNU_LIBRARY__
__GNUC_MINOR__
+2010-05-15 Ken Raeburn <raeburn@raeburn.org>
+
+ * admin.el (set-version, set-copyright): Update emacs.c instead of
+ version.el.
+
+ * make-tarball.txt: Update filename list in step 6.
+
+ * quick-install-emacs: Scan emacs.c instead of version.el for
+ version string.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ * CPP-DEFINES (__DJGPP__, __GO32__): Remove, no longer used.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
+2010-03-10 Miles Bader <miles@gnu.org>
+
+ * quick-install-emacs: Use more portable shell syntax.
+
+ * quick-install-emacs: (AVOID): Be more picky about files we avoid
+ installing.
+
2010-02-14 Juanma Barranquero <lekktu@gmail.com>
* quick-install-emacs (PRUNED): Fix typo in message.
(interactive "DEmacs root directory: \nsVersion number: ")
(unless (file-exists-p (expand-file-name "src/emacs.c" root))
(error "%s doesn't seem to be the root of an Emacs source tree" root))
- (set-version-in-file root "lisp/version.el" version
- (rx (and "emacs-version" (0+ space)
+ (set-version-in-file root "src/emacs.c" version
+ (rx (and "emacs_version" (0+ (not (in ?\")))
?\" (submatch (1+ (not (in ?\")))) ?\")))
(set-version-in-file root "README" version
(rx (and "version" (1+ space)
(format-time-string "%Y")))))
(unless (file-exists-p (expand-file-name "src/emacs.c" root))
(error "%s doesn't seem to be the root of an Emacs source tree" root))
- (set-version-in-file root "lisp/version.el" copyright
- (rx (and "emacs-copyright" (0+ space)
+ (set-version-in-file root "src/emacs.c" copyright
+ (rx (and "emacs_copyright" (0+ (not (in ?\")))
?\" (submatch (1+ (not (in ?\")))) ?\")))
(set-version-in-file root "lib-src/ebrowse.c" copyright
(rx (and "emacs_copyright" (0+ (not (in ?\")))
+++ /dev/null
-# Unlike most emacs dirs, admin/charsets has a simple non-autoconf-generated makefile
-source ^(Makefile)$
-
-# arch-tag: ee36cfe3-96f8-4e91-aec4-008c80a85e6b
make bootstrap
6. Commit configure, README, doc/emacs/emacs.texi,
- doc/lispref/elisp.texi, etc/AUTHORS, lisp/version.el, nt/emacs.rc,
+ doc/lispref/elisp.texi, etc/AUTHORS, src/emacs.c, nt/emacs.rc,
and lisp/cus-edit.el (if modified). Copy lisp/loaddefs.el to
lisp/ldefs-boot.el and commit lisp/ldefs-boot.el. For a release,
also commit the ChangeLog files in all directories.
-This file describes the bzr branch in which it is maintained.
-Everything below the line is branch-specific.
-________________________________________________________________________
-
-This is the trunk (sometimes mistakenly called "HEAD").
-When people say "use the development version of Emacs" or the
-"bzr version of Emacs", this is the branch they are talking about.
-
-Emacs development takes place on the trunk. Most of the time, Emacs
-hackers add to it relatively free of constraint (aside from proper
-legal / accounting practices), although sometimes there is related
-discussion on the emacs-devel mailing list.
-
-Sometime before the release of a new major version of Emacs (eg 22.1),
-a "feature freeze" is imposed on the trunk. No new features may be
-added after this point. This is usually many months before the release.
-During this time, there is no official place for development of new features.
-
-Shortly before the release, a release branch is created. For example,
-EMACS_22_BASE or EMACS_21_1_RC for Emacs 22.x and 21.x, respectively.
-(Unfortunately the naming scheme has not always been consistent.)
-
-The release branch is used to make the release (22.1), and all later
-members of the series (22.2, 22.3, etc). Generally, only bug-fixes have
-been allowed in the minor releases, although in 22.x, self-contained
-new features were allowed on a case-by-case basis.
-
-From the point that a release branch is created, the trunk is free for
-development for the next major version.
+You can view the available Emacs branches at
+
+http://bzr.savannah.gnu.org/r/emacs/
+
+Development normally takes places on the trunk.
+Sometimes specialized features are developed on separate branches
+before possibly being merged to the trunk.
+
+Development is discussed on the emacs-devel mailing list.
+
+Sometime before the release of a new major version of Emacs (eg 23.2),
+a "feature freeze" is imposed on the trunk. No new features may be
+added after this point. This is usually some months before the release.
+
+Shortly before the release, a release branch is created, and the
+trunk is then free for development.
+For example, "emacs-23" for Emacs 23.2 and later, "EMACS_23_1_RC" for
+23.1, "EMACS_22_BASE" for 22.x, and "EMACS_21_1_RC" for 21.x.
+
+Consult emacs-devel for exactly what kinds of changes are allowed
+on what branch at any time.
+
+If you are looking at this file in a branch other than the trunk,
+there may be some branch-specific documentation below this line.
+________________________________________________________________________
If a non-spam message accidentally gets discarded, just do:
cat /var/lib/mailman/spam/not-really-spam.msg | /usr/lib/debbugs/receive
+chown Debian-debbugs:Debian-debbugs /var/lib/debbugs/spool/incoming/*
... check it works ...
mv /var/lib/mailman/spam/not-really-spam.msg /var/lib/mailman/not-spam/
+Also check that the sender was not added to the auto-discard/reject list
+in the debbugs-submit Mailman interface.
+
** Administrivia
The debbugs-submit list should have the administrivia option off,
--- /dev/null
+NOTES ON COMMITTING TO EMACS'S BAZAAR REPO -*- outline -*-
+
+* Install changes only on one branch, let them get merged elsewhere if needed.
+In particular, install bug-fixes only on the release branch (if there
+is one) and let them get synced to the trunk; do not install them by
+hand on the trunk as well. E.g. if there is an active "emacs-23" branch
+and you have a bug-fix appropriate for the next Emacs-23.x release,
+install it only on the emacs-23 branch, not on the trunk as well.
+
+Installing things manually into more than one branch makes merges more
+difficult.
+
+http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01124.html
+
+* Backporting a bug-fix from the trunk to a branch (e.g. "emacs-23").
+Label the commit as a backport, e.g. by starting the commit message with
+"Backport:". This is helpful for the person merging the release branch
+to the trunk.
+
+http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00262.html
+
+* Installing changes from your personal branches.
+If your branch has only a single commit, or many different real
+commits, it is fine to do a merge. If your branch has only a very
+small number of "real" commits, but several "merge from trunks", it is
+preferred that you take your branch's diff, apply it to the trunk, and
+commit directly, not merge. This keeps the history cleaner.
+
+In general, when working on some feature in a separate branch, it is
+preferable not to merge from trunk until you are done with the
+feature. Unless you really need some change that was done on the
+trunk while you were developing on the branch, you don't really need
+those merges; just merge once, when you are done with the feature, and
+Bazaar will take care of the rest. Bazaar is much better in this than
+CVS, so interim merges are unnecessary.
+
+Or use shelves; or rebase; or do something else. See the thread for
+yet another fun excursion into the exciting world of version control.
+
+http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00086.html
ttn 2003-04-09
we use a C preprocesor not only in the normal compilation of .c files
-into object files, but also for creating
-
- src/Makefile
- lib-src/Makefile
-
+into object files, but also for creating src/Makefile.
(delimited by comment "start of cpp stuff"). some cpp implementations
insert whitespace in between tokens.
PUBLIC_LIBSRC_BINARIES='b2m emacsclient etags ctags ebrowse'
PUBLIC_LIBSRC_SCRIPTS='grep-changelog rcs-checkin'
-AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile makefile stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile testfile test-distrib"
+AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile$ Makefile.in$ Makefile.c$ makefile$ makefile.w32-in$ stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile testfile test-distrib"
# Prune old binaries lying around in the source tree
PRUNE=no
EOF
exit 0
;;
- -[^-]?*)
+ -[!-]?*)
# split concatenated single-letter options apart
FIRST="$1"; shift
set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@"
test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
-VERSION=`grep 'defconst[ ]*emacs-version' $SRC/lisp/version.el \
+VERSION=`grep 'char emacs_version' $SRC/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
DST_SHARE="$prefix/share/emacs/$VERSION"
+++ /dev/null
-# Generated at compile time
-precious ^unidata\.txt$
-
-# arch-tag: 7640ff84-9e72-45e6-a7c7-b7b307b73959
rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
rem\r
rem + msdos version 3 or better.\r
-rem + DJGPP version 1.12maint1 or later (version 2.03 or later recommended).\r
+rem + DJGPP version 2.0 or later (version 2.03 or later recommended).\r
rem + make utility that allows breaking of the 128 chars limit on\r
rem command lines. ndmake (as of version 4.5) won't work due to a\r
rem line length limit. The make that comes with DJGPP does work (and is\r
Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
Goto End\r
:go32Ok\r
-set djgpp_ver=1\r
-If ErrorLevel 20 set djgpp_ver=2\r
+set djgpp_ver=2\r
+If Not ErrorLevel 20 Echo To build 'Emacs' you need DJGPP v2.0 or later!\r
+If Not ErrorLevel 20 Goto End\r
rm -f junk.c junk junk.exe\r
-rem The v1.x build does not need djecho\r
-if "%DJGPP_VER%" == "1" Goto djechoOk\r
rem DJECHO is used by the top-level Makefile in the v2.x build\r
Echo Checking whether 'djecho' is available...\r
redir -o Nul -eo djecho -o junk.$$$ foo\r
if "%X11%" == "" goto src4\r
sed -f ../msdos/sed2x.inp <config.in >config.tmp\r
:src4\r
-if "%DJGPP_VER%" == "2" Goto src41\r
-sed -f ../msdos/sed2.inp <config.tmp >config.h2\r
-goto src42\r
-:src41\r
sed -f ../msdos/sed2v2.inp <config.tmp >config.h2\r
-:src42\r
Rem See if DECL_ALIGN can be supported with this GCC\r
rm -f junk.c junk.o junk junk.exe\r
echo struct { int i; char *p; } __attribute__((__aligned__(8))) foo; >junk.c\r
if exist dir.h ren dir.h vmsdir.h\r
\r
rem Create "makefile" from "makefile.in".\r
-rm -f Makefile junk.c\r
-sed -e "1,/== start of cpp stuff ==/s@^# .*$@@" <Makefile.in >junk.c\r
-If "%DJGPP_VER%" == "1" Goto mfV1\r
-gcc -E -traditional junk.c | sed -f ../msdos/sed1v2.inp >Makefile\r
-goto mfDone\r
-:mfV1\r
-gcc -E -traditional junk.c | sed -f ../msdos/sed1.inp >Makefile\r
-:mfDone\r
-rm -f junk.c\r
+rm -f Makefile junk.c junk2.c\r
+sed -e "1,/== start of cpp stuff ==/s@^##*[ ].*$@@" <Makefile.in >junk.c\r
+copy junk.c + deps.mk junk2.c\r
+gcc -E -traditional junk2.c | sed -f ../msdos/sed1v2.inp >Makefile\r
+rm -f junk.c junk2.c\r
\r
if "%X11%" == "" goto src5\r
mv Makefile makefile.tmp\r
rm -f makefile.tmp\r
:src5\r
\r
+if "%sys_malloc%" == "" goto src5a\r
+sed -e "/^GMALLOC_OBJ *=/s/gmalloc.o//" <Makefile >makefile.tmp\r
+sed -e "/^VMLIMIT_OBJ *=/s/vm-limit.o//" <makefile.tmp >makefile.tmp2\r
+sed -e "/^RALLOC_OBJ *=/s/ralloc.o//" <makefile.tmp2 >Makefile\r
+rm -f makefile.tmp makefile.tmp2\r
+:src5a\r
+\r
if "%nodebug%" == "" goto src6\r
sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp\r
sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >Makefile\r
rem ----------------------------------------------------------------------\r
Echo Configuring the library source directory...\r
cd lib-src\r
-rem Create "makefile" from "makefile.in".\r
-sed -e "1,/== start of cpp stuff ==/s@^#[ ].*$@@" <Makefile.in >junk.c\r
-gcc -E -traditional -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r
-If "%DJGPP_VER%" == "2" goto libsrc-v2\r
-sed -f ../msdos/sed3.inp <makefile.new >Makefile\r
-Goto libsrc2\r
-:libsrc-v2\r
-sed -f ../msdos/sed3v2.inp <makefile.new >Makefile\r
-:libsrc2\r
-rm -f makefile.new junk.c\r
+sed -f ../msdos/sed3v2.inp <Makefile.in >Makefile\r
+if "%X11%" == "" goto libsrc2a\r
+mv Makefile makefile.tmp\r
+sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile\r
+rm -f makefile.tmp\r
+:libsrc2a\r
if "%nodebug%" == "" goto libsrc3\r
sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp\r
sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >Makefile\r
Echo Configuring the main directory...\r
If Exist .dir-locals.el update .dir-locals.el _dir-locals.el\r
If Exist src\.dbxinit update src/.dbxinit src/_dbxinit\r
-If "%DJGPP_VER%" == "1" goto mainv1\r
Echo Looking for the GDB init file...\r
If Exist src\.gdbinit update src/.gdbinit src/_gdbinit\r
If Exist src\_gdbinit goto gdbinitOk\r
:gdbinitOk\r
Echo Looking for the GDB init file...found\r
copy msdos\mainmake.v2 Makefile >nul\r
-:mainv1\r
-If "%DJGPP_VER%" == "1" copy msdos\mainmake Makefile >nul\r
rem ----------------------------------------------------------------------\r
goto End\r
:SmallEnv\r
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for emacs 23.2.
+# Generated by GNU Autoconf 2.62 for emacs 24.0.50.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='emacs'
PACKAGE_TARNAME='emacs'
-PACKAGE_VERSION='23.2'
-PACKAGE_STRING='emacs 23.2'
+PACKAGE_VERSION='24.0.50'
+PACKAGE_STRING='emacs 24.0.50'
PACKAGE_BUGREPORT=''
ac_unique_file="src/lisp.h"
CPP
GREP
EGREP
-LN_S
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
INSTALL_INFO
GZIP_PROG
MAKEINFO
+cannot_dump
+LD_SWITCH_SYSTEM
+C_SWITCH_MACHINE
+C_SWITCH_SYSTEM
+LIBS_SYSTEM
+CRT_DIR
+LIB_MATH
+START_FILES
LIBSOUND
PKG_CONFIG
ALSA_CFLAGS
ALSA_LIBS
CFLAGS_SOUND
SET_MAKE
+MKDEPDIR
+DEPFLAGS
XMKMF
+LD_SWITCH_X_SITE_AUX
+LD_SWITCH_X_SITE_AUX_RPATH
+NS_IMPL_GNUSTEP_INC
+NS_IMPL_GNUSTEP_TEMACS_LDFLAGS
+TEMACS_LDFLAGS2
+NS_OBJ
+NS_SUPPORT
+LIB_STANDARD
HAVE_XSERVER
+GMALLOC_OBJ
+VMLIMIT_OBJ
RSVG_CFLAGS
RSVG_LIBS
GTK_CFLAGS
GTK_LIBS
+GTK_OBJ
DBUS_CFLAGS
DBUS_LIBS
+DBUS_OBJ
GCONF_CFLAGS
GCONF_LIBS
+LIBSELINUX_LIBS
+LIBXTR6
+LIBXMU
FONTCONFIG_CFLAGS
FONTCONFIG_LIBS
XFT_CFLAGS
M17N_FLT_LIBS
FREETYPE_CFLAGS
FREETYPE_LIBS
+LIBXPM
+LIBJPEG
+LIBPNG
+LIBTIFF
+LIBGIF
+LIBGPM
+LIBXSM
ALLOCA
liblockfile
+LIBS_MAIL
+BLESSMAIL_TARGET
LIBOBJS
NEED_SETGID
KMEM_GROUP
GETLOADAVG_LIBS
GETOPT_H
GETOPTOBJS
+LIBS_TERMCAP
+TERMCAP_OBJ
+LIBHESIOD
+LIBRESOLV
+COM_ERRLIB
+CRYPTOLIB
+KRB5LIB
+DESLIB
+KRB4LIB
version
configuration
canonical
bitmapdir
gamedir
gameuser
-c_switch_system
-c_switch_machine
+unexec
LD_SWITCH_X_SITE
-LD_SWITCH_X_SITE_AUX
C_SWITCH_X_SITE
+C_SWITCH_X_SYSTEM
X_TOOLKIT_TYPE
machfile
opsysfile
ns_appbindir
ns_appresdir
ns_appsrc
-GNUSTEP_MAKEFILES
-GNUSTEP_SYSTEM_HEADERS
-GNUSTEP_SYSTEM_LIBRARIES
GNU_OBJC_CFLAGS
-LIB_SRC_EXTRA_INSTALLABLES
OTHER_FILES
+FONT_OBJ
+XMENU_OBJ
+XOBJ
+WIDGET_OBJ
+TOOLKIT_LIBW
+LIBXT_OTHER
+OLDXMENU_TARGET
+OLDXMENU
+LIBXMENU
+LIBX_OTHER
+OLDXMENU_DEPS
+RALLOC_OBJ
+CYGWIN_OBJ
+PRE_ALLOC_OBJ
+POST_ALLOC_OBJ
+LD_SWITCH_SYSTEM_TEMACS
+LD_SWITCH_SYSTEM_EXTRA
+YMF_PASS_LDFLAGS
+LINKER
+LIB_GCC
+MOUSE_SUPPORT
+TOOLTIP_SUPPORT
+WINDOW_SUPPORT
LTLIBOBJS'
-ac_subst_files=''
+ac_subst_files='deps_frag
+ns_frag'
ac_user_opts='
enable_option_checking
with_pop
with_kerberos
with_kerberos5
with_hesiod
+with_mmdf
+with_mail_unlink
+with_mailhost
with_sound
with_sync_input
with_x_toolkit
with_gpm
with_dbus
with_gconf
+with_selinux
with_makeinfo
-with_gtk
-with_gcc
with_pkg_config_prog
+with_crt_dir
with_gnustep_conf
enable_ns_self_contained
enable_asserts
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures emacs 23.2 to adapt to many kinds of systems.
+\`configure' configures emacs 24.0.50 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of emacs 23.2:";;
+ short | recursive ) echo "Configuration of emacs 24.0.50:";;
esac
cat <<\_ACEOF
--with-kerberos support Kerberos-authenticated POP
--with-kerberos5 support Kerberos version 5 authenticated POP
--with-hesiod support Hesiod to get the POP server host
+ --with-mmdf support MMDF mailboxes
+ --with-mail-unlink unlink, rather than empty, mail spool after reading
+ --with-mailhost=HOSTNAME
+ string giving default POP mail host
--without-sound don't compile with sound support
--without-sync-input process async input synchronously
- --with-x-toolkit=KIT use an X toolkit (KIT one of: yes, lucid, athena,
- motif, gtk, no)
+ --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, lucid or
+ athena, motif, no)
--without-xpm don't compile with XPM image support
--without-jpeg don't compile with JPEG image support
--without-tiff don't compile with TIFF image support
console
--without-dbus don't compile with D-Bus support
--without-gconf don't compile with GConf support
+ --without-selinux don't compile with SELinux support
--without-makeinfo don't require makeinfo for building manuals
-
--with-pkg-config-prog=PATH
path to 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-gnustep-conf=PATH
path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE,
or /etc/GNUstep/GNUstep.conf
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-emacs configure 23.2
+emacs configure 24.0.50
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by emacs $as_me 23.2, which was
+It was created by emacs $as_me 24.0.50, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
fi
+# Check whether --with-mmdf was given.
+if test "${with_mmdf+set}" = set; then
+ withval=$with_mmdf;
+else
+ with_mmdf=no
+fi
+
+if test "$with_mmdf" != no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_USE_MMDF 1
+_ACEOF
+
+fi
+
+
+# Check whether --with-mail-unlink was given.
+if test "${with_mail_unlink+set}" = set; then
+ withval=$with_mail_unlink;
+else
+ with_mail_unlink=no
+fi
+
+if test "$with_mail_unlink" != no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_UNLINK_SPOOL 1
+_ACEOF
+
+fi
+
+
+# Check whether --with-mailhost was given.
+if test "${with_mailhost+set}" = set; then
+ withval=$with_mailhost;
+cat >>confdefs.h <<_ACEOF
+#define MAILHOST "$withval"
+_ACEOF
+
+fi
+
+
+
# Check whether --with-sound was given.
if test "${with_sound+set}" = set; then
withval=$with_sound;
fi
+# Check whether --with-selinux was given.
+if test "${with_selinux+set}" = set; then
+ withval=$with_selinux;
+else
+ with_selinux=yes
+fi
+
+
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.
-# Check whether --with-gtk was given.
-if test "${with_gtk+set}" = set; then
- withval=$with_gtk; { { $as_echo "$as_me:$LINENO: error: --with-gtk has been removed. Use --with-x-toolkit to
-specify a toolkit." >&5
-$as_echo "$as_me: error: --with-gtk has been removed. Use --with-x-toolkit to
-specify a toolkit." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-# Check whether --with-gcc was given.
-if test "${with_gcc+set}" = set; then
- withval=$with_gcc; { { $as_echo "$as_me:$LINENO: error: --with-gcc has been removed. Set the \`CC' environment
-variable to specify a compiler." >&5
-$as_echo "$as_me: error: --with-gcc has been removed. Set the \`CC' environment
-variable to specify a compiler." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
# Check whether --with-pkg-config-prog was given.
if test "${with_pkg_config_prog+set}" = set; then
withval=$with_pkg_config_prog;
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-gnustep-conf was given.
if test "${with_gnustep_conf+set}" = set; then
## NetBSD ports
*-*-netbsd* )
opsys=netbsd
- if test -f /usr/lib/crti.o; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CRTIN /**/
-_ACEOF
-
- fi
-
case "${canonical}" in
alpha*-*-netbsd*) machine=alpha ;;
i[3456]86-*-netbsd*) machine=intel386 ;;
esac
;;
- ## LynxOS ports
- *-*-lynxos* )
- opsys=lynxos
- case "${canonical}" in
- i[3456]86-*-lynxos*) machine=intel386 ;;
- powerpc-*-lynxos*) machine=powerpc ;;
- esac
- ;;
-
alpha*-*-linux-gnu* )
machine=alpha opsys=gnu-linux
;;
*-sun-solaris* \
| i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
- | x86_64-*-solaris2* | x86_64-*-sunos5* \
- | powerpc*-*-solaris2* | rs6000-*-solaris2*)
+ | x86_64-*-solaris2* | x86_64-*-sunos5*)
case "${canonical}" in
i[3456]86-*-* ) machine=intel386 ;;
amd64-*-*|x86_64-*-*) machine=amdx86-64 ;;
- powerpc* | rs6000* ) machine=ibmrs6000 ;;
sparc* ) machine=sparc ;;
* ) unported=yes ;;
esac
case "${canonical}" in
- *-sunos5.3* | *-solaris2.3* )
- opsys=sol2-3
- NON_GNU_CPP=/usr/ccs/lib/cpp
- ;;
- *-sunos5.4* | *-solaris2.4* )
- opsys=sol2-4
- NON_GNU_CPP=/usr/ccs/lib/cpp
- RANLIB="ar -ts"
- ;;
- *-sunos5.5* | *-solaris2.5* )
- opsys=sol2-5
- NON_GNU_CPP=/usr/ccs/lib/cpp
- RANLIB="ar -ts"
- ;;
*-sunos5.6* | *-solaris2.6* )
opsys=sol2-6
NON_GNU_CPP=/usr/ccs/lib/cpp
if test x"${opsys}" = x; then
case "${canonical}" in
*-gnu* ) opsys=gnu ;;
- *-sysv4.2uw* ) opsys=unixware ;;
- *-sysv5uw* ) opsys=unixware ;;
- *-sysv5OpenUNIX* ) opsys=unixware ;;
- *-sysv4.1* | *-sysvr4.1* )
- NON_GNU_CPP=/usr/lib/cpp
- opsys=usg5-4 ;;
- *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
- if [ x$NON_GNU_CPP = x ]; then
- if [ -f /usr/ccs/lib/cpp ]; then
- NON_GNU_CPP=/usr/ccs/lib/cpp
- else
- NON_GNU_CPP=/lib/cpp
- fi
- fi
- opsys=usg5-4-2 ;;
- *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
* )
unported=yes
;;
#### Some other nice autoconf tests.
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
fi
fi
+
+## Although we're running on an amd64 kernel, we're actually compiling for
+## the x86 architecture. The user should probably have provided an
+## explicit --build to `configure', but if everything else than the kernel
+## is running in i386 mode, we can help them out.
+if test "$machine" = "amdx86-64"; then
+ { $as_echo "$as_me:$LINENO: checking whether i386 is declared" >&5
+$as_echo_n "checking whether i386 is declared... " >&6; }
+if test "${ac_cv_have_decl_i386+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef i386
+ (void) i386;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl_i386=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl_i386=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_i386" >&5
+$as_echo "$ac_cv_have_decl_i386" >&6; }
+
+ if test "$ac_cv_have_decl_i386" = "yes"; then
+ canonical=`echo "$canonical" | sed -e 's/^amd64/i386/' -e 's/^x86_64/i386/'`
+ machine=intel386
+ machfile="m/${machine}.h"
+ fi
+fi
+
# Extract the first word of "install-info", so it can be a program name with args.
set dummy install-info; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
if test "$MAKEINFO" = "no"; then
if test "x${with_makeinfo}" = "xno"; then
MAKEINFO=off
- elif ! test -e $srcdir/info/emacs; then
+ elif test ! -e $srcdir/info/emacs; then
{ { $as_echo "$as_me:$LINENO: error: You do not seem to have makeinfo >= 4.6, and your
source tree does not seem to have pre-built manuals in the \`info' directory.
Either install a suitable version of makeinfo, or re-run configure
echo '
#include "'${srcdir}'/src/'${opsysfile}'"
#include "'${srcdir}'/src/'${machfile}'"
-#ifndef LIBS_MACHINE
-#define LIBS_MACHINE
-#endif
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-#ifndef C_SWITCH_MACHINE
-#define C_SWITCH_MACHINE
-#endif
-configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
-configure___ c_switch_system=C_SWITCH_SYSTEM
-configure___ c_switch_machine=C_SWITCH_MACHINE
-#ifndef LIB_X11_LIB
-#define LIB_X11_LIB -lX11
-#endif
-
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
+configure___ LIBX=-lX11
-#ifdef UNEXEC
configure___ unexec=UNEXEC
+
+#ifdef CANNOT_DUMP
+configure___ cannot_dump=yes
#else
-configure___ unexec=unexec.o
+configure___ cannot_dump=no
#endif
#ifdef SYSTEM_MALLOC
configure___ use_mmap_for_buffers=no
#endif
-#ifndef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH -g
-#endif
-
#ifndef C_OPTIMIZE_SWITCH
#ifdef __GNUC__
#define C_OPTIMIZE_SWITCH -O2
#define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
#endif
-#ifndef LD_SWITCH_MACHINE
-#define LD_SWITCH_MACHINE
-#endif
-
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-#ifndef LD_SWITCH_X_SITE_AUX
-#define LD_SWITCH_X_SITE_AUX
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-configure___ ld_switch_machine=LD_SWITCH_MACHINE
-
#ifdef THIS_IS_CONFIGURE
/* Get the CFLAGS for tests in configure. */
#ifdef __GNUC__
-configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS=-g C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
#else
-configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS='${SPECIFIED_CFLAGS}'
#endif
#else /* not THIS_IS_CONFIGURE */
/* Get the CFLAGS for real compilation. */
#ifdef __GNUC__
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
#else
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
#endif
#endif /* not THIS_IS_CONFIGURE */
fi
rm ${tempcname}
-ac_link="$ac_link $ld_switch_machine $ld_switch_system"
+
+
+
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+ freebsd)
+ ## Let `ld' find image libs and similar things in /usr/local/lib.
+ ## The system compiler, GCC, has apparently been modified to not
+ ## look there, contrary to what a stock GCC would do.
+ LD_SWITCH_SYSTEM=-L/usr/local/lib
+ ;;
+
+ gnu-linux)
+ ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+ test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+ ;;
+
+ netbsd)
+ LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+ ;;
+
+ openbsd)
+ ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+ ## otherwise Emacs dumps core on elf systems.
+ LD_SWITCH_SYSTEM="-Z"
+ ;;
+esac
+
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun. Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet. When using
+## cpp, it was expanded to null. Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles. How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+ gnu-linux)
+ ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+ LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+ netbsd|openbsd)
+ ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+ LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
+
+
+C_SWITCH_MACHINE=
+if test "$machine" = "alpha"; then
+ { $as_echo "$as_me:$LINENO: checking whether __ELF__ is declared" >&5
+$as_echo_n "checking whether __ELF__ is declared... " >&6; }
+if test "${ac_cv_have_decl___ELF__+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __ELF__
+ (void) __ELF__;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl___ELF__=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl___ELF__=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___ELF__" >&5
+$as_echo "$ac_cv_have_decl___ELF__" >&6; }
+
+ if test "$ac_cv_have_decl___ELF__" = "yes"; then
+ ## With ELF, make sure that all common symbols get allocated to in the
+ ## data section. Otherwise, the dump of temacs may miss variables in
+ ## the shared library that have been initialized. For example, with
+ ## GNU libc, __malloc_initialized would normally be resolved to the
+ ## shared library's .bss section, which is fatal.
+ if test "x$GCC" = "xyes"; then
+ C_SWITCH_MACHINE="-fno-common"
+ else
+ { { $as_echo "$as_me:$LINENO: error: What gives? Fix me if DEC Unix supports ELF now." >&5
+$as_echo "$as_me: error: What gives? Fix me if DEC Unix supports ELF now." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+
+
+
+C_SWITCH_SYSTEM=
+## Some programs in src produce warnings saying certain subprograms
+## are too complex and need a MAXMEM value greater than 2000 for
+## additional optimization. --nils@exp-math.uni-essen.de
+test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
+ C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
+## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
+## It is redundant in glibc2, since we define _GNU_SOURCE.
+
+
+
+LIBS_SYSTEM=
+case "$opsys" in
+ ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
+ aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
+
+ freebsd) LIBS_SYSTEM="-lutil" ;;
+
+ hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
+
+ sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;;
+
+ ## Motif needs -lgen.
+ unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
+esac
+
+
### Make sure subsequent tests use flags consistent with the build flags.
if test x"${OVERRIDE_CPPFLAGS}" != x; then
CPPFLAGS="${OVERRIDE_CPPFLAGS}"
else
- CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
+ CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
fi
-### The standard library on x86-64 and s390x GNU/Linux distributions can
-### be located in either /usr/lib64 or /usr/lib.
-### In some rare cases, /usr/lib64 exists but does not contain the
-### relevant files (bug#1287). Hence test for crtn.o.
-case "${canonical}" in
- x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
- if test -e /usr/lib64/crtn.o; then
+## If user specified a crt-dir, use that unconditionally.
+if test "X$CRT_DIR" = "X"; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIB64_DIR 1
-_ACEOF
+ 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
+
+ ## Default is /usr/lib.
+ test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
+
+else
+
+ ## Some platforms don't use any of these files, so it is not
+ ## appropriate to put this test outside the if block.
+ test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
+ { { $as_echo "$as_me:$LINENO: error: crt*.o not found in specified location." >&5
+$as_echo "$as_me: error: crt*.o not found in specified location." >&2;}
+ { (exit 1); exit 1; }; }
fi
+
+
+
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+ cygwin )
+ LIB_MATH=
+ START_FILES='ecrt0.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)/crtend.o $(CRT_DIR)/crtn.o'
+ START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+ ;;
+ 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 )
+ if test -f $CRT_DIR/crti.o; then
+ 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'
+ else
+ LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+ START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+ fi
+ ;;
esac
+
+
+
if test "${with_sound}" != "no"; then
# Sound support for GNU/Linux and the free BSDs.
-
for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
- termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
+ stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
sys/utsname.h pwd.h utmp.h
do
fi
+DEPFLAGS=
+MKDEPDIR=":"
+deps_frag=deps.mk
if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
{ $as_echo "$as_me:$LINENO: checking whether we are using GNU Make" >&5
$as_echo_n "checking whether we are using GNU Make... " >&6; }
$as_echo "$ac_enable_autodepend" >&6; }
fi
if test $ac_enable_autodepend = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define AUTO_DEPEND 1
-_ACEOF
-
+ DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d'
+ ## In parallel builds, another make might create depdir between
+ ## the first test and mkdir, so stick another test on the end.
+ ## Or use mkinstalldirs? mkdir -p is not portable.
+ MKDEPDIR='test -d ${DEPDIR} || mkdir ${DEPDIR} || test -d ${DEPDIR}'
+ deps_frag=autodeps.mk
fi
fi
+deps_frag=$srcdir/src/$deps_frag
+
+
+
+
{ $as_echo "$as_me:$LINENO: checking for long file names" >&5
$as_echo_n "checking for long file names... " >&6; }
## Workaround for bug in autoconf <= 2.62.
## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html
## No need to do anything special for these standard directories.
-## This is an experiment, take it out if it causes problems.
if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then
x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'`
fi
+LD_SWITCH_X_SITE_AUX=
+LD_SWITCH_X_SITE_AUX_RPATH=
if test "${x_libraries}" != NONE; then
if test -n "${x_libraries}"; then
LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
+ LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'`
fi
x_default_search_path=""
x_search_path=${x_libraries}
fi
done
fi
-if test "${x_includes}" != NONE && test -n "${x_includes}"; then
+
+
+
+if test "${x_includes}" != NONE && test -n "${x_includes}"; then
C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
fi
HAVE_NS=no
NS_IMPL_COCOA=no
NS_IMPL_GNUSTEP=no
+NS_IMPL_GNUSTEP_INC=
+NS_IMPL_GNUSTEP_TEMACS_LDFLAGS=
tmp_CPPFLAGS="$CPPFLAGS"
tmp_CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
CFLAGS="$CFLAGS -x objective-c"
+TEMACS_LDFLAGS2="\${LDFLAGS}"
if test "${with_ns}" != no; then
if test "${opsys}" = darwin; then
NS_IMPL_COCOA=yes
- ns_appdir=`pwd`/nextstep/Emacs.app
- ns_appbindir=`pwd`/nextstep/Emacs.app/Contents/MacOS
- ns_appresdir=`pwd`/nextstep/Emacs.app/Contents/Resources
+ ns_appdir=`pwd`/nextstep/Emacs.app/
+ ns_appbindir=${ns_appdir}Contents/MacOS/
+ ns_appresdir=${ns_appdir}Contents/Resources
ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base
elif test -f $GNUSTEP_CONFIG_FILE; then
NS_IMPL_GNUSTEP=yes
- ns_appdir=`pwd`/nextstep/Emacs.app
- ns_appbindir=`pwd`/nextstep/Emacs.app
- ns_appresdir=`pwd`/nextstep/Emacs.app/Resources
+ ns_appdir=`pwd`/nextstep/Emacs.app/
+ ns_appbindir=${ns_appdir}
+ ns_appresdir=${ns_appdir}Resources
ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base
GNUSTEP_MAKEFILES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_MAKEFILES)"
GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)"
GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)"
+ ## Pull in stuff from GNUstep-make.
+ ## FIXME? Cleaner to use AC_SUBST_FILE for this?
+ NS_IMPL_GNUSTEP_INC="FOUNDATION_LIB=gnu
+GUI_LIB=gnu
+include $GNUSTEP_MAKEFILES/Additional/base.make
+include $GNUSTEP_MAKEFILES/Additional/gui.make
+shared=no
+"
+ NS_IMPL_GNUSTEP_TEMACS_LDFLAGS="-L${GNUSTEP_SYSTEM_LIBRARIES} -lgnustep-gui -lgnustep-base -lobjc \${CONFIG_SYSTEM_LIBS} -lpthread"
CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+ LIB_STANDARD=
+ START_FILES=
+ TEMACS_LDFLAGS2=
fi
if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for AppKit/AppKit.h" >&5
NS_HAVE_NSINTEGER=no
fi
fi
+
+
+
+
+ns_frag=/dev/null
+NS_OBJ=
+NS_SUPPORT=
if test "${HAVE_NS}" = yes; then
window_system=nextstep
with_xft=no
if test "${EN_NS_SELF_CONTAINED}" = yes; then
prefix=${ns_appresdir}
fi
+ ns_frag=$srcdir/src/ns.mk
+ NS_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o"
+ NS_SUPPORT="\${lispsource}emacs-lisp/easymenu.elc \${lispsource}term/ns-win.elc"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
+
+
+
+
case "${window_system}" in
x11 )
HAVE_X_WINDOWS=yes
if test $emacs_cv_var___after_morecore_hook = no; then
doug_lea_malloc=no
fi
+
if test "${system_malloc}" = "yes"; then
GNU_MALLOC=no
GNU_MALLOC_reason="
(The GNU allocators don't work with this system configuration.)"
+ GMALLOC_OBJ=
+ VMLIMIT_OBJ=
+else
+ test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
+ VMLIMIT_OBJ=vm-limit.o
fi
+
+
+
if test "$doug_lea_malloc" = "yes" ; then
if test "$GNU_MALLOC" = yes ; then
GNU_MALLOC_reason="
#define DOUG_LEA_MALLOC 1
_ACEOF
+
+ ## Use mmap directly for allocating larger buffers.
+ ## FIXME this comes from src/s/{gnu,gnu-linux}.h:
+ ## #ifdef DOUG_LEA_MALLOC; #undef REL_ALLOC; #endif
+ ## Does the AC_FUNC_MMAP test below make this check unecessary?
+ case "$opsys" in
+ gnu*) REL_ALLOC=no ;;
+ esac
fi
if test x"${REL_ALLOC}" = x; then
REL_ALLOC=no
fi
-LIBS="$libsrc_libs $LIBS"
+LIBS="$LIBS_SYSTEM $LIBS"
{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
fi
+## Note: when using cpp in s/aix4.2.h, this definition depended on
+## HAVE_LIBPTHREADS. That was not defined earlier in configure when
+## the system file was sourced. Hence the value of LIBS_SYSTEM
+## added to LIBS in configure would never contain the pthreads part,
+## but the value used in Makefiles might. FIXME?
+##
+## -lpthreads seems to be necessary for Xlib in X11R6, and should
+## be harmless on older versions of X where it happens to exist.
+test "$opsys" = "aix4-2" && \
+ test $ac_cv_lib_pthreads_cma_open = yes && \
+ LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
+
case ${host_os} in
aix*)
fi
+GTK_OBJ=
if test x"$pkg_check_gtk" = xyes; then
#define USE_GTK 1
_ACEOF
+ GTK_OBJ=gtkutil.o
USE_X_TOOLKIT=none
if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
:
fi
+
if test "${HAVE_GTK}" = "yes"; then
if test "$with_toolkit_scroll_bars" != no; then
fi
HAVE_DBUS=no
+DBUS_OBJ=
if test "${with_dbus}" = "yes"; then
succeeded=no
fi
done
+ DBUS_OBJ=dbusbind.o
fi
fi
+
HAVE_GCONF=no
if test "${HAVE_X11}" = "yes" && test "${with_gconf}" = "yes"; then
fi
fi
+HAVE_LIBSELINUX=no
+LIBSELINUX_LIBS=
+if test "${with_selinux}" = "yes"; then
+ { $as_echo "$as_me:$LINENO: checking for lgetfilecon in -lselinux" >&5
+$as_echo_n "checking for lgetfilecon in -lselinux... " >&6; }
+if test "${ac_cv_lib_selinux_lgetfilecon+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lgetfilecon ();
+int
+main ()
+{
+return lgetfilecon ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_selinux_lgetfilecon=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_selinux_lgetfilecon=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_lgetfilecon" >&5
+$as_echo "$ac_cv_lib_selinux_lgetfilecon" >&6; }
+if test $ac_cv_lib_selinux_lgetfilecon = yes; then
+ HAVE_LIBSELINUX=yes
+else
+ HAVE_LIBSELINUX=no
+fi
+
+ if test "$HAVE_LIBSELINUX" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+ LIBSELINUX_LIBS=-lselinux
+ fi
+fi
+
+
HAVE_XAW3D=no
+LUCID_LIBW=
if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
if test "$with_xaw3d" != no; then
{ $as_echo "$as_me:$LINENO: checking for xaw3d" >&5
$as_echo "yes; using Lucid toolkit" >&6; }
USE_X_TOOLKIT=LUCID
HAVE_XAW3D=yes
+ LUCID_LIBW=-lXaw3d
cat >>confdefs.h <<\_ACEOF
#define HAVE_XAW3D 1
{ $as_echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
$as_echo "yes; using Lucid toolkit" >&6; }
USE_X_TOOLKIT=LUCID
+ LUCID_LIBW=-lXaw
elif test x"${USE_X_TOOLKIT}" = xLUCID; then
{ { $as_echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5
$as_echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;}
X_TOOLKIT_TYPE=$USE_X_TOOLKIT
+LIBXTR6=
if test "${USE_X_TOOLKIT}" != "none"; then
{ $as_echo "$as_me:$LINENO: checking X11 toolkit version" >&5
$as_echo_n "checking X11 toolkit version... " >&6; }
#define HAVE_X11XTR6 1
_ACEOF
+ LIBXTR6="-lSM -lICE"
+ case "$opsys" in
+ ## Use libw.a along with X11R6 Xt.
+ unixware) LIBXTR6="$LIBXTR6 -lw" ;;
+ esac
else
{ $as_echo "$as_me:$LINENO: result: before 6" >&5
$as_echo "before 6" >&6; }
test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
fi
+
+LIBXMU=-lXmu
+case "$machine" in
+ ## These machines don't supply Xmu.
+ hpux* | aix4-2 )
+ test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
+ ;;
+esac
+
+
# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
if test "${HAVE_X11}" = "yes"; then
if test "${USE_X_TOOLKIT}" != "none"; then
fi
fi
+LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
{ $as_echo "$as_me:$LINENO: checking for Motif version 2.1" >&5
$as_echo_n "checking for Motif version 2.1... " >&6; }
fi
{ $as_echo "$as_me:$LINENO: result: $emacs_cv_motif_version_2_1" >&5
$as_echo "$emacs_cv_motif_version_2_1" >&6; }
- HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
if test $emacs_cv_motif_version_2_1 = yes; then
- HAVE_LIBXP=no
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MOTIF_2_1 1
-_ACEOF
-
{ $as_echo "$as_me:$LINENO: checking for XpCreateContext in -lXp" >&5
$as_echo_n "checking for XpCreateContext in -lXp... " >&6; }
if test "${ac_cv_lib_Xp_XpCreateContext+set}" = set; then
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xp_XpCreateContext" >&5
$as_echo "$ac_cv_lib_Xp_XpCreateContext" >&6; }
if test $ac_cv_lib_Xp_XpCreateContext = yes; then
- HAVE_LIBXP=yes
+ LIBXP=-lXp
fi
- if test ${HAVE_LIBXP} = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXP 1
-_ACEOF
-
- fi
else
{ $as_echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
$as_echo_n "checking for LessTif where some systems put it... " >&6; }
HAVE_LIBOTF=no
HAVE_M17N_FLT=no
fi
+
### End of font-backend (under X11) section.
### Use -lXpm if available, unless `--with-xpm=no'.
HAVE_XPM=no
+LIBXPM=
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
if test "${ac_cv_header_X11_xpm_h+set}" = set; then
#define HAVE_XPM 1
_ACEOF
+ LIBXPM=-lXpm
fi
fi
+
### Use -ljpeg if available, unless `--with-jpeg=no'.
HAVE_JPEG=no
+LIBJPEG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_jpeg}" != "no"; then
if test "${ac_cv_header_jerror_h+set}" = set; then
rm -f conftest*
fi
+ if test "${HAVE_JPEG}" = "yes"; then
+ LIBJPEG=-ljpeg
+ fi
fi
+
### Use -lpng if available, unless `--with-png=no'.
HAVE_PNG=no
+LIBPNG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
#define HAVE_PNG 1
_ACEOF
+ LIBPNG="-lpng -lz -lm"
fi
fi
+
### Use -ltiff if available, unless `--with-tiff=no'.
HAVE_TIFF=no
+LIBTIFF=
if test "${HAVE_X11}" = "yes"; then
if test "${with_tiff}" != "no"; then
if test "${ac_cv_header_tiffio_h+set}" = set; then
#define HAVE_TIFF 1
_ACEOF
+ LIBTIFF=-ltiff
fi
fi
+
### Use -lgif or -lungif if available, unless `--with-gif=no'.
HAVE_GIF=no
+LIBGIF=
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
if test "${ac_cv_header_gif_lib_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for gif_lib.h" >&5
if test $ac_cv_lib_gif_EGifPutExtensionLast = yes; then
HAVE_GIF=yes
else
- try_libungif=yes
+ HAVE_GIF=maybe
fi
fi
if test "$HAVE_GIF" = yes; then
- ac_gif_lib_name="-lgif"
- fi
-
+ LIBGIF=-lgif
+ elif test "$HAVE_GIF" = maybe; then
# If gif_lib.h but no libgif, try libungif.
- if test x"$try_libungif" = xyes; then
{ $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
$as_echo_n "checking for EGifPutExtensionLast in -lungif... " >&6; }
if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
$as_echo "$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
HAVE_GIF=yes
+else
+ HAVE_GIF=no
fi
-
- if test "$HAVE_GIF" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define LIBGIF -lungif
-_ACEOF
-
- ac_gif_lib_name="-lungif"
- fi
+ test "$HAVE_GIF" = yes && LIBGIF=-lungif
fi
if test "${HAVE_GIF}" = "yes"; then
fi
fi
+
if test "${HAVE_X11}" = "yes"; then
MISSING=""
WITH_NO=""
### Use -lgpm if available, unless `--with-gpm=no'.
HAVE_GPM=no
+LIBGPM=
+MOUSE_SUPPORT=
if test "${with_gpm}" != "no"; then
if test "${ac_cv_header_gpm_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for gpm.h" >&5
fi
-fi
-if test "${HAVE_GPM}" = "yes"; then
+ if test "${HAVE_GPM}" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GPM 1
_ACEOF
+ LIBGPM=-lgpm
+ ## May be reset below.
+ MOUSE_SUPPORT="\$(GPM_MOUSE_SUPPORT)"
+ fi
fi
+
if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
$as_echo_n "checking for malloc/malloc.h... " >&6; }
+C_SWITCH_X_SYSTEM=
### Use NeXTstep API to implement GUI.
if test "${HAVE_NS}" = "yes"; then
#define NS_IMPL_GNUSTEP 1
_ACEOF
+ # See also .m.o rule in Makefile.in */
+ # FIXME: are all these flags really needed? Document here why. */
+ C_SWITCH_X_SYSTEM="-D_REENTRANT -fPIC -fno-strict-aliasing"
GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE"
fi
if test "${NS_HAVE_NSINTEGER}" = "yes"; then
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
+LIBXSM=
if test "${HAVE_X11}" = "yes"; then
if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
#define HAVE_X_SM 1
_ACEOF
+ LIBXSM="-lSM -lICE"
case "$LIBS" in
*-lSM*) ;;
- *) LIBS="-lSM -lICE $LIBS" ;;
+ *) LIBS="$LIBXSM $LIBS" ;;
esac
fi
fi
+
# If netdb.h doesn't declare h_errno, we must declare it by hand.
{ $as_echo "$as_me:$LINENO: checking whether netdb declares h_errno" >&5
$as_echo_n "checking whether netdb declares h_errno... " >&6; }
# Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below.
-
{ $as_echo "$as_me:$LINENO: checking for maillock in -lmail" >&5
$as_echo_n "checking for maillock in -lmail... " >&6; }
if test "${ac_cv_lib_mail_maillock+set}" = set; then
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mail_maillock" >&5
$as_echo "$ac_cv_lib_mail_maillock" >&6; }
if test $ac_cv_lib_mail_maillock = yes; then
- cat >>confdefs.h <<_ACEOF
+ have_mail=yes
+else
+ have_mail=no
+fi
+
+if test $have_mail = yes; then
+ LIBS_MAIL=-lmail
+ LIBS="$LIBS_MAIL $LIBS"
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMAIL 1
_ACEOF
- LIBS="-lmail $LIBS"
-
+else
+ LIBS_MAIL=
fi
-
-
{ $as_echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5
$as_echo_n "checking for maillock in -llockfile... " >&6; }
if test "${ac_cv_lib_lockfile_maillock+set}" = set; then
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5
$as_echo "$ac_cv_lib_lockfile_maillock" >&6; }
if test $ac_cv_lib_lockfile_maillock = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLOCKFILE 1
-_ACEOF
+ have_lockfile=yes
+else
+ have_lockfile=no
+fi
- LIBS="-llockfile $LIBS"
+if test $have_lockfile = yes; then
+ LIBS_MAIL=-llockfile
+ LIBS="$LIBS_MAIL $LIBS"
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBLOCKFILE 1
+_ACEOF
+else
# If we have the shared liblockfile, assume we must use it for mail
# locking (e.g. Debian). If we couldn't link against liblockfile
# (no liblockfile.a installed), ensure that we don't need to.
-if test "$ac_cv_lib_lockfile_maillock" = no; then
# Extract the first word of "liblockfile.so", so it can be a program name with args.
set dummy liblockfile.so; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
This probably means that movemail could lose mail.
There may be a \`development' package to install containing liblockfile." >&2;}
{ (exit 1); exit 1; }; }
- else :
fi
fi
+## Define MAIL_USE_FLOCK (or LOCKF) if the mailer uses flock (or lockf) to
+## interlock access to the mail spool. The alternative is a lock file named
+## /usr/spool/mail/$USER.lock.
+mail_lock=no
+case "$opsys" in
+ aix4-2) mail_lock="lockf" ;;
+
+ gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;;
+
+ ## On GNU/Linux systems, both methods are used by various mail programs.
+ ## I assume most people are using newer mailers that have heard of flock.
+ ## Change this if you need to.
+ ## Debian contains a patch which says: ``On Debian/GNU/Linux systems,
+ ## configure gets the right answers, and that means *NOT* using flock.
+ ## Using flock is guaranteed to be the wrong thing. See Debian Policy
+ ## for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
+ ## Debian maintainer hasn't provided a clean fix for Emacs.
+ ## movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
+ ## HAVE_MAILLOCK_H are defined, so the following appears to be the
+ ## correct logic. -- fx
+ ## We must check for HAVE_LIBLOCKFILE too, as movemail does.
+ ## liblockfile is a Free Software replacement for libmail, used on
+ ## Debian systems and elsewhere. -rfr.
+ gnu-*)
+ mail_lock="flock"
+ if test $have_mail = yes || test $have_lockfile = yes; then
+ test $ac_cv_header_maillock_h = yes && mail_lock=no
+ fi
+ ;;
+esac
+
+BLESSMAIL_TARGET=
+case "$mail_lock" in
+ flock)
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_USE_FLOCK 1
+_ACEOF
+ ;;
+
+ lockf)
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_USE_LOCKF 1
+_ACEOF
+ ;;
+
+ *) BLESSMAIL_TARGET="need-blessmail" ;;
+esac
+
+
+
+
+
+
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
-cfmakeraw cfsetspeed
+cfmakeraw cfsetspeed isnan copysign
do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
# That is because we have not set up to link ncurses in lib-src.
# It's better to believe a function is not available
# than to expect to find it in ncurses.
-
-{ $as_echo "$as_me:$LINENO: checking for tparm in -lncurses" >&5
-$as_echo_n "checking for tparm in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_tparm+set}" = set; then
+# Also we need tputs and friends to be able to build at all.
+have_tputs_et_al=true
+{ $as_echo "$as_me:$LINENO: checking for library containing tputs" >&5
+$as_echo_n "checking for library containing tputs... " >&6; }
+if test "${ac_cv_search_tputs+set}" = set; then
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
#ifdef __cplusplus
extern "C"
#endif
-char tparm ();
+char tputs ();
int
main ()
{
-return tparm ();
+return tputs ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+for ac_lib in '' ncurses terminfo termcap; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
- ac_cv_lib_ncurses_tparm=yes
+ ac_cv_search_tputs=$ac_res
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_ncurses_tparm=no
+
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if test "${ac_cv_search_tputs+set}" = set; then
+ break
fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tparm" >&5
-$as_echo "$ac_cv_lib_ncurses_tparm" >&6; }
-if test $ac_cv_lib_ncurses_tparm = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNCURSES 1
-_ACEOF
+done
+if test "${ac_cv_search_tputs+set}" = set; then
+ :
+else
+ ac_cv_search_tputs=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_tputs" >&5
+$as_echo "$ac_cv_search_tputs" >&6; }
+ac_res=$ac_cv_search_tputs
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- LIBS="-lncurses $LIBS"
+else
+ have_tputs_et_al=false
+fi
+if test "$have_tputs_et_al" != true; then
+ { { $as_echo "$as_me:$LINENO: error: I couldn't find termcap functions (tputs and friends).
+Maybe some development libraries/packages are missing? Try installing
+libncurses-dev(el), libterminfo-dev(el) or similar." >&5
+$as_echo "$as_me: error: I couldn't find termcap functions (tputs and friends).
+Maybe some development libraries/packages are missing? Try installing
+libncurses-dev(el), libterminfo-dev(el) or similar." >&2;}
+ { (exit 1); exit 1; }; }
fi
+# Must define this when any termcap library is found.
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBNCURSES 1
+_ACEOF
-# Do we have res_init, for detecting changes in /etc/resolv.conf?
+## FIXME This was the cpp logic, but I am not sure it is right.
+## The above test has not necessarily found libncurses.
+HAVE_LIBNCURSES=yes
+
+## Use terminfo instead of termcap?
+## Note only system files NOT using terminfo are:
+## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and
+## darwin|gnu without ncurses.
+TERMINFO=no
+LIBS_TERMCAP=
+case "$opsys" in
+ ## cygwin: Fewer environment variables to go wrong, more terminal types.
+ ## hpux10-20: Use the system provided termcap(3) library.
+ ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
+ ## is necessary. Otherwise Emacs dumps core when run -nw.
+ aix4-2|cygwin|hpux*|irix6-5|openbsd|sol2*|unixware) TERMINFO=yes ;;
+
+ ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
+ ## The ncurses library has been moved out of the System framework in
+ ## Mac OS X 10.2. So if configure detects it, set the command-line
+ ## option to use it.
+ darwin|gnu*)
+ ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
+ if test "x$HAVE_LIBNCURSES" = "xyes"; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lncurses"
+ fi
+ ;;
-resolv=no
-cat >conftest.$ac_ext <<_ACEOF
+ freebsd)
+ { $as_echo "$as_me:$LINENO: checking whether FreeBSD is new enough to use terminfo" >&5
+$as_echo_n "checking whether FreeBSD is new enough to use terminfo... " >&6; }
+ if test "${emacs_cv_freebsd_terminfo+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
+#include <osreldate.h>
int
main ()
{
-return res_init();
+#if __FreeBSD_version < 400000
+fail;
+#endif
+
;
return 0;
}
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
- have_res_init=yes
+ emacs_cv_freebsd_terminfo=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- have_res_init=no
+ emacs_cv_freebsd_terminfo=no
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
-if test "$have_res_init" = no; then
- OLIBS="$LIBS"
- LIBS="$LIBS -lresolv"
- { $as_echo "$as_me:$LINENO: checking for res_init with -lresolv" >&5
-$as_echo_n "checking for res_init with -lresolv... " >&6; }
- cat >conftest.$ac_ext <<_ACEOF
+fi
+
+
+ { $as_echo "$as_me:$LINENO: result: $emacs_cv_freebsd_terminfo" >&5
+$as_echo "$emacs_cv_freebsd_terminfo" >&6; }
+
+ if test $emacs_cv_freebsd_terminfo = yes; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lncurses"
+ else
+ LIBS_TERMCAP="-ltermcap"
+ fi
+ ;;
+
+ netbsd)
+ if test $ac_cv_search_tputs = -lterminfo; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lterminfo"
+ else
+ LIBS_TERMCAP="-ltermcap"
+ fi
+ ;;
+
+esac
+
+case "$opsys" in
+ ## hpux: Make sure we get select from libc rather than from libcurses
+ ## because libcurses on HPUX 10.10 has a broken version of select.
+ ## We used to use -lc -lcurses, but this may be cleaner.
+ hpux*) LIBS_TERMCAP="-ltermcap" ;;
+
+ openbsd) LIBS_TERMCAP="-lncurses" ;;
+
+ ## Must use system termcap, if we use any termcap. It does special things.
+ sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
+esac
+
+TERMCAP_OBJ=tparam.o
+if test $TERMINFO = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TERMINFO 1
+_ACEOF
+
+
+ ## Default used to be -ltermcap. Add a case above if need something else.
+ test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
+
+ TERMCAP_OBJ=terminfo.o
+fi
+
+
+
+
+# Do we have res_init, for detecting changes in /etc/resolv.conf?
+resolv=no
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:$LINENO: result: $have_res_init" >&5
-$as_echo "$have_res_init" >&6; }
- if test "$have_res_init" = yes ; then
- resolv=yes
- fi
- LIBS="$OLIBS"
-fi
-
-if test "$have_res_init" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RES_INIT 1
-_ACEOF
+if test "$have_res_init" = no; then
+ OLIBS="$LIBS"
+ LIBS="$LIBS -lresolv"
+ { $as_echo "$as_me:$LINENO: checking for res_init with -lresolv" >&5
+$as_echo_n "checking for res_init with -lresolv... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+int
+main ()
+{
+return res_init();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ have_res_init=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ have_res_init=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: result: $have_res_init" >&5
+$as_echo "$have_res_init" >&6; }
+ if test "$have_res_init" = yes ; then
+ resolv=yes
+ fi
+ LIBS="$OLIBS"
+fi
+
+if test "$have_res_init" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RES_INIT 1
+_ACEOF
fi
# Do we need the Hesiod library to provide the support routines?
+LIBHESIOD=
if test "$with_hesiod" != no ; then
- # Don't set $LIBS here -- see comments above.
+ # Don't set $LIBS here -- see comments above. FIXME which comments?
{ $as_echo "$as_me:$LINENO: checking for res_send" >&5
$as_echo_n "checking for res_send... " >&6; }
if test "${ac_cv_func_res_send+set}" = set; then
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
$as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
if test $ac_cv_lib_hesiod_hes_getmailhost = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBHESIOD 1
-_ACEOF
-
+ hesiod=yes
else
:
fi
fi
+
+ if test x"$hesiod" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBHESIOD 1
+_ACEOF
+
+ LIBHESIOD=-lhesiod
+ fi
fi
+
# Do we need libresolv (due to res_init or Hesiod)?
if test "$resolv" = yes ; then
#define HAVE_LIBRESOLV 1
_ACEOF
+ LIBRESOLV=-lresolv
+else
+ LIBRESOLV=
fi
+
# These tell us which Kerberos-related libraries to use.
-if test "${with_kerberos}" != no; then
+COM_ERRLIB=
+CRYPTOLIB=
+KRB5LIB=
+DESLIB=
+KRB4LIB=
-{ $as_echo "$as_me:$LINENO: checking for com_err in -lcom_err" >&5
+if test "${with_kerberos}" != no; then
+ { $as_echo "$as_me:$LINENO: checking for com_err in -lcom_err" >&5
$as_echo_n "checking for com_err in -lcom_err... " >&6; }
if test "${ac_cv_lib_com_err_com_err+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_com_err_com_err" >&5
$as_echo "$ac_cv_lib_com_err_com_err" >&6; }
if test $ac_cv_lib_com_err_com_err = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCOM_ERR 1
-_ACEOF
-
- LIBS="-lcom_err $LIBS"
-
+ have_com_err=yes
+else
+ have_com_err=no
fi
+ if test $have_com_err = yes; then
+ COM_ERRLIB=-lcom_err
+ LIBS="$COM_ERRLIB $LIBS"
-{ $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
-$as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
-if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCOM_ERR 1
+_ACEOF
+
+ fi
+ { $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lcrypto" >&5
+$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
+if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lk5crypto $LIBS"
+LIBS="-lcrypto $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
- ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
+ ac_cv_lib_crypto_mit_des_cbc_encrypt=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
+ ac_cv_lib_crypto_mit_des_cbc_encrypt=no
fi
rm -rf conftest.dSYM
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
-$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_k5crypto_mit_des_cbc_encrypt = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBK5CRYPTO 1
-_ACEOF
-
- LIBS="-lk5crypto $LIBS"
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
+$as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
+if test $ac_cv_lib_crypto_mit_des_cbc_encrypt = yes; then
+ have_crypto=yes
+else
+ have_crypto=no
fi
+ if test $have_crypto = yes; then
+ CRYPTOLIB=-lcrypto
+ LIBS="$CRYPTOLIB $LIBS"
-{ $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lcrypto" >&5
-$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+
+ fi
+ { $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
+$as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
+if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
+LIBS="-lk5crypto $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
- ac_cv_lib_crypto_mit_des_cbc_encrypt=yes
+ ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_lib_crypto_mit_des_cbc_encrypt=no
+ ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
fi
rm -rf conftest.dSYM
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
-$as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_crypto_mit_des_cbc_encrypt = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCRYPTO 1
-_ACEOF
-
- LIBS="-lcrypto $LIBS"
-
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
+$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
+if test $ac_cv_lib_k5crypto_mit_des_cbc_encrypt = yes; then
+ have_k5crypto=yes
+else
+ have_k5crypto=no
fi
+ if test $have_k5crypto = yes; then
+ CRYPTOLIB=-lk5crypto
+ LIBS="$CRYPTOLIB $LIBS"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBK5CRYPTO 1
+_ACEOF
-{ $as_echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
+ fi
+ { $as_echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
$as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
$as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
if test $ac_cv_lib_krb5_krb5_init_context = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB5 1
-_ACEOF
-
- LIBS="-lkrb5 $LIBS"
-
+ have_krb5=yes
+else
+ have_krb5=no
fi
- if test "${with_kerberos5}" = no; then
+ if test $have_krb5=yes; then
+ KRB5LIB=-lkrb5
+ LIBS="$KRB5LIB $LIBS"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBKRB5 1
+_ACEOF
-{ $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5
+ fi
+ if test "${with_kerberos5}" = no; then
+ { $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5
$as_echo_n "checking for des_cbc_encrypt in -ldes425... " >&6; }
if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
$as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDES425 1
-_ACEOF
+ have_des425=yes
+else
+ have_des425=no
+fi
- LIBS="-ldes425 $LIBS"
+ if test $have_des425 = yes; then
+ DESLIB=-ldes425
+ LIBS="$DESLIB $LIBS"
-else
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDES425 1
+_ACEOF
-{ $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
+ else
+ { $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
$as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
$as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDES 1
-_ACEOF
-
- LIBS="-ldes $LIBS"
-
+ have_des=yes
+else
+ have_des=no
fi
-fi
+ if test $have_des = yes; then
+ DESLIB=-ldes
+ LIBS="$DESLIB $LIBS"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDES 1
+_ACEOF
-{ $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb4" >&5
+ fi
+ fi
+ { $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb4" >&5
$as_echo_n "checking for krb_get_cred in -lkrb4... " >&6; }
if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_krb_get_cred" >&5
$as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
if test $ac_cv_lib_krb4_krb_get_cred = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB4 1
-_ACEOF
+ have_krb4=yes
+else
+ have_krb4=no
+fi
- LIBS="-lkrb4 $LIBS"
+ if test $have_krb4 = yes; then
+ KRB4LIB=-lkrb4
+ LIBS="$KRB4LIB $LIBS"
-else
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBKRB4 1
+_ACEOF
-{ $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb" >&5
+ else
+ { $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb" >&5
$as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb_krb_get_cred" >&5
$as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
if test $ac_cv_lib_krb_krb_get_cred = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB 1
-_ACEOF
-
- LIBS="-lkrb $LIBS"
-
+ have_krb=yes
+else
+ have_krb=no
fi
-fi
+ if test $have_krb = yes; then
+ KRB4LIB=-lkrb
+ LIBS="$KRB4LIB $LIBS"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBKRB 1
+_ACEOF
+
+ fi
+ fi
fi
if test "${with_kerberos5}" != no; then
fi
+
+
+
+
+
+
# Solaris requires -lintl if you want strerror (which calls dgettext)
# to return localized messages.
fi
#### Find out which version of Emacs this is.
-version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
+version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
if test x"${version}" = x; then
- { { $as_echo "$as_me:$LINENO: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&5
-$as_echo "$as_me: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&2;}
+ { { $as_echo "$as_me:$LINENO: error: can't find current emacs version in \`${srcdir}/src/emacs.c'." >&5
+$as_echo "$as_me: error: can't find current emacs version in \`${srcdir}/src/emacs.c'." >&2;}
{ (exit 1); exit 1; }; }
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
- { $as_echo "$as_me:$LINENO: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&5
-$as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
+$as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&2;}
fi
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
+## Unused?
+## FIXME? Nothing uses @LD_SWITCH_X_SITE@.
+## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the
+## end of LIBX_BASE, but nothing ever set it.
-
-
-
-
-
+## Used in lwlib/Makefile.in.
_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define LD_SWITCH_X_SITE ${LD_SWITCH_X_SITE}
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LD_SWITCH_X_SITE_AUX ${LD_SWITCH_X_SITE_AUX}
-_ACEOF
-
+XMENU_OBJ=
+XOBJ=
+FONT_OBJ=
+if test "${HAVE_X_WINDOWS}" = "yes" ; then
-cat >>confdefs.h <<_ACEOF
-#define C_SWITCH_X_SITE ${C_SWITCH_X_SITE}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_X_WINDOWS 1
_ACEOF
+ XMENU_OBJ=xmenu.o
+ XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
+ FONT_OBJ=xfont.o
+ if test "$HAVE_XFT" = "yes"; then
+ FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
+ elif test "$HAVE_FREETYPE" = "yes"; then
+ FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
+ fi
-cat >>confdefs.h <<_ACEOF
-#define UNEXEC_SRC ${UNEXEC_SRC}
-_ACEOF
+fi
-if test "${HAVE_X_WINDOWS}" = "yes" ; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X_WINDOWS 1
-_ACEOF
-fi
+WIDGET_OBJ=
+MOTIF_LIBW=
if test "${USE_X_TOOLKIT}" != "none" ; then
+ WIDGET_OBJ=widget.o
cat >>confdefs.h <<\_ACEOF
#define USE_X_TOOLKIT 1
#define USE_MOTIF 1
_ACEOF
+ MOTIF_LIBW=-lXm
+ case "$opsys" in
+ gnu-linux)
+ ## Paul Abrahams <abrahams at equinox.shaysnet.com> says this is needed.
+ MOTIF_LIBW="$MOTIF_LIBW -lXpm"
+ ;;
+
+ unixware)
+ ## Richard Anthony Ryan <ryanr at ellingtn.ftc.nrcs.usda.gov>
+ ## says -lXimp is needed in UNIX_SV ... 4.2 1.1.2.
+ MOTIF_LIBW="MOTIF_LIBW -lXimp"
+ ;;
+
+ aix4-2)
+ ## olson@mcs.anl.gov says -li18n is needed by -lXm.
+ MOTIF_LIBW="$MOTIF_LIBW -li18n"
+ ;;
+ esac
+ MOTIF_LIBW="$MOTIF_LIBW $LIBXP"
fi
fi
+
+
+TOOLKIT_LIBW=
+case "$USE_X_TOOLKIT" in
+ MOTIF) TOOLKIT_LIBW="$MOTIF_LIBW" ;;
+ LUCID) TOOLKIT_LIBW="$LUCID_LIBW" ;;
+ none) test "x$HAVE_GTK" = "xyes" && TOOLKIT_LIBW="$GTK_LIBS" ;;
+esac
+
+
+if test "$USE_X_TOOLKIT" = "none"; then
+ LIBXT_OTHER="\$(LIBXSM)"
+ OLDXMENU_TARGET="really-oldXMenu"
+else
+ LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
+ OLDXMENU_TARGET="really-lwlib"
+fi
+
+
+## The X Menu stuff is present in the X10 distribution, but missing
+## from X11. If we have X10, just use the installed library;
+## otherwise, use our own copy.
if test "${HAVE_X11}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_X11 1
_ACEOF
+
+ if test "$USE_X_TOOLKIT" = "none"; then
+ OLDXMENU="\${oldXMenudir}libXMenu11.a"
+ else
+ OLDXMENU="\${lwlibdir}liblw.a"
+ fi
+ LIBXMENU="\$(OLDXMENU)"
+ LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
+ OLDXMENU_DEPS="\${OLDXMENU} ../src/\${OLDXMENU}"
+else
+ ## For a syntactically valid Makefile; not actually used for anything.
+ ## See comments in src/Makefile.in.
+ OLDXMENU=nothing
+ ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
+ if test "${HAVE_X_WINDOWS}" = "yes"; then
+ LIBXMENU="-lXMenu"
+ else
+ LIBXMENU=
+ fi
+ LIBX_OTHER=
+ OLDXMENU_DEPS=
+fi
+
+if test "$HAVE_GTK" = "yes" || test "$HAVE_MENUS" != "yes"; then
+ OLDXMENU_TARGET=
+ OLDXMENU=nothing
+ LIBXMENU=
+ OLDXMENU_DEPS=
fi
+
+
+
+
+
+
+
if test "${HAVE_MENUS}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+
if test "${GNU_MALLOC}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+
+RALLOC_OBJ=
if test "${REL_ALLOC}" = "yes" ; then
cat >>confdefs.h <<\_ACEOF
#define REL_ALLOC 1
_ACEOF
+
+ test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o
+fi
+
+
+if test "$opsys" = "cygwin"; then
+ CYGWIN_OBJ="sheap.o"
+ ## Cygwin differs because of its unexec().
+ PRE_ALLOC_OBJ=
+ POST_ALLOC_OBJ=lastfile.o
+else
+ CYGWIN_OBJ=
+ PRE_ALLOC_OBJ=lastfile.o
+ POST_ALLOC_OBJ=
+fi
+
+
+
+
+
+case "$opsys" in
+ aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
+
+ darwin)
+ ## The -headerpad option tells ld (see man page) to leave room at the
+ ## end of the header for adding load commands. Needed for dumping.
+ ## 0x690 is the total size of 30 segment load commands (at 56
+ ## each); under Cocoa 31 commands are required.
+ if test "$HAVE_NS" = "yes"; then
+ libs_nsgui="-framework AppKit"
+ headerpad_extra=6C8
+ else
+ libs_nsgui=
+ headerpad_extra=690
+ fi
+ LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra"
+ ;;
+
+ *) LD_SWITCH_SYSTEM_TEMACS= ;;
+esac
+
+
+
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM. The cpp logic was:
+## #ifndef LD_SWITCH_SYSTEM
+## #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+ test "$opsys" = "darwin"; then
+ LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+ LD_SWITCH_SYSTEM_EXTRA=
+fi
+
+
+
+LINKER=
+ORDINARY_LINK=
+case "$opsys" in
+ ## gnu: GNU needs its own crt0.
+ aix4-2|darwin|gnu|usg5-4|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
+
+ cygwin) LINKER="\$(CC)" ;;
+
+ ## 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) LINKER="\$(CC) -nostartfiles" ;;
+
+ ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
+ ## MkLinux/LinuxPPC needs this.
+ ## ibms390x only supports opsys = gnu-linux so it can be added here.
+ gnu-*)
+ case "$machine" in
+ macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;;
+ esac
+ ;;
+esac
+
+## A macro which other sections of Makefile can redefine to munge the
+## flags before they are passed to LD. This is helpful if you have
+## redefined LD to something odd, like "gcc".
+## (The YMF prefix is a holdover from the old name "ymakefile".)
+YMF_PASS_LDFLAGS=flags
+if test "x$ORDINARY_LINK" = "xyes"; then
+
+ LINKER="\$(CC)"
+
+cat >>confdefs.h <<\_ACEOF
+#define ORDINARY_LINK 1
+_ACEOF
+
+
+## The system files defining neither ORDINARY_LINK nor LINKER are:
+## (bsd-common), freebsd, gnu-* not on macppc|ibms390x, hpux*.
+elif test "x$GCC" = "xyes" && test "x$LINKER" = "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).
+ LINKER="\$(CC) -nostdlib"
+ ## GCC passes any argument prefixed with -Xlinker directly to the linker.
+ ## See prefix-args.c for an explanation of why we do not do this with the
+ ## shell''s ``for'' construct. Note that sane people do not have '.' in
+ ## their paths, so we must use ./prefix-args.
+ ## TODO either make prefix-args check ORDINARY_LINK internally,
+ ## or remove it altogether (bug#6184), removing the need for this macro.
+ YMF_PASS_LDFLAGS='`./prefix-args -Xlinker flags`'
+fi
+
+
+test "x$LINKER" = "x" && LINKER=ld
+## FIXME? What setting of YMF_PASS_LDFLAGS should this have?
+test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic"
+
+
+
+
+## FIXME? The logic here is not precisely the same as that above
+## setting YMF_PASS_LDFLAGS. There is no check here for a pre-defined
+## LINKER. 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
+ ## cygwin: don't link against static libgcc.
+ cygwin|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)
+ ## Note that m/arm.h never bothered to undefine LIB_GCC first.
+ if test "$machine" = "arm"; then
+ LIB_GCC="-lgcc_s"
+ else
+ ## 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=
+ fi
+ ;;
+
+ ## Ask GCC where to find libgcc.a.
+ *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;;
+ esac
+fi
+
+
+TOOLTIP_SUPPORT=
+WINDOW_SUPPORT=
+## If we're using X11/GNUstep, define some consequences.
+if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WINDOW_SYSTEM 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MOUSE 1
+_ACEOF
+
+ MOUSE_SUPPORT="\$(REAL_MOUSE_SUPPORT)"
+ TOOLTIP_SUPPORT="\${lispsource}mouse.elc"
+
+ WINDOW_SUPPORT="\$(BASE_WINDOW_SUPPORT)"
+ test "$HAVE_X_WINDOWS" = "yes" && \
+ WINDOW_SUPPORT="$WINDOW_SUPPORT \$(X_WINDOW_SUPPORT)"
+
fi
+
+
+
#### Report on what we decided to do.
#### Report GTK as a toolkit, even if it doesn't use Xt.
#### It makes printing result more understandable as using GTK sets
echo " Does Emacs use -lXpm? ${HAVE_XPM}"
echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
-echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
+echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
echo " Does Emacs use -lpng? ${HAVE_PNG}"
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
echo " Does Emacs use -lgpm? ${HAVE_GPM}"
echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
+echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}"
echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}"
# the C preprocessor to some helpful value like 1, or maybe the empty
# string. Needless to say consequent macro substitutions are less
# than conducive to the makefile finding the correct directory.
-cpp_undefs="`echo $srcdir $configuration $canonical |
+# src/Makefile.in used to treat X11 as equivalent to HAVE_X11.
+# But nothing in Emacs defines X11, and everywhere else uses HAVE_X11,
+# so that cannot have been doing anything.
+cpp_undefs="`echo $srcdir $configuration $canonical unix mktime register X11 |
sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
-e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g'`"
rm -f conftest*
-ac_config_files="$ac_config_files Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile.c:src/Makefile.in lwlib/Makefile lisp/Makefile leim/Makefile"
+ac_config_files="$ac_config_files Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile.c:src/Makefile.in lwlib/Makefile lisp/Makefile leim/Makefile"
ac_config_commands="$ac_config_commands default"
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by emacs $as_me 23.2, which was
+This file was extended by emacs $as_me 24.0.50, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-emacs config.status 23.2
+emacs config.status 24.0.50
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
case $ac_config_target in
"src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "lib-src/Makefile.c") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile.c:lib-src/Makefile.in" ;;
+ "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;;
"oldXMenu/Makefile") CONFIG_FILES="$CONFIG_FILES oldXMenu/Makefile" ;;
"doc/emacs/Makefile") CONFIG_FILES="$CONFIG_FILES doc/emacs/Makefile" ;;
"doc/misc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/misc/Makefile" ;;
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
-
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
ac_cr='\r'
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
echo 'BEGIN {' >"$tmp/subs1.awk" &&
_ACEOF
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+rm -f conf$$files.sh
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
cat >>"\$tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = "\a"
-
+ \$ac_cs_awk_pipe_init
}
{
line = $ 0
} else
len += 1 + keylen
}
-
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
print line
}
-
+\$ac_cs_awk_pipe_fini
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$tmp/subs.awk"
+else
+ $AWK -f "$tmp/subs.awk" | $SHELL
+fi >$tmp/out \
|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
$as_echo "$as_me: error: could not create $ac_file" >&2;}
{ (exit 1); exit 1; }; }
CPPFLAGS="$CPPFLAGS -traditional"
fi
-echo creating lib-src/Makefile
-( cd lib-src
- rm -f junk.c junk1.c junk2.c
- sed -e '/start of cpp stuff/q' \
- < Makefile.c > junk1.c
- sed -e '1,/start of cpp stuff/d'\
- -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
- < Makefile.c > junk.c
- $CPP -P $cpp_undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
- sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
- cat junk1.c junk2.c > Makefile.new
- rm -f junk.c junk1.c junk2.c
- chmod 444 Makefile.new
- mv -f Makefile.new Makefile
-)
-
echo creating src/Makefile
( cd src
rm -f junk.c junk1.c junk2.c
dnl To rebuild the `configure' script from this, execute the command
dnl autoconf
dnl in the directory containing this script.
+dnl If you changed any AC_DEFINES, also run autoheader.
dnl
-dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003,
-dnl 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004,
+dnl 2005, 2006, 2007, 2008, 2009, 2010
+dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl
dnl along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.62)
-AC_INIT(emacs, 23.2.50)
+AC_INIT(emacs, 24.0.50)
AC_CONFIG_HEADER(src/config.h:src/config.in)
AC_CONFIG_SRCDIR(src/lisp.h)
fi
OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host])
+dnl FIXME hesiod support may not be present, so it seems like an error
+dnl to define, or at least use, this unconditionally.
if test "$with_hesiod" != no; then
AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
fi
+OPTION_DEFAULT_OFF([mmdf],[support MMDF mailboxes])
+if test "$with_mmdf" != no; then
+ AC_DEFINE(MAIL_USE_MMDF, 1, [Define to support MMDF mailboxes in movemail.])
+fi
+
+OPTION_DEFAULT_OFF([mail-unlink],[unlink, rather than empty, mail spool after reading])
+if test "$with_mail_unlink" != no; then
+ AC_DEFINE(MAIL_UNLINK_SPOOL, 1, [Define to unlink, rather than empty, mail spool after reading.])
+fi
+
+AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME],
+ [string giving default POP mail host])],
+ AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
+
OPTION_DEFAULT_ON([sound],[don't compile with sound support])
OPTION_DEFAULT_ON([sync-input],[process async input synchronously])
dnl added later on when we find the path of X, and it's best to
dnl keep them together visually.
AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT],
- [use an X toolkit (KIT one of: yes, lucid, athena, motif, gtk, no)])],
+ [use an X toolkit (KIT one of: yes or gtk, lucid or athena, motif, no)])],
[ case "${withval}" in
y | ye | yes ) val=gtk ;;
n | no ) val=no ;;
OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
OPTION_DEFAULT_ON([gconf],[don't compile with GConf support])
+OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])
## For the times when you want to build Emacs but don't have
## a suitable makeinfo, and can live without the manuals.
dnl http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01844.html
OPTION_DEFAULT_ON([makeinfo],[don't require makeinfo for building manuals])
-dnl Can remove these in Emacs 24.
-AC_ARG_WITH([gtk],,
- [AC_MSG_ERROR([--with-gtk has been removed. Use --with-x-toolkit to
-specify a toolkit.])],,)
-
-AC_ARG_WITH([gcc],,
- [AC_MSG_ERROR([--with-gcc has been removed. Set the `CC' environment
-variable to specify a compiler.])],,)
-
AC_ARG_WITH([pkg-config-prog],dnl
[AS_HELP_STRING([--with-pkg-config-prog=PATH],
[path to pkg-config for finding GTK and librsvg])])
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([gnustep-conf],dnl
[AS_HELP_STRING([--with-gnustep-conf=PATH],[path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE, or /etc/GNUstep/GNUstep.conf])])
test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \
## NetBSD ports
*-*-netbsd* )
opsys=netbsd
- if test -f /usr/lib/crti.o; then]
-dnl The close and open brackets here are because this section is quoted --
-dnl see the `changequote' comment above.
- AC_DEFINE(HAVE_CRTIN, [], [Define to 1 if you have /usr/lib/crti.o.])
-[ fi
-
case "${canonical}" in
alpha*-*-netbsd*) machine=alpha ;;
i[3456]86-*-netbsd*) machine=intel386 ;;
esac
;;
- ## LynxOS ports
- *-*-lynxos* )
- opsys=lynxos
- case "${canonical}" in
- i[3456]86-*-lynxos*) machine=intel386 ;;
- powerpc-*-lynxos*) machine=powerpc ;;
- esac
- ;;
-
alpha*-*-linux-gnu* )
machine=alpha opsys=gnu-linux
;;
*-sun-solaris* \
| i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
- | x86_64-*-solaris2* | x86_64-*-sunos5* \
- | powerpc*-*-solaris2* | rs6000-*-solaris2*)
+ | x86_64-*-solaris2* | x86_64-*-sunos5*)
case "${canonical}" in
i[3456]86-*-* ) machine=intel386 ;;
amd64-*-*|x86_64-*-*) machine=amdx86-64 ;;
- powerpc* | rs6000* ) machine=ibmrs6000 ;;
sparc* ) machine=sparc ;;
* ) unported=yes ;;
esac
case "${canonical}" in
- *-sunos5.3* | *-solaris2.3* )
- opsys=sol2-3
- NON_GNU_CPP=/usr/ccs/lib/cpp
- ;;
- *-sunos5.4* | *-solaris2.4* )
- opsys=sol2-4
- NON_GNU_CPP=/usr/ccs/lib/cpp
- RANLIB="ar -ts"
- ;;
- *-sunos5.5* | *-solaris2.5* )
- opsys=sol2-5
- NON_GNU_CPP=/usr/ccs/lib/cpp
- RANLIB="ar -ts"
- ;;
*-sunos5.6* | *-solaris2.6* )
opsys=sol2-6
NON_GNU_CPP=/usr/ccs/lib/cpp
if test x"${opsys}" = x; then
case "${canonical}" in
*-gnu* ) opsys=gnu ;;
- *-sysv4.2uw* ) opsys=unixware ;;
- *-sysv5uw* ) opsys=unixware ;;
- *-sysv5OpenUNIX* ) opsys=unixware ;;
- *-sysv4.1* | *-sysvr4.1* )
- NON_GNU_CPP=/usr/lib/cpp
- opsys=usg5-4 ;;
- *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
- if [ x$NON_GNU_CPP = x ]; then
- if [ -f /usr/ccs/lib/cpp ]; then
- NON_GNU_CPP=/usr/ccs/lib/cpp
- else
- NON_GNU_CPP=/lib/cpp
- fi
- fi
- opsys=usg5-4-2 ;;
- *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;;
* )
unported=yes
;;
#### Some other nice autoconf tests.
dnl checks for programs
-AC_PROG_LN_S
AC_PROG_CPP
AC_PROG_INSTALL
if test "x$RANLIB" = x; then
AC_PROG_RANLIB
fi
+
+## Although we're running on an amd64 kernel, we're actually compiling for
+## the x86 architecture. The user should probably have provided an
+## explicit --build to `configure', but if everything else than the kernel
+## is running in i386 mode, we can help them out.
+if test "$machine" = "amdx86-64"; then
+ AC_CHECK_DECL([i386])
+ if test "$ac_cv_have_decl_i386" = "yes"; then
+ canonical=`echo "$canonical" | sed -e 's/^amd64/i386/' -e 's/^x86_64/i386/'`
+ machine=intel386
+ machfile="m/${machine}.h"
+ fi
+fi
+
AC_PATH_PROG(INSTALL_INFO, install-info)
AC_PATH_PROG(INSTALL_INFO, install-info,, /usr/sbin)
AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin)
if test "$MAKEINFO" = "no"; then
if test "x${with_makeinfo}" = "xno"; then
MAKEINFO=off
- elif ! test -e $srcdir/info/emacs; then
+ elif test ! -e $srcdir/info/emacs; then
AC_MSG_ERROR( [You do not seem to have makeinfo >= 4.6, and your
source tree does not seem to have pre-built manuals in the `info' directory.
Either install a suitable version of makeinfo, or re-run configure
echo '
#include "'${srcdir}'/src/'${opsysfile}'"
#include "'${srcdir}'/src/'${machfile}'"
-#ifndef LIBS_MACHINE
-#define LIBS_MACHINE
-#endif
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-#ifndef C_SWITCH_MACHINE
-#define C_SWITCH_MACHINE
-#endif
-configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
-configure___ c_switch_system=C_SWITCH_SYSTEM
-configure___ c_switch_machine=C_SWITCH_MACHINE
-
-#ifndef LIB_X11_LIB
-#define LIB_X11_LIB -lX11
-#endif
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
+configure___ LIBX=-lX11
-#ifdef UNEXEC
configure___ unexec=UNEXEC
+
+#ifdef CANNOT_DUMP
+configure___ cannot_dump=yes
#else
-configure___ unexec=unexec.o
+configure___ cannot_dump=no
#endif
#ifdef SYSTEM_MALLOC
configure___ use_mmap_for_buffers=no
#endif
-#ifndef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH -g
-#endif
-
#ifndef C_OPTIMIZE_SWITCH
#ifdef __GNUC__
#define C_OPTIMIZE_SWITCH -O2
#define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
#endif
-#ifndef LD_SWITCH_MACHINE
-#define LD_SWITCH_MACHINE
-#endif
-
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-#ifndef LD_SWITCH_X_SITE_AUX
-#define LD_SWITCH_X_SITE_AUX
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-configure___ ld_switch_machine=LD_SWITCH_MACHINE
-
#ifdef THIS_IS_CONFIGURE
/* Get the CFLAGS for tests in configure. */
#ifdef __GNUC__
-configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS=-g C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
#else
-configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS='${SPECIFIED_CFLAGS}'
#endif
#else /* not THIS_IS_CONFIGURE */
/* Get the CFLAGS for real compilation. */
#ifdef __GNUC__
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
#else
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
#endif
#endif /* not THIS_IS_CONFIGURE */
fi]
rm ${tempcname}
-ac_link="$ac_link $ld_switch_machine $ld_switch_system"
+
+AC_SUBST(cannot_dump)
+
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+ freebsd)
+ ## Let `ld' find image libs and similar things in /usr/local/lib.
+ ## The system compiler, GCC, has apparently been modified to not
+ ## look there, contrary to what a stock GCC would do.
+ LD_SWITCH_SYSTEM=-L/usr/local/lib
+ ;;
+
+ gnu-linux)
+ ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+ test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+ ;;
+
+ netbsd)
+ LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+ ;;
+
+ openbsd)
+ ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+ ## otherwise Emacs dumps core on elf systems.
+ LD_SWITCH_SYSTEM="-Z"
+ ;;
+esac
+AC_SUBST(LD_SWITCH_SYSTEM)
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun. Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet. When using
+## cpp, it was expanded to null. Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles. How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+ gnu-linux)
+ ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+ LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+ netbsd|openbsd)
+ ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+ LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
+
+
+C_SWITCH_MACHINE=
+if test "$machine" = "alpha"; then
+ AC_CHECK_DECL([__ELF__])
+ if test "$ac_cv_have_decl___ELF__" = "yes"; then
+ ## With ELF, make sure that all common symbols get allocated to in the
+ ## data section. Otherwise, the dump of temacs may miss variables in
+ ## the shared library that have been initialized. For example, with
+ ## GNU libc, __malloc_initialized would normally be resolved to the
+ ## shared library's .bss section, which is fatal.
+ if test "x$GCC" = "xyes"; then
+ C_SWITCH_MACHINE="-fno-common"
+ else
+ AC_MSG_ERROR([What gives? Fix me if DEC Unix supports ELF now.])
+ fi
+ fi
+fi
+AC_SUBST(C_SWITCH_MACHINE)
+
+
+C_SWITCH_SYSTEM=
+## Some programs in src produce warnings saying certain subprograms
+## are too complex and need a MAXMEM value greater than 2000 for
+## additional optimization. --nils@exp-math.uni-essen.de
+test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
+ C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
+## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
+## It is redundant in glibc2, since we define _GNU_SOURCE.
+AC_SUBST(C_SWITCH_SYSTEM)
+
+
+LIBS_SYSTEM=
+case "$opsys" in
+ ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
+ aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
+
+ freebsd) LIBS_SYSTEM="-lutil" ;;
+
+ hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
+
+ sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;;
+
+ ## Motif needs -lgen.
+ unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
+esac
+AC_SUBST(LIBS_SYSTEM)
+
### Make sure subsequent tests use flags consistent with the build flags.
if test x"${OVERRIDE_CPPFLAGS}" != x; then
CPPFLAGS="${OVERRIDE_CPPFLAGS}"
else
- CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
+ CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
fi
dnl For AC_FUNC_GETLOADAVG, at least:
AC_SYS_LARGEFILE
-### The standard library on x86-64 and s390x GNU/Linux distributions can
-### be located in either /usr/lib64 or /usr/lib.
-### In some rare cases, /usr/lib64 exists but does not contain the
-### relevant files (bug#1287). Hence test for crtn.o.
-case "${canonical}" in
- x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
- if test -e /usr/lib64/crtn.o; then
- AC_DEFINE(HAVE_LIB64_DIR, 1,
- [Define to 1 if the directory /usr/lib64 exists.])
+## If user specified a crt-dir, use that unconditionally.
+if test "X$CRT_DIR" = "X"; then
+
+ 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
+
+ ## Default is /usr/lib.
+ test "X$CRT_DIR" = "X" && CRT_DIR=/usr/lib
+
+else
+
+ ## Some platforms don't use any of these files, so it is not
+ ## appropriate to put this test outside the if block.
+ test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
+ AC_MSG_ERROR([crt*.o not found in specified location.])
+
fi
+
+AC_SUBST(CRT_DIR)
+
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+ cygwin )
+ LIB_MATH=
+ START_FILES='ecrt0.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)/crtend.o $(CRT_DIR)/crtn.o'
+ START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+ ;;
+ 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 )
+ if test -f $CRT_DIR/crti.o; then
+ 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'
+ else
+ LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+ START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+ fi
+ ;;
esac
-dnl This function defintion taken from Gnome 2.0
+AC_SUBST(LIB_MATH)
+AC_SUBST(START_FILES)
+
+dnl This function definition taken from Gnome 2.0
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
dnl also defines GSTUFF_PKG_ERRORS on error
dnl checks for header files
AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
- termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
+ stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
sys/utsname.h pwd.h utmp.h)
dnl check for Make feature
AC_PROG_MAKE_SET
+DEPFLAGS=
+MKDEPDIR=":"
+deps_frag=deps.mk
dnl check for GNU Make if we have GCC and autodepend is on.
if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
AC_MSG_CHECKING([whether we are using GNU Make])
AC_MSG_RESULT([$ac_enable_autodepend])
fi
if test $ac_enable_autodepend = yes; then
- AC_DEFINE(AUTO_DEPEND, 1, [Generate dependencies with gcc.])
+ DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d'
+ ## In parallel builds, another make might create depdir between
+ ## the first test and mkdir, so stick another test on the end.
+ ## Or use mkinstalldirs? mkdir -p is not portable.
+ MKDEPDIR='test -d ${DEPDIR} || mkdir ${DEPDIR} || test -d ${DEPDIR}'
+ deps_frag=autodeps.mk
fi
fi
+deps_frag=$srcdir/src/$deps_frag
+AC_SUBST(MKDEPDIR)
+AC_SUBST(DEPFLAGS)
+AC_SUBST_FILE(deps_frag)
+
dnl checks for operating system services
AC_SYS_LONG_FILE_NAMES
## Workaround for bug in autoconf <= 2.62.
## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html
## No need to do anything special for these standard directories.
-## This is an experiment, take it out if it causes problems.
if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then
x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'`
fi
+LD_SWITCH_X_SITE_AUX=
+LD_SWITCH_X_SITE_AUX_RPATH=
if test "${x_libraries}" != NONE; then
if test -n "${x_libraries}"; then
LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"`
LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
+ LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'`
fi
x_default_search_path=""
x_search_path=${x_libraries}
fi
done
fi
+AC_SUBST(LD_SWITCH_X_SITE_AUX)
+AC_SUBST(LD_SWITCH_X_SITE_AUX_RPATH)
+
if test "${x_includes}" != NONE && test -n "${x_includes}"; then
C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"`
fi
HAVE_NS=no
NS_IMPL_COCOA=no
NS_IMPL_GNUSTEP=no
+NS_IMPL_GNUSTEP_INC=
+NS_IMPL_GNUSTEP_TEMACS_LDFLAGS=
tmp_CPPFLAGS="$CPPFLAGS"
tmp_CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS -x objective-c"
CFLAGS="$CFLAGS -x objective-c"
+TEMACS_LDFLAGS2="\${LDFLAGS}"
+dnl I don't think it's especially important, but src/Makefile.in
+dnl (now the only user of ns_appdir) used to go to the trouble of adding a
+dnl trailing "/" to it, so now we do it here.
if test "${with_ns}" != no; then
if test "${opsys}" = darwin; then
NS_IMPL_COCOA=yes
- ns_appdir=`pwd`/nextstep/Emacs.app
- ns_appbindir=`pwd`/nextstep/Emacs.app/Contents/MacOS
- ns_appresdir=`pwd`/nextstep/Emacs.app/Contents/Resources
+ ns_appdir=`pwd`/nextstep/Emacs.app/
+ ns_appbindir=${ns_appdir}Contents/MacOS/
+ ns_appresdir=${ns_appdir}Contents/Resources
ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base
elif test -f $GNUSTEP_CONFIG_FILE; then
NS_IMPL_GNUSTEP=yes
- ns_appdir=`pwd`/nextstep/Emacs.app
- ns_appbindir=`pwd`/nextstep/Emacs.app
- ns_appresdir=`pwd`/nextstep/Emacs.app/Resources
+ ns_appdir=`pwd`/nextstep/Emacs.app/
+ ns_appbindir=${ns_appdir}
+ ns_appresdir=${ns_appdir}Resources
ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base
dnl FIXME sourcing this 3 times in subshells seems inefficient.
GNUSTEP_MAKEFILES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_MAKEFILES)"
GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)"
GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)"
+ ## Pull in stuff from GNUstep-make.
+ ## FIXME? Cleaner to use AC_SUBST_FILE for this?
+ NS_IMPL_GNUSTEP_INC="FOUNDATION_LIB=gnu
+GUI_LIB=gnu
+include $GNUSTEP_MAKEFILES/Additional/base.make
+include $GNUSTEP_MAKEFILES/Additional/gui.make
+shared=no
+"
+ dnl Presumably ${CONFIG_SYSTEM_LIBS} is defined by above includes.
+ NS_IMPL_GNUSTEP_TEMACS_LDFLAGS="-L${GNUSTEP_SYSTEM_LIBRARIES} -lgnustep-gui -lgnustep-base -lobjc \${CONFIG_SYSTEM_LIBS} -lpthread"
CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+ LIB_STANDARD=
+ START_FILES=
+ TEMACS_LDFLAGS2=
fi
AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes],
[AC_MSG_ERROR([`--with-ns' was specified, but the include
NS_HAVE_NSINTEGER=no
fi
fi
+AC_SUBST(NS_IMPL_GNUSTEP_INC)
+AC_SUBST(NS_IMPL_GNUSTEP_TEMACS_LDFLAGS)
+AC_SUBST(TEMACS_LDFLAGS2)
+
+ns_frag=/dev/null
+NS_OBJ=
+NS_SUPPORT=
if test "${HAVE_NS}" = yes; then
window_system=nextstep
with_xft=no
if test "${EN_NS_SELF_CONTAINED}" = yes; then
prefix=${ns_appresdir}
fi
+ ns_frag=$srcdir/src/ns.mk
+ NS_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o"
+ NS_SUPPORT="\${lispsource}emacs-lisp/easymenu.elc \${lispsource}term/ns-win.elc"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
+AC_SUBST(NS_OBJ)
+AC_SUBST(NS_SUPPORT)
+AC_SUBST(LIB_STANDARD)
+AC_SUBST_FILE(ns_frag)
case "${window_system}" in
x11 )
if test $emacs_cv_var___after_morecore_hook = no; then
doug_lea_malloc=no
fi
+
if test "${system_malloc}" = "yes"; then
GNU_MALLOC=no
GNU_MALLOC_reason="
(The GNU allocators don't work with this system configuration.)"
+ GMALLOC_OBJ=
+ VMLIMIT_OBJ=
+else
+ test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
+ VMLIMIT_OBJ=vm-limit.o
fi
+AC_SUBST(GMALLOC_OBJ)
+AC_SUBST(VMLIMIT_OBJ)
+
if test "$doug_lea_malloc" = "yes" ; then
if test "$GNU_MALLOC" = yes ; then
GNU_MALLOC_reason="
fi
AC_DEFINE(DOUG_LEA_MALLOC, 1,
[Define to 1 if you are using the GNU C Library.])
+
+ ## Use mmap directly for allocating larger buffers.
+ ## FIXME this comes from src/s/{gnu,gnu-linux}.h:
+ ## #ifdef DOUG_LEA_MALLOC; #undef REL_ALLOC; #endif
+ ## Does the AC_FUNC_MMAP test below make this check unecessary?
+ case "$opsys" in
+ gnu*) REL_ALLOC=no ;;
+ esac
fi
if test x"${REL_ALLOC}" = x; then
REL_ALLOC=no
fi
-LIBS="$libsrc_libs $LIBS"
+LIBS="$LIBS_SYSTEM $LIBS"
dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
AC_CHECK_LIB(pthreads, cma_open)
+## Note: when using cpp in s/aix4.2.h, this definition depended on
+## HAVE_LIBPTHREADS. That was not defined earlier in configure when
+## the system file was sourced. Hence the value of LIBS_SYSTEM
+## added to LIBS in configure would never contain the pthreads part,
+## but the value used in Makefiles might. FIXME?
+##
+## -lpthreads seems to be necessary for Xlib in X11R6, and should
+## be harmless on older versions of X where it happens to exist.
+test "$opsys" = "aix4-2" && \
+ test $ac_cv_lib_pthreads_cma_open = yes && \
+ LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
+
dnl Check for need for bigtoc support on IBM AIX
case ${host_os} in
fi
+GTK_OBJ=
if test x"$pkg_check_gtk" = xyes; then
AC_SUBST(GTK_CFLAGS)
else
HAVE_GTK=yes
AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
+ GTK_OBJ=gtkutil.o
USE_X_TOOLKIT=none
if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
:
fi
fi
+AC_SUBST(GTK_OBJ)
if test "${HAVE_GTK}" = "yes"; then
dnl other platforms. Support for higher D-Bus versions than 1.0 is
dnl also not configured.
HAVE_DBUS=no
+DBUS_OBJ=
if test "${with_dbus}" = "yes"; then
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
if test "$HAVE_DBUS" = yes; then
LIBS="$LIBS $DBUS_LIBS"
AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
+ DBUS_OBJ=dbusbind.o
fi
fi
+AC_SUBST(DBUS_OBJ)
dnl GConf has been tested under GNU/Linux only.
dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6.
fi
fi
+dnl SELinux is available for GNU/Linux only.
+HAVE_LIBSELINUX=no
+LIBSELINUX_LIBS=
+if test "${with_selinux}" = "yes"; then
+ AC_CHECK_LIB([selinux], [lgetfilecon], HAVE_LIBSELINUX=yes, HAVE_LIBSELINUX=no)
+ if test "$HAVE_LIBSELINUX" = yes; then
+ AC_DEFINE(HAVE_LIBSELINUX, 1, [Define to 1 if using SELinux.])
+ LIBSELINUX_LIBS=-lselinux
+ fi
+fi
+AC_SUBST(LIBSELINUX_LIBS)
+
dnl Do not put whitespace before the #include statements below.
dnl Older compilers (eg sunos4 cc) choke on it.
HAVE_XAW3D=no
+LUCID_LIBW=
if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
if test "$with_xaw3d" != no; then
AC_MSG_CHECKING(for xaw3d)
AC_MSG_RESULT([yes; using Lucid toolkit])
USE_X_TOOLKIT=LUCID
HAVE_XAW3D=yes
+ LUCID_LIBW=-lXaw3d
AC_DEFINE(HAVE_XAW3D, 1,
[Define to 1 if you have the Xaw3d library (-lXaw3d).])
else
if test $emacs_cv_xaw = yes; then
AC_MSG_RESULT([yes; using Lucid toolkit])
USE_X_TOOLKIT=LUCID
+ LUCID_LIBW=-lXaw
elif test x"${USE_X_TOOLKIT}" = xLUCID; then
AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
else
X_TOOLKIT_TYPE=$USE_X_TOOLKIT
+LIBXTR6=
if test "${USE_X_TOOLKIT}" != "none"; then
AC_MSG_CHECKING(X11 toolkit version)
AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
AC_MSG_RESULT(6 or newer)
AC_DEFINE(HAVE_X11XTR6, 1,
[Define to 1 if you have the X11R6 or newer version of Xt.])
+ LIBXTR6="-lSM -lICE"
+ case "$opsys" in
+ ## Use libw.a along with X11R6 Xt.
+ unixware) LIBXTR6="$LIBXTR6 -lw" ;;
+ esac
else
AC_MSG_RESULT(before 6)
fi
AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
fi
+AC_SUBST(LIBXTR6)
+
+dnl FIXME the logic here seems weird, but this is what cpp was doing.
+dnl Why not just test for libxmu in the normal way?
+LIBXMU=-lXmu
+case "$machine" in
+ ## These machines don't supply Xmu.
+ hpux* | aix4-2 )
+ test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
+ ;;
+esac
+AC_SUBST(LIBXMU)
# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
if test "${HAVE_X11}" = "yes"; then
fi
fi
+LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
[AC_TRY_COMPILE([#include <Xm/Xm.h>],
Motif version prior to 2.1.
#endif],
emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
- HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
if test $emacs_cv_motif_version_2_1 = yes; then
- HAVE_LIBXP=no
- AC_DEFINE(HAVE_MOTIF_2_1, 1,
- [Define to 1 if you have Motif 2.1 or newer.])
- AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
- if test ${HAVE_LIBXP} = yes; then
- AC_DEFINE(HAVE_LIBXP, 1,
- [Define to 1 if you have the Xp library (-lXp).])
- fi
+ AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp)
else
AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
# We put this in CFLAGS temporarily to precede other -I options
HAVE_LIBOTF=no
HAVE_M17N_FLT=no
fi
+
### End of font-backend (under X11) section.
AC_SUBST(FREETYPE_CFLAGS)
### Use -lXpm if available, unless `--with-xpm=no'.
HAVE_XPM=no
+LIBXPM=
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
AC_CHECK_HEADER(X11/xpm.h,
if test "${HAVE_XPM}" = "yes"; then
AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm libary (-lXpm).])
+ LIBXPM=-lXpm
fi
fi
+AC_SUBST(LIBXPM)
### Use -ljpeg if available, unless `--with-jpeg=no'.
HAVE_JPEG=no
+LIBJPEG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_jpeg}" != "no"; then
dnl Checking for jpeglib.h can lose because of a redefinition of
[AC_MSG_WARN([libjpeg found, but not version 6b or later])
HAVE_JPEG=no])
fi
+ if test "${HAVE_JPEG}" = "yes"; then
+ LIBJPEG=-ljpeg
+ fi
fi
+AC_SUBST(LIBJPEG)
### Use -lpng if available, unless `--with-png=no'.
HAVE_PNG=no
+LIBPNG=
if test "${HAVE_X11}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
if test "${HAVE_PNG}" = "yes"; then
AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
+ LIBPNG="-lpng -lz -lm"
fi
fi
+AC_SUBST(LIBPNG)
### Use -ltiff if available, unless `--with-tiff=no'.
HAVE_TIFF=no
+LIBTIFF=
if test "${HAVE_X11}" = "yes"; then
if test "${with_tiff}" != "no"; then
AC_CHECK_HEADER(tiffio.h,
if test "${HAVE_TIFF}" = "yes"; then
AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ dnl FIXME -lz -lm, as per libpng?
+ LIBTIFF=-ltiff
fi
fi
+AC_SUBST(LIBTIFF)
### Use -lgif or -lungif if available, unless `--with-gif=no'.
HAVE_GIF=no
+LIBGIF=
if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs.
- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, try_libungif=yes)])
+ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
if test "$HAVE_GIF" = yes; then
- ac_gif_lib_name="-lgif"
- fi
-
+ LIBGIF=-lgif
+ elif test "$HAVE_GIF" = maybe; then
# If gif_lib.h but no libgif, try libungif.
- if test x"$try_libungif" = xyes; then
- AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)
-
- if test "$HAVE_GIF" = yes; then
- AC_DEFINE(LIBGIF, -lungif, [Compiler option to link with the gif library (if not -lgif).])
- ac_gif_lib_name="-lungif"
- fi
+ AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=no)
+ test "$HAVE_GIF" = yes && LIBGIF=-lungif
fi
if test "${HAVE_GIF}" = "yes"; then
- AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lgif; otherwise specify with LIBGIF).])
+ AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
fi
fi
+AC_SUBST(LIBGIF)
dnl Check for required libraries.
if test "${HAVE_X11}" = "yes"; then
### Use -lgpm if available, unless `--with-gpm=no'.
HAVE_GPM=no
+LIBGPM=
+MOUSE_SUPPORT=
if test "${with_gpm}" != "no"; then
AC_CHECK_HEADER(gpm.h,
[AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
-fi
-if test "${HAVE_GPM}" = "yes"; then
- AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+ if test "${HAVE_GPM}" = "yes"; then
+ AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+ LIBGPM=-lgpm
+ ## May be reset below.
+ MOUSE_SUPPORT="\$(GPM_MOUSE_SUPPORT)"
+ fi
fi
+AC_SUBST(LIBGPM)
dnl Check for malloc/malloc.h on darwin
AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])])
+C_SWITCH_X_SYSTEM=
### Use NeXTstep API to implement GUI.
if test "${HAVE_NS}" = "yes"; then
AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on Mac OS X.])
fi
if test "${NS_IMPL_GNUSTEP}" = "yes"; then
AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.])
+ # See also .m.o rule in Makefile.in */
+ # FIXME: are all these flags really needed? Document here why. */
+ C_SWITCH_X_SYSTEM="-D_REENTRANT -fPIC -fno-strict-aliasing"
GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE"
fi
if test "${NS_HAVE_NSINTEGER}" = "yes"; then
### Use session management (-lSM -lICE) if available
HAVE_X_SM=no
+LIBXSM=
if test "${HAVE_X11}" = "yes"; then
AC_CHECK_HEADER(X11/SM/SMlib.h,
[AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)])
if test "${HAVE_X_SM}" = "yes"; then
AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
+ LIBXSM="-lSM -lICE"
case "$LIBS" in
*-lSM*) ;;
- *) LIBS="-lSM -lICE $LIBS" ;;
+ *) LIBS="$LIBXSM $LIBS" ;;
esac
fi
fi
+AC_SUBST(LIBXSM)
# If netdb.h doesn't declare h_errno, we must declare it by hand.
AC_CACHE_CHECK(whether netdb declares h_errno,
# Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below.
-AC_CHECK_LIB(mail, maillock)
+AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
+if test $have_mail = yes; then
+ LIBS_MAIL=-lmail
+ LIBS="$LIBS_MAIL $LIBS"
+ AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).])
+else
+ LIBS_MAIL=
+fi
dnl Debian, at least:
-AC_CHECK_LIB(lockfile, maillock)
+AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no)
+if test $have_lockfile = yes; then
+ LIBS_MAIL=-llockfile
+ LIBS="$LIBS_MAIL $LIBS"
+ AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).])
+else
# If we have the shared liblockfile, assume we must use it for mail
# locking (e.g. Debian). If we couldn't link against liblockfile
# (no liblockfile.a installed), ensure that we don't need to.
-if test "$ac_cv_lib_lockfile_maillock" = no; then
dnl This works for files generally, not just executables.
dnl Should we look elsewhere for it? Maybe examine /etc/ld.so.conf?
AC_CHECK_PROG(liblockfile, liblockfile.so, yes, no,
AC_MSG_ERROR([Shared liblockfile found but can't link against it.
This probably means that movemail could lose mail.
There may be a `development' package to install containing liblockfile.])
- else :
fi
fi
AC_CHECK_FUNCS(touchlock)
AC_CHECK_HEADERS(maillock.h)
+AC_SUBST(LIBS_MAIL)
+
+## Define MAIL_USE_FLOCK (or LOCKF) if the mailer uses flock (or lockf) to
+## interlock access to the mail spool. The alternative is a lock file named
+## /usr/spool/mail/$USER.lock.
+mail_lock=no
+case "$opsys" in
+ aix4-2) mail_lock="lockf" ;;
+
+ gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;;
+
+ ## On GNU/Linux systems, both methods are used by various mail programs.
+ ## I assume most people are using newer mailers that have heard of flock.
+ ## Change this if you need to.
+ ## Debian contains a patch which says: ``On Debian/GNU/Linux systems,
+ ## configure gets the right answers, and that means *NOT* using flock.
+ ## Using flock is guaranteed to be the wrong thing. See Debian Policy
+ ## for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
+ ## Debian maintainer hasn't provided a clean fix for Emacs.
+ ## movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
+ ## HAVE_MAILLOCK_H are defined, so the following appears to be the
+ ## correct logic. -- fx
+ ## We must check for HAVE_LIBLOCKFILE too, as movemail does.
+ ## liblockfile is a Free Software replacement for libmail, used on
+ ## Debian systems and elsewhere. -rfr.
+ gnu-*)
+ mail_lock="flock"
+ if test $have_mail = yes || test $have_lockfile = yes; then
+ test $ac_cv_header_maillock_h = yes && mail_lock=no
+ fi
+ ;;
+esac
+
+BLESSMAIL_TARGET=
+case "$mail_lock" in
+ flock) AC_DEFINE(MAIL_USE_FLOCK, 1, [Define if the mailer uses flock to interlock the mail spool.]) ;;
+
+ lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;;
+
+ *) BLESSMAIL_TARGET="need-blessmail" ;;
+esac
+AC_SUBST(BLESSMAIL_TARGET)
+
AC_CHECK_FUNCS(gethostname getdomainname dup2 \
rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
-cfmakeraw cfsetspeed)
+cfmakeraw cfsetspeed isnan copysign)
AC_CHECK_HEADERS(sys/un.h)
# That is because we have not set up to link ncurses in lib-src.
# It's better to believe a function is not available
# than to expect to find it in ncurses.
-AC_CHECK_LIB(ncurses, tparm)
+# Also we need tputs and friends to be able to build at all.
+have_tputs_et_al=true
+AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap], , have_tputs_et_al=false)
+if test "$have_tputs_et_al" != true; then
+ AC_MSG_ERROR([I couldn't find termcap functions (tputs and friends).
+Maybe some development libraries/packages are missing? Try installing
+libncurses-dev(el), libterminfo-dev(el) or similar.])
+fi
+# Must define this when any termcap library is found.
+AC_DEFINE(HAVE_LIBNCURSES, 1,
+ [Define to 1 if you have the `ncurses' library (-lncurses).])
+## FIXME This was the cpp logic, but I am not sure it is right.
+## The above test has not necessarily found libncurses.
+HAVE_LIBNCURSES=yes
+
+## Use terminfo instead of termcap?
+## Note only system files NOT using terminfo are:
+## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and
+## darwin|gnu without ncurses.
+TERMINFO=no
+LIBS_TERMCAP=
+case "$opsys" in
+ ## cygwin: Fewer environment variables to go wrong, more terminal types.
+ ## hpux10-20: Use the system provided termcap(3) library.
+ ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
+ ## is necessary. Otherwise Emacs dumps core when run -nw.
+ aix4-2|cygwin|hpux*|irix6-5|openbsd|sol2*|unixware) TERMINFO=yes ;;
+
+ ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
+ ## The ncurses library has been moved out of the System framework in
+ ## Mac OS X 10.2. So if configure detects it, set the command-line
+ ## option to use it.
+ darwin|gnu*)
+ ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
+ if test "x$HAVE_LIBNCURSES" = "xyes"; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lncurses"
+ fi
+ ;;
+
+ freebsd)
+ AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo])
+ AC_CACHE_VAL(emacs_cv_freebsd_terminfo,
+ [AC_TRY_LINK([#include <osreldate.h>],
+[#if __FreeBSD_version < 400000
+fail;
+#endif
+], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)])
+
+ AC_MSG_RESULT($emacs_cv_freebsd_terminfo)
+
+ if test $emacs_cv_freebsd_terminfo = yes; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lncurses"
+ else
+ LIBS_TERMCAP="-ltermcap"
+ fi
+ ;;
+
+ netbsd)
+ if test $ac_cv_search_tputs = -lterminfo; then
+ TERMINFO=yes
+ LIBS_TERMCAP="-lterminfo"
+ else
+ LIBS_TERMCAP="-ltermcap"
+ fi
+ ;;
+
+esac
+
+case "$opsys" in
+ ## hpux: Make sure we get select from libc rather than from libcurses
+ ## because libcurses on HPUX 10.10 has a broken version of select.
+ ## We used to use -lc -lcurses, but this may be cleaner.
+ hpux*) LIBS_TERMCAP="-ltermcap" ;;
+
+ openbsd) LIBS_TERMCAP="-lncurses" ;;
+
+ ## Must use system termcap, if we use any termcap. It does special things.
+ sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
+esac
+
+TERMCAP_OBJ=tparam.o
+if test $TERMINFO = yes; then
+ AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.])
+
+ ## Default used to be -ltermcap. Add a case above if need something else.
+ test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
+
+ TERMCAP_OBJ=terminfo.o
+fi
+AC_SUBST(LIBS_TERMCAP)
+AC_SUBST(TERMCAP_OBJ)
-# Do we have res_init, for detecting changes in /etc/resolv.conf?
+# Do we have res_init, for detecting changes in /etc/resolv.conf?
resolv=no
AC_TRY_LINK([#include <netinet/in.h>
#include <arpa/nameser.h>
fi
# Do we need the Hesiod library to provide the support routines?
+LIBHESIOD=
if test "$with_hesiod" != no ; then
- # Don't set $LIBS here -- see comments above.
+ # Don't set $LIBS here -- see comments above. FIXME which comments?
AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
[AC_CHECK_LIB(resolv, res_send, resolv=yes,
[AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
RESOLVLIB=
fi
AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
- [AC_DEFINE(HAVE_LIBHESIOD, 1,
- [Define to 1 if you have the hesiod library (-lhesiod).])],
- :, $RESOLVLIB)])
+ hesiod=yes, :, $RESOLVLIB)])
+
+ if test x"$hesiod" = xyes; then
+ AC_DEFINE(HAVE_LIBHESIOD, 1,
+ [Define to 1 if you have the hesiod library (-lhesiod).])
+ LIBHESIOD=-lhesiod
+ fi
fi
+AC_SUBST(LIBHESIOD)
# Do we need libresolv (due to res_init or Hesiod)?
if test "$resolv" = yes ; then
AC_DEFINE(HAVE_LIBRESOLV, 1,
[Define to 1 if you have the resolv library (-lresolv).])
+ LIBRESOLV=-lresolv
+else
+ LIBRESOLV=
fi
+AC_SUBST(LIBRESOLV)
# These tell us which Kerberos-related libraries to use.
+COM_ERRLIB=
+CRYPTOLIB=
+KRB5LIB=
+DESLIB=
+KRB4LIB=
+
if test "${with_kerberos}" != no; then
- AC_CHECK_LIB(com_err, com_err)
- AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt)
- AC_CHECK_LIB(crypto, mit_des_cbc_encrypt)
- AC_CHECK_LIB(krb5, krb5_init_context)
+ AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
+ if test $have_com_err = yes; then
+ COM_ERRLIB=-lcom_err
+ LIBS="$COM_ERRLIB $LIBS"
+ AC_DEFINE(HAVE_LIBCOM_ERR, 1, [Define to 1 if you have the `com_err' library (-lcom_err).])
+ fi
+ AC_CHECK_LIB(crypto, mit_des_cbc_encrypt, have_crypto=yes, have_crypto=no)
+ if test $have_crypto = yes; then
+ CRYPTOLIB=-lcrypto
+ LIBS="$CRYPTOLIB $LIBS"
+ AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
+ fi
+ AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt, have_k5crypto=yes, have_k5crypto=no)
+ if test $have_k5crypto = yes; then
+ CRYPTOLIB=-lk5crypto
+ LIBS="$CRYPTOLIB $LIBS"
+ AC_DEFINE(HAVE_LIBK5CRYPTO, 1, [Define to 1 if you have the `k5crypto' library (-lk5crypto).])
+ fi
+ AC_CHECK_LIB(krb5, krb5_init_context, have_krb5=yes, have_krb5=no)
+ if test $have_krb5=yes; then
+ KRB5LIB=-lkrb5
+ LIBS="$KRB5LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB5, 1, [Define to 1 if you have the `krb5' library (-lkrb5).])
+ fi
+ dnl FIXME Simplify. Does not match 22 logic, thanks to default_off?
if test "${with_kerberos5}" = no; then
- AC_CHECK_LIB(des425, des_cbc_encrypt,,
- [AC_CHECK_LIB(des, des_cbc_encrypt)])
- AC_CHECK_LIB(krb4, krb_get_cred,,
- [AC_CHECK_LIB(krb, krb_get_cred)])
+ AC_CHECK_LIB(des425, des_cbc_encrypt, have_des425=yes, have_des425=no )
+ if test $have_des425 = yes; then
+ DESLIB=-ldes425
+ LIBS="$DESLIB $LIBS"
+ AC_DEFINE(HAVE_LIBDES425, 1, [Define to 1 if you have the `des425' library (-ldes425).])
+ else
+ AC_CHECK_LIB(des, des_cbc_encrypt, have_des=yes, have_des=no)
+ if test $have_des = yes; then
+ DESLIB=-ldes
+ LIBS="$DESLIB $LIBS"
+ AC_DEFINE(HAVE_LIBDES, 1, [Define to 1 if you have the `des' library (-ldes).])
+ fi
+ fi
+ AC_CHECK_LIB(krb4, krb_get_cred, have_krb4=yes, have_krb4=no)
+ if test $have_krb4 = yes; then
+ KRB4LIB=-lkrb4
+ LIBS="$KRB4LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB4, 1, [Define to 1 if you have the `krb4' library (-lkrb4).])
+ else
+ AC_CHECK_LIB(krb, krb_get_cred, have_krb=yes, have_krb=no)
+ if test $have_krb = yes; then
+ KRB4LIB=-lkrb
+ LIBS="$KRB4LIB $LIBS"
+ AC_DEFINE(HAVE_LIBKRB, 1, [Define to 1 if you have the `krb' library (-lkrb).])
+ fi
+ fi
fi
if test "${with_kerberos5}" != no; then
AC_CHECK_HEADERS(com_err.h)
fi
+AC_SUBST(COM_ERRLIB)
+AC_SUBST(CRYPTOLIB)
+AC_SUBST(KRB5LIB)
+AC_SUBST(DESLIB)
+AC_SUBST(KRB4LIB)
+
# Solaris requires -lintl if you want strerror (which calls dgettext)
# to return localized messages.
AC_CHECK_LIB(intl, dgettext)
fi
#### Find out which version of Emacs this is.
-[version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
+[version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
if test x"${version}" = x; then
- AC_MSG_ERROR([can't find current emacs version in `${srcdir}/lisp/version.el'.])
+ AC_MSG_ERROR([can't find current emacs version in `${srcdir}/src/emacs.c'.])
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
- AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/lisp/version.el'.])
+ AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/src/emacs.c'.])
fi
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
AC_SUBST(version)
AC_SUBST(configuration)
+## Unused?
AC_SUBST(canonical)
AC_SUBST(srcdir)
AC_SUBST(prefix)
AC_SUBST(bitmapdir)
AC_SUBST(gamedir)
AC_SUBST(gameuser)
-AC_SUBST(c_switch_system)
-AC_SUBST(c_switch_machine)
+AC_SUBST(unexec)
+## FIXME? Nothing uses @LD_SWITCH_X_SITE@.
+## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the
+## end of LIBX_BASE, but nothing ever set it.
AC_SUBST(LD_SWITCH_X_SITE)
-AC_SUBST(LD_SWITCH_X_SITE_AUX)
AC_SUBST(C_SWITCH_X_SITE)
+AC_SUBST(C_SWITCH_X_SYSTEM)
AC_SUBST(CFLAGS)
+## Used in lwlib/Makefile.in.
AC_SUBST(X_TOOLKIT_TYPE)
AC_SUBST(machfile)
AC_SUBST(opsysfile)
AC_SUBST(ns_appbindir)
AC_SUBST(ns_appresdir)
AC_SUBST(ns_appsrc)
-AC_SUBST(GNUSTEP_MAKEFILES)
-AC_SUBST(GNUSTEP_SYSTEM_HEADERS)
-AC_SUBST(GNUSTEP_SYSTEM_LIBRARIES)
AC_SUBST(GNU_OBJC_CFLAGS)
-AC_SUBST(LIB_SRC_EXTRA_INSTALLABLES)
AC_SUBST(OTHER_FILES)
AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
[Define to the used machine dependent file.])
AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}",
[Define to the used os dependent file.])
-AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE},
-[Define LD_SWITCH_X_SITE to contain any special flags your loader
- may need to deal with X Windows. For instance, if you've defined
- HAVE_X_WINDOWS above and your X libraries aren't in a place that
- your loader can find on its own, you might want to add "-L/..." or
- something similar.])
-AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX},
- [Define LD_SWITCH_X_SITE_AUX with an -R option
- in case it's needed (for Solaris, for example).])
-AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE},
-[Define C_SWITCH_X_SITE to contain any special flags your compiler
- may need to deal with X Windows. For instance, if you've defined
- HAVE_X_WINDOWS above and your X include files aren't in a place
- that your compiler can find on its own, you might want to add
- "-I/..." or something similar.])
-AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC},
- [Define to the unexec source file name.])
+XMENU_OBJ=
+XOBJ=
+FONT_OBJ=
if test "${HAVE_X_WINDOWS}" = "yes" ; then
AC_DEFINE(HAVE_X_WINDOWS, 1,
[Define to 1 if you want to use the X window system.])
+ XMENU_OBJ=xmenu.o
+ XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
+ FONT_OBJ=xfont.o
+ if test "$HAVE_XFT" = "yes"; then
+ FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
+ elif test "$HAVE_FREETYPE" = "yes"; then
+ FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
+ fi
+ AC_SUBST(FONT_OBJ)
fi
+AC_SUBST(XMENU_OBJ)
+AC_SUBST(XOBJ)
+AC_SUBST(FONT_OBJ)
+
+WIDGET_OBJ=
+MOTIF_LIBW=
if test "${USE_X_TOOLKIT}" != "none" ; then
+ WIDGET_OBJ=widget.o
AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
if test "${USE_X_TOOLKIT}" = "LUCID"; then
AC_DEFINE(USE_LUCID, 1, [Define to 1 if using the Lucid X toolkit.])
elif test "${USE_X_TOOLKIT}" = "MOTIF"; then
AC_DEFINE(USE_MOTIF, 1, [Define to 1 if using the Motif X toolkit.])
+ MOTIF_LIBW=-lXm
+ case "$opsys" in
+ gnu-linux)
+ ## Paul Abrahams <abrahams at equinox.shaysnet.com> says this is needed.
+ MOTIF_LIBW="$MOTIF_LIBW -lXpm"
+ ;;
+
+ unixware)
+ ## Richard Anthony Ryan <ryanr at ellingtn.ftc.nrcs.usda.gov>
+ ## says -lXimp is needed in UNIX_SV ... 4.2 1.1.2.
+ MOTIF_LIBW="MOTIF_LIBW -lXimp"
+ ;;
+
+ aix4-2)
+ ## olson@mcs.anl.gov says -li18n is needed by -lXm.
+ MOTIF_LIBW="$MOTIF_LIBW -li18n"
+ ;;
+ esac
+ MOTIF_LIBW="$MOTIF_LIBW $LIBXP"
fi
fi
+AC_SUBST(WIDGET_OBJ)
+
+TOOLKIT_LIBW=
+case "$USE_X_TOOLKIT" in
+ MOTIF) TOOLKIT_LIBW="$MOTIF_LIBW" ;;
+ LUCID) TOOLKIT_LIBW="$LUCID_LIBW" ;;
+ none) test "x$HAVE_GTK" = "xyes" && TOOLKIT_LIBW="$GTK_LIBS" ;;
+esac
+AC_SUBST(TOOLKIT_LIBW)
+
+if test "$USE_X_TOOLKIT" = "none"; then
+ LIBXT_OTHER="\$(LIBXSM)"
+ OLDXMENU_TARGET="really-oldXMenu"
+else
+ LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
+ OLDXMENU_TARGET="really-lwlib"
+fi
+AC_SUBST(LIBXT_OTHER)
+
+## The X Menu stuff is present in the X10 distribution, but missing
+## from X11. If we have X10, just use the installed library;
+## otherwise, use our own copy.
if test "${HAVE_X11}" = "yes" ; then
AC_DEFINE(HAVE_X11, 1,
[Define to 1 if you want to use version 11 of X windows.
Otherwise, Emacs expects to use version 10.])
+
+ if test "$USE_X_TOOLKIT" = "none"; then
+ OLDXMENU="\${oldXMenudir}libXMenu11.a"
+ else
+ OLDXMENU="\${lwlibdir}liblw.a"
+ fi
+ LIBXMENU="\$(OLDXMENU)"
+ LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
+ OLDXMENU_DEPS="\${OLDXMENU} ../src/\${OLDXMENU}"
+else
+ ## For a syntactically valid Makefile; not actually used for anything.
+ ## See comments in src/Makefile.in.
+ OLDXMENU=nothing
+ ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
+ if test "${HAVE_X_WINDOWS}" = "yes"; then
+ LIBXMENU="-lXMenu"
+ else
+ LIBXMENU=
+ fi
+ LIBX_OTHER=
+ OLDXMENU_DEPS=
fi
+
+if test "$HAVE_GTK" = "yes" || test "$HAVE_MENUS" != "yes"; then
+ OLDXMENU_TARGET=
+ OLDXMENU=nothing
+ LIBXMENU=
+ OLDXMENU_DEPS=
+fi
+
+AC_SUBST(OLDXMENU_TARGET)
+AC_SUBST(OLDXMENU)
+AC_SUBST(LIBXMENU)
+AC_SUBST(LIBX_OTHER)
+AC_SUBST(OLDXMENU_DEPS)
+
if test "${HAVE_MENUS}" = "yes" ; then
AC_DEFINE(HAVE_MENUS, 1,
[Define to 1 if you have mouse menus.
(This is automatic if you use X, but the option to specify it remains.)
It is also defined with other window systems that support xmenu.c.])
fi
+
if test "${GNU_MALLOC}" = "yes" ; then
AC_DEFINE(GNU_MALLOC, 1,
[Define to 1 if you want to use the GNU memory allocator.])
fi
+
+RALLOC_OBJ=
if test "${REL_ALLOC}" = "yes" ; then
AC_DEFINE(REL_ALLOC, 1,
[Define REL_ALLOC if you want to use the relocating allocator for
buffer space.])
+
+ test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o
fi
+AC_SUBST(RALLOC_OBJ)
+
+if test "$opsys" = "cygwin"; then
+ CYGWIN_OBJ="sheap.o"
+ ## Cygwin differs because of its unexec().
+ PRE_ALLOC_OBJ=
+ POST_ALLOC_OBJ=lastfile.o
+else
+ CYGWIN_OBJ=
+ PRE_ALLOC_OBJ=lastfile.o
+ POST_ALLOC_OBJ=
+fi
+AC_SUBST(CYGWIN_OBJ)
+AC_SUBST(PRE_ALLOC_OBJ)
+AC_SUBST(POST_ALLOC_OBJ)
+
+
+case "$opsys" in
+ aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
+
+ darwin)
+ ## The -headerpad option tells ld (see man page) to leave room at the
+ ## end of the header for adding load commands. Needed for dumping.
+ ## 0x690 is the total size of 30 segment load commands (at 56
+ ## each); under Cocoa 31 commands are required.
+ if test "$HAVE_NS" = "yes"; then
+ libs_nsgui="-framework AppKit"
+ headerpad_extra=6C8
+ else
+ libs_nsgui=
+ headerpad_extra=690
+ fi
+ LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra"
+ ;;
+
+ *) LD_SWITCH_SYSTEM_TEMACS= ;;
+esac
+AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
+
+
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM. The cpp logic was:
+## #ifndef LD_SWITCH_SYSTEM
+## #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+ test "$opsys" = "darwin"; then
+ LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+ LD_SWITCH_SYSTEM_EXTRA=
+fi
+AC_SUBST(LD_SWITCH_SYSTEM_EXTRA)
+
+
+LINKER=
+ORDINARY_LINK=
+case "$opsys" in
+ ## gnu: GNU needs its own crt0.
+ aix4-2|darwin|gnu|usg5-4|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
+
+ cygwin) LINKER="\$(CC)" ;;
+
+ ## 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) LINKER="\$(CC) -nostartfiles" ;;
+
+ ## macpcc: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
+ ## MkLinux/LinuxPPC needs this.
+ ## ibms390x only supports opsys = gnu-linux so it can be added here.
+ gnu-*)
+ case "$machine" in
+ macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;;
+ esac
+ ;;
+esac
+
+## A macro which other sections of Makefile can redefine to munge the
+## flags before they are passed to LD. This is helpful if you have
+## redefined LD to something odd, like "gcc".
+## (The YMF prefix is a holdover from the old name "ymakefile".)
+YMF_PASS_LDFLAGS=flags
+if test "x$ORDINARY_LINK" = "xyes"; then
+
+ LINKER="\$(CC)"
+ AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.])
+
+## The system files defining neither ORDINARY_LINK nor LINKER are:
+## (bsd-common), freebsd, gnu-* not on macppc|ibms390x, hpux*.
+elif test "x$GCC" = "xyes" && test "x$LINKER" = "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).
+ LINKER="\$(CC) -nostdlib"
+ ## GCC passes any argument prefixed with -Xlinker directly to the linker.
+ ## See prefix-args.c for an explanation of why we do not do this with the
+ ## shell''s ``for'' construct. Note that sane people do not have '.' in
+ ## their paths, so we must use ./prefix-args.
+ ## TODO either make prefix-args check ORDINARY_LINK internally,
+ ## or remove it altogether (bug#6184), removing the need for this macro.
+ YMF_PASS_LDFLAGS='`./prefix-args -Xlinker flags`'
+fi
+AC_SUBST(YMF_PASS_LDFLAGS)
+
+test "x$LINKER" = "x" && LINKER=ld
+## FIXME? What setting of YMF_PASS_LDFLAGS should this have?
+test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic"
+
+AC_SUBST(LINKER)
+
+
+## FIXME? The logic here is not precisely the same as that above
+## setting YMF_PASS_LDFLAGS. There is no check here for a pre-defined
+## LINKER. 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
+ ## cygwin: don't link against static libgcc.
+ cygwin|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)
+ ## Note that m/arm.h never bothered to undefine LIB_GCC first.
+ if test "$machine" = "arm"; then
+ LIB_GCC="-lgcc_s"
+ else
+ ## 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=
+ fi
+ ;;
+
+ ## 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)
+
+
+TOOLTIP_SUPPORT=
+WINDOW_SUPPORT=
+## If we're using X11/GNUstep, define some consequences.
+if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
+ AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
+ AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.])
+ MOUSE_SUPPORT="\$(REAL_MOUSE_SUPPORT)"
+ TOOLTIP_SUPPORT="\${lispsource}mouse.elc"
+
+ WINDOW_SUPPORT="\$(BASE_WINDOW_SUPPORT)"
+ test "$HAVE_X_WINDOWS" = "yes" && \
+ WINDOW_SUPPORT="$WINDOW_SUPPORT \$(X_WINDOW_SUPPORT)"
+
+fi
+AC_SUBST(MOUSE_SUPPORT)
+AC_SUBST(TOOLTIP_SUPPORT)
+AC_SUBST(WINDOW_SUPPORT)
AH_TOP([/* GNU Emacs site configuration template file.
])dnl
AH_BOTTOM([
-/* If we're using X11/Carbon/GNUstep, define some consequences. */
-#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
-#define HAVE_WINDOW_SYSTEM
-#define HAVE_MOUSE
-#endif
-
/* Define AMPERSAND_FULL_NAME if you use the convention
that & in the full name stands for the login id. */
/* Turned on June 1996 supposing nobody will mind it. */
#endif
#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
-/* If using GNU, then support inline function declarations. */
+/* If using GNU, then support inline function declarations. */
/* Don't try to switch on inline handling as detected by AC_C_INLINE
generally, because even if non-gcc compilers accept `inline', they
may reject `extern inline'. */
/* Set up some defines, C and LD flags for NeXTstep interface on GNUstep.
(There is probably a better place to do this, but right now the Cocoa
side does this in s/darwin.h and we cannot
- parallel this exactly since GNUstep is multi-OS. */
+ parallel this exactly since GNUstep is multi-OS. */
#ifdef HAVE_NS
# ifdef NS_IMPL_GNUSTEP
-/* See also .m.o rule in Makefile.in */
-/* FIXME: are all these flags really needed? Document here why. */
-# define C_SWITCH_X_SYSTEM -D_REENTRANT -fPIC -fno-strict-aliasing
/* GNUstep needs a bit more pure memory. Of the existing knobs,
SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */
# define SYSTEM_PURESIZE_EXTRA 30000
#include "string.h"
#endif
#ifdef HAVE_STRINGS_H
-#include "strings.h" /* May be needed for bcopy & al. */
+#include "strings.h" /* May be needed for bcopy & al. */
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#ifdef HAVE_X11R6
#define HAVE_X_I18N
-#elif !defined X11R5_INHIBIT_I18N
-#define HAVE_X_I18N
#endif
/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
that the stack is continuous. */
#ifdef __GNUC__
# ifndef GC_SETJMP_WORKS
- /* GC_SETJMP_WORKS is nearly always appropriate for GCC --
- see NON_SAVING_SETJMP in the target descriptions. */
- /* Exceptions (see NON_SAVING_SETJMP in target description) are
- SCO5 non-ELF (but Emacs specifies ELF) and SVR3 on x86.
- Fixme: Deal with SVR3. */
+ /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */
# define GC_SETJMP_WORKS 1
# endif
# ifndef GC_LISP_OBJECT_ALIGNMENT
echo " Does Emacs use -lXpm? ${HAVE_XPM}"
echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
-echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
+echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
echo " Does Emacs use -lpng? ${HAVE_PNG}"
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
echo " Does Emacs use -lgpm? ${HAVE_GPM}"
echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
+echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}"
echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}"
echo " Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}"
# the C preprocessor to some helpful value like 1, or maybe the empty
# string. Needless to say consequent macro substitutions are less
# than conducive to the makefile finding the correct directory.
-[cpp_undefs="`echo $srcdir $configuration $canonical unix |
+# src/Makefile.in used to treat X11 as equivalent to HAVE_X11.
+# But nothing in Emacs defines X11, and everywhere else uses HAVE_X11,
+# so that cannot have been doing anything.
+[cpp_undefs="`echo $srcdir $configuration $canonical unix mktime register X11 |
sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
-e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g'`"]
CPP_NEED_TRADITIONAL=no,
CPP_NEED_TRADITIONAL=yes)
-AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
+AC_OUTPUT(Makefile lib-src/Makefile oldXMenu/Makefile \
doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
doc/lispref/Makefile src/Makefile.c:src/Makefile.in \
lwlib/Makefile lisp/Makefile leim/Makefile, [
CPPFLAGS="$CPPFLAGS -traditional"
fi
-echo creating lib-src/Makefile
-( cd lib-src
- rm -f junk.c junk1.c junk2.c
- sed -e '/start of cpp stuff/q' \
- < Makefile.c > junk1.c
- sed -e '1,/start of cpp stuff/d'\
- -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
- < Makefile.c > junk.c
- $CPP -P $cpp_undefs -I. -I$srcdir/src $CPPFLAGS junk.c | \
- sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
- cat junk1.c junk2.c > Makefile.new
- rm -f junk.c junk1.c junk2.c
- chmod 444 Makefile.new
- mv -f Makefile.new Makefile
-)
-
echo creating src/Makefile
( cd src
rm -f junk.c junk1.c junk2.c
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+2010-05-18 Eli Zaretskii <eliz@gnu.org>
- * Version 23.2 released.
+ * display.texi (Fringes): Document reversal of fringe arrows for R2L
+ paragraphs.
+ (Line Truncation): Fix wording for bidi display.
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+ * basic.texi (Moving Point): Document bidi-aware behavior of the arrow
+ keys.
+
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* building.texi (GDB Graphical Interface): Remove misleading comparison
to an IDE (Bug#6128).
-2010-05-03 Štěpán Němec <stepnem@gmail.com> (tiny change)
+2010-05-08 Štěpán Němec <stepnem@gmail.com> (tiny change)
* programs.texi (Man Page):
* misc.texi (Invoking emacsclient):
* mini.texi (Repetition):
* mark.texi (Setting Mark): Fix typos.
-2010-04-25 Chong Yidong <cyd@stupidchicken.com>
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* misc.texi (Printing): Document htmlfontify-buffer.
-2010-04-21 Glenn Morris <rgm@gnu.org>
+2010-05-08 Glenn Morris <rgm@gnu.org>
* calendar.texi (Displaying the Diary, Format of Diary File):
Fix external cross-references for TeX format output.
+2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * Version 23.2 released.
+
+2010-05-02 Jan Djärv <jan.h.d@swipnet.se>
+
+ * cmdargs.texi (Initial Options): Mention --chdir.
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * frames.texi (Tool Bars): Add tool-bar-style.
+
+2010-04-21 Glenn Morris <rgm@gnu.org>
+
+ * ack.texi, emacs.texi (Acknowledgments): Add SELinux support.
+
2010-04-18 Chong Yidong <cyd@stupidchicken.com>
* programs.texi (Semantic): New node.
* misc.texi (Gnus): Use the `C-h i' keybinding for info.
-2010-04-16 Glenn Morris <rgm@gnu.org>
+2010-04-18 Glenn Morris <rgm@gnu.org>
* emacs.texi (Acknowledgments): Remove duplicate.
* maintaining.texi (VC Directory Commands): Mention stashes and shelves.
-2010-04-15 Glenn Morris <rgm@gnu.org>
+2010-04-18 Glenn Morris <rgm@gnu.org>
* dired.texi (Misc Dired Features): Mention VC diff and log.
* maintaining.texi (Old Revisions, VC Change Log):
* custom.texi (Specifying File Variables, Directory Variables):
Document new commands for manipulating local variable lists.
-2010-04-09 Glenn Morris <rgm@gnu.org>
+2010-04-18 Glenn Morris <rgm@gnu.org>
* trouble.texi (Contributing): Add cindex entry.
Mention etc/CONTRIBUTE.
-2010-04-06 Chong Yidong <cyd@stupidchicken.com>
+2010-04-18 Chong Yidong <cyd@stupidchicken.com>
* mark.texi (Persistent Mark): Copyedits. Replace undo example with
query-replace (Bug#5774).
+2010-04-16 Glenn Morris <rgm@gnu.org>
+
+ * ack.texi, emacs.texi (Acknowledgments): Update for Org changes.
+
+2010-04-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xresources.texi (Lucid Resources): Mention faceName for dialogs.
+
+2010-04-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xresources.texi (Lucid Resources): Mention faceName to set Xft fonts.
+
2010-03-30 Eli Zaretskii <eliz@gnu.org>
* mule.texi (Input Methods): Mention "C-x 8 RET" and add a
* basic.texi (Inserting Text): Add an index entry for "C-x 8 RET".
Mention completion provided by `ucs-insert'.
-2010-03-28 Chong Yidong <cyd@stupidchicken.com>
+2010-03-30 Chong Yidong <cyd@stupidchicken.com>
* sending.texi (Sending Mail): Note variables that may need
customizing.
(Mail Sending): Expand discussion of send-mail-function.
-2010-03-28 Chong Yidong <cyd@stupidchicken.com>
+2010-03-30 Chong Yidong <cyd@stupidchicken.com>
Document Message mode as the default mail mode.
* custom.texi (Init Examples): Add xref to Mail Header.
- * emacs.texi (Top): Fix xrefs.
+ * emacs.texi (Top): Fix xrefs.
-2010-03-25 Chong Yidong <cyd@stupidchicken.com>
+2010-03-30 Chong Yidong <cyd@stupidchicken.com>
* maintaining.texi (VC With A Merging VCS): C-x v v now creates a
repository if there is none.
* misc.texi (Navigation): Document doc-view-continuous.
(Shell Ring): Document new M-r binding. M-s is no longer bound.
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ * search.texi (Other Repeating Search): Remove line that `occur'
+ can not handle multiline matches.
+
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
+
+ * mule.texi (International): Mention support of bidirectional editing.
+ (Bidirectional Editing): New section.
+
+2010-03-28 Nick Roberts <nickrob@snap.net.nz>
+
+ * emacs.texi (Top): Update node names to those in building.texi.
+
+2010-03-27 Nick Roberts <nickrob@snap.net.nz>
+
+ doc/emacs/building.texi: Describe restored GDB/MI fuctionality removed by 2009-12-29T07:15:34Z!nickrob@snap.net.nz.
+ doc/emacs/emacs.texi: Update node names for building.texi.
+
2010-03-24 Glenn Morris <rgm@gnu.org>
* ack.texi (Acknowledgments):
* xresources.texi (Table of Resources):
* mule.texi (Defining Fontsets, Charsets): Update xrefs.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-03-06 Chong Yidong <cyd@stupidchicken.com>
* custom.texi (Init Examples): Add xref to Locals.
(Fortran Columns): Mention font-locking.
(Fortran Abbrev): Word syntax not relevant with new-style abbrev.
-2008-08-23 Johan Bockgard <bojohan@muon>
+2008-08-23 Johan Bockgård <bojohan@muon>
* basic.texi (Moving Point): Fix <prior>/<next> confusion.
Carsten Dominik wrote Ref@TeX{}, a package for setting up labels and
cross-references in La@TeX{} documents; and co-wrote IDLWAVE mode
(q.v.@:). He was the main author of Org mode, for maintaining notes,
-todo lists, and project planning. Thomas Baumann, Lennart Borgman,
-Baoqiu Cui, Daniel German, Bastien Guerry, Tassilo Horn, Philip Jackson,
-Tokuya Kameshima, Ross Patterson, Sebastian Rose, Eric Schulte, Andy
-Stewart, David O'Toole, John Wiegley, and Piotr Zielinski also wrote
-various Org mode components.
+todo lists, and project planning. Thomas Baumann, Jan Böcker, Lennart
+Borgman, Baoqiu Cui, Daniel German, Bastien Guerry, Tassilo Horn, Philip
+Jackson, Tokuya Kameshima, Ross Patterson, Sebastian Rose, Eric Schulte,
+Paul Sexton, Ulf Stegemann, Andy Stewart, David O'Toole, John Wiegley,
+and Piotr Zielinski also wrote various Org mode components.
@item
Scott Draves wrote @file{tq.el}, help functions for maintaining
files and running a PostScript interpreter interactively from within
Emacs.
+@item
+Karel Kl@'{@dotless{i}}@v{c} contributed SELinux support, for preserving the
+Security-Enchanced Linux context of files on backup and copy.
+
@item
Shuhei Kobayashi wrote @file{hex-util.el}, for operating on hexadecimal
strings; support for HMAC (Keyed-Hashing for Message Authentication);
@findex move-end-of-line
@findex forward-char
@findex backward-char
+@findex right-arrow-command
+@findex left-arrow-command
@findex next-line
@findex previous-line
@findex beginning-of-buffer
@itemx @key{End}
Move to the end of the line (@code{move-end-of-line}).
@item C-f
-@itemx @key{right}
Move forward one character (@code{forward-char}).
+@item @key{right}
+Move one character to the right (@code{right-arrow-command}). This
+moves one character forward in text that is read in the usual
+left-to-right direction, but one character @emph{backward} if the text
+is read right-to-left, as needed for right-to-left scripts such as
+Arabic. @xref{Bidirectional Editing}.
@item C-b
-@itemx @key{left}
Move backward one character (@code{backward-char}).
+@item @key{left}
+Move one character to the left (@code{left-arrow-command}). This
+moves one character backward in left-to-right text and one character
+forward in right-to-left text.
@item M-f
@itemx M-@key{right}
@itemx C-@key{right}
multiple programs within one Emacs session.
@menu
-* GDB-UI Layout:: Control the number of displayed buffers.
+* GDB User Interface Layout:: Control the number of displayed buffers.
* Source Buffers:: Use the mouse in the fringe/margin to
control your program.
* Breakpoints Buffer:: A breakpoint control panel.
+* Threads Buffer:: Displays your threads.
* Stack Buffer:: Select a frame from the call stack.
-* Other GDB-UI Buffers:: Input/output, locals, registers,
+* Other GDB Buffers:: Input/output, locals, registers,
assembler, threads and memory buffers.
* Watch Expressions:: Monitor variable values in the speedbar.
-* Reverse Debugging:: Execute and reverse debug your program.
+* Multithreaded Debugging:: Debugging programs with several threads.
@end menu
-@node GDB-UI Layout
+@node GDB User Interface Layout
@subsubsection GDB User Interface Layout
@cindex GDB User Interface layout
Visit the source line for the breakpoint you click on.
@end table
+@vindex gdb-show-threads-by-default
When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer
shares its window with the threads buffer. To switch from one to the
other click with @kbd{Mouse-1} on the relevant button in the header
-line.
+line. If @code{gdb-show-threads-by-default} is non-@code{nil}, the
+threads buffer, rather than the breakpoints buffer, is shown at start
+up.
+
+@node Threads Buffer
+@subsubsection Threads Buffer
+
+@findex gdb-select-thread
+The threads buffer displays a summary of all threads currently in your
+program (@pxref{Threads, Threads, Debugging programs with multiple
+threads, gdb, The GNU debugger}). Move point to any thread in the list
+and press @key{RET} to select it (@code{gdb-select-thread}) and
+display the associated source in the primary source buffer.
+Alternatively, click @kbd{Mouse-2} on a thread to select it. Contents
+of all GDB buffers are updated whenever you select a thread.
+
+ You can customize variables under @code{gdb-buffers} group to select
+fields included in threads buffer.
+
+@table @code
+@item gdb-thread-buffer-verbose-names
+@vindex gdb-thread-buffer-verbose-names
+Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in
+threads buffer.
+
+@item gdb-thread-buffer-arguments
+@vindex gdb-thread-buffer-arguments
+Show arguments of thread top frames in threads buffer.
+
+@item gdb-thread-buffer-locations
+@vindex gdb-thread-buffer-locations
+Show file information or library names in threads buffer.
+
+@item gdb-thread-buffer-addresses
+@vindex gdb-thread-buffer-addresses
+Show addresses for thread frames in threads buffer.
+@end table
+
+ It’s possible to observe information for several threads
+simultaneously (in addition to buffers which show information for
+currently selected thread) using the following keys from the threads
+buffer.
+
+@table @kbd
+@item d
+@kindex d @r{(GDB threads buffer)}
+@findex gdb-display-disassembly-for-thread
+Display disassembly buffer for the thread at current line.
+(@code{gdb-display-disassembly-for-thread})
+
+@item f
+@kindex f @r{(GDB threads buffer)}
+@findex gdb-display-stack-for-thread
+Display stack buffer for the thread at current line.
+(@code{gdb-display-stack-for-thread}).
+
+@item l
+@kindex l @r{(GDB threads buffer)}
+@findex gdb-display-locals-for-thread
+Display locals buffer for the thread at current line.
+(@code{gdb-display-locals-for-thread}).
+
+@item r
+@kindex r @r{(GDB threads buffer)}
+@findex gdb-display-registers-for-thread
+Display registers buffer for the thread at current line.
+(@code{gdb-display-registers-for-thread}).
+@end table
+
+Pressing their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and
+@kbd{R} displays the corresponding buffer in a new frame.
+
+ When you create a buffer showing information about some specific
+thread, it becomes bound to that thread and keeps showing actual
+information while you debug your program. Every GDB buffer contains a
+number of thread it shows information for in its mode name. Thread
+number is also included in the buffer name of bound buffers to prevent
+buffer names clashing.
+
+Further commands are available in the threads buffer which depend on the
+mode of GDB that is used for controlling execution of your program.
+(@pxref{Multithreaded Debugging, Stopping and Starting Multi-threaded Programs}).
@node Stack Buffer
@subsubsection Stack Buffer
selecting a stack frame updates it to display the local variables of the
new frame.
-@node Other GDB-UI Buffers
+@node Other GDB Buffers
@subsubsection Other Buffers
@table @asis
breakpoints as in a source buffer. Breakpoint icons also appear in
the fringe or margin.
-@item Threads Buffer
-@findex gdb-threads-select
-The threads buffer displays a summary of all threads currently in your
-program (@pxref{Threads, Threads, Debugging programs with multiple
-threads, gdb, The GNU debugger}). Move point to any thread in the
-list and press @key{RET} to select it (@code{gdb-threads-select}) and
-display the associated source in the primary source buffer.
-Alternatively, click @kbd{Mouse-2} on a thread to select it. If the
-locals buffer is visible, its contents update to display the variables
-that are local in the new thread.
-
-When there is more than one main thread and the threads buffer is
-present, Emacs displays the selected thread number in the mode line of
-many of the GDB-UI Buffers.
-
@item Memory Buffer
The memory buffer lets you examine sections of program memory
(@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}).
size for these data items.
@end table
-When @code{gdb-many-windows} is non-@code{nil}, the threads buffer
-shares its window with the breakpoints buffer, and the locals buffer
-with the registers buffer. To switch from one to the other click with
+When @code{gdb-many-windows} is non-@code{nil}, the locals buffer
+shares its window with the registers buffer, just like breakpoints
+and threads buffers. To switch from one to the other click with
@kbd{Mouse-1} on the relevant button in the header line.
@node Watch Expressions
non-@code{nil}. This can be useful if you are debugging with a full
screen Emacs frame.
-@node Reverse Debugging
-@subsubsection Reverse Debugging
-
- The GDB tool bar shares many buttons with the other GUD debuggers
-for tasks like stepping and printing expressions. It also has a
-further set of buttons that allow reverse debugging (@pxref{Process
-Record and Replay, , ,gdb, The GNU debugger}). This is useful when it
-takes a long time to reproduce the conditions where your program fails
-or for transient problems, like race conditions in multi-threaded
-programs, where a failure might otherwise be hard to reproduce.
-
-To use reverse debugging, set a breakpoint slightly before the
-location of interest and run your program to that point. Enable
-process recording by clicking on the record button. At this point, a
-new set of buttons appear. These buttons allow program execution in
-the reverse direction. Run your program over the code where the
-problem occurs, and then use the new set of buttons to retrace your
-steps, examine values, and analyze the problem. When analysis is
-complete, turn off process recording by clicking on the record button
-again.
+@node Multithreaded Debugging
+@subsubsection Stopping and Starting Multi-threaded Programs
+@cindex Multithreaded debugging in GDB
+
+@subsubheading All-stop Debugging
+
+In all-stop mode, whenever your program stops, @emph{all} threads of
+execution stop. Likewise, whenever you restart the program, all
+threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb,
+The GNU debugger}. You can enable this behaviour in Emacs by setting
+@code{gdb-non-stop-setting} to @code{nil} before starting a debugging
+session.
+
+@subsubheading Non-stop Debugging
+@cindex Non-stop debugging in GDB
+
+For some multi-threaded targets, GDB supports a further mode of
+operation in which you can examine stopped program threads in the
+debugger while other threads continue to execute freely.
+@xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}.
+This is referred to as @dfn{non-stop} mode.
+
+Versions of GDB prior to 7.0 do not support non-stop mode and it does
+not work on all targets. In such cases, Emacs uses all-stop mode
+regardless of the value of @code{gdb-non-stop-setting}.
+
+@vindex gdb-non-stop-setting
+If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the
+default value), Emacs tries to start GDB in non-stop mode. Note that
+GDB debugging session needs to be restarted for change of this setting
+to take effect.
+
+@vindex gdb-switch-when-another-stopped
+When a thread stops in non-stop mode, Emacs automatically switches to
+that thread. It may be undesirable to allow switching of current
+thread when some other stopped thread is already selected. Set
+@code{gdb-switch-when-another-stopped} to @code{nil} to prevent this.
+
+@vindex gdb-switch-reasons
+Emacs can decide whether or not to switch to the stopped thread
+depending on the reason which caused the stop. Customize
+@code{gdb-switch-reasons} to select stop reasons which make Emacs
+switch thread.
+
+@vindex gdb-stopped-hooks
+The variable @code{gdb-stopped-hooks} allows you to execute your
+functions whenever some thread stops.
+
+ In non-stop mode, you can switch between different modes for GUD
+execution control commands.
+
+@vindex gdb-gud-control-all-threads
+@table @dfn
+@item Non-stop/A
+
+When @code{gdb-gud-control-all-threads} is @code{t} (the default
+value), interruption and continuation commands apply to all threads,
+so you can halt or continue all your threads with one command using
+@code{gud-stop-subjob} and @code{gud-cont}, respectively. The
+@samp{Go} button is shown on the toolbar when at least one thread is
+stopped, whereas @samp{Stop} button is shown when at least one thread
+is running.
+
+@item Non-stop/T
+
+When @code{gdb-gud-control-all-threads} is @code{nil}, only the
+current thread is stopped/continued. @samp{Go} and @samp{Stop}
+buttons on the GUD toolbar are shown depending on the state of current
+thread.
+@end table
+
+You can change the current value of @code{gdb-gud-control-all-threads}
+from the tool bar or from @samp{GUD->GDB-MI} menu.
+
+ Stepping commands always apply to the current thread.
+
+@subsubheading Fine Thread Control
+
+ In non-stop mode, you can interrupt/continue your threads without
+selecting them. Hitting @kbd{i} in threads buffer interrupts thread
+under point, @kbd{c} continues it, @kbd{s} steps through. More such
+commands may be added in the future.
+
+Combined with creating bound buffers for any thread, this allows you
+to change and track state of many threads in the same time.
+
+ Note that when you interrupt a thread, it stops with @samp{signal
+received} reason. If that reason is included in your
+@code{gdb-switch-reasons} (it is by default), Emacs will switch to
+that thread.
@node Executing Lisp
@section Executing Lisp Expressions
other files for them.
@table @samp
+@item -chdir @var{directory}
+@opindex -chdir
+@itemx --chdir=@var{directory}
+@opindex --chdir
+@cindex change Emacs directory
+Change to @var{directory} before doing anything else. This is mainly used
+by session management in X so that Emacs starts in the same directory as it
+stopped. This makes desktop saving and restoring easier.
+
@item -t @var{device}
@opindex -t
@itemx --terminal=@var{device}
screen. The left fringe shows a curving arrow for each screen line
except the first, indicating that ``this is not the real beginning.''
The right fringe shows a curving arrow for each screen line except the
-last, indicating that ``this is not the real end.''
+last, indicating that ``this is not the real end.'' If the line's
+direction is right-to-left (@pxref{Bidirectional Editing}), the
+meaning of the curving arrows in the left and right fringes are
+swapped.
The fringes indicate line truncation with short horizontal arrows
meaning ``there's more text on this line which is scrolled
characters that do not fit in the width of the screen or window do not
appear at all. On graphical displays, a small straight arrow in the
fringe indicates truncation at either end of the line. On text-only
-terminals, @samp{$} appears in the first column when there is text
-truncated to the left, and in the last column when there is text
+terminals, @samp{$} appears in the leftmost column when there is text
+truncated to the left, and in the rightmost column when there is text
truncated to the right.
@vindex truncate-lines
@c The edition number appears in several places in this file
@set EDITION Sixteenth
-@set EMACSVER 23.2.50
+@set EMACSVER 24.0.50
@copying
This is the @value{EDITION} edition of the @cite{GNU Emacs Manual},@*
GDB Graphical Interface
-* GDB-UI Layout:: Control the number of displayed buffers.
-* Source Buffers:: Use the mouse in the fringe/margin to
- control your program.
-* Breakpoints Buffer:: A breakpoint control panel.
-* Stack Buffer:: Select a frame from the call stack.
-* Other GDB-UI Buffers::Input/output, locals, registers,
- assembler, threads and memory buffers.
-* Watch Expressions:: Monitor variable values in the speedbar.
+* GDB User Interface Layout:: Control the number of displayed buffers.
+* Source Buffers:: Use the mouse in the fringe/margin to
+ control your program.
+* Breakpoints Buffer:: A breakpoint control panel.
+* Threads Buffer:: Displays your threads.
+* Stack Buffer:: Select a frame from the call stack.
+* Other GDB Buffers:: Input/output, locals, registers,
+ assembler, threads and memory buffers.
+* Watch Expressions:: Monitor variable values in the speedbar.
+* Multithreaded Debugging:: Debugging programs with several threads.
Maintaining Large Programs
Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, Eli
Barzilay, Thomas Baumann, Steven L.@: Baur, Jay Belanger, Alexander L.@:
Belikoff, Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim
-Blandy, Johan Bockg@aa{}rd, Lennart Borgman, Per Bothner, Terrence
-Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin Broadey,
-Vincent Broman, David M.@: Brown, Georges Brun-Cottan, Joe Buehler,
-W@l{}odek Bzyl, Bill Carpenter, Per Cederqvist, Hans Chalupsky, Chong
-Yidong, Chris Chase, Bob Chassell, Andrew Choi, Sacha Chua, James Clark,
-Mike Clarkson, Glynn Clements, Daniel Colascione, Andrew Csillag, Baoqiu
-Cui, Doug Cutting, Mathias Dahl, Satyaki Das, Vivek Dasmohapatra,
+Blandy, Johan Bockg@aa{}rd, Jan Böcker, Lennart Borgman, Per Bothner,
+Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin
+Broadey, Vincent Broman, David M.@: Brown, Georges Brun-Cottan, Joe
+Buehler, W@l{}odek Bzyl, Bill Carpenter, Per Cederqvist, Hans Chalupsky,
+Chong Yidong, Chris Chase, Bob Chassell, Andrew Choi, Sacha Chua, James
+Clark, Mike Clarkson, Glynn Clements, Daniel Colascione, Andrew Csillag,
+Baoqiu Cui, Doug Cutting, Mathias Dahl, Satyaki Das, Vivek Dasmohapatra,
Michael DeCorte, Gary Delp, Matthieu Devin, Eri Ding, Jan Dj@"{a}rv,
Carsten Dominik, Scott Draves, Benjamin Drieu, Viktor Dukhovni, Dmitry
Dzhus, John Eaton, Rolf Ebert, Paul Eggert, Stephen Eglen, Torbj@"orn
Jones, Simon Josefsson, Arne J@o{}rgensen, Tomoji Kagatani, Brewster
Kahle, Tokuya Kameshima, Lute Kamstra, David Kastrup, David Kaufman,
Henry Kautz, Taichi Kawabata, Howard Kaye, Michael Kifer, Richard King,
-Peter Kleiweg, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: Kolodney,
-David M.@: Koppelman, Koseki Yoshinori, Robert Krawitz, Sebastian
-Kremer, Ryszard Kubiak, David K@aa{}gedal, Daniel LaLiberte,
-Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus,
-Vinicius Jose Latorre, Werner Lemberg, Frederic Lepied, Peter
-Liljenberg, Lars Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link,
-Juri Linkov, Francis Litterio, Emilio C. Lopes, K@'{a}roly L@H{o}rentey,
-Dave Love, Sascha L@"{u}decke, Eric Ludlam, Alan Mackenzie, Christopher
-J.@: Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, Brian Marick,
-Simon Marshall, Bengt Martensson, Charlie Martin, Thomas May, Roland
-McGrath, Will Mengarini, David Megginson, Ben A. Mesander, Wayne Mesard,
-Brad Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan
+Peter Kleiweg, Karel Kl@'{@dotless{i}}@v{c}, Shuhei Kobayashi, Pavel
+Kobiakov, Larry K.@: Kolodney, David M.@: Koppelman, Koseki Yoshinori,
+Robert Krawitz, Sebastian Kremer, Ryszard Kubiak, David K@aa{}gedal, Daniel
+LaLiberte, Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus,
+Vinicius Jose Latorre, Werner Lemberg, Frederic Lepied, Peter Liljenberg,
+Lars Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link, Juri Linkov,
+Francis Litterio, Emilio C. Lopes, K@'{a}roly L@H{o}rentey, Dave Love,
+Sascha L@"{u}decke, Eric Ludlam, Alan Mackenzie, Christopher J.@:
+Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, Brian Marick, Simon
+Marshall, Bengt Martensson, Charlie Martin, Thomas May, Roland McGrath,
+Will Mengarini, David Megginson, Ben A. Mesander, Wayne Mesard, Brad
+Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan
Monnier, Morioka Tomohiko, Keith Moore, Jan Moringen, Glenn Morris,
Diane Murray, Sen Nagata, Erik Naggum, Thomas Neumann, Thien-Thi Nguyen,
Mike Newton, Jurgen Nickelsen, Dan Nicolaescu, Hrvoje Niksic, Jeff
Schleicher, Gregor Schmid, Michael Schmidt, Ronald S. Schnell, Philippe
Schnoebelen, Jan Schormann, Alex Schroeder, Stephen Schoef, Raymond
Scholz, Eric Schulte, Andreas Schwab, Randal Schwartz, Oliver Seidel,
-Manuel Serrano, Hovav Shacham, Stanislav Shalunov, Marc Shapiro, Richard
-Sharman, Olin Shivers, Espen Skoglund, Rick Sladkey, Lynn Slater, Chris
-Smith, David Smith, Paul D.@: Smith, William Sommerfeld, Andre Spiegel,
-Michael Staats, Reiner Steib, Sam Steingold, Ake Stenhoff,
-Peter Stephenson, Ken Stevens, Andy Stewart, Jonathan
-Stigelman, Martin Stjernholm, Kim F.@: Storm, Steve Strassman, Olaf
-Sylvester, Naoto Takahashi, Steven Tamm, Jean-Philippe Theberge, Jens
-T.@: Berger Thielemann, Spencer Thomas, Jim Thompson, Luc Teirlinck,
-David O'Toole, Tom Tromey, Enami Tsugutomo, Eli Tziperman, Daiki Ueno,
-Masanobu Umeda, Rajesh Vaidheeswarran, Neil W.@: Van Dyke, Didier Verna,
-Joakim Verona, Ulrik Vieth, Geoffrey Voelker, Johan Vromans, Inge
-Wallin, John Paul Wallington, Colin Walters, Barry Warsaw, Morten
-Welinder, Joseph Brian Wells, Rodney Whitby, John Wiegley, Ed Wilkinson,
-Mike Williams, Bill Wohler, Steven A. Wood, Dale R.@: Worley, Francis
-J.@: Wright, Felix S. T. Wu, Tom Wurgler, Katsumi Yamaoka, Yamamoto
-Mitsuharu, Masatake Yamato, Jonathan Yavner, Ryan Yeske, Ilya
+Manuel Serrano, Paul Sexton, Hovav Shacham, Stanislav Shalunov, Marc
+Shapiro, Richard Sharman, Olin Shivers, Espen Skoglund, Rick Sladkey,
+Lynn Slater, Chris Smith, David Smith, Paul D.@: Smith, William
+Sommerfeld, Andre Spiegel, Michael Staats, Ulf Stegemann, Reiner Steib,
+Sam Steingold, Ake Stenhoff, Peter Stephenson, Ken Stevens, Andy Stewart,
+Jonathan Stigelman, Martin Stjernholm, Kim F.@: Storm, Steve Strassman,
+Olaf Sylvester, Naoto Takahashi, Steven Tamm, Jean-Philippe Theberge,
+Jens T.@: Berger Thielemann, Spencer Thomas, Jim Thompson, Luc
+Teirlinck, David O'Toole, Tom Tromey, Enami Tsugutomo, Eli Tziperman,
+Daiki Ueno, Masanobu Umeda, Rajesh Vaidheeswarran, Neil W.@: Van Dyke,
+Didier Verna, Joakim Verona, Ulrik Vieth, Geoffrey Voelker, Johan
+Vromans, Inge Wallin, John Paul Wallington, Colin Walters, Barry Warsaw,
+Morten Welinder, Joseph Brian Wells, Rodney Whitby, John Wiegley, Ed
+Wilkinson, Mike Williams, Bill Wohler, Steven A. Wood, Dale R.@: Worley,
+Francis J.@: Wright, Felix S. T. Wu, Tom Wurgler, Katsumi Yamaoka,
+Yamamoto Mitsuharu, Masatake Yamato, Jonathan Yavner, Ryan Yeske, Ilya
Zakharevich, Milan Zamazal, Victor Zandy, Eli Zaretskii, Jamie Zawinski,
Shenghuo Zhu, Piotr Zielinski, Ian T.@: Zimmermann, Reto Zimmermann,
Neal Ziring, Teodor Zlatanov, and Detlev Zundel.
You can turn display of tool bars on or off with @kbd{M-x
tool-bar-mode} or by customizing the option @code{tool-bar-mode}.
+@vindex tool-bar-style
+@cindex Tool Bar style
+ When Emacs is compiled with GTK+ support, tool bars can have text and images.
+Customize @code{tool-bar-style} to select style. The default style is
+the same as for the desktop in the Gnome case. If no default is found,
+the tool bar uses just images.
+
@node Dialog Boxes
@section Using Dialog Boxes
@cindex dialog boxes
incorrectly, refer to @ref{Undisplayable Characters}, which describes
possible problems and explains how to solve them.
+@item
+Characters from scripts whose natural ordering of text is from right
+to left are reordered for display (@pxref{Bidirectional Editing}).
+These scripts include Arabic, Hebrew, Syriac, Thaana, and a few
+others.
+
@item
You can insert non-@acronym{ASCII} characters or search for them. To do that,
you can specify an input method (@pxref{Select Input Method}) suitable
* Unibyte Mode:: You can pick one European character set
to use without multibyte characters.
* Charsets:: How Emacs groups its internal character codes.
+* Bidirectional Editing:: Support for right-to-left scripts.
@end menu
@node International Chars
point before it and type @kbd{C-u C-x =} (@pxref{International
Chars}).
+@node Bidirectional Editing
+@section Bidirectional Editing
+@cindex bidirectional editing
+@cindex right-to-left text
+
+ Emacs supports editing text written in scripts, such as Arabic and
+Hebrew, whose natural ordering of horizontal text for display is from
+right to left. However, digits and Latin text embedded in these
+scripts are still displayed left to right. It is also not uncommon to
+have small portions of text in Arabic or Hebrew embedded in otherwise
+Latin document, e.g., as comments and strings in a program source
+file. For these reasons, text that uses these scripts is actually
+@dfn{bidirectional}: a mixture of runs of left-to-right and
+right-to-left characters.
+
+ This section describes the facilities and options provided by Emacs
+for editing bidirectional text.
+
+@cindex logical order
+@cindex visual order
+ Emacs stores right-to-left and bidirectional text in the so-called
+@dfn{logical} (or @dfn{reading}) order: the buffer or string position
+of the first character you read precedes that of the next character.
+Reordering of bidirectional text into the @dfn{visual} order happens
+at display time. As result, character positions no longer increase
+monotonically with their positions on display. Emacs implements the
+Unicode Bidirectional Algorithm described in the Unicode Standard
+Annex #9, for reordering of bidirectional text for display.
+
+@vindex bidi-display-reordering
+ The buffer-local variable @code{bidi-display-reordering} controls
+whether text in the buffer is reordered for display. If its value is
+non-@code{nil}, Emacs reorders characters that have right-to-left
+directionality when they are displayed. The default value is
+@code{nil}.
+
+ Each paragraph of bidirectional text can have its own @dfn{base
+direction}, either right-to-left or left-to-right. (Paragraph
+boundaries are defined by the regular expressions
+@code{paragraph-start} and @code{paragraph-separate}, see
+@ref{Paragraphs}.) Text in left-to-right paragraphs begins at the
+left margin of the window and is truncated or continued when it
+reaches the right margin. By contrast, text in right-to-left
+paragraphs begins at the right margin and is continued or truncated at
+the left margin.
+
+@vindex bidi-paragraph-direction
+ Emacs determines the base direction of each paragraph dynamically,
+based on the text at the beginning of the paragraph. However,
+sometimes a buffer may need to force a certain base direction for its
+paragraphs. The variable @code{bidi-paragraph-direction}, if
+non-@code{nil}, disables the dynamic determination of the base
+direction, and instead forces all paragraphs in the buffer to have the
+direction specified by its buffer-local value. The value can be either
+@code{right-to-left} or @code{left-to-right}. Any other value is
+interpreted as @code{nil}.
+
+@cindex LRM
+@cindex RLM
+ Alternatively, you can control the base direction of a paragraph by
+inserting special formatting characters in front of the paragraph.
+The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces
+the right-to-left direction on the following paragraph, while
+@code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right
+direction. (You can use @kbd{C-x 8 RET} to insert these characters.)
+In a GUI session, the @sc{lrm} and @sc{rlm} characters display as
+blanks.
+
+ Because characters are reordered for display, Emacs commands that
+operate in the logical order or on stretches of buffer positions may
+produce unusual effects. For example, @kbd{C-f} and @kbd{C-b}
+commands move point in the logical order, so the cursor will sometimes
+jump when point traverses reordered bidirectional text. Similarly, a
+highlighted region covering a contiguous range of character positions
+may look discontinuous if the region spans reordered text. This is
+normal and similar to behavior of other programs that support
+bidirectional text.
+
@ignore
arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3
@end ignore
buffer that contains a match for it. To limit the search to part of
the buffer, narrow to that part (@pxref{Narrowing}). A numeric
argument @var{n} specifies that @var{n} lines of context are to be
-displayed before and after each matching line. Currently,
-@code{occur} can not correctly handle multiline matches.
+displayed before and after each matching line.
@kindex RET @r{(Occur mode)}
@kindex o @r{(Occur mode)}
@end table
@node Lucid Resources
-@appendixsec Lucid Menu X Resources
+@appendixsec Lucid Menu And Dialog X Resources
@cindex Menu X Resources (Lucid widgets)
+@cindex Dialog X Resources (Lucid widgets)
@cindex Lucid Widget X Resources
@ifnottex
@end example
@noindent
-For example, to specify the font @samp{8x16} for the menu-bar items,
+For example, to specify the font @samp{Courier-12} for the menu-bar items,
write this:
@end ifnottex
@iftex
with the Lucid menu widgets, then the menu bar is a separate widget
and has its own resources. The resource specifications start with
@samp{Emacs.pane.menubar}---for instance, to specify the font
-@samp{8x16} for the menu-bar items, write this:
+@samp{Courier-12} for the menu-bar items, write this:
@end iftex
@example
-Emacs.pane.menubar.font: 8x16
+Emacs.pane.menubar.faceName: Courier-12
@end example
@noindent
-Resources for @emph{non-menubar} toolkit pop-up menus have
-@samp{menu*} instead of @samp{pane.menubar}. For example, to specify
-the font @samp{8x16} for the pop-up menu items, write this:
+To specify a font, use fontconfig font names as values to the @code{faceName}
+resource.
+
+If Emacs is not built with the Xft library, Lucid menus and dialogs can only
+display old style fonts. If Emacs is built with Xft and you prefer the old
+fonts, you have to specify @samp{none} to @code{faceName}:
@example
-Emacs.menu*.font: 8x16
+Emacs.pane.menubar.faceName: none
+Emacs.pane.dialog.faceName: none
@end example
@noindent
-For dialog boxes, use @samp{dialog*}:
+To specify a non-Xft font, use @code{font}. For example:
@example
-Emacs.dialog*.font: 8x16
+Emacs.pane.menubar.font: lucidasanstypewriter-10
@end example
@noindent
-The Lucid menus can display multilingual text in your locale. For
-more information about fontsets see the man page for
+The Lucid menus can display multilingual text in your locale with old style
+fonts. For more information about fontsets see the man page for
@code{XCreateFontSet}. To enable multilingual menu text you specify a
@code{fontSet} resource instead of the font resource. If both
@code{font} and @code{fontSet} resources are specified, the
Emacs*menu*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
@end example
+@noindent
+Resources for @emph{non-menubar} toolkit pop-up menus have
+@samp{menu*} instead of @samp{pane.menubar}. For example, to specify
+the font @samp{8x16} for the pop-up menu items, write this:
+
+@example
+Emacs.menu*.font: 8x16
+@end example
+
+@noindent
+For dialog boxes, use @samp{dialog*}:
+
+@example
+Emacs.dialog*.faceName: Sans-12
+@end example
+
@noindent
The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
@samp{menu@dots{}}.
Here is a list of the specific resources for menu bars and pop-up menus:
@table @code
+@item faceName
+Xft font for menu item text.
@item font
Font for menu item text.
@item fontSet
* Version 23.2 released.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-02-16 Glenn Morris <rgm@gnu.org>
* emacs-lisp-intro.texi: Fix typo in name of `find-tag' command.
2009-12-09 David Robinow <drobinow@gmail.com> (tiny change)
- * makefile.w32-in: Use parenthesis for macros for nmake
- compatibility.
+ * makefile.w32-in: Use parenthesis for macros for nmake compatibility.
2009-12-03 Glenn Morris <rgm@gnu.org>
2009-02-22 Karl Berry <karl@gnu.org>
- * emacs-lisp-intro.texi (Default Configuration): fix dup word "by by".
+ * emacs-lisp-intro.texi (Default Configuration): Fix dup word "by by".
2009-02-20 Juanma Barranquero <lekktu@gmail.com>
2006-08-21 Robert J. Chassell <bob@rattlesnake.com>
* emacs-lisp-intro.texi: Deleted in directory copy of texinfo.tex
- and pointed towards ../man/texinfo.tex so only one file
- needs updating. Added comment of what to do when building on own.
+ and pointed towards ../man/texinfo.tex so only one file
+ needs updating. Added comment of what to do when building on own.
* texinfo.tex: Changed to version 2006-02-13.16
- to enable a DVI build using the more recent versions of TeX.
+ to enable a DVI build using the more recent versions of TeX.
2006-05-25 David Kastrup <dak@gnu.org>
+++ /dev/null
-# Generated files
-precious ^(config\.status|config\.cache)$
-
-# arch-tag: dde817a2-94ff-4c6e-838c-bb5b33e7f0df
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+2010-05-22 Chong Yidong <cyd@stupidchicken.com>
- * Version 23.2 released.
+ * display.texi (Image Cache): Update documentation about image
+ caching.
-2010-05-03 Štěpán Němec <stepnem@gmail.com> (tiny change)
+2010-05-08 Štěpán Němec <stepnem@gmail.com> (tiny change)
* windows.texi (Textual Scrolling):
* tips.texi (Coding Conventions):
* loading.texi (Where Defined):
* edebug.texi (Instrumenting): Fix typos.
-2010-04-25 Chong Yidong <cyd@stupidchicken.com>
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* keymaps.texi (Menu Bar): Document :advertised-binding property.
- * functions.texi (Obsolete Functions): Document
- set-advertised-calling-convention.
+ * functions.texi (Obsolete Functions):
+ Document set-advertised-calling-convention.
* minibuf.texi (Basic Completion): Document completion-in-region.
(Programmed Completion): Document completion-annotate-function.
* elisp.texi (Top): Update node description.
+2010-05-08 Eli Zaretskii <eliz@gnu.org>
+
+ * nonascii.texi (Character Properties):
+ Document unicode-category-table. Add an index entry for Unicode
+ general category.
+
+2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * Version 23.2 released.
+
+2010-04-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * locals.texi (Standard Buffer-Local Variables):
+ Remove @ignore'd reference to `direction-reversed'.
+
2010-04-14 Juri Linkov <juri@jurta.org>
Fix @deffn without category.
* frames.texi (Cursor Parameters): Fix typo. (Bug#5760)
-2010-03-21 Chong Yidong <cyd@stupidchicken.com>
+2010-03-24 Chong Yidong <cyd@stupidchicken.com>
* processes.texi (Network Processes): Document seqpacket type.
+2010-03-20 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * os.texi (System Environment): Do not mention lynxos.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-03-06 Chong Yidong <cyd@stupidchicken.com>
* objects.texi (Integer Type): Take note of the read syntax
@center @titlefont{GNU Emacs Lisp Reference Manual}
@sp 5
@center GNU
-@center Emacs Version 23.2.50
+@center Emacs Version 24.0.50
@center for Unix Users
@sp 5
efficiently. When Emacs displays an image, it searches the image
cache for an existing image specification @code{equal} to the desired
specification. If a match is found, the image is displayed from the
-cache; otherwise, Emacs loads the image normally.
-
- Occasionally, you may need to tell Emacs to refresh the images
-associated with a given image specification. For example, suppose you
-display an image using a specification that contains a @code{:file}
-property. The image is automatically cached, and subsequent displays
-of that image, with the same image specification, will use the image
-cache. If the image file changes in the meantime, Emacs would be
-displaying the old version of the image. In such a situation, you can
-``refresh'' the image by calling @code{image-refresh}.
-
- In Emacs' current implementation, each graphical terminal possesses
-an image cache, which is shared by all the frames on that terminal
+cache. Otherwise, Emacs loads the image normally.
+
+@defun image-flush spec &optional frame
+This function removes the image with specification @var{spec} from the
+image cache of frame @var{frame}. Image specifications are compared
+using @code{equal}. If @var{frame} is @code{nil}, it defaults to the
+selected frame. If @var{frame} is @code{t}, the image is flushed on
+all existing frames.
+
+In Emacs' current implementation, each graphical terminal possesses an
+image cache, which is shared by all the frames on that terminal
(@pxref{Multiple Terminals}). Thus, refreshing an image in one frame
also refreshes it in all other frames on the same terminal.
-
-@defun image-refresh spec &optional frame
-This function refreshes any images with image specifications
-@code{equal} to @var{spec} on frame @var{frame}. If @var{frame} is
-@code{nil}, it defaults to the selected frame. If @var{frame} is
-@code{t}, the refresh is applied to all existing frames.
@end defun
+ One use for @code{image-flush} is to tell Emacs about a change in an
+image file. If an image specification contains a @code{:file}
+property, the image is cached based on the file's contents when the
+image is first displayed. Even if the file subsequently changes,
+Emacs continues displaying the old version of the image. Calling
+@code{image-flush} flushes the image from the cache, forcing Emacs to
+re-read the file the next time it needs to display that image.
+
+ Another use for @code{image-flush} is for memory conservation. If
+your Lisp program creates a large number of temporary images over a
+period much shorter than @code{image-cache-eviction-delay} (see
+below), you can opt to flush unused images yourself, instead of
+waiting for Emacs to do it automatically.
+
@defun clear-image-cache &optional filter
This function clears an image cache, removing all the images stored in
it. If @var{filter} is omitted or @code{nil}, it clears the cache for
associated memory.
@defvar image-cache-eviction-delay
-This variable specifies the number of seconds an image can remain in the
-cache without being displayed. When an image is not displayed for this
-length of time, Emacs removes it from the image cache.
+This variable specifies the number of seconds an image can remain in
+the cache without being displayed. When an image is not displayed for
+this length of time, Emacs removes it from the image cache.
+
+Under some circumstances, if the number of images in the cache grows
+too large, the actual eviction delay may be shorter than this.
If the value is @code{nil}, Emacs does not remove images from the cache
except when you explicitly clear it. This mode can be useful for
@c Please remember to update the edition number in README as well.
@c And also the copies in vol1.texi and vol2.texi.
@set VERSION 3.0
-@set EMACSVER 23.2.50
+@set EMACSVER 24.0.50
@set DATE July 2009
@c in general, keep the following line commented out, unless doing a
@item desktop-save-buffer
@xref{Desktop Save Mode}.
-@ignore
-@item direction-reversed
-Does not work yet.
-@end ignore
-
@item enable-multibyte-characters
@ref{Text Representations}.
value is a string consisting of upper-case Latin letters A to Z,
digits, spaces, and hyphen @samp{-} characters.
+@cindex unicode general category
@item general-category
This property corresponds to the Unicode @code{General_Category}
property. The value is a symbol whose name is a 2-letter abbreviation
@var{propname} for the character @var{char}.
@end defun
-@defvar char-script-table
+@defvar unicode-category-table
The value of this variable is a char-table (@pxref{Char-Tables}) that
-specifies, for each character, a symbol whose name is the script to
-which the character belongs, according to the Unicode Standard
-classification of the Unicode code space into script-specific blocks.
-This char-table has a single extra slot whose value is the list of all
-script symbols.
+specifies, for each character, its Unicode @code{General_Category}
+property as a symbol.
+@end defvar
+
+@defvar char-script-table
+The value of this variable is a char-table that specifies, for each
+character, a symbol whose name is the script to which the character
+belongs, according to the Unicode Standard classification of the
+Unicode code space into script-specific blocks. This char-table has a
+single extra slot whose value is the list of all script symbols.
@end defvar
@defvar char-width-table
@item irix
Silicon Graphics Irix system.
-@item lynxos 3.0.1
-LynxOS-3.0.1.
-
@item ms-dos
Microsoft MS-DOS ``operating system.'' Emacs compiled with DJGPP for
MS-DOS binds @code{system-type} to @code{ms-dos} even when you run it on
@c Version of the manual and of Emacs.
@c Please remember to update the edition number in README as well.
@set VERSION 3.0
-@set EMACSVER 23.2.50
+@set EMACSVER 24.0.50
@set DATE July 2009
@dircategory Emacs
@c Version of the manual and of Emacs.
@c Please remember to update the edition number in README as well.
@set VERSION 3.0
-@set EMACSVER 23.2.50
+@set EMACSVER 24.0.50
@set DATE July 2009
@dircategory Emacs
* Version 23.2 released.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-01-09 Chong Yidong <cyd@stupidchicken.com>
- * emacs.1: Copyedits. Update options -Q, -mm and --daemon. Remove
- deprecated --unibyte option.
+ * emacs.1: Copyedits. Update options -Q, -mm and --daemon.
+ Remove deprecated --unibyte option.
2009-06-21 Chong Yidong <cyd@stupidchicken.com>
.\" See section COPYING for copyright and redistribution information.
-.TH EMACS 1 "2007 April 13" "GNU Emacs 23.2.50"
+.TH EMACS 1 "2007 April 13" "GNU Emacs 24.0.50"
.
.
.SH NAME
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+2010-05-16 Jay Belanger <jay.p.belanger@gmail.com>
- * Version 23.2 released.
+ * calc.texi (Manipulating Vectors): Mention that vectors can
+ be used to determine bins for `calc-histogram'.
+
+2010-05-13 Jay Belanger <jay.p.belanger@gmail.com>
-2010-05-03 Štěpán Němec <stepnem@gmail.com> (tiny change)
+ * calc.texi: Remove "\turnoffactive" commands throughout.
+
+2010-05-08 Štěpán Němec <stepnem@gmail.com> (tiny change)
* url.texi (HTTP language/coding, Customization):
* message.texi (Header Commands, Responses):
* cl.texi (Argument Lists): Fix typos.
-2010-04-18 Chong Yidong <cyd@stupidchicken.com>
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
- * ede.texi (EDE Mode): Refer to init file rather than `.emacs'. Note
- that Development menu is always available.
+ * ede.texi (EDE Mode): Refer to init file rather than `.emacs'.
+ Note that Development menu is always available.
(Creating a project): Fix terminology.
(Add/Remove files): Fix typo.
-2010-04-17 Teodor Zlatanov <tzz@lifelogs.com>
+2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * Version 23.2 released.
+
+2010-05-01 Daniel E. Doherty <ddoherty03@gmail.com> (tiny change)
+
+ * calc.texi (Tutorial): Use "^{\prime}" to indicate primes.
+
+2010-05-01 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Inline methods, Default Method):
+ Mention `tramp-inline-compress-start-size'.
+
+2010-04-18 Teodor Zlatanov <tzz@lifelogs.com>
* gnus.texi (Gnus Versions, Oort Gnus): Mention the Git repo instead of
the CVS repo. Put the Git repo in the news section.
- * gnus-coding.texi (Gnus Maintainance Guide): Fixed title typo.
+ * gnus-coding.texi (Gnus Maintainance Guide): Fix title typo.
Removed some mentions of CVS. Mention the new Git repo.
-2010-04-15 Andreas Seltenreich <seltenreich@gmx.de>
+2010-04-18 Andreas Seltenreich <seltenreich@gmx.de>
* gnus.texi (Score File Format): Fix typo. Reported by Štěpán Němec.
(Mail Group Commands): Add index entry.
-2010-04-15 Glenn Morris <rgm@gnu.org>
+2010-04-18 Glenn Morris <rgm@gnu.org>
* info.texi (Search Index): Mention Emacs's Info-virtual-index.
-2010-03-14 Michael Albinus <michael.albinus@gmx.de>
+2010-04-18 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (Radix modes): Mention that the option prefix will
+ turn on twos-complement mode.
+ (Inverse and Hyperbolic Flags): Mention the Option flag.
+
+2010-04-15 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.texi (LaTeX and PDF export): Add a footnote about xetex.
+ (LaTeX/PDF export commands): Rename and Move section.
+ (Sectioning structure): Update.
+ (References): New use case for field coordinates.
+ (The export dispatcher): Rename from ASCII export.
+ (Setting up the staging area): Document the availability of
+ encryption for MobileOrg.
+ (Images and tables): Document how to reference labels.
+ (Index entries): New section.
+ (Generating an index): New section.
+ (Column width and alignment): Document that <N> now
+ means a fixed width, not a maximum width.
+ (Publishing options): Document the :email option.
+ (Beamer class export): Fix bug in the BEAMER example.
+ (Refiling notes): Document refile logging.
+ (In-buffer settings): Document refile logging keywords.
+ (Drawers): Document `C-c C-z' command.
+ (Agenda commands): Mention the alternative key `C-c C-z'.
+ (Special properties): Document the BLOCKED property.
+ (The spreadsheet): Mention the formula editor.
+ (References): Document field coordinates.
+ (Publishing action): Correct the documentation for the
+ publishing function.
+ (The date/time prompt): Document that we accept dates
+ like month/day/year.
+ (Cooperation): Document the changes in table.el support.
+ (Faces for TODO keywords, Faces for TODO keywords)
+ (Priorities): Document the easy colors.
+ (Visibility cycling): Document the new double prefix
+ arg for `org-reveal'.
+ (Cooperation): Remember.el is part of Emacs.
+ (Clean view): Mention that `wrap-prefix' is also set by
+ org-indent-mode.
+ (Agenda commands): Add information about prefix args to
+ scheduling and deadline commands.
+ (Search view): Point to the docstring of
+ `org-search-view' for more details.
+ (Agenda commands): Document that `>' prompts for a date.
+ (Setting tags): Document variable
+ org-complete-tags-always-offer-all-agenda-tags.
+ (Column attributes): Cross-reference special properties.
+
+2010-04-10 Michael Albinus <michael.albinus@gmx.de>
+
+ Synchronize with Tramp repository.
+
+ * tramp.texi (Auto-save and Backup): Remove reference to Emacs 21.
+ (Frequently Asked Questions): Adapt supported (X)Emacs versions. Adapt
+ supported MS Windows versions. Remove obsolete URL. Use the $()
+ syntax, texi2dvi reports errors with the backquotes.
* trampver.texi: Update release number.
+2010-04-01 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * gnus.texi (Finding the News): Add pointers to the Server buffer
+ because it's essential.
+
+2010-03-31 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (MIME Commands): Update description of
+ gnus-article-browse-html-article.
+
+2010-03-27 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth.texi (Secret Service API): Add TODO node.
+ (Help for users): Explain the new source options for `auth-sources'.
+
+2010-03-24 Michael Albinus <michael.albinus@gmx.de>
+
+ * trampver.texi: Update release number.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-03-03 Chong Yidong <cyd@stupidchicken.com>
* faq.texi (Escape sequences in shell output): Note that ansi-color is
(Agenda commands): Document new bulk commands.
(Plain lists): Document new behavior of
`org-cycle-include-plain-lists'.
- Hyphenation only in TeX.
+ Hyphenation only in TeX.
(Clocking work time): Document the key to update effort
estimates.
(Clocking work time): Document the clock time display.
2008-06-15 Reiner Steib <Reiner.Steib@gmx.de>
* gnus.texi (Mail Source Customization): Correct values of
- `mail-source-delete-incoming'. Reported by Tassilo Horn.
+ `mail-source-delete-incoming'. Reported by Tassilo Horn.
(Oort Gnus): Fix version comment for mml-dnd-protocol-alist.
2008-06-14 Reiner Steib <Reiner.Steib@gmx.de>
@menu
* Overview:: Overview of the auth-source library.
* Help for users::
+* Secret Service API::
* Help for developers::
* Index::
* Function Index::
@chapter Overview
The auth-source library is simply a way for Emacs and Gnus, among
-others, to find the answer to the old burning question ``I have a
-server name and a port, what are my user name and password?''
+others, to answer the old burning question ``I have a server name and
+a port, what are my user name and password?''
The auth-source library actually supports more than just the user name
(known as the login) or the password, but only those two are in use
-today in Emacs or Gnus. Similarly, the auth-source library can in
-theory support multiple storage formats, but currently it only
-understands the classic ``netrc'' format, examples of which you can
-see later in this document.
+today in Emacs or Gnus. Similarly, the auth-source library supports
+multiple storage formats, currently either the classic ``netrc''
+format, examples of which you can see later in this document, or the
+Secret Service API.
@node Help for users
@chapter Help for users
@defvar auth-sources
The @code{auth-sources} variable tells the auth-source library where
-your netrc files live for a particular host and protocol. While you
-can get fancy, the default and simplest configuration is:
+your netrc files or Secret Service API collection items live for a
+particular host and protocol. While you can get fancy, the default
+and simplest configuration is:
@lisp
+;;; old default: required :host and :protocol, not needed anymore
(setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
+;;; mostly equivalent (see below about fallbacks) but shorter:
+(setq auth-sources '((:source "~/.authinfo.gpg")))
@end lisp
This says ``for any host and any protocol, use just that one file.''
-Sweet simplicity. In fact, this is already the default, so unless you
-want to move your netrc file, it will just work if you have that
-file. You may not, though, so make sure it exists.
+Sweet simplicity. In fact, the latter is already the default, so
+unless you want to move your netrc file, it will just work if you have
+that file. Make sure it exists.
By adding multiple entries to @code{auth-sources} with a particular
host or protocol, you can have specific netrc files for that host or
shared netrc files or some other unusual setup (90% of Emacs users
have unusual setups and the remaining 10% are @emph{really} unusual).
+Here's an example that uses the Secret Service API for all lookups,
+using the default collection:
+
+@lisp
+(setq auth-sources '((:source (:secrets default))))
+@end lisp
+
+And here's a mixed example, using two sources:
+
+@lisp
+(setq auth-sources '((:source (:secrets default) :host "myserver" :user "joe")
+ (:source "~/.authinfo.gpg")))
+@end lisp
+
+The best match is determined by order (starts from the bottom) only
+for the first pass, where things are checked exactly. In the example
+above, the first pass would find a single match for host
+@code{myserver}. The netrc choice would fail because it matches any
+host and protocol implicitly (as a @emph{fallback}). A specified
+value of @code{:host t} in @code{auth-sources} is considered a match
+on the first pass, unlike a missing @code{:host}.
+
+Now if you look for host @code{missing}, it won't match either source
+explicitly. The second pass (the @emph{fallback} pass) will look at
+all the implicit matches and collect them. They will be scored and
+returned sorted by score. The score is based on the number of
+explicit parameters that matched. See the @code{auth-pick} function
+for details.
+
@end defvar
If you don't customize @code{auth-sources}, you'll have to live with
earlier. Since Tramp has about 88 connection methods, this may be
necessary if you have an unusual (see earlier comment on those) setup.
+@node Secret Service API
+@chapter Secret Service API
+
+TODO: how does it work generally, how does secrets.el work, some examples.
+
@node Help for developers
@chapter Help for developers
The auth-source library only has one function for external use.
-@defun auth-source-user-or-password mode host port
+@defun auth-source-user-or-password mode host port &optional username
Retrieve appropriate authentication tokens, determined by @var{mode},
-for host @var{host} and @var{port}. If @code{auth-source-debug} is t,
-debugging messages will be printed. Set @code{auth-source-debug} to a
-function to use that function for logging. The parameters passed will
-be the same that the @code{message} function takes, that is, a string
+for host @var{host} and @var{port}. If @var{username} is provided it
+will also be checked. If @code{auth-source-debug} is t, debugging
+messages will be printed. Set @code{auth-source-debug} to a function
+to use that function for logging. The parameters passed will be the
+same that the @code{message} function takes, that is, a string
formatting spec and optional parameters.
If @var{mode} is a list of strings, the function will return a list of
strings or @code{nil} objects (thus you can avoid parsing the netrc
-file more than once). If it's a string, the function will return a
-string or a @code{nil} object. Currently only the modes ``login'' and
-``password'' are recognized but more may be added in the future.
+file or checking the Secret Service API more than once). If it's a
+string, the function will return a string or a @code{nil} object.
+Currently only the modes ``login'' and ``password'' are recognized but
+more may be added in the future.
@var{host} is a string containing the host name.
a port number. It must be a string, corresponding to the port in the
users' netrc files.
+@var{username} contains the user name (e.g. ``joe'') as a string.
+
@example
;; IMAP example
(setq auth (auth-source-user-or-password
@newcount@calcpageno
@newtoks@calcoldeverypar @calcoldeverypar=@everypar
@everypar={@calceverypar@the@calcoldeverypar}
-@ifx@turnoffactive@undefinedzzz@def@turnoffactive{}@fi
@ifx@ninett@undefinedzzz@font@ninett=cmtt9@fi
@catcode`@\=0 \catcode`\@=11
\r@ggedbottomtrue
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ 2 + { 3 \times 4 \times 5 \over 6 \times 7^8 } - 9 $$
\afterdisplay
@end group
@end ifnottex
@tex
-\turnoffactive
\beforedisplayh
$$ \openup1\jot \tabskip=0pt plus1fil
\halign to\displaywidth{\tabskip=0pt
@end group
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \pmatrix{ 1 & 2 & 3 \cr 4 & 5 & 6 \cr 7 & 6 & 0 }
\times
@end group
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \eqalign{ x &+ a y = 6 \cr
x &+ b y = 10}
@samp{trn(A)*A*X = trn(A)*B}.
@end ifnottex
@tex
-\turnoffactive
$A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
@end tex
Now
@end group
@end ifnottex
@tex
-\turnoffactive
\beforedisplayh
$$ \openup1\jot \tabskip=0pt plus1fil
\halign to\displaywidth{\tabskip=0pt
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ m = {N \sum x y - \sum x \sum y \over
N \sum x^2 - \left( \sum x \right)^2} $$
@samp{sum(x y)}.)
@end ifnottex
@tex
-\turnoffactive
These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$,
respectively. (We could have used \kbd{*} to compute $\sum x^2$ and
$\sum x y$.)
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ b = {\sum y - m \sum x \over N} $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \displaylines{
\qquad {h \over 3} (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + \cdots
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots
+ f(a+(n-2)h) + f(a+(n-1)h)) $$
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \cos x = 1 - {x^2 \over 2!} + {x^4 \over 4!} - {x^6 \over 6!} + \cdots $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \cos x = 1 - {x^2 \over 2!} + O(x^3) $$
\afterdisplay
@end ifnottex
@tex
\beforedisplay
-$$ x_{\rm new} = x - {f(x) \over f'(x)} $$
+$$ x_{\rm new} = x - {f(x) \over f^{\prime}(x)} $$
\afterdisplay
@end tex
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \eqalign{ s(n,n) &= 1 \qquad \hbox{for } n \ge 0, \cr
s(n,0) &= 0 \qquad \hbox{for } n > 0, \cr
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \eqalign{ x &+ a y = 6 \cr
x &+ b y = 10}
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplayh
$$ \openup1\jot \tabskip=0pt plus1fil
\halign to\displaywidth{\tabskip=0pt
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ m \times x + b \times 1 = y $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ 3 (3 a + b - 511 m) + c - 511 n $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ 9 a + 3 b + c - 511\times3 m - 511 n $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
-$$ 9 a + 3 b + c - 511 n' $$
+$$ 9 a + 3 b + c - 511 n^{\prime} $$
\afterdisplay
@end tex
their default values, then settings from the file you named are loaded
if this file exists, and this file becomes the one that Calc will
use in the future for commands like @kbd{m m}. The default settings
-file name is @file{~/.calc.el}. You can see the current file name by
+file name is @file{~/.emacs.d/calc.el}. You can see the current file name by
giving a blank response to the @kbd{m F} prompt. See also the
discussion of the @code{calc-settings-file} variable; @pxref{Customizing Calc}.
toggle the Inverse and/or Hyperbolic flags and then execute the
corresponding base command (@code{calc-sin} in this case).
-The Inverse and Hyperbolic flags apply only to the next Calculator
-command, after which they are automatically cleared. (They are also
-cleared if the next keystroke is not a Calc command.) Digits you
-type after @kbd{I} or @kbd{H} (or @kbd{K}) are treated as prefix
-arguments for the next command, not as numeric entries. The same
-is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means to
-subtract and keep arguments).
-
-The third Calc prefix flag, @kbd{K} (keep-arguments), is discussed
+@kindex O
+@pindex calc-option
+The @kbd{O} key (@code{calc-option}) sets another flag, the
+@dfn{Option Flag}, which also can alter the subsequent Calc command in
+various ways.
+
+The Inverse, Hyperbolic and Option flags apply only to the next
+Calculator command, after which they are automatically cleared. (They
+are also cleared if the next keystroke is not a Calc command.) Digits
+you type after @kbd{I}, @kbd{H} or @kbd{O} (or @kbd{K}) are treated as
+prefix arguments for the next command, not as numeric entries. The
+same is true of @kbd{C-u}, but not of the minus sign (@kbd{K -} means
+to subtract and keep arguments).
+
+Another Calc prefix flag, @kbd{K} (keep-arguments), is discussed
elsewhere. @xref{Keep Arguments}.
@node Calculation Modes, Simplification Modes, Inverse and Hyperbolic, Mode Settings
entirety.)
@cindex Two's complements
-With the binary, octal and hexadecimal display modes, Calc can
-display @expr{w}-bit integers using two's complement notation. This
-option is selected with the key sequences @kbd{C-u d 2}, @kbd{C-u d 8}
-and @kbd{C-u d 6}, respectively, and a negative word size might be
-appropriate (@pxref{Binary Functions}). In two's complement
-notation, the integers in the (nearly) symmetric interval from
+Calc can display @expr{w}-bit integers using two's complement
+notation, although this is most useful with the binary, octal and
+hexadecimal display modes. This option is selected by using the
+@kbd{O} option prefix before setting the display radix, and a negative word
+size might be appropriate (@pxref{Binary Functions}). In two's
+complement notation, the integers in the (nearly) symmetric interval
+from
@texline @math{-2^{w-1}}
@infoline @expr{-2^(w-1)}
to
@end group
@end example
@tex
-\turnoffactive
$$ [3 + 4i, {3 \over 4}, 3 \pm 4, [ 3 \ldots \infty)] $$
@end tex
@sp 1
@end group
@end example
@tex
-\turnoffactive
$$ [\sin{a}, \sin{2 a}, \sin(2 + a), \sin\left( {a \over b} \right)] $$
@end tex
@sp 2
@end group
@end example
@tex
-\turnoffactive
$$ 2 + 3 \to 5 $$
$$ 5 $$
@end tex
@end group
@end example
@tex
-\turnoffactive
$$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$
{\let\to\Rightarrow
$$ [{2 + 3 \to 5}, {{a \over 2} \to {b + c \over 2}}] $$}
@end group
@end example
@tex
-\turnoffactive
$$ \matrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
$$ \pmatrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
@end tex
Selections show deep structure (@kbd{j b}; @pxref{Making Selections}).
@item Save
-Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
+Record modes in @file{~/.emacs.d/calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
@item Local
Record modes in Embedded buffer (@kbd{m R}).
@end example
@end ifnottex
@tex
-\turnoffactive
$$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$
$$ \code{fvb}(r, n, p) = p { ((1 + r)^n - 1) (1 + r) \over r } $$
$$ \code{fvl}(r, n, p) = p (1 + r)^n $$
and @kbd{H I f G} [@code{gammaG}] commands.
@end ifnottex
@tex
-\turnoffactive
The functions corresponding to the integrals that define $P(a,x)$
and $Q(a,x)$ but without the normalizing $1/\Gamma(a)$
factor are called $\gamma(a,x)$ and $\Gamma(a,x)$, respectively.
that the counts in the result vector don't add up to the length of the
input vector.)
+If no prefix is given, then you will be prompted for a vector which
+will be used to determine the bins. (If a positive integer is given at
+this prompt, it will be still treated as if it were given as a
+prefix.) Each bin will consist of the interval of numbers closest to
+the corresponding number of this new vector; if the vector
+@expr{[a, b, c, ...]} is entered at the prompt, the bins will be
+@expr{(-inf, (a+b)/2]}, @expr{((a+b)/2, (b+c)/2]}, etc. The result of
+this command will be a vector counting how many elements of the
+original vector are in each bin.
+
+The result will then be a vector with the same length as this new vector;
+each element of the new vector will be replaced by the number of
+elements of the original vector which are closest to it.
+
@kindex H v H
@kindex H V H
With the Hyperbolic flag, @kbd{H V H} pulls two vectors from the stack.
@texline @math{1 /\sigma^2}.
@infoline @expr{1 / s^2}.
@tex
-\turnoffactive
$$ \mu = { \displaystyle \sum { x_i \over \sigma_i^2 } \over
\displaystyle \sum { 1 \over \sigma_i^2 } } $$
@end tex
of the input errors. (I.e., the variance is the reciprocal of the
sum of the reciprocals of the variances.)
@tex
-\turnoffactive
$$ \sigma_\mu^2 = {1 \over \displaystyle \sum {1 \over \sigma_i^2}} $$
@end tex
If the inputs are plain
then assuming each value's error is equal to this standard
deviation.)
@tex
-\turnoffactive
$$ \sigma_\mu^2 = {\sigma^2 \over N} $$
@end tex
defined as the reciprocal of the arithmetic mean of the reciprocals
of the values.
@tex
-\turnoffactive
$$ { N \over \displaystyle \sum {1 \over x_i} } $$
@end tex
equal to the @code{exp} of the arithmetic mean of the logarithms
of the data values.
@tex
-\turnoffactive
$$ \exp \left ( \sum { \ln x_i } \right ) =
\left ( \prod { x_i } \right)^{1 / N} $$
@end tex
replacing the two numbers with their arithmetic mean and geometric
mean, then repeating until the two values converge.
@tex
-\turnoffactive
$$ a_{i+1} = { a_i + b_i \over 2 } , \qquad b_{i+1} = \sqrt{a_i b_i} $$
@end tex
the differences between the values and the mean of the @expr{N} values,
divided by @expr{N-1}.
@tex
-\turnoffactive
$$ \sigma^2 = {1 \over N - 1} \sum (x_i - \mu)^2 $$
@end tex
data values, so that the mean computed from the input is itself
only an estimate of the true mean.
@tex
-\turnoffactive
$$ \sigma^2 = {1 \over N} \sum (x_i - \mu)^2 $$
@end tex
is taken as the square root of the sum of the squares of the two
input errors.
@tex
-\turnoffactive
$$ \sigma_{x\!y}^2 = {1 \over N-1} \sum (x_i - \mu_x) (y_i - \mu_y) $$
$$ \sigma_{x\!y}^2 =
{\displaystyle {1 \over N-1}
product of their standard deviations. (There is no difference
between sample or population statistics here.)
@tex
-\turnoffactive
$$ r_{x\!y} = { \sigma_{x\!y}^2 \over \sigma_x^2 \sigma_y^2 } $$
@end tex
@end example
@end ifnottex
@tex
-\turnoffactive
-\turnoffactive
\beforedisplay
$$ \pmatrix{ 1 & 2 & 3 & 4 & 5 \cr
5 & 7 & 9 & 11 & 13 }
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \chi^2 = \sum_{i=1}^N (y_i - (a + b x_i))^2 $$
\afterdisplay
@end example
@end ifnottex
@tex
-\turnoffactive
\beforedisplay
$$ \chi^2 = \sum_{i=1}^N \left(y_i - (a + b x_i) \over \sigma_i\right)^2 $$
\afterdisplay
the stack. Thus, @kbd{' k^2 @key{RET} ' k @key{RET} 1 @key{RET} 5 @key{RET} a + @key{RET}}
produces the result 55.
@tex
-\turnoffactive
$$ \sum_{k=1}^5 k^2 = 55 $$
@end tex
@cindex Calc init file, user-defined units
The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined
units in your Calc init file (the file given by the variable
-@code{calc-settings-file}, typically @file{~/.calc.el}), so that the
+@code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}), so that the
units will still be available in subsequent Emacs sessions. If there
was already a set of user-defined units in your Calc init file, it
is replaced by the new set. (@xref{General Mode Commands}, for a way to
@cindex Calc init file, variables
The @kbd{s p} (@code{calc-permanent-variable}) command saves a
variable's value permanently in your Calc init file (the file given by
-the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so
+the variable @code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}), so
that its value will still be available in future Emacs sessions. You
can re-execute @w{@kbd{s p}} later on to update the saved value, but the
only way to remove a saved variable is to edit your calc init file
which are also available outside of Embedded mode.
(@pxref{General Mode Commands}.) They are @code{Save}, in which mode
settings are recorded permanently in your Calc init file (the file given
-by the variable @code{calc-settings-file}, typically @file{~/.calc.el})
+by the variable @code{calc-settings-file}, typically @file{~/.emacs.d/calc.el})
rather than by annotating the current document, and no-recording
mode (where there is no symbol like @code{Save} or @code{Local} in
the mode line), in which mode-changing commands do not leave any
binding permanent so that it will remain in effect even in future Emacs
sessions. (It does this by adding a suitable bit of Lisp code into
your Calc init file; that is, the file given by the variable
-@code{calc-settings-file}, typically @file{~/.calc.el}.) For example,
+@code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}.) For example,
@kbd{Z P s} would register our @code{sincos} command permanently. If
you later wish to unregister this command you must edit your Calc init
file by hand. (@xref{General Mode Commands}, for a way to tell Calc to
A good place to put your @code{defmath} commands is your Calc init file
(the file given by @code{calc-settings-file}, typically
-@file{~/.calc.el}), which will not be loaded until Calc starts.
+@file{~/.emacs.d/calc.el}), which will not be loaded until Calc starts.
If a file named @file{.emacs} exists in your home directory, Emacs reads
and executes the Lisp forms in this file as it starts up. While it may
seem reasonable to put your favorite @code{defmath} commands there,
@code{nil}, then Calc will automatically load your settings file (if it
exists) the first time Calc is invoked.
-The default value for this variable is @code{"~/.calc.el"}.
+The default value for this variable is @code{"~/.emacs.d/calc.el"}
+unless the file @file{~/.calc.el} exists, in which case the default
+value will be @code{"~/.calc.el"}.
@end defvar
@defvar calc-gnuplot-name
@r{ @: M @: @: @:calc-more-recursion-depth@:}
@r{ @: I M @: @: @:calc-less-recursion-depth@:}
@r{ a@: N @: @: 5 @:evalvn@:(a)}
+@r{ @: O @:command @: 32 @:@:Option}
@r{ @: P @: @: @:@:pi}
@r{ @: I P @: @: @:@:gamma}
@r{ @: H P @: @: @:@:e}
@c %**end of header
@c This is used in many places
-@set VER 23.2.50
+@set VER 24.0.50
@c This file is maintained by Romain Francoise <rfrancoise@gnu.org>.
@c Feel free to install changes without prior permission (but I'd
@section Finding the News
@cindex finding news
+First of all, you should know that there is a special buffer called
+@code{*Server*} that lists all the servers Gnus knows about. You can
+press @kbd{^} from the Group buffer to see it. In the Server buffer,
+you can press @kbd{RET} on a defined server to see all the groups it
+serves (subscribed or not!). You can also add or delete servers, edit
+a foreign server's definition, agentize or de-agentize a server, and
+do many other neat things. @xref{Server Buffer}.
+@xref{Foreign Groups}. @xref{Agent Basics}.
+
@vindex gnus-select-method
@c @head
The @code{gnus-select-method} variable says where Gnus should look for
@kindex K H (Summary)
@findex gnus-article-browse-html-article
View @samp{text/html} parts of the current article with a WWW browser.
-The message header is added to the beginning of every html part unless
-the prefix argument is given.
+Inline images embedded in a message using the @code{cid} scheme, as they
+are generally considered to be safe, will be processed properly. The
+message header is added to the beginning of every @acronym{HTML} part
+unless the prefix argument is given.
-Warning: Spammers use links to images in HTML articles to verify whether
-you have read the message. As this command passes the @acronym{HTML}
-content to the browser without eliminating these ``web bugs'' you should
-only use it for mails from trusted senders.
+Warning: Spammers use links to images (using the @code{http} scheme) in
+@acronym{HTML} articles to verify whether you have read the message. As
+this command passes the @acronym{HTML} content to the browser without
+eliminating these ``web bugs'' you should only use it for mails from
+trusted senders.
If you always want to display @acronym{HTML} parts in the browser, set
@code{mm-text-html-renderer} to @code{nil}.
+This command creates temporary files to pass @acronym{HTML} contents
+including images if any to the browser, and deletes them when exiting
+the group (if you want).
+
@item K b
@kindex K b (Summary)
Make all the @acronym{MIME} parts have buttons in front of them. This is
@setfilename ../../info/org
@settitle The Org Manual
-@set VERSION 6.33x
-@set DATE November 2009
+@set VERSION 6.35i
+@set DATE April 2010
@c Version and Contact Info
@set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
@copying
This manual is for Org version @value{VERSION}.
-Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation
+Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation
@quotation
Permission is granted to copy, distribute and/or modify this document
* Images and tables:: Tables and Images will be included
* Literal examples:: Source code examples with special formatting
* Include files:: Include additional files into a document
+* Index entries::
* Macro replacement:: Use macros to create complex output
* Embedded LaTeX:: LaTeX can be freely used inside Org documents
* Selective export:: Using tags to select and exclude trees
* Export options:: Per-file export settings
* The export dispatcher:: How to access exporter commands
-* ASCII export:: Exporting to plain ASCII
+* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
* HTML export:: Exporting to HTML
* LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
* DocBook export:: Exporting to DocBook
La@TeX{} and PDF export
* LaTeX/PDF export commands:: Which key invokes which commands
+* Header and sectioning:: Setting up the export file structure
* Quoting LaTeX code:: Incorporating literal La@TeX{} code
-* Sectioning structure:: Changing sectioning in La@TeX{} output
* Tables in LaTeX export:: Options for exporting tables to La@TeX{}
* Images in LaTeX export:: How to insert figures into La@TeX{} output
+* Beamer class export:: Turning the file into a presentation
DocBook export
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
* Publishing links:: Which links keep working after publishing?
-* Project page index:: Publishing a list of project files
+* Sitemap:: Generating a list of all pages
+* Generating an index:: An index that reaches across pages
Sample configuration
and the hierarchy above. Useful for working near a location that has been
exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
(@pxref{Agenda commands}). With a prefix argument show, on each
-level, all sibling headings.
+level, all sibling headings. With double prefix arg, also show the entire
+subtree of the parent.
@kindex C-c C-x b
@item C-c C-x b
Show the current subtree in an indirect buffer@footnote{The indirect
press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for
storing properties (@pxref{Properties and Columns}), and you can also arrange
for state change notes (@pxref{Tracking TODO state changes}) and clock times
-(@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}.
+(@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you
+want to store a quick note in the LOGBOOK drawer, in a similar way as this is
+done by state changes, use
+
+@table @kbd
+@kindex C-c C-z
+@item C-c C-z
+Add a time-stamped note to the LOGBOOK drawer.
+@end table
@node Blocks, Footnotes, Drawers, Document Structure
@section Blocks
also the alignment of a column is determined automatically from the fraction
of number-like versus non-number fields in the column.
-Sometimes a single field or a few fields need to carry more text,
-leading to inconveniently wide columns. To limit@footnote{This feature
-does not work on XEmacs.} the width of a column, one field anywhere in
-the column may contain just the string @samp{<N>} where @samp{N} is an
-integer specifying the width of the column in characters. The next
-re-align will then set the width of this column to no more than this
-value.
+Sometimes a single field or a few fields need to carry more text, leading to
+inconveniently wide columns. Or maybe you want to make a table with several
+columns having a fixed width, regardless of content. To set@footnote{This
+feature does not work on XEmacs.} the width of a column, one field anywhere
+in the column may contain just the string @samp{<N>} where @samp{N} is an
+integer specifying the width of the column in characters. The next re-align
+will then set the width of this column to this value.
@example
@group
The table editor makes use of the Emacs @file{calc} package to implement
spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
-derive fields from other fields. While fully featured, Org's
-implementation is not identical to other spreadsheets. For example,
-Org knows the concept of a @emph{column formula} that will be
-applied to all non-header fields in a column without having to copy the
-formula to each relevant field.
+derive fields from other fields. While fully featured, Org's implementation
+is not identical to other spreadsheets. For example, Org knows the concept
+of a @emph{column formula} that will be applied to all non-header fields in a
+column without having to copy the formula to each relevant field. There is
+also a formula debugger, and a formula editor with features for highlighting
+fields in the table corresponding to the references at the point in the
+formula, moving these references by arrow keys
@menu
* References:: How to refer to another field or range
see the @samp{E} mode switch below). If there are no non-empty fields,
@samp{[0]} is returned to avoid syntax errors in formulas.
+@subsubheading Field coordinates in formulas
+@cindex field coordinates
+@cindex coordinates, of field
+@cindex row, of field coordinates
+@cindex column, of field coordinates
+
+For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
+get the row or column number of the field where the formula result goes.
+The traditional Lisp formula equivalents are @code{org-table-current-dline}
+and @code{org-table-current-column}. Examples:
+
+@example
+if(@@# % 2, $#, string("")) @r{column number on odd lines only}
+$3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into}
+ @r{column 3 of the current table}
+@end example
+
+@noindent For the second example, table FOO must have at least as many rows
+as the current table. Inefficient@footnote{The computation time scales as
+O(N^2) because table FOO is parsed for each field to be copied.} for large
+number of rows.
+
@subsubheading Named references
@cindex named references
@cindex references, named
@code{org-calc-default-modes}.
@example
-p20 @r{switch the internal precision to 20 digits}
-n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
+p20 @r{set the internal Calc calculation precision to 20 digits}
+n3 s3 e2 f4 @r{Normal, scientific, engineering, or fixed}
+ @r{format of the result of Calc passed back to Org.}
+ @r{Calc formatting is unlimited in precision as}
+ @r{long as the Calc calculation precision is greater.}
D R @r{angle modes: degrees, radians}
F S @r{fraction and symbolic modes}
N @r{interpret all fields as numbers, use 0 for non-numbers}
@end example
@noindent
-In addition, you may provide a @code{printf} format specifier to
-reformat the final result. A few examples:
+Unless you use large integer numbers or high-precision-calculation
+and -display for floating point numbers you may alternatively provide a
+@code{printf} format specifier to reformat the Calc result after it has been
+passed back to Org instead of letting Calc already do the
+formatting@footnote{The @code{printf} reformatting is limited in precision
+because the value passed to it is converted into an @code{integer} or
+@code{double}. The @code{integer} is limited in size by truncating the
+signed value to 32 bits. The @code{double} is limited in precision to 64
+bits overall which leaves approximately 16 significant decimal digits.}.
+A few examples:
@example
$1+$2 @r{Sum of first and second field}
/home/dominik/images/jupiter.jpg @r{same as above}
file:papers/last.pdf @r{file, relative path}
./papers/last.pdf @r{same as above}
+file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine}
+/myself@@some.where:papers/last.pdf @r{same as above}
file:sometextfile::NNN @r{file with line number to jump to}
file:projects.org @r{another Org file}
file:projects.org::some words @r{text search in Org file}
file:projects.org::*task title @r{heading search in Org file}
+docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
news:comp.emacs @r{Usenet link}
mailto:adent@@galaxy.net @r{Mail link}
[[file:~/code/main.c::255]]
[[file:~/xx.org::My Target]]
[[file:~/xx.org::*My Target]]
+[[file:~/xx.org::#my-custom-id]]
[[file:~/xx.org::/regexp/]]
@end example
the linked file.
@item *My Target
In an Org file, restrict search to headlines.
+@item #my-custom-id
+Link to a heading with a @code{CUSTOM_ID} property
@item /regexp/
Do a regular expression search for @code{regexp}. This uses the Emacs
command @code{occur} to list all matches in a separate window. If the
@lisp
@group
(setq org-todo-keyword-faces
- '(("TODO" . org-warning)
- ("DEFERRED" . shadow)
- ("CANCELED" . (:foreground "blue" :weight bold))))
+ '(("TODO" . org-warning) ("STARTED" . "yellow")
+ ("CANCELED" . (:foreground "blue" :weight bold))))
@end group
@end lisp
-While using a list with face properties as shown for CANCELED
-@emph{should} work, this does not aways seem to be the case. If
-necessary, define a special face and use that.
+While using a list with face properties as shown for CANCELED @emph{should}
+work, this does not aways seem to be the case. If necessary, define a
+special face and use that. A string is interpreted as a color. The variable
+@code{org-faces-easy-properties} determines if that color is interpreted as a
+foreground or a background color.
@node TODO dependencies, , Faces for TODO keywords, TODO extensions
@subsection TODO dependencies
@end example
@noindent
+@vindex org-priority-faces
By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
-@samp{C}. @samp{A} is the highest priority. An entry without a cookie
-is treated as priority @samp{B}. Priorities make a difference only in
-the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
-no inherent meaning to Org mode.
+@samp{C}. @samp{A} is the highest priority. An entry without a cookie is
+treated as priority @samp{B}. Priorities make a difference only in the
+agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have no
+inherent meaning to Org mode. The cookies can be highlighted with special
+faces by customizing the variable @code{org-priority-faces}.
Priorities can be attached to any outline tree entries; they do not need
to be TODO items.
window is not even shown for single-key tag selection, it comes up only
when you press an extra @kbd{C-c}.
+@vindex org-complete-tags-always-offer-all-agenda-tags
+As said before, when setting tags and @code{org-tag-alist} is nil, then the
+list of tags in the current buffer is used. Normally, this behavior is very
+convenient, except in org remember buffers (@pxref{Remember}), because there
+are no tags that can be calculated dynamically. Here, you most probably want
+to have completion for all tags in all agenda files. This can be done by
+setting @code{org-complete-tags-always-offer-all-agenda-tags} to non-nil in
+those buffers.
+
+@lisp
+(add-hook 'org-remember-mode-hook
+ (lambda ()
+ (set (make-local-variable
+ 'org-complete-tags-always-offer-all-agenda-tags)
+ t)))
+@end lisp
+
+Of course, you can also set it to @code{t} globally if you always want to
+have completion of all tags in all agenda files.
+
@node Tag searches, , Setting tags, Tags
@section Tag searches
@cindex tag searches
@cindex property, special, TIMESTAMP
@cindex property, special, TIMESTAMP_IA
@cindex property, special, CLOCKSUM
+@cindex property, special, BLOCKED
@c guessing that ITEM is needed in this area; also, should this list be sorted?
@cindex property, special, ITEM
@example
TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
@r{must be run first to compute the values.}
+BLOCKED @r{"t" if task is currently blocked by children or siblings}
ITEM @r{The content of the entry.}
@end example
A timestamp is a specification of a date (possibly with a time or a range of
times) in a special format, either @samp{<2003-09-16 Tue>} or
@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
-12:00-12:30>}@footnote{This is inspired by the standard ISO 6801 date/time
+12:00-12:30>}@footnote{This is inspired by the standard ISO 8601 date/time
format. To use an alternative format, see @ref{Custom time format}.}. A
timestamp can appear anywhere in the headline or body of an Org tree entry.
Its presence causes entries to be shown on specific dates in the agenda
@example
3-2-5 --> 2003-02-05
+2/5/3 --> 2003-02-05
14 --> @b{2006}-@b{06}-14
12 --> @b{2006}-@b{07}-12
+2/5 --> @b{2003}-02-05
Fri --> nearest Friday (defaultdate or later)
sep 15 --> @b{2006}-09-15
feb 15 --> @b{2007}-02-15
will continue to run after the note was filed away.
The handler will then store the note in the file and under the headline
-specified in the template, or it will use the default file and headline.
-The window configuration will be restored, sending you back to the working
-context before the call to Remember. To re-use the location found
-during the last call to Remember, exit the Remember buffer with
-@kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
-Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
-the currently clocked item.
+specified in the template, or it will use the default file and headline. The
+window configuration will be restored, sending you back to the working
+context before the call to Remember. To re-use the location found during the
+last call to Remember, exit the Remember buffer with @kbd{C-0 C-c C-c},
+i.e. specify a zero prefix argument to @kbd{C-c C-c}. Another special case
+is @kbd{C-2 C-c C-c} which files the note as a child of the currently clocked
+item, and @kbd{C-3 C-c C-c} files as a sibling of the currently clocked item.
@vindex org-remember-store-without-prompt
If you want to store the note directly to a different place, use
@vindex org-refile-use-outline-path
@vindex org-outline-path-complete-in-steps
@vindex org-refile-allow-creating-parent-nodes
+@vindex org-log-refile
Refile the entry or region at point. This command offers possible locations
for refiling the entry and lets you select one with completion. The item (or
all items in the region) is filed below the target heading as a subitem.
@code{org-outline-path-complete-in-steps}. If you would like to be able to
create new nodes as new parents for refiling on the fly, check the
variable @code{org-refile-allow-creating-parent-nodes}.
+When the variable @code{org-log-refile}@footnote{with corresponding
+@code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile},
+and @code{nologrefile}} is set, a time stamp or a note will be
+recorded when an entry has been refiled.
@kindex C-u C-c C-w
@item C-u C-c C-w
Use the refile interface to jump to a heading.
#+CATEGORY: Holiday
%%(org-calendar-holiday) ; special function for holiday names
#+CATEGORY: Ann
-%%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
-%%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
+%%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
+%%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
@end example
@subsubheading Anniversaries from BBDB
will search for note entries that contain the keywords @code{computer}
and @code{wifi}, but not the keyword @code{ethernet}, and which are also
not matched by the regular expression @code{8\.11[bg]}, meaning to
-exclude both 8.11b and 8.11g.
+exclude both 8.11b and 8.11g. The first @samp{+} is necessary to turn on
+word search, other @samp{+} characters are optional. For more details, see
+the docstring of the command @code{org-search-view}.
@vindex org-agenda-text-search-extra-files
Note that in addition to the agenda files, this command will also search
Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
@c
@kindex v l
+@kindex v L
@kindex l
@item v l @ @r{or short} @ l
@vindex org-log-done
@code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
all possible logbook entries, including state changes. When called with two
prefix args @kbd{C-u C-u}, show only logging information, nothing else.
+@kbd{v L} is equivalent to @kbd{C-u v l}.
@c
@kindex v [
@kindex [
@itemx S-@key{down}
Decrease the priority of the current item.
@c
+@kindex C-c C-z
@kindex z
-@item z
+@item z @ @r{or also} @ C-c C-z
@vindex org-log-into-drawer
Add a note to the entry. This note will be recorded, and then files to the
same location where state change notes are put. Depending on
@c
@kindex C-c C-s
@item C-c C-s
-Schedule this item
+Schedule this item, with prefix arg remove the scheduling timestamp
@c
@kindex C-c C-d
@item C-c C-d
-Set a deadline for this item.
+Set a deadline for this item, with prefix arg remove the deadline.
@c
@kindex k
@item k
@c
@kindex >
@item >
-Change the timestamp associated with the current line to today.
-The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
-on my keyboard.
+Change the timestamp associated with the current line. The key @kbd{>} has
+been chosen, because it is the same as @kbd{S-.} on my keyboard.
@c
@kindex I
@item I
@cindex remote editing, bulk, from agenda
@kindex m
-@item s
+@item m
Mark the entry at point for bulk action.
@kindex u
@kindex B
@item B
Bulk action: act on all marked entries in the agenda. This will prompt for
-another key to select the action to be applied:
+another key to select the action to be applied. The prefix arg to @kbd{B}
+will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove
+these special timestamps.
@example
r @r{Prompt for a single refile target and move all entries. The entries}
@r{will no longer be in the agenda, refresh (@kbd{g}) to bring them back.}
* Images and tables:: Tables and Images will be included
* Literal examples:: Source code examples with special formatting
* Include files:: Include additional files into a document
+* Index entries::
* Macro replacement:: Use macros to create complex output
* Embedded LaTeX:: LaTeX can be freely used inside Org documents
@end menu
the @file{table.el} package will be exported properly. For Org mode tables,
the lines before the first horizontal separator line will become table header
lines. You can use the following lines somewhere before the table to assign
-a caption and a label for cross references:
+a caption and a label for cross references, and in the text you can refer to
+the object with @code{\ref@{tab:basic-data@}}:
@example
#+CAPTION: This is the caption for the next table (or link)
@end table
-@node Include files, Macro replacement, Literal examples, Markup
+@node Include files, Index entries, Literal examples, Markup
@section Include files
@cindex include files, markup rules
Visit the include file at point.
@end table
+@node Index entries, Macro replacement, Include files, Markup
+@section Index enries
+@cindex index entries, for publishing
+
+You can specify entries that will be used for generating an index during
+publishing. This is done by lines starting with @code{#+INDEX}. An entry
+the contains an exclamation mark will create a sub item. See @ref{Generating
+an index} for more information.
+
+@example
+* Curriculum Vitae
+#+INDEX: CV
+#+INDEX: Application!CV
+@end example
+
+
-@node Macro replacement, Embedded LaTeX, Include files, Markup
+
+@node Macro replacement, Embedded LaTeX, Index entries, Markup
@section Macro replacement
@cindex macro replacement, during export
@cindex #+MACRO
* Selective export:: Using tags to select and exclude trees
* Export options:: Per-file export settings
* The export dispatcher:: How to access exporter commands
-* ASCII export:: Exporting to plain ASCII
+* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
* HTML export:: Exporting to HTML
* LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
* DocBook export:: Exporting to DocBook
H: @r{set the number of headline levels for export}
num: @r{turn on/off section-numbers}
toc: @r{turn on/off table of contents, or set level limit (integer)}
-\n: @r{turn on/off line-break-preservation}
+\n: @r{turn on/off line-break-preservation (DOES NOT WORK)}
@@: @r{turn on/off quoted HTML tags}
:: @r{turn on/off fixed-width sections}
|: @r{turn on/off tables}
LaTeX: @r{turn on/off La@TeX{} fragments}
skip: @r{turn on/off skipping the text before the first heading}
author: @r{turn on/off inclusion of author name/email into exported file}
+email: @r{turn on/off inclusion of author email into exported file}
creator: @r{turn on/off inclusion of creator info into exported file}
timestamp: @r{turn on/off inclusion creation time into exported file}
d: @r{turn on/off inclusion of drawers}
@code{EXPORT_TEXT}, @code{EXPORT_AUTHOR}, @code{EXPORT_DATE}, and
@code{EXPORT_OPTIONS}.
-@node The export dispatcher, ASCII export, Export options, Exporting
+@node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
@section The export dispatcher
@cindex dispatcher, for export commands
not set, or force processing in the current Emacs process if set.
@end table
-@node ASCII export, HTML export, The export dispatcher, Exporting
-@section ASCII export
+@node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
+@section ASCII/Latin-1/UTF-8 export
@cindex ASCII export
+@cindex Latin-1 export
+@cindex UTF-8 export
ASCII export produces a simple and very readable version of an Org-mode
-file.
+file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
+with special characters and symbols available in these encodings.
@cindex region, active
@cindex active region
@kindex C-c C-e A
@item C-c C-e A
Export to a temporary buffer, do not create a file.
+@kindex C-c C-e n
+@kindex C-c C-e N
+@item C-c C-e n @ @ @r{and} @ @ C-c C-e N
+Like the above commands, but use Latin-1 encoding.
+@kindex C-c C-e u
+@kindex C-c C-e U
+@item C-c C-e u @ @ @r{and} @ @ C-c C-e U
+Like the above commands, but use UTF-8 encoding.
@kindex C-c C-e v a
-@item C-c C-e v a
+@kindex C-c C-e v n
+@kindex C-c C-e v u
+@item C-c C-e v a @ @ @r{and} @ @ C-c C-e v n @ @ @r{and} @ @ C-c C-e v u
Export only the visible part of the document.
@end table
the text and the link in a note before the next heading. See the variable
@code{org-export-ascii-links-to-notes} for details and other options.
-@node HTML export, LaTeX and PDF export, ASCII export, Exporting
+@node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
@section HTML export
@cindex HTML export
@cindex Guerry, Bastien
Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
-further processing, this backend is also used to produce PDF output. Since
-the La@TeX{} output uses @file{hyperref} to implement links and cross
-references, the PDF output file will be fully linked.
+further processing@footnote{The default LaTeX output is designed for
+processing with pdftex or latex. It includes packages that are not
+compatible with xetex and possibly luatex. See the variables
+@code{org-export-latex-default-packages-alist} and
+@code{org-export-latex-packages-alist}.}, this backend is also used to
+produce PDF output. Since the La@TeX{} output uses @file{hyperref} to
+implement links and cross references, the PDF output file will be fully
+linked.
@menu
* LaTeX/PDF export commands:: Which key invokes which commands
+* Header and sectioning:: Setting up the export file structure
* Quoting LaTeX code:: Incorporating literal La@TeX{} code
-* Sectioning structure:: Changing sectioning in La@TeX{} output
* Tables in LaTeX export:: Options for exporting tables to La@TeX{}
* Images in LaTeX export:: How to insert figures into La@TeX{} output
+* Beamer class export:: Turning the file into a presentation
@end menu
-@node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
+@node LaTeX/PDF export commands, Header and sectioning, LaTeX and PDF export, LaTeX and PDF export
@subsection La@TeX{} export commands
@cindex region, active
@noindent
creates two levels of headings and does the rest as items.
-@node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
+@node Header and sectioning, Quoting LaTeX code, LaTeX/PDF export commands, LaTeX and PDF export
+@subsection Header and sectioning structure
+@cindex La@TeX{} class
+@cindex La@TeX{} sectioning structure
+@cindex La@TeX{} header
+@cindex header, for LaTeX files
+@cindex sectioning structure, for LaTeX export
+
+By default, the La@TeX{} output uses the class @code{article}.
+
+@vindex org-export-latex-default-class
+@vindex org-export-latex-classes
+@vindex org-export-latex-default-packages-alist
+@vindex org-export-latex-packages-alist
+@cindex #+LATEX_HEADER
+@cindex #+LATEX_CLASS
+@cindex #+LATEX_CLASS_OPTIONS
+@cindex property, LATEX_CLASS
+@cindex property, LATEX_CLASS_OPTIONS
+You can change this globally by setting a different value for
+@code{org-export-latex-default-class} or locally by adding an option like
+@code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
+property that applies when exporting a region containing only this (sub)tree.
+The class must be listed in @code{org-export-latex-classes}. This variable
+defines a header template for each class@footnote{Into which the values of
+@code{org-export-latex-default-packages-alist} and
+@code{org-export-latex-packages-alist} are spliced.}, and allows you to
+define the sectioning structure for each class. You can also define your own
+classes there. @code{#+LaTeX_CLASS_OPTIONS} or a @code{LaTeX_CLASS_OPTIONS}
+property can specify the options for the @code{\documentclass} macro. You
+can also use @code{#+LATEX_HEADER: \usepackage@{xyz@}} to add lines to the
+header. See the docstring of @code{org-export-latex-classes} for more
+information.
+
+@node Quoting LaTeX code, Tables in LaTeX export, Header and sectioning, LaTeX and PDF export
@subsection Quoting La@TeX{} code
Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
#+END_LaTeX
@end example
-@node Sectioning structure, Tables in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
-@subsection Sectioning structure
-@cindex La@TeX{} class
-@cindex La@TeX{} sectioning structure
-
-By default, the La@TeX{} output uses the class @code{article}.
-@vindex org-export-latex-default-class
-@vindex org-export-latex-classes
-@cindex #+LATEX_HEADER
-@cindex #+LATEX_CLASS
-@cindex property, LATEX_CLASS
-You can change this globally by setting a different value for
-@code{org-export-latex-default-class} or locally by adding an option like
-@code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
-property that applies when exporting a region containing only this (sub)tree.
-The class should be listed in @code{org-export-latex-classes}, where you can
-also define the sectioning structure for each class, as well as defining
-additional classes. You can also use @code{#+LATEX_HEADER:
-\usepackage@{xyz@}} to add lines to the header.
-
-@node Tables in LaTeX export, Images in LaTeX export, Sectioning structure, LaTeX and PDF export
+@node Tables in LaTeX export, Images in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
@subsection Tables in La@TeX{} export
@cindex tables, in La@TeX{} export
@end example
-@node Images in LaTeX export, , Tables in LaTeX export, LaTeX and PDF export
+@node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export
@subsection Images in La@TeX{} export
@cindex images, inline in La@TeX{}
@cindex inlining images in La@TeX{}
If you need references to a label created in this way, write
@samp{\ref@{fig:SED-HR4049@}} just like in La@TeX{}.
+@node Beamer class export, , Images in LaTeX export, LaTeX and PDF export
+@subsection Beamer class export
+
+The LaTeX class @file{beamer} allows to produce high quality presentations
+using LaTeX and pdf processing. Org-mode has special support for turning an
+Org-mode file or tree into a @file{beamer} presentation.
+
+When the LaTeX class for the current buffer (as set with @code{#+LaTeX_CLASS:
+beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is
+@code{beamer}, a special export mode will turn the file or tree into a beamer
+presentation. Any tree with not-to-deep level nesting should in principle be
+exportable as a beamer presentation. By default, the top-level entries (or
+the first level below the selected subtree heading) will be turned into
+frames, and the outline structure below this level will become itemize lists.
+You can also configure the variable @code{org-beamer-frame-level} to a
+different level - then the hierarchy above frames will produce the sectioning
+structure of the presentation.
+
+A template for useful in-buffer settings or properties can be inserted into
+the buffer with @kbd{M-x org-beamer-settings-template}. Among other things,
+this will install a column view format which is very handy for editing
+special properties used by beamer.
+
+You can influence the structure of the presentation using the following
+properties:
+
+@table @code
+@item BEAMER_env
+The environment that should be used to format this entry. Valid environments
+are defined in the constant @code{org-beamer-environments-default}, and you
+can define more in @code{org-beamer-environments-extra}. If this property is
+set, the entry will also get a @code{:B_environment:} tag to make this
+visible. This tag has no semantic meaning, it is only a visual aid.
+@item BEAMER_envargs
+The beamer-special arguments that should be used for the environment, like
+@code{[t]} or @code{[<+->]} of @code{<2-3>}. If the @code{BEAMER_col}
+property is also set, something like @code{C[t]} can be added here as well to
+set an options argument for the implied @code{columns} environment.
+@code{c[t]} will set an option for the implied @code{column} environment.
+@item BEAMER_col
+The width of a column that should start with this entry. If this property is
+set, the entry will also get a @code{:BMCOL:} property to make this visible.
+Also this tag is only a visual aid. When his is a plain number, it will be
+interpreted as a fraction of @code{\textwidth}. Otherwise it will be assumed
+that you have specified the units, like @samp{3cm}. The first such property
+in a frame will start a @code{columns} environment to surround the columns.
+This environment is closed when an entry has a @code{BEAMER_col} property
+with value 0 or 1, or automatically at the end of the frame.
+@item BEAMER_extra
+Additional commands that should be inserted after the environment has been
+opened. For example, when creating a frame, this can be used to specify
+transitions.
+@end table
+
+Frames will automatically receive a @code{fragile} option if they contain
+source code that uses the verbatim environment. Special @file{beamer}
+specific code can be inserted using @code{#+BEAMER:} and
+@code{#+BEGIN_beamer...#+end_beamer} constructs, similar to other export
+backends, but with the difference that @code{#+LaTeX:} stuff will be included
+in the presentation as well.
+
+Outline nodes with @code{BEAMER_env} property value @samp{note} or
+@samp{noteNH} will be formatted as beamer notes, i,e, they will be wrapped
+into @code{\note@{...@}}. The former will include the heading as part of the
+note text, the latter will ignore the heading of that node. To simplify note
+generation, it is actually enough to mark the note with a @emph{tag} (either
+@code{:B_note:} or @code{:B_noteNH:}) instead of creating the
+@code{BEAMER_env} property.
+
+You can turn on a special minor mode @code{org-beamer-mode} for editing
+support with
+
+@example
+#+STARTUP: beamer
+@end example
+
+@table @kbd
+@kindex C-c C-b
+@item C-c C-b
+In @code{org-beamer-mode}, this key offers fast selection of a beamer
+environment or the @code{BEAMER_col} property.
+@end table
+
+Column view provides a great way to set the environment of a node and other
+important parameters. Make sure you are using a COLUMN format that is geared
+toward this special purpose. The command @kbd{M-x
+org-beamer-settings-template} does define such a format.
+
+Here is a simple example Org document that is intended for beamer export.
+
+@smallexample
+#+LaTeX_CLASS: beamer
+#+TITLE: Example Presentation
+#+AUTHOR: Carsten Dominik
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 2
+#+BEAMER_HEADER_EXTRA: \usetheme@{Madrid@}\usecolortheme@{default@}
+#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
+
+* This is the first structural section
+
+** Frame 1 \\ with a subtitle
+*** Thanks to Eric Fraga :BMCOL:B_block:
+ :PROPERTIES:
+ :BEAMER_env: block
+ :BEAMER_envargs: C[t]
+ :BEAMER_col: 0.5
+ :END:
+ for the first viable beamer setup in Org
+*** Thanks to everyone else :BMCOL:B_block:
+ :PROPERTIES:
+ :BEAMER_col: 0.5
+ :BEAMER_env: block
+ :BEAMER_envargs: <2->
+ :END:
+ for contributing to the discussion
+**** This will be formatted as a beamer note :B_note:
+** Frame 2 \\ where we will not use columns
+*** Request :B_block:
+ Please test this stuff!
+ :PROPERTIES:
+ :BEAMER_env: block
+ :END:
+@end smallexample
+
+For more information, see the documentation on Worg.
+
@node DocBook export, Freemind export, LaTeX and PDF export, Exporting
@section DocBook export
@cindex DocBook export
* Publishing action:: Setting the function doing the publishing
* Publishing options:: Tweaking HTML export
* Publishing links:: Which links keep working after publishing?
-* Project page index:: Publishing a list of project files
+* Sitemap:: Generating a list of all pages
+* Generating an index:: An index that reaches across pages
@end menu
@node Project alist, Sources and destinations, Configuration, Configuration
the Emacs @file{tramp} package. Or you can publish to a local directory and
use external tools to upload your website (@pxref{Uploading files}).
@item @code{:preparation-function}
-@tab Function called before starting the publishing process, for example, to
-run @code{make} for updating files to be published.
+@tab Function or list of functions to be called before starting the
+publishing process, for example, to run @code{make} for updating files to be
+published. The project property list is scoped into this call as the
+variable @code{project-plist}.
@item @code{:completion-function}
-@tab Function called after finishing the publishing process, for example, to
-change permissions of the resulting files.
+@tab Function or list of functions called after finishing the publishing
+process, for example, to change permissions of the resulting files. The
+project property list is scoped into this call as the variable
+@code{project-plist}.
@end multitable
@noindent
@tab Non-nil means, publish htmlized source.
@end multitable
-The function must accept two arguments: a property list containing at least a
-@code{:publishing-directory} property, and the name of the file to be
-published. It should take the specified file, make the necessary
-transformation (if any) and place the result into the destination folder.
+The function must accept three arguments: a property list containing at least
+a @code{:publishing-directory} property, the name of the file to be
+published, and the path to the publishing directory of the output file. It
+should take the specified file, make the necessary transformation (if any)
+and place the result into the destination folder.
@node Publishing options, Publishing links, Publishing action, Configuration
@subsection Options for the HTML/La@TeX{} exporters
@vindex org-export-with-fixed-width
@vindex org-export-with-timestamps
@vindex org-export-author-info
+@vindex org-export-email
@vindex org-export-creator-info
@vindex org-export-with-tables
@vindex org-export-highlight-first-table-line
@item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
@item @code{:timestamps} @tab @code{org-export-with-timestamps}
@item @code{:author-info} @tab @code{org-export-author-info}
+@item @code{:email-info} @tab @code{org-export-email-info}
@item @code{:creator-info} @tab @code{org-export-creator-info}
@item @code{:tables} @tab @code{org-export-with-tables}
@item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
any) during publishing. Options set within a file (@pxref{Export
options}), however, override everything.
-@node Publishing links, Project page index, Publishing options, Configuration
+@node Publishing links, Sitemap, Publishing options, Configuration
@subsection Links between published files
@cindex links, publishing
function is @code{org-publish-validate-link} which checks if the given
file is part of any project in @code{org-publish-project-alist}.
-@node Project page index, , Publishing links, Configuration
-@subsection Project page index
-@cindex index, of published pages
+@node Sitemap, Generating an index, Publishing links, Configuration
+@subsection Generating a sitemap
+@cindex sitemap, of published pages
-The following properties may be used to control publishing of an
-index of files or a summary page for a given project.
+The following properties may be used to control publishing of
+a map of files for a given project.
@multitable @columnfractions 0.25 0.75
-@item @code{:auto-index}
-@tab When non-nil, publish an index during @code{org-publish-current-project}
+@item @code{:auto-sitemap}
+@tab When non-nil, publish a sitemap during @code{org-publish-current-project}
or @code{org-publish-all}.
-@item @code{:index-filename}
-@tab Filename for output of index. Defaults to @file{sitemap.org} (which
+@item @code{:sitemap-filename}
+@tab Filename for output of sitemap. Defaults to @file{sitemap.org} (which
becomes @file{sitemap.html}).
-@item @code{:index-title}
-@tab Title of index page. Defaults to name of file.
+@item @code{:sitemap-title}
+@tab Title of sitemap page. Defaults to name of file.
-@item @code{:index-function}
-@tab Plug-in function to use for generation of index.
-Defaults to @code{org-publish-org-index}, which generates a plain list
+@item @code{:sitemap-function}
+@tab Plug-in function to use for generation of the sitemap.
+Defaults to @code{org-publish-org-sitemap}, which generates a plain list
of links to all files in the project.
@end multitable
+@node Generating an index, , Sitemap, Configuration
+@subsection Generating an index
+@cindex index, in a publishing project
+
+Org-mode can generate an index across the files of a publishing project.
+
+@multitable @columnfractions 0.25 0.75
+@item @code{:makeindex}
+@tab When non-nil, generate in index in the file @file{theindex.org} and
+publish it as @file{theindex.html}.
+@end multitable
+
+The file will be create when first publishing a project with the
+@code{:makeindex} set. The file only contains a statement @code{#+include:
+"theindex.inc"}. You can then built around this include statement by adding
+a title, style information etc.
+
@node Uploading files, Sample configuration, Configuration, Publishing
@section Uploading files
@cindex rsync
@cindex @code{logredeadline}, STARTUP keyword
@cindex @code{lognoteredeadline}, STARTUP keyword
@cindex @code{nologredeadline}, STARTUP keyword
+@cindex @code{logrefile}, STARTUP keyword
+@cindex @code{lognoterefile}, STARTUP keyword
+@cindex @code{nologrefile}, STARTUP keyword
@example
logdone @r{record a timestamp when an item is marked DONE}
lognotedone @r{record timestamp and a note when DONE}
logredeadline @r{record a timestamp when deadline changes}
lognoteredeadline @r{record a note when deadline changes}
nologredeadline @r{do not record when a deadline date changes}
+logrefile @r{record a timestamp when refiling}
+lognoterefile @r{record a note when refiling}
+nologrefile @r{do not record when refiling}
@end example
@vindex org-hide-leading-stars
@vindex org-odd-levels-only
If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
the entire table.
@item
-If the cursor is inside a table created by the @file{table.el} package,
-activate that table.
-@item
If the current buffer is a Remember buffer, close the note and file it.
With a prefix argument, file it, without further interaction, to the
default location.
If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
of view can be achieved dynamically at display time using
@code{org-indent-mode}. In this minor mode, all lines are prefixed for
-display with the necessary amount of space. Also headlines are prefixed with
-additional stars, so that the amount of indentation shifts by
-two@footnote{See the variable @code{org-indent-indentation-per-level}.}
-spaces per level. All headline stars but the last one are made invisible
-using the @code{org-hide} face@footnote{Turning on @code{org-indent-mode}
-sets @code{org-hide-leading-stars} to @code{t} and
-@code{org-adapt-indentation} to @code{nil}.} - see below under @samp{2.} for
-more information on how this works. You can turn on @code{org-indent-mode}
-for all files by customizing the variable @code{org-startup-indented}, or you
-can turn it on for individual files using
+display with the necessary amount of space@footnote{@code{org-indent-mode}
+also sets the @code{wrap-prefix} property, such that @code{visual-line-mode}
+(or purely setting @code{word-wrap}) wraps long lines (including headlines)
+correctly indented. }. Also headlines are prefixed with additional stars,
+so that the amount of indentation shifts by two@footnote{See the variable
+@code{org-indent-indentation-per-level}.} spaces per level. All headline
+stars but the last one are made invisible using the @code{org-hide}
+face@footnote{Turning on @code{org-indent-mode} sets
+@code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to
+@code{nil}.} - see below under @samp{2.} for more information on how this
+works. You can turn on @code{org-indent-mode} for all files by customizing
+the variable @code{org-startup-indented}, or you can turn it on for
+individual files using
@example
#+STARTUP: indent
@cindex @file{remember.el}
@cindex Wiegley, John
Org cooperates with remember, see @ref{Remember}.
-@file{Remember.el} is not part of Emacs, find it on the web.
+As of Emacs 23, @file{Remember.el} is part of the Emacs distribution.
@item @file{speedbar.el} by Eric M. Ludlam
@cindex @file{speedbar.el}
@cindex Ludlam, Eric M.
@cindex @file{table.el}
@cindex Ota, Takaaki
-Complex ASCII tables with automatic line wrapping, column- and
-row-spanning, and alignment can be created using the Emacs table
-package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
-and also part of Emacs 22).
-When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
-will call @command{table-recognize-table} and move the cursor into the
-table. Inside a table, the keymap of Org mode is inactive. In order
-to execute Org mode-related commands, leave the table.
+Complex ASCII tables with automatic line wrapping, column- and row-spanning,
+and alignment can be created using the Emacs table package by Takaaki Ota
+(@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22).
+Org-mode will recognize these tables and export them properly. Because of
+interference with other Org-mode functionality, you unfortunately cannot edit
+these tables directly in the buffer. Instead, you need to use the command
+@kbd{C-c '} to edit them, similar to source code snippets.
@table @kbd
-@kindex C-c C-c
-@item C-c C-c
-Recognize @file{table.el} table. Works when the cursor is in a
-table.el table.
+@kindex C-c '
+@item C-c '
+Edit a @file{table.el} table. Works when the cursor is in a table.el table.
@c
@kindex C-c ~
@item C-c ~
@code{org-convert-table} for the restrictions under which this is
possible.
@end table
-@file{table.el} is part of Emacs 22.
+@file{table.el} is part of Emacs since Emacs 22.
@item @file{footnote.el} by Steven L. Baur
@cindex @file{footnote.el}
@cindex Baur, Steven L.
Skip current entry if it has a deadline.
@item '(org-agenda-skip-entry-if 'scheduled 'deadline)
Skip current entry if it has a deadline, or if it is scheduled.
+@item '(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
+Skip current entry if the TODO keyword is TODO or WAITING.
+@item '(org-agenda-skip-entry-if 'todo 'done)
+Skip current entry if the TODO keyword marks a DONE state.
@item '(org-agenda-skip-entry-if 'timestamp)
Skip current entry if it has any timestamp, may also be deadline or scheduled.
@item '(org-agenda-skip-entry 'regexp "regular expression")
values and check if VALUE is in this list.
@end defun
+@defopt org-property-allowed-value-functions
+Hook for functions supplying allowed values for specific.
+The functions must take a single argument, the name of the property, and
+return a flat list of allowed values. If @samp{:ETC} is one of
+the values, use the values as completion help, but allow also other values
+to be entered. The functions must return @code{nil} if they are not
+responsible for this property.
+@end defopt
+
@node Using the mapping API, , Using the property API, Hacking
@section Using the mapping API
@cindex API, for mapping
Org-mode has commands to prepare a directory with files for @i{MobileOrg},
and to read captured notes from there. If Emacs can directly write to the
-WebDAV directory accessed by @i{MobileOrg}, just point to this directory
-using the variable @code{org-mobile-directory}. Using the @file{tramp}
-method, @code{org-mobile-directory} may point to a remote directory
-accessible through, for example,
-@file{ssh/scp}:
+WebDAV directory@footnote{If you are using a public server, you might prefer
+to encrypt the files on the server. This can be done with Org-mode 6.35 and
+MobileOrg 1.2. On the Emacs side, configure the variables
+@code{org-mobile-use-encryption} and @code{org-mobile-encryption-password}.}
+accessed by @i{MobileOrg}, just point to this directory using the variable
+@code{org-mobile-directory}. Using the @file{tramp} method,
+@code{org-mobile-directory} may point to a remote directory accessible
+through, for example, @file{ssh/scp}:
@smallexample
(setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
@item
@i{Alex Bochannek} provided a patch for rounding timestamps.
@item
+@i{Jan Böcker} wrote @file{org-docview.el}.
+@item
@i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files.
@item
@i{Tom Breton} wrote @file{org-choose.el}.
@i{Eric Schulte} wrote @file{org-plot.el} and (together with @i{Dan Davison})
Org Babel, and contributed various patches, small features and modules.
@item
+@i{Paul Sexton} wrote @file{org-ctags.el}.
+@item
Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
@file{organizer-mode.el}.
@item
@i{J@"urgen Vollmer} contributed code generating the table of contents
in HTML output.
@item
+@i{Samuel Wales} has provided important feedback and bug reports.
+@item
@i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
keyword.
@item
patches directly to Org, including the attachment system
(@file{org-attach.el}), integration with Apple Mail
(@file{org-mac-message.el}), hierarchical dependencies of TODO items, habit
-tracking (@file{org-habits.el}) and support for pcomplete.
+tracking (@file{org-habits.el}).
@item
@i{Carsten Wimmer} suggested some changes and helped fix a bug in
linking to Gnus.
transfers a small piece of Perl code to the remote host, and tries to
apply it for encoding and decoding.
+The variable @var{tramp-inline-compress-start-size} controls, whether
+a file shall be compressed before encoding. This could increase
+transfer speed for large text files.
+
@table @asis
@item @option{rsh}
My suggestion is to use an inline method. For large files, external
methods might be more efficient, but I guess that most people will
-want to edit mostly small files.
+want to edit mostly small files. And if you access large text files,
+compression (driven by @var{tramp-inline-compress-start-size}) shall
+still result in good performance.
I guess that these days, most people can access a remote machine by
using @command{ssh}. So I suggest that you use the @option{ssh}
The same problem can happen with auto-saving files.
@ifset emacs
-Since @value{emacsname} 21, the variable
-@code{auto-save-file-name-transforms} keeps information, on which
-directory an auto-saved file should go. By default, it is initialized
-for @value{tramp} files to the local temporary directory.
+The variable @code{auto-save-file-name-transforms} keeps information,
+on which directory an auto-saved file should go. By default, it is
+initialized for @value{tramp} files to the local temporary directory.
On some versions of @value{emacsname}, namely the version built for
Debian GNU/Linux, the variable @code{auto-save-file-name-transforms}
@item
Which systems does it work on?
-The package has been used successfully on GNU Emacs 21, GNU Emacs 22,
-GNU Emacs 23, XEmacs 21 (starting with 21.4), and SXEmacs 22.
+The package has been used successfully on GNU Emacs 22, GNU Emacs 23,
+XEmacs 21 (starting with 21.4), and SXEmacs 22.
The package was intended to work on Unix, and it really expects a
-Unix-like system on the remote end (except the @option{smb} method),
-but some people seemed to have some success getting it to work on MS
-Windows NT/2000/XP @value{emacsname}.
-
-There is some informations on @value{tramp} on NT at the following URL;
-many thanks to Joe Stoy for providing the information:
-@uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/}
+Unix-like system on the remote end (except the @option{smb} and
+@option{imap} methods), but some people seemed to have some success
+getting it to work on MS Windows XP/Vista/7 @value{emacsname}.
@item
@example
#!/bin/sh
-emacsclient @trampfn{ssh, `whoami`, `hostname --fqdn`, $1}
+emacsclient @trampfn{ssh, $(whoami), $(hostname --fqdn), $1}
@end example
Then you must set the environment variable @code{EDITOR} pointing to
@c texi/trampver.texi. Generated from trampver.texi.in by configure.
@c This is part of the Emacs manual.
-@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-@c Free Software Foundation, Inc.
+@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+@c 2010 Free Software Foundation, Inc.
@c See file doclicense.texi for copying conditions.
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
-@set trampver 2.1.18-23.2
+@set trampver 2.1.19-pre
@c Other flags from configuration
@set instprefix /usr/local
+++ /dev/null
-# Unlike most emacs dirs, etc has a simple non-autoconf-generated makefile
-source ^(Makefile)$
-
-# Auto-generated files, which ignore
-precious ^(buildobj\.lst)$
-
-# Generated files (DOC-X is generated on windows)
-backup ^(DOC(|-[0-9.]*|-X))$
-
-# Install-in-place on NT makes this directory, so just ignore it
-backup ^(icons)$
-
-# arch-tag: 5a1d62e0-593a-48cd-8743-8d45dc58dfae
-2010-05-19 Stefan Monnier <monnier@iro.umontreal.ca>
+2010-05-24 Stefan Monnier <monnier@iro.umontreal.ca>
* NEWS: Add sections for Emacs-23.3.
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
+
+ * PROBLEMS: Document gcc-4.5 bug (Bug#6031).
+
+2010-05-08 Kenichi Handa <handa@m17n.org>
+
+ * HELLO: Adjust Burmese for Unicode 5.2 encoding.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
-2010-04-27 Chong Yidong <cyd@stupidchicken.com>
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
- * PROBLEMS: Document gcc-4.5 bug (Bug#6031).
+ * HELLO: Reorder Arabic greetings into logical order (they were
+ mistakenly changed to visual order by the 2010-03-28 change).
-2010-04-23 Kenichi Handa <handa@m17n.org>
+2010-04-18 Francesc Rocher <rocher@member.fsf.org>
- * HELLO: Adjust Burmese for Unicode 5.2 encoding.
+ * MORE.STUFF: Add a new entry for QWE.
-2010-04-04 Francesc Rocher <rocher@member.fsf.org>
+2010-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
- * MORE.STUFF: Add a new entry for QWE.
+ * HELLO (Mathematics): Prefer Unicode charset.
-2010-03-28 Chong Yidong <cyd@stupidchicken.com>
+2010-03-30 Chong Yidong <cyd@stupidchicken.com>
* images/icons/hicolor/scalable/apps/emacs.svg: Put preamble after
svg tag (Bug#5790).
-2010-03-27 Eli Zaretskii <eliz@gnu.org>
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
* PROBLEMS: Mention problems on MS-Windows with incompatible
regex.h headers.
-2010-03-15 Francesc Rocher <rocher@member.fsf.org>
+2010-03-28 Eli Zaretskii <eliz@gnu.org>
+
+ * HELLO: Reorder Arabic and Hebrew into logical order, and
+ insert RLM before the opening paren, to make the display more
+ reasonable. Add setting for bidi-display-reordering in the local
+ variables section.
+ * NEWS: Mention initial support for bidirectional editing.
+
+2010-03-24 Francesc Rocher <rocher@member.fsf.org>
* MORE.STUFF: Remove CEDET entry, now distributed as part of Emacs.
+2010-03-22 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * gnus/gnus-setup.ast: Add finish links to the top nodes.
+
+ * gnus/news-server.ast: Add some trivial validation.
+
+2010-03-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: Add secrets.el.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * images/custom/down.xpm, images/custom/right.xpm: Update images
+ to increase contrast on bright backgrounds.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-03-06 Glenn Morris <rgm@gnu.org>
* srecode/default.srt (COPYRIGHT): Update template copyright to GPLv3+.
2006-11-05 Slawomir Nowaczyk <slawek@cs.lth.se>
* emacs.py (eargs): Provide eldoc message for builtin types.
- Make sure eargs always outputs sentinel, to avoid Emacs freeze.
+ Make sure eargs always outputs sentinel, to avoid Emacs freeze.
2006-10-22 Chong Yidong <cyd@stupidchicken.com>
1990-01-19 David Lawrence (tale@cocoa-puffs)
* timer.c, getdate.y (new files) and Makefile:
- Sub-process support for run-at-time in timer.el.
- Doesn't yet work correctly for USG.
+ Sub-process support for run-at-time in timer.el.
+ Doesn't yet work correctly for USG.
1990-01-10 Jim Kingdon (kingdon@pogo)
- In src/s/SYSTEM-NAME.h add "#define SYSTEM_MALLOC".
- - In src/m/MACHINE-NAME.h add "#define CANNOT_DUMP" and
- "#define CANNOT_UNEXEC".
+ - In src/m/MACHINE-NAME.h add "#define CANNOT_DUMP"
- Configure with a different --prefix= option. If you use GCC,
version 2.7.2 is preferred, as some malloc debugging packages
Europe: \e,A!\e(BHola!, Gr\e,A|_\e(B Gott, Hyv\e,Add\e(B p\e,Ad\e(Biv\e,Add\e(B, Tere \e,Au\e(Bhtust, Bon\e,Cu\e(Bu
Cze\e,B6f\e(B!, Dobr\e,B}\e(B den, \e,L7T`PRabRcYbU\e(B!, \e,FCei\\e(B \e,Fsar\e(B, \e$,1J2J0J;J0J@JOJ=J1J0\e(B
Africa: \e$(3!A!,!>\e(B
- Middle/Near East: \e,Hylem\e(B, \e,GecjdY\e(B \e,GeGdqSdG\e(B
+ Middle/Near East: \e,Hylem\e(B, \e,GGdSqdGe\e(B \e,GYdjce\e(B
South Asia: \e$,19h9n9x:-9d:'\e(B, \e$,15h5n5x6-5d6'\e(B, \e$,1?(?.?8?M>u?>?0\e(B, \e$,1@H@N@X@m@5@^@P@"\e(B, \e$,1;6;A;#;?;,;G\e(B,
\e$,1AFAzB4AvB=B AqB*\e(B, \e$,1<U<C<5<m<5<N<m\e(B, \e$,1=h=n=x>-=U=~=p=B\e(B, \e$(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>\e(B
South East Asia: \e$,1\'\f\:\V\4\?\]\:\e(B, \e(1JP:R-4U\e(B, \e$,1H9H$HZHYH"H<HLH5HK\e(B, \e,TJGQJ4U$CQ:\e(B, Ch\e,1`\e(Bo b\e,1U\e(Bn
LANGUAGE (NATIVE NAME) HELLO
---------------------- -----
Amharic (\e$,1O M[MmN{\e(B) \e$,1M`MKM]\e(B
-Arabic (\e,GIqjHQYdG\e(B) \e,GecjdY\e(B \e,GeGdqSdG\e(B
+Arabic \e$,1ro\e(B(\e,GGdYQHjqI\e(B) \e,GGdSqdGe\e(B \e,GYdjce\e(B
Bengali (\e$,17,7>6b727>\e(B) \e$,17(7.787M6u7>70\e(B
Braille \e$,2(3(1('('(5\e(B
Burmese (\e$,1H9H\H4HZH9HL\e(B) \e$,1H9H$HZHYH"H<HLH5HK\e(B
German (Deutsch) Guten Tag / Gr\e,A|_\e(B Gott
Greek (\e,Fekkgmij\\e(B) \e,FCei\\e(B \e,Fsar\e(B
Gujarati (\e$,19W:!9\9p9~9d: \e(B) \e$,19h9n9x:-9d:'\e(B
-Hebrew (\e,Hzixar\e(B) \e,Hylem\e(B
+Hebrew \e$,1ro\e(B(\e$,1-",q-(,y-*\e(B) \e,Hylem\e(B
Hungarian (magyar) Sz\e,Bi\e(Bp j\e,Bs\e(B napot!
Hindi (\e$,15y5\7f5B5f6 \e(B) \e$,15h5n5x6-5d6'\e(B / \e$,15h5n5x6-5U5~5p\e(B \e$,16D\e(B
Italian (italiano) Ciao / Buon giorno
Lao (\e(1>RJRERG\e(B) \e(1JP:R-4U\e(B / \e(1"mcKib*!4U\e(B
Malayalam (\e$,1@N@R@O@^@S@"\e(B) \e$,1@H@N@X@m@5@^@P@"\e(B
Maltese (il-Malti) Bon\e,Cu\e(Bu / Sa\e,C11\e(Ba
-Mathematics \e$B"O\e(B p \e$A!J\e(B world \e$(O#@\e(B hello p \e$A!u\e(B
+Mathematics \e$,1x \e(B p \e$,1x(\e(B world \e$,1s"\e(B hello p \e$,2!a\e(B
Nederlands, Vlaams Hallo / Dag
Norwegian (norsk) Hei / God dag
Oriya (\e$,1:s;\;?:f\e(B) \e$,1;6;A;#;?;,;G\e(B
;;; Local Variables:
;;; tab-width: 32
+;;; bidi-display-reordering: t
;;; End:
-GNU Emacs NEWS -- history of user-visible changes.
-
-Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-See the end of the file for license conditions.
-
-Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
-If possible, use M-x report-emacs-bug.
-
-This file is about changes in Emacs version 23.
-
-See files NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18, and NEWS.1-17
-for changes in older Emacs versions.
-
-You can narrow news to a specific version by calling `view-emacs-news'
-with a prefix argument or by typing C-u C-h C-n.
-
-\f
-* Installation Changes in Emacs 23.3
-
-* Startup Changes in Emacs 23.3
-
-* Changes in Emacs 23.3
-
-\f
-* Editing Changes in Emacs 23.3
-
-\f
-* Changes in Specialized Modes and Packages in Emacs 23.3
-
-\f
-* New Modes and Packages in Emacs 23.3
-
-\f
-* Incompatible Lisp Changes in Emacs 23.3
-
-\f
-* Lisp changes in Emacs 23.3
-
-** New function byte-to-string, like char-to-string but for bytes.
-
-\f
-* Changes in Emacs 23.3 on non-free operating systems
-
-\f
-* Installation Changes in Emacs 23.2
-
-** New configure options for Emacs developers.
-These are not new features; only the configure flags are new.
-
-*** --enable-profiling builds Emacs with profiling enabled.
-This might not work on all platforms.
-
-*** --enable-checking[=OPTIONS] builds emacs with extra runtime checks.
-
-** `make install' now consistently ignores umask, creating a
-world-readable install.
-
-** Emacs compiles with Gconf support, if it is detected.
-Use the configure option --without-gconf to disable this.
-This is used by the `font-use-system-font' feature (see below).
-
-* Startup Changes in Emacs 23.2
-
-** The command-line option -Q (--quick) also inhibits loading X resources.
-However, if Emacs is compiled with the Lucid or Motif toolkit, X
-resource settings for the graphical widgets are still applied.
-On Windows, the -Q option causes Emacs to ignore Registry settings,
-but environment variables set on the Registry are still honored.
-
-*** The new variable `inhibit-x-resources' shows whether X resources
-were loaded.
-
-** New command-line option -mm (--maximized) maximizes the initial frame.
-
-* Changes in Emacs 23.2
-
-** The maximum size of buffers (and the largest fixnum) is doubled.
-On typical 32bit systems, buffers can now be up to 512MB.
-
-** The default value of `trash-directory' is now nil.
-This means that `move-file-to-trash' trashes files according to
-freedesktop.org specifications, the same method used by the Gnome,
-KDE, and XFCE desktops. (This change has no effect on Windows, which
-uses `system-move-file-to-trash' for trashing.)
-
-** The pointer now becomes invisible when typing.
-Customize `make-pointer-invisible' to disable this feature.
-
-** Font changes
-
-*** Emacs can use the system default monospaced font in Gnome.
-To enable this feature, set `font-use-system-font' to non-nil (it is
-nil by default). If the system default changes, Emacs changes also.
-This feature requires Gconf support, which is automatically included
-at compile-time if configure detects the gconf libraries (you can
-disable this with the configure option --without-gconf).
-
-*** On X11, Emacs reacts to Xft changes made by configuration tools,
-via the XSETTINGS mechanism. This includes antialias, hinting,
-hintstyle, RGBA, DPI and lcdfilter changes.
-
-** Killing a buffer with a running process now asks for confirmation.
-To remove this query, remove `process-kill-buffer-query-function' from
-`kill-buffer-query-functions', or set the appropriate process flag
-with `set-process-query-on-exit-flag'.
-
-** File-local variable changes
-
-*** Specifying a minor mode as a local variables enables that mode,
-unconditionally. The previous behavior, toggling the mode, was
-neither reliable nor generally desirable.
-
-*** There are new commands for adding and removing file-local variables:
-`add-file-local-variable', `delete-file-local-variable',
-`add-file-local-variable-prop-line', and
-`delete-file-local-variable-prop-line'.
-
-*** There are new commands for adding and removing directory-local variables,
-and copying them to and from file-local variable lists:
-`add-dir-local-variable', `delete-dir-local-variable',
-`copy-dir-locals-to-file-locals',
-`copy-dir-locals-to-file-locals-prop-line' and
-`copy-file-locals-to-dir-locals'.
-
-** Internationalization changes
-
-*** Unibyte sessions are now considered obsolete.
-This refers to the EMACS_UNIBYTE environment variable as well as the
---unibyte, --multibyte, --no-multibyte, and --no-unibyte command line
-arguments. Customizing enable-multibyte-characters and setting
-default-enable-multibyte-characters are also deprecated.
-
-*** New coding system `utf-8-hfs'.
-This is suitable for default-file-name-coding-system on Mac OS X; see
-international/ucs-normalize.el.
-
-** Function arguments in *Help* buffers are now shown in upper-case.
-Customize `help-downcase-arguments' to t to show them in lower-case.
-
-** New command `async-shell-command', bound globally to `M-&'.
-This executes the command asynchronously, similar to calling `M-!' and
-manually adding an ampersand to the end of the command. With `M-&',
-you don't need the ampersand. The output appears in the buffer
-`*Async Shell Command*'.
-
-** When running in a new enough xterm (newer than version 242), Emacs
-asks xterm what the background color is and it sets up faces
-accordingly for a dark background if needed (the current default is to
-consider the background light).
-
-\f
-* Editing Changes in Emacs 23.2
-
-** Kill-ring and selection changes
-
-*** If `select-active-regions' is t, any active region automatically
-becomes the primary selection (for interaction with other window
-applications). If you enable this, you might want to bind
-`mouse-yank-primary' to Mouse-2.
-
-*** When `save-interprogram-paste-before-kill' is non-nil, the kill
-commands save the interprogram-paste selection into the kill ring
-before doing anything else. This avoids losing the selection.
-
-*** When `kill-do-not-save-duplicates' is non-nil, identical
-subsequent kills are not duplicated in the `kill-ring'.
-
-** Completion changes
-
-*** The new command `completion-at-point' provides mode-sensitive completion.
-
-*** tab-always-indent set to `complete' lets TAB do completion as well.
-
-*** The new completion-style `initials' is available.
-For instance, this can complete M-x lch to list-command-history.
-
-*** The new variable `completions-format' determines how completions
-are displayed in the *Completions* buffer. If you set it to
-`vertical', completions are sorted vertically in columns.
-
-** The default value of `blink-matching-paren-distance' is increased.
-
-** M-n provides more default values in the minibuffer for commands
-that read file names. These include the file name at point (when ffap
-is loaded without ffap-bindings), the file name on the current line
-(in Dired buffers), and the directory names of adjacent Dired windows
-(for Dired commands that operate on several directories, such as copy,
-rename, or diff).
-
-** M-r is bound to the new `move-to-window-line-top-bottom'.
-This moves point to the window center, top and bottom on successive
-invocations, in the same spirit as the C-l (recenter-top-bottom)
-command.
-
-** The new variable `recenter-positions' determines the default
-cycling order of C-l (`recenter-top-bottom').
-
-** The abbrevs file is now a file named abbrev_defs in
-user-emacs-directory; but the old location, ~/.abbrev_defs, is used if
-that file exists.
-
-\f
-* Changes in Specialized Modes and Packages in Emacs 23.2
-
-** The bookmark menu has a narrowing search via bookmark-bmenu-search.
-
-** Calc
-
-*** The Calc settings file is now a file named calc.el in
-user-emacs-directory; but the old location, ~/.calc.el, is used if
-that file exists.
-
-*** Graphing commands (`g f' etc.) now work on MS-Windows, if you have
-the native Windows port of Gnuplot version 3.8 or later installed.
-
-** Calendar and diary
-
-*** Fancy diary display is now the default.
-If you prefer the simple display, customize `diary-display-function'.
-
-*** The diary's fancy display now enables view-mode.
-
-*** The command `calendar-current-date' accepts an optional argument
-giving an offset from today.
-
-** Desktop
-
-*** The default value for `desktop-buffers-not-to-save' is nil.
-This means Desktop will try restoring all buffers, when you restart
-your Emacs session. Also, `desktop-buffers-not-to-save' is only
-effective for buffers that have no associated file. If you want to
-exempt buffers that do correspond to files, customize the value of
-`desktop-files-not-to-save' instead.
-
-** Dired
-
-*** The new variable `dired-auto-revert-buffer', if non-nil, causes
-Dired buffers to be reverted automatically on revisiting them.
-
-** DocView
-
-*** When `doc-view-continuous' is non-nil, scrolling a line
-on the page edge advances to the next/previous page.
-
-** Elint
-
-*** Elint now uses compilation-mode.
-
-*** Elint can now scan individual files and whole directories,
-and can be run in batch mode.
-
-*** Elint does a more thorough initialization, and recognizes more built-in
-functions and variables. Customize `elint-scan-preloaded' if you want
-to sacrifice some accuracy for a faster startup.
-
-*** Elint attempts some basic understanding of featurep and (f)boundp tests.
-
-*** Customize `elint-ignored-warnings' to suppress some warnings.
-
-** GDB-UI
-
-*** Toolbar functionality for reverse debugging. Display of STL
-collections as watch expressions. These features require GDB 7.0 or later.
-
-** Grep
-
-*** A new command `zrgrep' searches recursively in gzipped files.
-
-** Info
-
-*** The new command `Info-virtual-index' bound to "I" displays a menu of
-matched topics found in the index.
-
-*** The new command `info-finder' replaces finder.el with a virtual Info
-manual that generates an Info file which gives the same information
-through a menu structure.
-
-** LaTeX mode now provides completion (via completion-at-point).
-
-** Message mode is now the default mode for composing mail.
-
-The default for `mail-user-agent' is now message-user-agent, so the
-C-x m (`compose-mail') command uses Message mode instead of Mail mode.
-
-Message mode has been included in Emacs, as part of the Gnus package,
-for several years. It provides several features that are absent in
-Mail mode, such as MIME handling.
-
-*** If the user has not customized mail-user-agent, `compose-mail'
-checks for Mail mode customizations, and issues a warning if these
-customizations are found. This alerts users who may otherwise be
-unaware that their mail configuration has changed.
-
-To disable this check, set compose-mail-user-agent-warnings to nil.
-
-** The default value of mail-interactive is t, since Emacs 23.1.
-(This was not announced at the time.) It means that when sending mail,
-Emacs will wait for the process sending mail to return. If you
-experience delays when sending mail, you may wish to set this to nil.
-
-** nXML mode is now the default for editing XML files.
-
-** pcomplete provides a new command `pcomplete-std-completion' which
-is similar to `pcomplete' but using the standard completion UI code.
-
-** Shell (and other comint modes)
-
-*** M-s is no longer bound to `comint-next-matching-input'.
-
-*** M-r is now bound to `comint-history-isearch-backward-regexp'.
-This starts an incremental search of the comint/shell input history.
-
-*** ansi-color is now enabled by default in Shell mode.
-To disable it, set ansi-color-for-comint-mode to nil.
-
-** Tramp
-
-*** New connection methods "rsyncc", "imap" and "imaps".
-On systems which support GVFS-Fuse, Tramp offers also the new
-connection methods "dav", "davs", "obex" and "synce".
-
-** VC and related modes
-
-*** When using C-x v v or C-x v i on a unregistered file that is in a
-directory not controlled by any VCS, ask the user what VC backend to
-use to create a repository, create a new repository and register the
-file.
-
-*** New command `vc-root-print-log', bound to `C-x v L'.
-This displays a `*vc-change-log*' buffer showing the history of the
-version-controlled directory tree as a whole.
-
-*** New command `vc-root-diff', bound to `C-x v D'.
-This is similar to `vc-diff', but compares the entire directory tree
-of the current VC directory with its working revision.
-
-*** `C-x v l' and `C-x v L' do not show the full log by default.
-The number of entries shown can be chosen interactively with a prefix
-argument, or by customizing vc-log-show-limit. The `*vc-change-log*'
-buffer now contains buttons at the end of the buffer, which can be
-used to increase the number of entries shown. RCS, SCCS, and CVS do
-not support this feature.
-
-*** vc-annotate supports annotations through file copies and renames,
-it displays the old names for the files and it can show logs/diffs for
-the corresponding lines. Currently only Git and Mercurial take
-advantage of this feature.
-
-*** The log command in vc-annotate can display a single log entry
-instead of redisplaying the full log. The RCS, CVS and SCCS VC
-backends do not support this.
-
-*** When a file is not found, VC will not try to check it out of RCS anymore.
-
-*** Diff and log operations can be used from Dired buffers.
-
-*** vc-git changes
-
-**** The short log format for git makes use of the graph display,
-so it's not supported on git versions earlier than 1.5.6.
-
-**** vc-dir uses the --relative option of git, and so requires at least
-git version 1.5.5.
-
-**** Support for operating with stashes has been added to vc-dir:
-the stash list is displayed in the *vc-dir* header, stashes can be
-created, removed, applied and their content displayed.
-
-*** vc-bzr supports operating with shelves: the shelve list is
-displayed in the *vc-dir* header, shelves can be created, removed and applied.
-
-*** log-edit-strip-single-file-name controls whether or not single filenames
-are stripped when copying text from the ChangeLog to the *VC-Log* buffer.
-
-** Miscellaneous
-
-*** Interactively `multi-isearch-buffers' and `multi-isearch-buffers-regexp'
-read buffer names to search, one by one, ended with RET. With a prefix
-argument, they ask for a regexp, and search in buffers whose names match
-the specified regexp. Interactively `multi-isearch-files' and
-`multi-isearch-files-regexp' read file names to search, one by one,
-ended with RET. With a prefix argument, they ask for a wildcard, and
-search in file buffers whose file names match the specified wildcard.
-
-*** Autorevert Tail mode now works also for remote files.
-
-*** The new eshell built-in commands `su' and `sudo' support Tramp.
-Thus, they change `default-directory' to reflect the new user id, and
-let commands run under that user's permissions. This works even when
-`default-directory' is already remote. Calling the external commands
-is possible via `*su' or `*sudo', respectively.
-
-** Obsolete packages
-
-*** sym-comp.el is now obsolete, superseded by completion-at-point.
-
-*** lucid.el and levents.el are now obsolete.
-
-\f
-* New Modes and Packages in Emacs 23.2
-
-** CEDET (the Collection of Emacs Development Tools) is now in Emacs.
-This is a collection of packages to aid with using Emacs as an IDE
-(integrated development environment):
-
-*** The Semantic package allows the use of parsers to intelligently
-edit and navigate source code. Parsers for C/C++, Java, Javascript,
-and several other languages are included by default, and Semantic can
-also interface with external tools such as GNU Global and GNU Idutils.
-
-To enable Semantic, use the global minor mode `semantic-mode'.
-See the Semantic manual for details.
-
-*** EDE (Emacs Development Environment) is a package for managing code
-projects, including features such as automatic Makefile generation.
-
-To enable EDE, use the minor mode `global-ede-mode'.
-See the EDE manual for details.
-
-*** SRecode is a library for recoding Semantic tags back into source
-code. It is currently used by some parts of Semantic and EDE; in the
-future, it may be used for code generation features.
-
-*** The EIEIO library implements a subset of the Common Lisp Object
-System (CLOS). It is used by the other CEDET packages.
-
-** mpc.el is a front end for the Music Player Daemon. Run it with M-x mpc.
-
-** htmlfontify.el turns a fontified Emacs buffer into an HTML page.
-
-** js.el is a new major mode for JavaScript files.
-
-** imap-hash.el is a new library to address IMAP mailboxes as hashtables.
-
-\f
-* Incompatible Lisp Changes in Emacs 23.2
-
-** The Lisp reader turns integers that are too large/small into floats.
-For instance, on machines where `536870911' is the largest integer,
-reading `536870912' gives the floating-point object `536870912.0'.
-
-This change only concerns the Lisp reader; it does not affect how
-actual integer objects overflow.
-
-** Several obsolete functions removed.
-The functions have been obsolete since Emacs 19, and are unlikely to
-be in use:
-
- time-stamp-month-dd-yyyy, time-stamp-dd/mm/yyyy, time-stamp-mon-dd-yyyy
- time-stamp-dd-mon-yy, time-stamp-yy/mm/dd, time-stamp-yyyy/mm/dd,
- time-stamp-yyyy-mm-dd, time-stamp-yymmdd, time-stamp-hh:mm:ss,
- time-stamp-hhmm, baud-rate
-
-** Support for generating Emacs 18 compatible bytecode (by setting
-the variable `byte-compile-compatibility') has been removed.
-
-** In image-mode.el `image-mode-maybe' is obsolete.
-Instead, you can either use `image-mode' (which displays an image file
-as the actual image initially), or `image-mode-as-text' (when you want
-to display an image file as text initially). `image-mode-as-text' is a
-combination of a non-image mode from `auto-mode-alist' (or Fundamental
-mode) and `image-minor-mode'. `image-minor-mode' provides a `C-c C-c'
-key binding to toggle image display.
-`image-toggle-display-text' removes image properties.
-`image-toggle-display-image' adds image properties.
-`image-toggle-display' toggles between `image-mode-as-text' and `image-mode'.
-
-\f
-* Lisp changes in Emacs 23.2
-
-** All the default-FOO variables that hold the default value of the FOO
-variable, are now declared obsolete.
-
-** read-key is a function halfway between read-event and read-key-sequence.
-It reads a single key, but obeys input and escape sequence decoding.
-
-** Frame parameter changes
-
-*** You can give the `fullscreen' frame parameter the value `maximized'.
-This maximizes the frame.
-
-*** The new frame parameter `sticky' makes Emacs frames sticky in
-virtual desktops.
-
-** Completion changes
-
-*** completion-base-size is obsoleted by completion-base-position.
-This change causes a few backward incompatibilities, mostly with
-choose-completion-string-functions where the `mini-p' argument has
-been replaced by a `base-position' argument, and where the `base-size'
-argument is now always nil.
-
-*** New function `completion-in-region' to use the standard completion
-facilities on a particular region of text.
-
-*** The 4th arg to all-completions (aka hide-spaces) is declared obsolete.
-
-*** completion-annotate-function specifies how to compute annotations
-for completions displayed in *Completions*.
-
-** Minibuffer changes
-
-*** read-file-name-predicate is obsolete. It was used to pass the predicate
-to read-file-name-internal because read-file-name-internal abused its `pred'
-argument to pass the current directory, but this hack is not needed
-any more.
-
-** Changes to file-manipulation functions
-
-*** `delete-directory' has an optional parameter RECURSIVE.
-
-*** New function `copy-directory', which copies a directory recursively.
-
-** called-interactively-p now takes one argument and replaces interactive-p
-which is now marked obsolete.
-
-** New function set-advertised-calling-convention makes it possible
-to obsolete arguments as well as make some arguments mandatory.
-
-** You can control which binding is preferentially shown in menus and
-docstrings by adding a `:advertised-binding' property to the corresponding
-command's symbol. That property can hold a single binding or a list
-of bindings.
-
-** Network and process changes
-
-*** start-process-shell-command and start-file-process-shell-command
-now only take a single `command' argument.
-
-*** The new variable `process-file-side-effects' should be set to nil
-if a `process-file' call does not change a remote file. This allows
-file name handlers such as Tramp to optimizations.
-
-*** make-network-process can now also create `seqpacket' Unix sockets.
-
-** Loading changes
-
-*** eval-next-after-load is obsolete.
-
-*** New hook `after-load-functions' run after loading an Elisp file.
-
-** Byte compilation changes
-
-*** Changing the file-names generated by byte-compilation by redefining
-the function `byte-compile-dest-file' before loading bytecomp.el is obsolete.
-Instead, customize byte-compile-dest-file-function.
-
-*** `byte-compile-warnings' has new members, `constants' and `suspicious'.
-
-** New macro with-silent-modifications to tweak text properties without
-affecting the buffer's modification state.
-
-** Hash tables have a new printed representation that is readable.
-The feature `hashtable-print-readable' identifies this new
-functionality.
-
-** New functions for performing Unicode normalization:
-ucs-normalize-NFD-region, ucs-normalize-NFD-string,
-ucs-normalize-NFC-region, ucs-normalize-NFC-string,
-ucs-normalize-NFKD-region, ucs-normalize-NFKD-string,
-ucs-normalize-NFKC-region, ucs-normalize-NFKC-string,
-ucs-normalize-HFS-NFD-region, ucs-normalize-HFS-NFD-string,
-ucs-normalize-HFS-NFC-region, ucs-normalize-HFS-NFC-string.
-
-** Face aliases can now be marked as obsolete, using the macro
-`define-obsolete-face-alias'.
-
-** New function `window-full-height-p', analogous to the full-width version.
-
-\f
-* Changes in Emacs 23.2 on non-free operating systems
-
-** On MS-Windows, `display-time' now displays the system load average
-as well as the time, as it does on GNU and Unix.
-
-\f
-* Installation Changes in Emacs 23.1
-
-** The default X toolkit is now Gtk+, rather than Lucid.
-The configure option `--with-gtk' has been removed. Gtk is now the
-default toolkit, but you can use --with-x-toolkit=gtk if necessary.
-
-** New font code.
-Fonts are handled by new code capable of dealing with multiple font
-backends. This uses the freetype and fontconfig libraries.
-
-*** Emacs now accepts font names supplied in the fontconfig format
-(e.g. "monospace-12:bold") and GTK format (e.g. "Monospace Bold 12").
-
-*** Added support for local fonts (fonts installed on the machine
-where Emacs is running).
-
-*** Added support for the Xft library for antialiasing.
-
-*** Added support for the otf library for complex text layout by
-OpenType fonts.
-
-*** Added support for the m17n library for text shaping.
-
-** Changes to image support
-
-*** configure now checks for libgif before libungif when searching for
-a GIF library.
-
-*** Emacs now supports the SVG image format through librsvg2.
-
-*** Emacs now supports multi-page TIFF images.
-
-** New NeXTSTEP-based port.
-This provides support for GNUstep (via the GNUstep libraries) and Mac
-OS X (via the Cocoa libraries).
-
-Specify --with-ns to configure for this. By default, a self-contained
-app will be built (containing all lisp). To install/share lisp with
-other emacsen (e.g. X11 build) use --disable-ns-self-contained. See
-nextstep/README and nextstep/INSTALL in the Emacs source directory.
-
-** Mac OS X is no longer supported via Carbon.
-Use the NeXTSTEP port, described above.
-
-** The new configuration option "--with-dbus" enables D-Bus language
-bindings for Emacs.
-
-** Support for many obsolete platforms has been removed.
-See the list at the end of etc/MACHINES for details.
-
-*** Support for systems without alloca has been removed.
-
-*** Support for Sun windows has been removed.
-
-*** The `emacstool' utility has been removed.
-
-** The following platforms will be removed in a future Emacs version:
-If you are still using Emacs on one of these platforms, please email
-emacs-devel@gnu.org to inform the Emacs developers.
-
-*** Old GNU/Linux systems based on libc version 5.
-
-*** Old FreeBSD, NetBSD, and OpenBSD systems based on the COFF
-executable format.
-
-*** Solaris versions 2.6 and below.
-
-*** Solaris on IBM RS6000 machines.
-
-*** UNIX System V (the original SysV, not later platforms based on it).
-
-*** Unixware on non-x86 machines.
-
-*** Platforms not supporting shared libraries (i.e., requiring the
-NO_SHARED_LIBS compilation flag).
-
-** The configure options `--with-gcc', `--without-gcc' have been removed.
-Configure will use gcc by default. Set the CC environment variable if
-you need control over which C compiler is used.
-
-** The refcards are now shipped as PDF files.
-
-** The manuals are now licensed under the GNU Free Documentation License v1.3,
-or any later version.
-
-** Emacs 23 comes with a new set of default icons.
-Various resolutions are available as etc/images/icons/hicolor/*/apps/emacs.png.
-The Emacs 22 icon is available as `emacs22.png' in the same location.
-\f
-* Changes in Emacs 23.1
-
-** Improved X Window System support
-
-*** Emacs now supports using both X displays and ttys in one session.
-With an Emacs server active (M-x server-start), `emacsclient -t'
-creates a tty frame connected to the running emacs server. You can
-use any number of different ttys. `emacsclient -c' creates a new X11
-frame on the current $DISPLAY (or a tty frame if $DISPLAY is not set).
-There may be problems if a display exits unexpectedly and Emacs is compiled
-with Gtk+, see etc/PROBLEMS.
-
-You can test for the presence of this feature in your Lisp code by
-testing for the `multi-tty' feature.
-
-*** Emacs starts in the background, as a daemon, when given the
---daemon command line argument. It disconnects from the terminal and
-starts the server. Clients can connect and create graphical or
-terminal frames using emacsclient.
-
-**** emacsclient starts emacs in daemon mode and connects to it when
---alternate-editor="" is used (or when the evironment variable
-ALTERNATE_EDITOR is set to "") and emacsclient cannot connect to an
-emacs server.
-
-*** The new command close-display-connection closes a connection to a
-remote display. There are some bugs for Gtk+. See etc/PROBLEMS.
-
-*** Emacs now supports the XEmbed specification.
-You can embed Emacs in another application on X11. The new command line
-option --parent-id is used to pass the parent window id to Emacs. See
-http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
-for details about XEmbed.
-
-*** Emacs can now set the frame opacity.
-The opacity of a frame can be controlled by setting the `alpha' frame
-parameter. This only takes effect on a compositing window manager for
-the X Window System, such as Compiz, Beryl and Compiz Fusion, on Mac
-OS X, or on Windows 2000 and later versions of Windows.
-
-The alpha parameter should be an integer between 0 (transparent) and
-100 (opaque), or a float number between 0.0 and 1.0. It can also be a
-cons cell (ACTIVE . INACTIVE), where ACTIVE is the opacity of an
-active frame and INACTIVE is the opacity of non-active frames.
-
-The variable `frame-alpha-lower-limit' defines a lower bound for the
-opacity; the default is 20.
-
-** Internationalization changes
-
-*** The Emacs character set is now a superset of Unicode.
-(It has about four times the code space, which should be plenty).
-
-The internal encoding used for buffers and strings is now
-Unicode-based and called `utf-8-emacs' (`emacs-internal' is an alias
-for this). This encoding is backward-compatible with Unicode's UTF-8
-encoding. The internal encoding previously used by Emacs,
-`emacs-mule', is still available for reading and writing files.
-
-During byte-compilation, Emacs 23 uses `utf-8-emacs' to write files.
-As a result, byte-compiled files containing non-ASCII characters can't
-be read by earlier versions of Emacs. Files compiled by Emacs 20, 21,
-or 22 are loaded correctly as `emacs-mule' (whether or not they
-contain multibyte characters). This takes somewhat more time, so it
-may be worth recompiling existing .elc files which don't need to be
-shared with older Emacsen.
-
-*** There are new coding systems/aliases; see M-x list-coding-systems.
-
-*** There is a new charset implementation with many new charsets.
-See M-x list-character-sets. New charsets can be defined conveniently
-as tables of unicodes.
-
-*** There are new language environments for Chinese-GBK,
-Chinese-GB18030, Khmer, Bengali, Punjabi, Gujarati, Oriya, Telugu,
-Sinhala, and TaiViet.
-
-*** The minor modes unify-8859-on-encoding-mode and
-unify-8859-on-decoding-mode are obsolete.
-
-*** `ucs-insert' is bound to `C-x 8 RET' and in addition to hex numbers
-accepts numbers in hash notation (e.g. #o21430 for octal, or #10r8984 for
-decimal). It also accepts Unicode character names with completion.
-
-*** The `cyrillic-translit' input method supports many new characters.
-Common typographical characters available from Unicode were added to
-`cyrillic-translit': punctuation marks, accented characters, fractions,
-and others.
-
-** Emacs now supports serial port access on GNU/Linux, Unix, and
-Windows. The new command `serial-term' starts an interactive terminal
-on a serial port. The serial port can be configured at runtime with
-the mode-line mouse menu.
-
-** Menu Bar changes
-
-*** In the Options menu, the "Set Default Font" item applies the
-selected font to the `default' face on all frames, not just the
-current frame. Furthermore, if Emacs is compiled with both GTK and
-Fontconfig support, the "Set Default Font" item uses the GTK font
-selection dialog instead of an Emacs pop-up menu.
-
-*** The font setting chosen by "Set Default Font" is saved if the
-"Save Options" item is used.
-
-*** The Tools menu contains a new Encryption/Decryption submenu.
-This contains commands provided by EasyPG, the newly-included
-interface to GnuPG (see New Modes and Packages).
-
-*** In the Options menu, the "Truncate Long Lines in the Buffer" entry
-has been replaced with a submenu offering three different ways to
-handle long lines: truncation, continuation at the window edge, and
-the new word wrapping behavior (see Editing Changes, below).
-
-*** Improvements to menus for major and minor modes
-More major and minor modes now have a mode specific menu, and existing
-mode menus have been improved to include more functionality.
-
-** Mode-line changes
-
-*** The mode-line displays a `@', instead of `-', if the
-default-directory for the current buffer is on a remote machine.
-
-*** The mode-line displays a mode menu when mouse-1 is clicked on a
-minor mode, in the same way as it already did for major modes.
-
-*** The `mode-line-emphasis' face is used to highlight certain
-mode-line information (e.g. waiting for a VC command to finish).
-
-*** The mode-line tooltips have been improved to provide more details.
-
-*** The VC, line/colum number and minor mode indicators on the mode
-line are now interactive: mouse-1 can be used on them to pop up a menu.
-
-** File deletion can make use of the Recycle Bin or system Trash folder.
-Set `delete-by-moving-to-trash' non-nil to use this. Deleted files
-and directories will then be sent to the Recycle Bin on Windows, and
-to `trash-directory' on other systems.
-
-** Directory-local variables can now be defined.
-By default, Emacs looks in .dir-locals.el for directory-local
-variables. For more information, see `dir-locals-set-directory-class'
-and `dir-locals-set-class-variables'.
-
-** Emacs can now use `auth-source' for authentication.
-`smtpmail' and `url' (Tramp and Gnus also) use `auth-source' to obtain
-login names and passwords. The match, if found, is reported
-in *Messages* with the password blanked out.
-
-** `where-is-preferred-modifier' can specify your favorite modifier.
-
-\f
-* Startup Changes in Emacs 23.1
-
-** The option `inhibit-startup-screen' (with aliases to old names
-`inhibit-splash-screen' and `inhibit-startup-message') doesn't inhibit
-display of the initial message in the *scratch* buffer. If you don't
-want to display the initial message in the *scratch* buffer at startup,
-you can set the option `initial-scratch-message' to nil.
-
-** New user option `initial-buffer-choice' specifies what to display
-after starting Emacs: startup screen, *scratch* buffer, visiting a
-file or directory.
-
-** New alias `argv' for `command-line-args-left'
-This is a convenience alias, so that one can write `(pop argv)'
-inside of --eval command line arguments in order to access
-following arguments.
-
-** The abbrev file is no longer read at startup in batch mode.
-
-** Emacs now supports invocation by an X session manager.
-It can save a session and restore it later. See the documentation of
-the functions `emacs-session-save' and `emacs-session-restore'.
-(Actually, this feature was introduced with Emacs 22, but it was not
-documented.)
-\f
-* Incompatible Editing Changes in Emacs 23.1
-
-** In Dired, `dired-flag-garbage-files' is rebound from `&' to `%&'
-on the regexp command prefix map.
-
-** In Dired-x, all command guesses for ! are now added to the default
-list accessible by M-n instead of pushing all guesses temporarily into
-the history list.
-
-** In Isearch mode, a special case of typing `C-w' at the beginning of
-the minibuffer that toggles word search (i.e. using key sequences
-`C-s RET C-w' or `C-s M-e C-w') is obsolete. You can use the global key
-`M-s w' to start word search, or type `M-s w' in Isearch mode to
-toggle word search. To start nonincremental word search you can now use
-`M-s w RET' and `M-s w C-r RET' instead of `C-s RET C-w' and `C-r RET C-w'.
-
-** In Info, `Info-search' is unbound from `M-s' to allow using `M-s w'
-for word search as well as other search commands from the global prefix
-key `M-s'. `Info-search' is still bound to `s', and also incremental
-search commands `C-s', `C-M-s', `C-r', `C-M-r' are available for searching
-through multiple Info nodes, together with their nonincremental versions
-`C-s RET', `C-r RET', `C-M-s RET', `C-M-r RET', `M-s w RET'.
-
-** In Text mode, `center-line' and `center-paragraph' are rebound from
-`M-s' and `M-S' to global keys `M-o M-s' and `M-o M-S' on the global
-prefix map `M-o', which is intended for such formatting commands.
-
-** The following input methods were removed in Emacs 22.2, but this was
-not advertised: danish-alt-postfix, esperanto-alt-postfix,
-finnish-alt-postfix, german-alt-postfix, icelandic-alt-postfix,
-norwegian-alt-postfix, scandinavian-alt-postfix, spanish-alt-postfix,
-and swedish-alt-postfix. Use the versions without "alt-", which are
-identical.
-
-\f
-* Editing Changes in Emacs 23.1
-
-** The C-n and C-p line-motion commands now move by screen lines,
-taking continued lines and variable-width characters into account.
-Setting `line-move-visual' to nil reverts this to the previous
-behavior (i.e., motion by logical lines based on buffer contents
-alone).
-
-** C-x C-c now invokes `save-buffers-kill-terminal', and C-z now
-invokes `suspend-frame'. These changes are for compatibility with the
-new multi-tty support (see `Improved X Window System support' above).
-
-** Mark changes
-
-*** Transient Mark mode is now on by default.
-
-*** mark-even-if-inactive now defaults to t
-
-*** When Transient Mark mode is on, C-SPC C-SPC pushes a mark without
-activating it.
-
-*** When Transient Mark mode is on, M-q now fills the region if the
-region is active. Otherwise, it fills the current paragraph.
-
-*** When Transient Mark mode is on, M-$ now checks spelling of the
-region if the region is active. Otherwise, it checks spelling of the
-word at point.
-
-*** When Transient Mark mode is on, TAB now indents the region if the
-region is active.
-
-*** The variable `use-empty-active-region' controls whether an empty
-active region in Transient Mark mode should make commands operate on
-that empty region.
-
-** Temporarily active regions
-
-*** The new variable shift-select-mode, non-nil by default, controls
-shift-selection. When Shift Select mode is on, shift-translated
-motion keys (e.g. S-left and S-down) activate and extend a temporary
-region, similar to mouse-selection.
-
-*** Temporarily active regions, created using shift-selection or
-mouse-selection, are not necessarily deactivated in the next command.
-They are only deactivated after point motion commands that are not
-shift-translated, or after commands that would ordinarily deactivate
-the mark in Transient Mark mode (e.g., any command that modifies the
-buffer).
-
-** Minibuffer and completion changes
-
-*** Emacs may ask for confirmation before opening a non-existent file
-or buffer. By default, Emacs requests confirmation if you type RET
-immediately after TAB, and the resulting input is not an existing file
-or buffer; this usually happens when the minibuffer input did not
-complete far enough and you entered RET by mistake. In that case,
-Emacs puts the message "[Confirm]" in the minibuffer; type RET again
-to create the file or buffer.
-
-The new variable confirm-nonexistent-file-or-buffer determines whether
-Emacs asks for confirmation. The default value is `after-completion'.
-If you change it to t, Emacs always asks for confirmation; if you
-change it to nil, Emacs never asks for confirmation.
-
-*** The rules for performing completion have been changed.
-When generating completion alternatives, Emacs now takes the
-minibuffer text after point, if any, into account: this text is
-treated as a substring of the remaining part of the completion
-alternative (i.e., the part not matched by the minibuffer text before
-point). If no completion alternatives are found this way, Emacs
-attempts to perform partial-completion. If still no completion
-alternatives are found, we fall back on the Emacs 22 rules for
-performing completion.
-
-The new variable `completion-styles' can be customized to choose your
-favorite completion style.
-
-*** When M-n in the minibuffer reaches the end of the list of defaults,
-it adds the completion list to the end, so next M-n continues putting
-completion items to the minibuffer. The same principle applies to
-incremental search commands as well: C-s or C-M-s starts searching
-the default values and after the end of defaults they continue
-searching minibuffer completion items.
-
-*** Minibuffer input of shell commands now comes with completion.
-
-*** In the `C-x d' (Dired) prompt, typing M-n gives the visited file
-name of the current buffer.
-
-*** In the M-! (shell-command) prompt, M-n provides some default commands.
-These are guessed using the file extension of the current file, based
-on the file-handlers specified in the operating system's `mailcap'
-file. The ! command in Dired (dired-do-shell-command) works
-similarly, using the file displayed on the current line.
-
-*** A list of regexp default values is available via M-n for `occur',
-`keep-lines', `flush-lines' and `how-many'. This list includes the active
-region in transient-mark-mode, the word under the cursor, the last Isearch
-regexp, the last Isearch string and the last replacement regexp.
-
-*** When enable-recursive-minibuffers is non-nil, operations which use
-switch-to-buffer (such as C-x b and C-x C-f) do not fail any more when
-used in a minibuffer or a dedicated window. Instead, they fallback on
-using pop-to-buffer, which will use some other window. This change
-has no effect when enable-recursive-minibuffers is nil (the default).
-
-*** Isearch started in the minibuffer searches in the minibuffer history.
-Reverse Isearch commands (C-r, C-M-r) search in previous minibuffer
-history elements, and forward Isearch commands (C-s, C-M-s) search in
-next history elements. When the reverse search reaches the first history
-element, it wraps to the last history element, and the forward search
-wraps to the first history element. When the search is terminated, the
-history element containing the search string becomes the current.
-
-*** The variable read-file-name-completion-ignore-case overrides
-completion-ignore-case for file name completion.
-
-*** The variable read-buffer-completion-ignore-case overrides
-completion-ignore-case for buffer name completion.
-
-*** The new command `minibuffer-force-complete' chooses one of the
-possible completions, rather than stopping at the common prefix.
-
-*** If `completion-auto-help' is `lazy', Emacs shows the completions
-buffer only on the second attempt to complete. This was already
-supported in `partial-completion-mode'.
-
-** Face changes
-
-*** S-down-mouse-1 now pops up a menu for changing the font and text
-size of the default face in the current buffer. The face is changed
-via face remapping (see Lisp changes, below).
-
-*** New commands to change the default face size in the current buffer.
-To increase it, type `C-x C-+' or `C-x C-='. To decrease it, type
-`C-x C--'. To restore the default (global) face size, type `C-x C-0'.
-These work via Text Scale mode, a new minor mode.
-
-The final key in the above commands may be repeated without the
-leading `C-x', e.g. `C-x C-= C-= C-=' increases the face height by
-three steps. Each step scales the height of the default face by the
-value of the variable `text-scale-mode-step'.
-
-*** The commands buffer-face-mode and buffer-face-set can be used to
-remap the default face in the current buffer. See "Buffer Face mode",
-under New Modes and Packages.
-
-** Primary selection changes
-
-*** You can disable kill ring commands from accessing the primary
-selection by setting `x-select-enable-primary' to nil.
-
-** Continuation lines can now be wrapped at word boundaries
-(word-wrapping). This is controlled by the new per-buffer variable
-`word-wrap'. Word wrapping does not take place if continuation lines
-are not shown, e.g. if truncate-lines is non-nil. The most convenient
-way to enable word-wrapping is using the new minor mode Visual Line
-mode; in addition to setting `word-wrap' to t, this rebinds some
-editing commands to work on screen lines rather than text lines. See
-New Modes and Packages, below.
-
-** Window management changes
-
-*** truncate-partial-width-windows now accepts integer values, which
-specify a minimum window width for partial-width windows, below which
-lines are truncated. The default has been changed to 50.
-
-*** The new command balance-windows-area balances windows both
-vertically and horizontally.
-
-*** pop-to-buffer now always sets input focus when the popped-to window
-is on a different frame.
-
-** Miscellaneous changes:
-
-*** C-l is bound to the new command recenter-top-bottom, rather than recenter.
-This moves the current line to window center, top and bottom on
-successive invocations.
-
-*** scroll-preserve-screen-position also preserves the column position.
-
-*** If `yank-pop-change-selection' is t, rotating the kill ring also
-updates the selection or clipboard to the current yank, just as M-w
-would do so with the text it copies to the kill ring.
-
-*** C-M-% now shows replacement as it would look in the buffer, with
-`\N' and `\&' substituted according to the match. Old behavior can be
-restored by customizing `query-replace-show-replacement'.
-
-*** The command shell prompts for the default directory, when it is
-called with a prefix and the default directory is a remote file name.
-This is because some file name handlers (like ange-ftp) are not able to
-run processes remotely.
-
-*** The new command kill-matching-buffers kills buffers whose name
-matches a regexp.
-
-*** The value of comment-style now defaults to `indent'.
-Thefore, comment-start markers are inserted at the current indentation
-of the region to comment, rather than the leftmost column.
-
-*** The new commands `pp-macroexpand-expression' and
-`pp-macroexpand-last-sexp' pretty-print macro expansions.
-
-*** The new command `set-file-modes' allows to set file's mode bits.
-The mode bits can be specified in symbolic notation, like with GNU
-Coreutils, in addition to an octal number. `chmod' is a new
-convenience alias for this function.
-
-*** `next-error-recenter' specifies how next-error should recenter the
-visited source file. Its value can be a number (for example, 0 for
-top line, -1 for bottom line), or nil for no recentering.
-
-*** When typing in a password in the echo area, C-y yanks the current
-kill into the password.
-
-*** Tooltip frame parameters `font' and `color' in `tooltip-frame-parameters'
-are ignored. Customize the `tooltip' face instead.
-
-*** `mkdir' is a new convenience alias for `make-directory'.
-\f
-* New Modes and Packages in Emacs 23.1
-
-** Auto Composition Mode is a minor mode that composes characters
-automatically when they are displayed. It is globally on by default.
-It uses `auto-composition-function' (default `auto-compose-chars').
-
-** Bubbles, a new game, is similar to SameGame.
-
-** Buffer Face mode is a minor mode for remapping the default face in
-the current buffer. The variable `buffer-face-mode-face' specifies
-the face to remap to. The command `buffer-face-set' prompts for a
-face name, sets `buffer-face-mode-face' to it, and enables
-buffer-face-mode. See "Face changes", under Editing Changes, for a
-description of face remapping.
-
-** butterfly flips the desired bit on the drive platter.
-See http://xkcd.com/378/
-
-** bug-reference.el provides clickable links to bug reports.
-
-** dbus.el provides D-Bus language bindings.
-D-Bus is an inter-process communication mechanism for applications
-residing on the same host. See the manual for details.
-
-** DocView mode allows viewing of PDF, PostScript and DVI documents.
-One can also search for a regular expression in the document. For
-details, see the commentary in doc-view.el.
-
-PDF and DVI files are now opened in Doc View mode by default.
-
-In Postcript mode, C-c C-c launches Doc View minor mode for viewing
-the postscript file.
-
-** EasyPG provides an interface to the GNU Privacy Guard (GnuPG).
-It includes a GnuPG keyring browser, cryptographic operations on
-regions and files, and automatic encryption of *.gpg files. For
-details, see the EasyPG Assistant User's Manual.
-
-** json.el is a library for parsing and generating JSON
-(JavaScript Object Notation), a lightweight data-interchange format.
-
-** linum.el is a new minor mode to display line numbers for the
-current buffer.
-
-** mairix.el is an interface to mairix, a free tool for indexing and
-searching locally stored mail. It allows you to query mairix and
-display the search results with Rmail, Gnus and VM. Note that there
-is an existing Gnus back end, nnmairix.el, which should be used with
-Maildir/MH setups.
-
-** minibuffer-depth-indicate-mode shows the minibuffer depth in the prompt.
-
-** nXML Mode
-This is a new mode for editing XML documents. It allows a schema to
-be associated with the XML document being edited, using Relax NG as
-the schema language. The schema is used to provide two key features:
-
-*** Continuous validation. nXML validates as you type, highlighting
-any invalid parts of your document.
-
-*** Completion. nXML can assist you in entering an element name,
-attribute name or data value by using information about what is
-allowed by the schema in that context.
-
-** proced.el provides a Dired-like interface for operating on
-processes. Proced makes an Emacs buffer containing a listing of the
-current processes. You can use the normal Emacs commands to move
-around in this buffer, and special Proced commands to operate on the
-processes listed. It is currently only functional on GNU/Linux,
-MS-Windows and Solaris.
-
-** Remember Mode is a mode for jotting down things to remember.
-Notes can be saved to a Diary file. For details, see the Remember
-Manual.
-
-** RST mode is a major mode for editing reStructuredText files.
-
-** Ruby mode is a major mode for Ruby files.
-
-** Visual Line mode provides support for editing by visual lines.
-It turns on word-wrapping in the current buffer, and rebinds C-a, C-e,
-and C-k to commands that operate by visual lines instead of logical
-lines. This is a more reliable replacement for longlines-mode.
-This can also be turned on using the menu bar, via
-Options -> Line Wrapping in this Buffer -> Word Wrap
-
-** xesam.el is an implementation of Xesam, an interface to (desktop)
-search engines like Beagle, Strigi, and Tracker. The Xesam API
-requires D-Bus for communication.
-
-** zeroconf.el offers service discovery and service publishing
-interfaces according to the zeroconf specification. It communicates
-with Avahi, a zeroconf implementation, via D-Bus messages on systems
-which have installed this software.
-
-** There is a new `whitespace' package.
-(The pre-existing one has been renamed to `old-whitespace'.)
-Now, besides reporting bogus blanks, the whitespace package has a
-minor mode and a global minor mode to visualize blanks (TAB, (HARD)
-SPACE and NEWLINE). The visualization is made via faces and/or display
-table. It can also indicate lines that extend beyond a given column,
-trailing blanks, and empty lines at the start or end of a buffer.
-See `whitespace-style' for more details. The `whitespace-action' option
-specifies what to do when a buffer is visited, killed, or written.
-
-\f
-* Changes in Specialized Modes and Packages in Emacs 23.1
-
-** Abbrev has been rewritten in Elisp and extended with more flexibility.
-
-*** New functions: abbrev-get, abbrev-put, abbrev-table-get, abbrev-table-put,
-abbrev-table-p, abbrev-insert, abbrev-table-menu.
-
-*** Special hook `abbrev-expand-functions' obsoletes `pre-abbrev-expand-hook'.
-
-*** `make-abbrev-table', `define-abbrev', `define-abbrev-table' all take
-extra arguments for arbitrary properties.
-
-*** New variable `abbrev-minor-mode-table-alist'.
-
-*** `local-abbrev-table' can hold a list of abbrev-tables.
-
-*** Abbrevs have now the following special properties:
-`:count', `:system', `:enable-function', `:case-fixed'.
-
-*** Abbrev-tables have now the following special properties:
-`:parents', `:case-fixed', `:enable-function', `:regexp',
-`abbrev-table-modiff'.
-
-** Apropos
-
-*** `apropos-library' describes the elements defined in a given library.
-
-*** Set `apropos-compact-layout' is you want a more compact (but wider) layout.
-
-** Archive Mode has basic support to browse Rar archives.
-Note, however, that the free version of the unrar command only handles
-versions 1 and 2 of the Rar format.
-
-** BibTeX mode
-
-*** New command `bibtex-initialize' (re)initializes BibTeX buffers.
-
-*** New `bibtex-entry-format' options `whitespace', `braces', and
-`string', disabled by default.
-
-*** New variable `bibtex-cite-matcher-alist' contains rules to
-identify cited keys in BibTeX entries, used by `bibtex-find-crossref'.
-
-*** Command `bibtex-url' allows multiple URLs per entry.
-
-** Bookmarks
-
-*** bookmark.el saves bookmarks in a pre-Emacs-23-incompatible file format
-bookmark.el can read a .emacs.bmk file saved by an older Emacs, but an
-older Emacs cannot read one saved by Emacs 23.
-
-** Calendar and diary
-
-*** There is a new date style, `iso', essentially year/month/day.
-The variable `european-calendar-style' is obsolete - use `calendar-date-style'.
-Similarly, the commands `american-calendar' and `european-calendar'
-should be replaced by `calendar-set-date-style'.
-
-*** The calendar namespace has been rationalized.
-All functions and variables now begin with a `calendar-', `diary-', or
-`holiday-' prefix. The various calendar systems have secondary
-prefixes, eg `calendar-french-'. The old names you are likely to use
-directly still exist, for the time being, as aliases, but please start
-using the new names.
-
-*** The whitespace in the calendar layout can be customized.
-See the variables:
-calendar-left-margin, calendar-intermonth-spacing, calendar-column-width,
-calendar-day-header-width, and calendar-day-digit-width.
-
-*** Text (e.g. ISO weeks) can be displayed between the calendar months.
-See the variables calendar-intermonth-header and calendar-intermonth-text.
-
-*** The function `holiday-chinese' computes holidays on the Chinese calendar.
-It has been used to add items to the list `holiday-oriental-holidays'.
-
-*** `diary-remind' accepts a negative number -DAYS as a shorthand for
-the list (1 2 ... DAYS).
-
-** Change Log mode
-
-*** The new command C-c C-f (change-log-find-file) finds the file
-associated with the current log entry.
-
-*** The new command C-c C-c (change-log-goto-source) goes to the
-source code associated with a log entry.
-
-** Compile and grep modes
-
-*** The mode-line entry for the *compilation* and *grep* buffer is color coded.
-It has different colors for to show that: (a) the command is still
-running, (b) successful completion, (c) error.
-
-*** compilation-auto-jump-to-first-error tells `compile' to jump to
-the first error encountered during compilations.
-
-*** compilation-scroll-output accepts a new value, `first-error', which
-says to stop auto scrolling at the first error that occurs.
-
-*** The `cc' alias for C++ files in `grep-file-aliases' has been
-improved. `hh' can be used to match C++ header files and `cchh' both
-C++ sources and headers.
-
-** Copyright
-
-*** You can specify your copyright holders' names.
-Only copyright lines with holders matching `copyright-names-regexp' are
-considered for update.
-
-*** Copyrights can be at the end of the buffer.
-This is controlled by `copyright-at-end-flag' (used by, e.g., change-log-mode).
-
-** Custom
-
-*** defcustom accepts new keyword arguments, `:safe' and `:risky', which
-set a variable's `safe-local-variable' and `risky-local-variable' property.
-
-** Diff mode
-
-*** diff-refine-hunk highlights word-level details of changes in a diff hunk.
-It's used automatically as you move through hunks, see
-diff-auto-refine-mode. It is bound to `C-c C-b'.
-
-*** diff-add-change-log-entries-other-window iterates through the diff
-buffer and tries to create ChangeLog entries for each change.
-It is bound to `C-x 4 A'.
-
-*** Turning on `whitespace-mode' in a diff buffer will show trailing
-whitespace problems in the modified lines.
-
-** Dired
-
-*** In Dired, C-x C-q now runs the command wdired-change-to-wdired-mode,
-and C-x C-q in wdired-mode exits it with asking a question about
-saving changes.
-
-*** `&' runs the command `dired-do-async-shell-command' that executes
-the command asynchronously without the need to manually add ampersand
-to the end of the command. Its output appears in the buffer `*Async Shell
-Command*'.
-
-*** `M-s f C-s' and `M-s f M-C-s' run Isearch that matches only at file names.
-When a new user option `dired-isearch-filenames' is t, then even ordinary
-Isearch started with `C-s' and `C-M-s' matches only at file names in the
-Dired buffer. When `dired-isearch-filenames' is `dwim' then activation of
-file name Isearch depends on the position of point - if point is on a file
-name initially, then Isearch matches only file names, otherwise it matches
-everywhere in the Dired buffer. You can toggle file names matching on or
-off by typing `M-s f' in Isearch mode.
-
-*** `M-s a C-s' and `M-s a M-C-s' run multi-file Isearch on the marked files.
-They visit the first marked file in the sequence and display the usual Isearch
-prompt for a string or a regexp where all Isearch commands are available.
-
-*** `Q' in Dired provides two new keys for multi-file replacement.
-The upper case key `Y' replaces all remaining matches in all remaining files
-with no more questions. The upper case key `N' stops doing replacements
-in the current file and skips to the next file. These multi-file keys
-are available for all commands that use `tags-query-replace'
-including `dired-do-query-replace-regexp', `vc-dir-query-replace-regexp',
-`reftex-query-replace-document'.
-
-** Fortran
-
-*** The line length of fixed-form Fortran is not fixed at 72 any more.
-Customize the variable `fortran-line-length' to change it.
-
-*** In Fortran mode, M-; is now bound to the standard comment-dwim,
-rather than fortran-indent-comment.
-
-*** (The increasingly misnamed) F90 mode supports Fortran 2003 syntax.
-
-** Gnus
-
-*** The Gnus package has been updated
-There are many new features, bug fixes and improvements; see the file
-GNUS-NEWS or the node "No Gnus" in the Gnus manual for details.
-
-*** In Emacs 23, Gnus uses Emacs' new internal coding system `utf-8-emacs' for
-saving articles, drafts, and ~/.newsrc.eld. These file may not be read
-correctly in Emacs 22 and below. If you want to Gnus across different Emacs
-versions, you may set `mm-auto-save-coding-system' to `emacs-mule'.
-
-*** Passwords are consistently loaded through `auth-source'
-Gnus can use `auth-source' for POP and IMAP passwords. Also see that
-`smtpmail' and `url' support `auth-source' for SMTP and HTTP/HTTPS/RSS
-authentication respectively.
-
-** Help mode
-
-*** New macro `with-help-window' should set up help windows better
-than `with-output-to-temp-buffer' with `print-help-return-message'.
-
-*** New option `help-window-select' permits to customize whether help
-window shall be automatically selected when invoking help.
-
-*** New variable `help-window-point-marker' permits one to specify a new
-position for point in help window (for example in `view-lossage').
-
-** Isearch
-
-*** New command `isearch-forward-word' bound globally to `M-s w' starts
-incremental word search. New command `isearch-toggle-word' bound to the
-same key `M-s w' in Isearch mode toggles word searching on or off
-while Isearch is active.
-
-*** New command `isearch-highlight-regexp' bound to `M-s h r' in Isearch
-mode runs `highlight-regexp' (`hi-lock-face-buffer') with the current
-search string as its regexp argument. The same key `M-s h r' and
-other keys on the `M-s h' prefix are bound globally to the command
-`highlight-regexp' and other hi-lock commands.
-
-*** New command `isearch-occur' bound to `M-s o' in Isearch mode
-runs `occur' with the current search string. The same key `M-s o'
-is bound globally to the command `occur'.
-
-*** Isearch can now search through multiple ChangeLog files.
-When running Isearch in a ChangeLog file, if the search fails,
-then another C-s tries searching the previous ChangeLog,
-if there is one (e.g. going from ChangeLog to ChangeLog.12).
-This is enabled if multi-isearch-search is non-nil.
-
-*** Two new commands to start Isearch on a list of marked buffers
-for buff-menu.el and ibuffer.el are bound to the keys `M-s a C-s' and
-`M-s a M-C-s'.
-
-*** The part of an Isearch that failed to match is highlighted in
-`isearch-fail' face.
-
-*** `C-h C-h' in Isearch mode displays isearch-specific Help screen,
-`C-h b' displays all Isearch key bindings, `C-h k' displays the full
-documentation of the given Isearch key sequence, `C-h m' displays
-documentation for Isearch mode. All the other Help commands exit
-Isearch mode and execute their global definitions.
-
-*** When started in the minibuffer, Isearch searches in the minibuffer
-history. See `Minibuffer changes', above.
-
-** MH-E
-
-*** Upgraded to MH-E version 8.2. See MH-E-NEWS for details.
-
-** Python
-*** The file etc/emacs.py now supports both Python 2 and 3, meaning
-that either version can be used as inferior Python by python.el.
-
-*** Python mode now has `pdbtrack' functionality. When using pdb to
-debug a Python program, pdbtrack notices the pdb prompt and displays
-the source file and line that the program is stopped at, much the same
-way as gud-mode does for debugging C programs with gdb.
-
-** Recentf
-
-*** The default value of `recentf-keep' prevents from checking of
-remote files, if there is no established connection to the
-corresponding remote host.
-
-** Rmail
-
-*** Rmail no longer converts the messages to Babyl format.
-Instead, it uses UNIX mbox format, both on disk and in Rmail buffers,
-and does conversion and decoding when a message is displayed.
-
-The first time you visit an Rmail file in Babyl format, Rmail
-automatically converts it to mbox format. This is a one-time
-conversion, but it can take a few minutes, depending on how fast is
-your machine and on the size of the file. You should find the rest of
-Rmail usage unaltered.
-
-However, M-x set-rmail-inbox-list now lasts only for one session
-because there is no way to save the list of inbox files in an
-mbox-format file.
-
-Also, whereas with Babyl format M-x find-file would switch to Rmail
-mode, with mbox format this is no longer the case (there being no way
-to add an "-*- rmail-*-" cookie to an mbox file). Use C-u M-x rmail
-instead.
-
-If you have written any extensions to Rmail, they are likely to need
-updating. Conceptually, the Rmail buffer that you see is no longer
-just a narrowed portion of the whole. So you cannot access the whole
-of a message (or message collection) by a simple save-restriction and
-widen. Instead, there are two buffers: the rmail-buffer, and the
-rmail-view-buffer. The former is the buffer that you see, the latter
-is invisible. Most of the time, the invisible `view' buffer contains
-the full contents of the Rmail file, and the Rmail buffer contains a
-decoded copy of the current message (with only a subset of the
-headers). In this state, Rmail is said to be `swapped'.
-
-You may find the following functions useful:
-
-`rmail-get-header' and `rmail-set-header' get or set the value of a
-message header, whether or not it is currently visible.
-
-`rmail-apply-in-message' is a general purpose function that calls a
-function (with arguments) which you specify on the full text of a given
-message. To further narrow to just the headers, search forward for "\n\n".
-
-*** The new command `rmail-mime' displays MIME messages.
-It is bound to `v' in Rmail buffers and summaries. It displays plain
-text and multipart messages in a temporary buffer, and offers buttons
-to save attachments.
-
-*** The command `rmail-redecode-body' no longer accepts the optional arg RAW.
-Since Rmail now holds messages in their original undecoded form in a
-separate buffer, `rmail-redecode-body' no longer encodes the original
-message, and therefore there should be no need to avoid encoding it.
-
-*** The o command is now `rmail-output'. It is an all-purpose command
-for copying messages from Rmail and appending them to files. It
-handles Babyl-format files as well as mbox-format files, and it
-handles both kinds properly when they are visited in Emacs. It always
-copies the full headers of the message.
-
-*** The C-o command is now `rmail-output-as-seen'. It uses
-the message as displayed, appending it to an mbox file.
-
-*** The modified status of the Rmail buffer is reported in the mode-line.
-Previously, this information was hidden.
-
-** TeX modes
-
-*** New option latex-indent-within-escaped-parens
-permits to customize indentation of LaTeX environments delimited
-by escaped parens.
-
-** T-mouse Mode
-
-*** If the gpm mouse server is running and t-mouse-mode is enabled,
-Emacs uses a Unix socket in a GNU/Linux console to talk to server,
-rather than faking events using the client program mev. This C level
-approach provides mouse highlighting and help echoing in the
-minibuffer.
-
-** Tramp
-
-*** New connection methods.
-The new methods "plinkx", "plink2", "psftp", "sftp" and "fish" have
-been introduced. There are also new so-called gateway methods
-"tunnel" and "socks".
-
-*** IPv6 addresses.
-IPv6 addresses are supported now as host names. They must be embedded
-in square brackets, like in "/ssh:[::1]:".
-
-*** Multihop syntax has been removed.
-The pseudo-method "multi" has been removed. Instead, multi hops
-can be specified by the new variable `tramp-default-proxies-alist'.
-
-*** More default settings.
-Default values can be set via the variables `tramp-default-user',
-`tramp-default-user-alist' and `tramp-default-host'.
-
-*** Connection information is cached.
-In order to reduce connection setup, information about used
-connections is kept persistently in a file. The name of this file is
-defined in the variable `tramp-persistency-file-name'.
-
-*** Control of remote processes.
-Running processes on a remote host can be controlled by settings in
-`tramp-remote-path' and `tramp-remote-process-environment'.
-
-*** Success of remote copy is checked.
-When the variable `file-precious-flag' is set, the success of a remote
-file copy is checked via the file's checksum.
-
-*** Passwords can be read from an authentification file.
-Tramp uses the package `auth-source' to read passwords from a file, if
-necessary.
-
-** VC and related modes
-
-*** VC now supports applying VC operations to a set of files at a time.
-This enables VC to work much more effectively with changeset-oriented
-version-control systems such as Subversion, GNU Arch, Mercurial, Git
-and Bzr. VC will now pass a multiple-file commit to these systems as
-a single changeset.
-
-*** vc-dir is a new command that displays file names and their VC
-status. It allows to apply various VC operations to a file, a
-directory or a set of files/directories.
-
-*** VC switches are no longer appended, rather the first non-nil value is used.
-(This was for the most part true in Emacs 22, but was not advertised).
-This is because there is an increasing variety of VC systems, and they
-do not all accept the same "common" options. For example, a CVS diff
-command used to append the values of `vc-cvs-diff-switches',
-`vc-diff-switches', and `diff-switches'. Now the first non-nil value
-from that sequence is used. The special value `t' means "no switches".
-
-*** Clicking on the VC mode-line entry now pops the VC menu.
-
-*** The VC mode-line entry now has a tooltip that explains the VC file status.
-
-*** In VC Annotate mode, the key bindings have changed to use lower
-case keys instead of the upper case keys used in the past.
-
-*** In VC Annotate mode, for VC systems that support changesets, you can
-see the diff for the whole changeset (not only for the current file)
-by typing the D key. Using the "Show changeset diff of revision at
-line" menu entry does the same thing.
-
-*** In VC Annotate mode, you can type v to toggle the annotation visibility.
-
-*** In VC Annotate mode, you can type f to show the file revision on
-the current line.
-
-*** Asynchronous VC commands display [Waiting...] in the mode-line
-of the corresponding buffer as long as the asynchronous process is
-active.
-
-*** Log entries can be modified using the key "e" in log-view.
-For now only CVS, RCS, SCCS and SVN support this functionality.
-This is done by the `modify-change-comment' backend function.
-
-*** In log-view-mode, for VC systems that support changesets, you can
-see the diff for the whole changeset (not only for the current file)
-by typing the D key or using the "Changeset Diff" menu entry.
-
-*** In Log Edit mode, C-c C-d now shows the diff for the files involved.
-
-*** vc-git supports the "git grep" command.
-
-*** VC Support for Meta-CVS has been removed for lack of a maintainer able
-to update it to the new VC.
-
-** Miscellaneous
-
-*** comint-mode uses `start-file-process' now (see Lisp Changes).
-If `default-directory' is a remote file name, subprocesses are started
-on the corresponding remote system.
-
-*** Eldoc highlights the function argument under point
-with the face `eldoc-highlight-function-argument'.
-
-*** In Etags, the --members option is now the default.
-Use --no-members if you want the old default behavior of not tagging
-struct members in C, members variables in C++ and variables in PHP.
-
-*** The `gdb' command only works with the graphical interface now.
-Use `gud-gdb' if you want the (old) text command mode.
-
-*** goto-address.el provides two new minor modes, goto-address-mode and
-goto-address-prog-mode, which buttonize URLS and email addresses.
-
-*** The new command `eshell/info' runs info in an eshell buffer.
-
-*** The new variable `ffap-rfc-directories' specifies a list of local
-directories in which `ffap-rfc' will first search for RFCs.
-
-*** hide-ifdef-mode allows shadowing ifdef-blocks instead of hiding them.
-See option `hide-ifdef-shadow' and function `hide-ifdef-toggle-shadowing'.
-
-*** `icomplete-prospects-height' now supercedes `icomplete-prospects-length'.
-
-*** Info displays breadcrumbs in the header of the page.
-See Info-breadcrumbs-depth to control it.
-
-*** net-utils has an `iwconfig' command, similar to the existing `ifconfig'.
-It is used to configure wireless interfaces.
-
-*** The pcmpl-unix package supports hostname completion for ssh and scp.
-
-*** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
-
-*** smerge-refine highlights word-level details of changes in conflict.
-It's used automatically as you move through conflicts, see
-smerge-auto-refine-mode.
-
-*** talk.el has been extended for multiple tty support.
-
-*** A new command `display-time-world' has been added to the Time
-package. It creates a buffer with an updating time display using
-several time zones.
-
-*** The appearance of superscript and subscript in TeX is more customizable.
-See the documentation of the variables: tex-fontify-script,
-tex-font-script-display, tex-suscript-height-ratio, and
-tex-suscript-height-minimum.
-
-*** view-remove-frame-by-deleting is now by default t
-since users found iconification of view-mode frames distracting.
-
-*** WoMan tries to add locale-specific manual page directories to the
-search path. This can be disabled by setting `woman-locale' to nil.
-
-\f
-* Changes in Emacs 23.1 on non-free operating systems
-
-** Case is now considered significant in completion on MS-Windows.
-The default value of `completion-ignore-case' is now nil on
-MS-Windows, the same as it is for other operating systems. The
-variable doesn't apply to reading a file name -- in that case Emacs
-heeds `read-file-name-completion-ignore-case' instead.
-
-** IPv6 is supported on MS-Windows.
-Emacs now supports IPv6 on Windows XP and later, and earlier versions
-of Windows with third party IPv6 stacks installed. In Emacs 22, IPv6 was
-supported on other platforms, but not on Windows due to using the winsock
-1.1 header file, even though Emacs was linking to the winsock 2 library.
-
-** Busy cursor (hourglass) now displays on MS-Windows.
-When Emacs is busy, an hourglass mouse cursor is displayed on Windows.
-In Emacs 22 only X supported the busy cursor.
-
-** Battery status is available on MS-Windows
-Emacs can now display the battery status in the mode-line when enabled with
-display-battery-mode or from the Options menu. More verbose battery
-information is also available with the command `battery'. In Emacs 22
-battery status was supported only on GNU/Linux and Mac.
-
-** More keys available on MS-Windows.
-Keys normally associated with IMEs, and some exotic keys not normally found
-on standard keyboards have been given names so they can be bound to functions
-inside Emacs. If there are keys on your keyboard that have not been exposed
-to Emacs in the past, try C-h k to see if they are available now.
-
-Emacs can now bind functions to the extra buttons for media player and
-browser control present on some keyboards. These buttons are disabled
-by default, since enabling them prevents their system-wide use when
-Emacs has focus. To enable them, set the variable
-w32-pass-multimedia-buttons to nil. See the doc string of that variable
-for the list of extra keys that are available.
-
-** BDF fonts no longer supported on MS-Windows.
-The font backend was completely rewritten for this release. The focus
-on Windows has been getting acceptable performance and full unicode
-support, including complex script shaping for native Windows fonts. A
-rewrite of the BDF font support has not happened due to lack of time
-and developers. If demand still exists for such a backend even with
-the improved language support for native Windows fonts, future
-development in this direction will most likely be based on the
-freetype library, giving access to a wider range of font formats.
-
-\f
-* Incompatible Lisp Changes in Emacs 23.1
-
-** Variables cannot be both buffer-local and frame-local any more.
-
-** `functionp' returns nil for special forms.
-I.e., it only returns t for objects that can be passed to `funcall'.
-
-** The behavior of map-char-table has changed. It may call the
-specified function with a cons (FROM . TO) as a key if characters in
-that range have the same value.
-
-** Process changes
-
-*** The function `dired-call-process' has been removed.
-
-*** The multibyteness of process filters is now determined by the
-coding-system used for decoding. The functions
-`process-filter-multibyte-p' and `set-process-filter-multibyte' are
-obsolete.
-
-** The variable `byte-compile-warnings' can now be a list starting with `not',
-meaning to disable the specified warnings. The meaning of this list
-may therefore be the reverse of what you expect (of course, this is
-only an issue if you make use of the new `not' syntax). Rather than
-checking/manipulating elements directly, use the new functions
-`byte-compile-warning-enabled-p', `byte-compile-disable-warning', and
-`byte-compile-enable-warning.'
-
-** `mode-name' is no longer guaranteed to be a string.
-Use `(format-mode-line mode-name)' to ensure a string value.
-
-** The function x-font-family-list has been removed.
-Use the new function font-family-list (see Lisp Changes, below).
-
-** Internationalization changes
-
-*** The value of the function `charset-id' is now always 0.
-
-*** The functions `register-char-codings' and `coding-system-spec'
-have been removed.
-
-*** The cpXXX coding systems are now supported automatically.
-The functions cp-...-codepage, which you had to use in Emacs 22 to
-enable support for these coding systems, have been deleted.
-
-*** The following features have been removed. They were used for
-displaying various scripts with specific fonts, and are no longer
-needed now that OpenType font support is available:
-
-**** `devanagari' and `devan-util', and all associated devanagari-* and
-dev-* functions and variables (formerly used for Devanagari script).
-
-**** `kannada' and `knd-util', and all associated kannada-* and knd-*
-functions and variables (formerly used for Kannada script).
-
-**** `malayalam' and `mlm-util', and all associated malayalam-* and
-mlm-* functions and variables (formerly used for Malayalam script).
-
-**** `tamil' and `tml-util, and all associated tamil-* and tml-*
-functions and variables (formerly used for Tamil script).
-
-*** The meaning of NAME argument of `set-fontset-font' is changed.
-Previously nil is accepted as the default fontset. Now, nil is for
-the fontset of the selected frame and t is for the default fontset.
-
-*** The meaning of FONTSET argument of `print-fontset' is changed.
-Now, nil is for the fontset of the selected frame and t is for the
-default fontset.
-
-** If a function in write-region-annotate-functions returns with a
-different buffer current, Emacs no longer kills that buffer
-automatically. This behavior existed in previous versions of Emacs,
-but was undocumented. To kill a buffer after write-region, give the
-variable `write-region-post-annotation-function' a buffer-local value
-of `kill-buffer'.
-
-** The variable temp-file-name-pattern has been removed.
-This variable was only used by call-process-region, which now uses
-temporary-file-directory instead.
-
-** The COUNT and SYSTEM-FLAG arguments to define-abbrev have been
-removed. The function now takes extra arguments for specifying
-arbitrary abbrev properties.
-
-** end-of-defun-function is now guaranteed to work only when called
-from the start of a defun. It must now leave point exactly at the end
-of defun, since `end-of-defun' now itself moves forward over
-whitespace after calling it.
-
-\f
-* Lisp Changes in Emacs 23.1
-
-** The new variable `generate-autoload-cookie' controls the magic comment
-string used by `update-file-autoloads' to find autoloaded forms. The
-variable `generated-autoload-file' similarly controls the name of the
-file where `update-file-autoloads' writes the calls to `autoload'.
-The default values are ";;;###autoload" and `loaddefs.el',
-respectively.
-
-** New primitives `list-system-processes' and `process-attributes'
-let Lisp programs access the processes that are running on the local
-machine. See the doc strings of these functions for more details.
-Not all platforms support accessing this information; on those that
-don't, these primitives will return nil.
-
-** New variable `user-emacs-directory'.
-Use this instead of "~/.emacs.d".
-
-** If a local hook function has a non-nil `permanent-local-hook'
-property, `kill-all-local-variables' does not remove it from the local
-value of the hook variable; it remains even if you change major modes.
-
-** `frame-inherited-parameters' lets new frames inherit parameters from
-the selected frame.
-
-** New keymap `input-decode-map' overrides like key-translation-map, but
-applies before function-key-map. Also it is terminal-local contrary to
-key-translation-map. Terminal-specific key-sequences are generally added to
-this map rather than to function-key-map now.
-
-** `ignore-errors' is now a standard macro (does not require the CL package).
-
-** `interprogram-paste-function' can now return one string or a list
-of strings. In the latter case, Emacs puts the second and following
-strings on the kill ring.
-
-** In `condition-case', a handler can specify "let the debugger run first".
-You do this by writing `debug' in the list of conditions to be handled,
-like this:
-
- (condition-case nil
- (foo bar)
- ((debug error) nil))
-
-** clone-indirect-buffer now runs the clone-indirect-buffer-hook.
-
-** `beginning-of-defun-function' now takes one argument, the count given to
-`beginning-of-defun'. (N.B. `end-of-defun-function' doesn't take any
-arguments.)
-
-** `file-remote-p' has new optional parameters IDENTIFICATION and CONNECTED.
-IDENTIFICATION specifies which part of the remote identifier has to be
-returned. With CONNECTED passed non-nil, it is checked whether a
-remote connection has been established already.
-
-** The new macro `declare-function' suppresses compiler warnings about
-undefined functions.
-
-** Changes to interactive function handling
-
-*** The new interactive spec code ^ says to first call
-handle-shift-selection if shift-select-mode is non-nil, before reading
-the command arguments. This is used for shift-selection (see above).
-
-*** Built-in functions can now have an interactive specification that
-is not a prompt string. If the `intspec' parameter of a `DEFUN'
-starts with a `(', the string is evaluated as a Lisp form.
-
-*** The interactive-form of a function can be added post-facto via the
-`interactive-form' symbol property. Mostly useful to add complex
-interactive forms to subroutines.
-
-** Region changes
-
-*** Commands should use `use-region-p' to test whether there is
-an active region that they should operate on.
-
-*** `region-active-p' returns non-nil when Transient Mark mode is
-enabled and the mark is active. Most commands that act specially on
-the active region in Transient Mark mode should use `use-region-p'
-instead of `region-active-p', because `use-region-p' obeys the new
-user option `use-empty-active-region' (see Editing Changes, above).
-
-*** If a command sets `transient-mark-mode' to (only . OLDVAL), that
-means to activate transient-mark-mode temporarily, until the next
-unshifted point motion command or mark deactivation. Afterwards,
-reset transient-mark-mode to the value OLDVAL. The values `only' and
-`identity', introduced in Emacs 22, are now deprecated.
-
-** Emacs session information
-
-*** The new variables `before-init-time' and `after-init-time' record the
-value of `current-time' before and after Emacs loads the init files.
-
-*** The new function `emacs-uptime' returns the uptime of an Emacs instance.
-
-*** The new function `emacs-init-time' returns the duration of the
-Emacs initialization.
-
-** Changes affecting display-buffer
-
-*** display-buffer tries to be smarter when splitting windows.
-The new option split-window-preferred-function lets you specify your own
-function to pop up new windows. Its default value split-window-sensibly
-can split a window either vertically or horizontally, whichever seems
-more suitable in the current configuration. You can tune the behavior
-of split-window-sensibly by customizing split-height-threshold and the
-new option split-width-threshold. Both options now take the value nil
-to inhibit splitting in one direction. Setting split-width-threshold to
-nil inhibits horizontal splitting and gets you the behavior of Emacs 22
-in this respect. In any case, display-buffer may now split the largest
-window vertically even when it is not as wide as the containing frame.
-
-*** If pop-up-frames has the value `graphic-only', display-buffer only
-makes a separate frame on graphic displays.
-
-*** select-frame and set-frame-selected-window have a new optional
-argument NORECORD. If non-nil, this will avoid messing with the order
-of recently selected windows and the buffer list.
-
-** Window parameters can now be defined.
-These are analogous to frame parameters, but are associated with
-individual windows.
-
-*** The new functions window-parameters, window-parameter, and
-set-window-parameter are used to query and set window parameters.
-
-** Minibuffer and completion changes
-
-*** A list of default values can be specified for the DEFAULT argument of
-functions `read-from-minibuffer', `read-string', `read-command',
-`read-variable', `read-buffer', `completing-read'. Elements of this list
-are available for inserting into the minibuffer by typing `M-n'.
-For empty input these functions return the first element of this list.
-
-*** New function `read-regexp' uses the regexp history and some useful
-regexp defaults (string at point, last Isearch/replacement regexp/string)
-via M-n when reading a regexp in the minibuffer.
-
-*** minibuffer-local-must-match-filename-map is now named
-minibuffer-local-filename-must-match-map.
-
-*** The `require-match' argument to `completing-read' accepts the new
-values `confirm-only' and `confirm-after-completion'.
-
-** Search and replacement changes
-
-*** The regexp form \(?<num>:<regexp>\) specifies the group number explicitly.
-
-*** New function `match-substitute-replacement' returns the result of
-`replace-match' without actually using it in the buffer.
-
-*** The new variable `replace-search-function' determines the function
-to use for searching in query-replace and replace-string. The
-function it specifies is called by `perform-replace' when its 4th
-argument is nil.
-
-*** The new variable `replace-re-search-function' determines the
-function to use for searching in `query-replace-regexp',
-`replace-regexp', `query-replace-regexp-eval', and
-`map-query-replace-regexp'. The function it specifies is called by
-`perform-replace' when its 4th argument is non-nil.
-
-*** New keymap `search-map' bound to `M-s' provides global bindings
-for search related commands.
-
-*** New keymap `multi-query-replace-map' contains additonal keys bound
-to `automatic-all' and `exit-current' for multi-buffer interactive replacement.
-
-*** The variable `inhibit-changing-match-data', if non-nil, prevents
-the search and match primitives from changing the match data.
-
-*** New functions `word-search-forward-lax' and `word-search-backward-lax'.
-These are like `word-search-forward and `word-search-backward', except
-that the end of the search string need not match a word boundary,
-unless it ends in whitespace.
-
-** File handling changes
-
-*** set-file-modes is now interactive and can take the mode value in
-symbolic notation thanks to auxiliary functions.
-
-*** file-local-variables-alist stores an alist of file-local
-variables defined in the current buffer.
-
-** Face-remapping
-
-*** Each face can be remapped to a different face definition using the
-variable `face-remapping-alist'. This is an alist that maps faces to
-replacement definitions (which can be face names, lists of face names,
-or attribute/value plists. If this variable is buffer-local, the
-remapping occurs only in that buffer.
-
-*** text-scale-mode remaps the default face to a larger or smaller
-size in the current buffer. This feature is used by the Buffer Face
-menu and the new `C-x C-+', `C-x C--', and `C-x C-0' commands (see
-Editing Changes, above).
-
-*** New functions:
-
-**** `face-remap-add-relative' adds a face remapping entry to the
-current buffer.
-
-**** ``face-remap-remove-relative' removes a face remapping entry from
-the current buffer.
-
-**** `face-remap-reset-base' restores a face to its global definition.
-
-**** `face-remap-set-base' sets the base remapping of a face.
-
-** Process changes
-
-*** The new function `start-file-process' is similar to `start-process',
-but obeys file handlers. The file handler is chosen based on
-`default-directory'. The functions `start-file-process-shell-command'
-and `process-file-shell-command' are also new; they call internally
-`start-file-process' and `process-file', respectively.
-
-*** The new function `process-lines' executes an external program and
-returns its output as a list of lines.
-
-** Character code, representation, and charset changes.
-
-*** In multibyte buffers and strings, characters are represented by
-UTF-8 byte sequences. The character code space is now 0x0..0x3FFFFF
-with no gap; code points 0x0..0x10FFFF are Unicode characters of the
-same code points, while code points 0x3FFF80..0x3FFFFF are raw 8-bit
-bytes.
-
-*** Generic characters no longer exist.
-
-*** The concept of a charset has changed. A single character may
-belong to multiple charsets (e.g. a-grave, U+00E0, belongs to charsets
-unicode, iso-8859-1, iso-8859-3, etc).
-
-**** The dimension of a charset is now 1, 2, 3, or 4, and the size of
-each dimension is no longer limited to 94 or 96.
-
-**** A dynamic charset priority list is used to infer the charset of
-characters for display.
-
-*** The functions `split-char' and `make-char' now accept up to 4
-positional codes instead of just 2.
-
-*** The functions `encode-char' and `decode-char' now accept any character sets.
-
-*** The function `define-charset' now accepts a completely different
-form of arguments (old-style arguments still work).
-
-*** The value of the function `char-charset' depends on the current
-priorities of charsets.
-
-*** The function get-char-code-property now accepts many Unicode base
-character properties. They are `name', `general-category',
-`canonical-combining-class', `bidi-class', `decomposition',
-`decimal-digit-value', `digit-value', `numeric-value', `mirrored',
-`old-name', `iso-10646-comment', `uppercase', `lowercase', and
-`titlecase'.
-
-*** The functions `modify-syntax-entry' and `modify-category-entry' now
-accept a cons of characters as the first argument, and modify all
-entries in that range of characters.
-
-*** Use of `translation-table-for-input' for character code unification
-is now obsolete, since Emacs 23.1 and later uses Unicode as basis for
-internal representation of characters.
-
-*** New functions:
-
-**** `characterp' returns t if and only if the argument is a character.
-This replaces `char-valid-p', which is now obsolete.
-
-**** `max-char' returns the maximum character code (currently #x3FFFFF).
-
-**** `define-charset-alias' defines an alias of a charset.
-
-**** `set-charset-priority' sets priorities of charsets.
-
-**** `charset-priority-list' returns a prioritized list of charsets.
-
-**** `unibyte-string' makes a unibyte string from bytes.
-
-**** `define-char-code-property' defines a character code property.
-
-**** `char-code-property-description' returns the description string of
-a character code property.
-
-*** New variables:
-
-**** `find-word-boundary-function-table' is a char-table of functions to
-search for a word boundary.
-
-**** `char-script-table' is a char-table of script names.
-
-**** `char-width-table' is a char-table of character widths.
-
-**** `print-charset-text-property' controls how to handle `charset' text
-property on printing a string.
-
-**** `printable-chars' is a char-table of printable characters.
-
-** Code conversion changes
-
-*** The new function `define-coding-system' should be used to define a
-coding system instead of `make-coding-system' (which is now obsolete).
-
-*** The functions `encode-coding-region' and `decode-coding-region'
-have an optional 4th argument to specify where the result of
-conversion should go.
-
-*** The functions `encode-coding-string' and `decode-coding-string'
-have an optional 4th argument specifying a buffer to store the result
-of conversion.
-
-*** The new variable `inhibit-null-byte-detection' controls whether to
-consider text with null bytes as binary data. By default, it is
-`nil', and Emacs uses `no-conversion' for any text containing null
-bytes.
-
-*** The functions `set-coding-priority' and `make-coding-system' are obsolete.
-
-*** New functions:
-
-**** `with-coding-priority' executes Lisp code using the specified
-coding system priority order.
-
-**** `check-coding-systems-region' checks if the text in the region is
-encodable by the specified coding systems.
-
-**** `coding-system-aliases' returns a list of aliases of a coding system.
-
-**** `coding-system-charset-list' returns a list of charsets supported
-by a coding system.
-
-**** `coding-system-priority-list' returns a list of coding systems
-ordered by their priorities.
-
-**** `set-coding-system-priority' sets priorities of coding systems.
-
-**** `coding-system-from-name' returns a coding system matching with
-the argument name.
-
-** There is a new input method, Robin, different from Quail.
-It has three functionalities:
- i) a simple input method (converts an ASCII sequence into a string).
-ii) converts an existing buffer substring into another string
-iii) reverse conversion (each character produced by a
-robin rule can hold the original ASCII sequence as a char-code-property)
-
-*** The new function `robin-define-package' defines a Robin package.
-
-*** The new function `robin-modify-package' modifies an existing Robin package.
-
-*** The new function `robin-use-package' starts using a Robin package
-as an input method.
-
-*** The new function `string-to-unibyte' is like `string-as-unibyte'
-but signals an error if STRING contains a non-ASCII, non-eight-bit
-character.
-
-** Changes related to the new font backend
-
-*** Which font backends to use can be specified by the X resource
-"FontBackend". For instance, to use both X core fonts and Xft fonts:
-
-Emacs.FontBackend: x,xft
-
-If this resource is not set, Emacs tries to use all font backends
-available on your graphic device.
-
-*** New frame parameter `font-backend' specifies a list of
-font-backends supported by the frame's graphic device. On X, they are
-currently `x' and `xft'.
-
-*** The function `set-fontset-font' now accepts a script name as the
-second argument, and has an optional 5th argument to control how to
-set the font.
-
-*** New functions:
-
-**** `fontp' checks if the argument is a font-spec or font-entity.
-
-**** `font-spec' creates a new font-spec object.
-
-**** `font-get' returns a font property value.
-
-**** `font-put' sets a font property value.
-
-**** `font-face-attributes' returns a plist of face attributes set by a font.
-
-**** `list-fonts' returns a list of font-entities matching a font spec.
-
-**** `find-font' returns the font-entity best matching the given font spec.
-
-**** `font-family-list' returns a list of family names of available fonts.
-
-**** `font-xlfd-name' returns an XLFD name of a given font spec, font
-entity, or font object.
-
-**** `clear-font-cache' clears all font caches.
-
-** Changes related to multiple-terminal (multi-tty) support
-
-*** $TERM is now set to `dumb' for subprocesses. If you want to know the
-$TERM inherited by Emacs you will have to look inside initial-environment.
-
-*** $DISPLAY is now dynamically inherited from the frame's `display'.
-
-*** The `window-system' variable is now frame-local. The new
-`initial-window-system' variable contains the `window-system' value
-for the first frame. `window-system' is also now a function that
-takes a frame argument.
-
-*** The `keyboard-translate-table' variable and the terminal and
-keyboard coding systems are now terminal-local.
-
-*** You can specify a terminal device (`tty' parameter) and a terminal
-type (`tty-type' parameter) to `make-terminal-frame'.
-
-*** The function `make-frame-on-display' now works during a tty
-session.
-
-*** A new `terminal' data type.
-The functions `get-device-terminal', `terminal-parameters',
-`terminal-parameter', `set-terminal-parameter' use this data type.
-
-*** Function key sequences are now mapped using `local-function-key-map',
-a new variable. This inherits from the global variable function-key-map,
-which is not used directly any more.
-
-*** New hooks:
-
-**** before-hack-local-variables-hook is called after setting new
-variable file-local-variables-alist, and before actually applying the
-file-local variables.
-
-**** `suspend-tty-functions' and `resume-tty-functions' are called
-after a tty frame has been suspended or resumed, respectively. The
-functions are called with the terminal id of the frame being
-suspended/resumed as a parameter.
-
-**** The special hook `delete-terminal-functions' is called before
-deleting a terminal.
-
-*** New functions:
-
-**** `delete-terminal'
-
-**** `suspend-tty'
-
-**** `resume-tty'.
-
-*** `initial-environment' holds the environment inherited from Emacs's parent.
-
-** Redisplay changes
-
-*** For underlined characters, the distance between the underline and
-the baseline is controlled by a new variable, `underline-minimum-offset'.
-
-*** You can now pass the value of the `invisible' property to
-invisible-p to check whether it would cause the text to be invisible.
-This is convenient when checking invisibility of text with no buffer
-position (e.g. in before/after-strings).
-
-*** `clear-image-cache' can be told to flush only images of a specific file.
-
-*** `vertical-motion' can now be given a goal column.
-It now accepts a cons cell (COLS . LINES) in its first argument, which
-says to stop, where possible, at a pixel x-position equal to COLS
-times the default column width.
-
-*** redisplay-end-trigger-functions, set-window-redisplay-end-trigger,
-and window-redisplay-end-trigger are obsolete. Use `jit-lock-register'
-instead.
-
-*** The new variables `wrap-prefix' and `line-prefix' specify display
-specs which are appended at display-time to every continuation line
-and non-continuation line, respectively. In addition, Emacs
-recognizes the `wrap-prefix' and `line-prefix' text or overlay
-properties; these have the same effects as the variables of the same
-name, but take precedence.
-
-** The Lisp interpreter now treats non-breaking space as whitespace.
-
-** Miscellaneous new functions
-
-*** `apply-partially' performs a "curried" application of a function.
-
-*** `buffer-swap-text' swaps text between two buffers. This can be
-useful for modes such as tar-mode, archive-mode, RMAIL.
-
-*** `combine-and-quote-strings' produces a single string from a list of strings
-sticking a separator string in between each pair, and quoting those
-strings that include the separator as their substring. Useful for
-consing shell command lines from the individual arguments.
-
-*** `custom-note-var-changed' tells Custom to treat the change in a
-certain variable as having been made within Custom.
-
-*** `face-all-attributes' returns an alist describing all the basic
-attributes of a given face.
-
-*** `format-seconds' converts a number of seconds into a readable
-string of days, hours, etc.
-
-*** `image-refresh' refreshes all images associated with a given image
-specification.
-
-*** `locate-user-emacs-file' helps packages to select the appropriate
-place to save user-specific files. It defaults to `user-emacs-directory'
-unless the file already exists at $HOME.
-
-*** `read-color' reads a color name using the minibuffer.
-
-*** `read-shell-command' does what its name says, with completion. It
-uses the minibuffer-local-shell-command-map for that.
-
-*** `split-string-and-unquote' splits a string into a list of substrings
-on the boundaries of a given delimiter, and unquotes the substrings that
-are quoted. Useful for taking apart shell commands.
-
-*** The two new functions `looking-at-p' and `string-match-p' can do
-the same matching as `looking-at' and `string-match' without changing
-the match data.
-
-*** The two new functions `make-serial-process' and
-`serial-process-configure' provide a Lisp interface to the new serial
-port support (see Emacs changes, above).
-
-** Miscellaneous new variables
-
-*** `auto-save-include-big-deletions', if non-nil, means auto-save is
-not turned off automatically after a big deletion.
-
-*** `read-circle', if nil, disables the reading of recursive Lisp
-structures using the #N= and #N# syntax.
-
-*** `this-command-keys-shift-translated' is non-nil if the key
-sequence invoking the current command was found by shift-translation.
-
-*** `window-point-insertion-type' determines the insertion-type of the
-marker used for window-point.
-
-*** bookmark provides `bookmark-make-record-function' so special major
-modes like Info can teach bookmark.el how to save and restore the
-relevant data.
-
-*** `fill-forward-paragraph-function' specifies which function the
-filling code should use to find paragraph boundaries.
-
-\f
-* New Packages for Lisp Programming in Emacs 23.1
-
-** The new package avl-tree.el deals with the AVL tree data structure.
-
-** The new package check-declare.el verifies the accuracy of
-declare-function macros (see Lisp Changes, above).
-
-** find-cmd.el can build `find' commands using lisp syntax.
-
-** The package misearch.el has been added. It allows Isearch to search
-through multiple buffers. A variable `multi-isearch-next-buffer-function'
-defines the function to call to get the next buffer to search in the series
-of multiple buffers. Top-level functions `multi-isearch-buffers',
-`multi-isearch-buffers-regexp', `multi-isearch-files' and
-`multi-isearch-files-regexp' accept a single argument that specifies
-a list of buffers/files to search for a string/regexp.
-
-** The new major mode `special-mode' is intended as a parent for
-major modes such as those that set the "'mode-class 'special" property.
-
-\f
-----------------------------------------------------------------------
-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/>.
-
-\f
-Local variables:
-mode: outline
-paragraph-separate: "[ \f]*$"
-end:
-
-arch-tag: e759449d-88b3-4de4-9900-3a6c3dfa23e2
+GNU Emacs NEWS -- history of user-visible changes.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+See the end of the file for license conditions.
+
+Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
+If possible, use M-x report-emacs-bug.
+
+This file is about changes in Emacs version 24.
+
+See files NEWS.23, NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18,
+and NEWS.1-17 for changes in older Emacs versions.
+
+You can narrow news to a specific version by calling `view-emacs-news'
+with a prefix argument or by typing C-u C-h C-n.
+
+
+Temporary note:
+ +++ indicates that the appropriate manual has already been updated.
+ --- means no change in the manuals is called for.
+When you add a new item, please add it without either +++ or ---
+so we will look at it and add it to the manual.
+
+\f
+* Installation Changes in Emacs 24.1
+
+---
+** There are new configure options:
+--with-mmdf, --with-mail-unlink, --with-mailhost.
+These provide no new functionality, they just remove the need to edit
+lib-src/Makefile by hand in order to use the associated features.
+
+---
+** There is a new configure option --with-crt-dir.
+This is only useful if your crt*.o files are in a non-standard location.
+
+** Configure links against libselinux if it is found.
+You can disable this by using --without-selinux.
+
+\f
+* Startup Changes in Emacs 24.1
+
+\f
+* Changes in Emacs 24.1
+
+** Completion can cycle, depending on completion-cycle-threshold.
+
+** auto-mode-case-fold is now enabled by default.
+
++++
+** Emacs now supports display and editing of bidirectional text.
+
+See the node "Bidirectional Editing" in the Emacs Manual for some
+initial documentation.
+
+To turn this on in any given buffer, set the buffer-local variable
+`bidi-display-reordering' to a non-nil value. The default is nil.
+
+The buffer-local variable `bidi-paragraph-direction', if non-nil,
+forces each paragraph in the buffer to have its base direction
+according to the value of this variable. Possible values are
+`right-to-left' and `left-to-right'. If the value is nil (the
+default), Emacs determines the base direction of each paragraph from
+its text, as specified by the Unicode Bidirectional Algorithm.
+
+The function `current-bidi-paragraph-direction' returns the actual
+value of paragraph base direction at point.
+
+Reordering of bidirectional text for display in Emacs is a "Full
+bidirectionality" class implementation of the Unicode Bidirectional
+Algorithm.
+
+Note that some advanced display features, such as overlay strings and
+`display' text properties, do not yet work correctly when
+bidirectional text is reordered for display.
+
+** GTK scroll-bars are now placed on the right by default.
+Use `set-scroll-bar-mode' to change this.
+
+** GTK tool bars can have just text, just images or images and text.
+Customize `tool-bar-style' to choose style. On a Gnome desktop, the default
+is taken from the desktop settings.
+
+** Lucid menus and dialogs can display antialiased fonts if Emacs is built
+with Xft.
+
+** Basic SELinux support has been added.
+This requires Emacs to be linked with libselinux at build time.
+
+*** Emacs preserves the SELinux file context when backing up, and
+optionally when copying files. To this end, copy-file has an extra
+optional argument, and backup-buffer and friends include the SELinux
+context in their return values.
+
+*** The new functions file-selinux-context and set-file-selinux-context
+get and set the SELinux context of a file.
+
+*** Tramp offers handlers for file-selinux-context and set-file-selinux-context
+for remote machines which support SELinux.
+
+** New scrolling commands `scroll-up-command' and `scroll-down-command'
+(bound to C-v/[next] and M-v/[prior]) does not signal errors at top/bottom
+of buffer at first key-press (instead moves to top/bottom of buffer)
+when a new variable `scroll-error-top-bottom' is non-nil.
+
+** New scrolling commands `scroll-up-line' and `scroll-down-line'
+scroll a line instead of full screen.
+
+** New property `scroll-command' should be set on a command's symbol to
+define it as a scroll command affected by `scroll-preserve-screen-position.
+
+\f
+* Editing Changes in Emacs 24.1
+
+** completion-at-point is now an alias for complete-symbol.
+
+** mouse-region-delete-keys has been deleted.
+
+** If delete-file is called with a prefix argument, it really deletes,
+regardless of the value of `delete-by-moving-to-trash'.
+
+\f
+* Changes in Specialized Modes and Packages in Emacs 24.1
+
+** Archive Mode has basic support to browse 7z archives.
+
+** In ido-mode, C-v is no longer bound to ido-toggle-vc.
+The reason is that this interferes with cua-mode.
+
+** partial-completion-mode is now obsolete.
+You can get a comparable behavior with:
+(setq completion-styles '(partial-completion initials))
+(setq completion-pcm-complete-word-inserts-delimiters t)
+
+** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags.
+** Customize
+
+*** Customize buffers now contain a search field.
+The search is performed using `customize-apropos'.
+To turn off the search field, set custom-search-field to nil .
+
+*** Custom options now start out hidden if at their default values.
+Use the arrow to the left of the option name to toggle visibility.
+
+*** custom-buffer-sort-alphabetically now defaults to t.
+
+*** The color widget now has a "Choose" button, which allows you to
+choose a color via list-colors-display.
+
+** Dired-x
+
+*** dired-jump and dired-jump-other-window called with a prefix argument
+read a file name from the minibuffer instead of using buffer-file-name.
+
+** VC and related modes
+
+*** New VC commands: vc-log-incoming, vc-log-outgoing, vc-find-conflicted-file.
+
+*** vc-dir for Bzr supports viewing shelve contents and shelving snapshots.
+
+*** Special markup can be added to log-edit buffers.
+The log-edit buffers are expected to have a format similar to email messages
+with headers of the form:
+ Author: <author of this change>
+ Summary: <one line summary of this change>
+ Fixes: <reference to the bug fixed by this change>
+Some backends handle some of those headers specially, but any unknown header
+is just left as is in the message, so it is not lost.
+
+** Directory local variables can apply to file-less buffers.
+For example, adding "(diff-mode . ((mode . whitespace)))" to your
+.dir-locals.el file, will turn on `whitespace-mode' for *vc-diff* buffers.
+
+** SQL Mode enhancements.
+
+*** Several variables have been marked as safe local variables.
+The variables `sql-product', `sql-user', `sql-server', and
+`sql-database' can now be safely used as local variables.
+
+*** Added ability to login with a port on MySQL.
+The custom variable `sql-port' can be specified for connection to
+MySQL servers.
+
+*** Custom variables control prompting for login parameters.
+Each supported product has a custom variable `sql-*-login-params'
+which is a list of the parameters to be prompted for before a
+connection is established.
+
+*** Added option `sql-send-terminator'.
+When set makes sure that each command sent with `sql-send-*' commands
+are properly terminated and submitted to the SQL processor.
+
+*** Added option `sql-oracle-scan-on'.
+When set commands sent to Oracle's SQL*Plus are scanned for strings
+starting with an ampersand and the user is asked for replacement
+text. In general, the SQL*Plus option SCAN should be set OFF under
+SQL interactive mode.
+
+*** SQL interactive mode will replace tabs with spaces.
+This prevents the comand interpretter for MySQL and Postgres from
+listing object name completions when being sent text via
+`sql-send-*' functions.
+
+*** An API for manipulating SQL product definitions has been added.
+
+** s-region.el is now declared obsolete, superceded by shift-select-mode
+enabled by default in 23.1.
+
+** gdb-mi
+
+*** GDB User Interface migrated to GDB Machine Interface and now
+supports multithread non-stop debugging and debugging of several
+threads simultaneously.
+
+\f
+* New Modes and Packages in Emacs 24.1
+
+** smie.el is a package providing a simple generic indentation engine.
+
+** secrets.el is an implementation of the Secret Service API, an
+interface to password managers like GNOME Keyring or KDE Wallet. The
+Secret Service API requires D-Bus for communication. The command
+`secrets-show-secrets' offers a buffer with a visualization of the
+secrets.
+
+\f
+* Incompatible Lisp Changes in Emacs 24.1
+
+** Test for special mode-class was moved from view-file to view-buffer.
+
+** Passing a nil argument to a minor mode function now turns the mode
+ ON unconditionally.
+\f
+* Lisp changes in Emacs 24.1
+
+** frame-local variables cannot be let-bound any more.
+** prog-mode is a new major-mode meant to be the parent of programming mode.
+** define-minor-mode accepts a new keyword :variable.
+
+** delete-file now accepts an optional second arg, FORCE, which says
+to always delete and ignore the value of delete-by-moving-to-trash.
+
+** buffer-substring-filters is obsoleted by filter-buffer-substring-functions.
+
+** New completion style `substring'.
+
+** Image API
+
+*** When the image type is one of listed in `image-animated-types'
+and the number of sub-images in the image is more than one, then the
+new function `create-animated-image' creates an animated image where
+sub-images are displayed successively with the duration defined by
+`image-animate-max-time' and the delay between sub-images defined
+by the Graphic Control Extension of the image.
+
+*** `image-extension-data' is renamed to `image-metadata'.
+
+** Isearch
+
+*** New hook `isearch-update-post-hook' that runs in `isearch-update'.
+
+** Progress reporters can now "spin".
+The MIN-VALUE and MAX-VALUE arguments of `make-progress-reporter' can
+now be nil, or omitted. This makes a "non-numeric" reporter. Each
+time you call `progress-reporter-update' on that progress reporter,
+with a nil or omitted VALUE argument, the reporter message is
+displayed with a "spinning bar".
+
+\f
+* Changes in Emacs 24.1 on non-free operating systems
+
+\f
+----------------------------------------------------------------------
+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/>.
+
+\f
+Local variables:
+mode: outline
+paragraph-separate: "[ \f]*$"
+end:
prepared to sign legal papers to transfer the copyright on your work
to the FSF.
-* Simple tasks. These don't require much emacs knowledge, they are
+* Tentative plan for Emacs-24
+
+** Bidi
+** lexbind: I haven't checked the status of the code recently, so
+ I don't know how realistic it is to include it. But it's been around
+ for a long time, and I trust Miles, so I have hope.
+** concurrency: including it as an "experimental" compile-time option
+ sounds good. Of course there might still be big questions around
+ "which form of concurrency" we'll want.
+** Overhaul of customize: sounds wonderful.
+** some kind of color-theme: agreed.
+** better support for dynamic embedded graphics: I like this idea (my
+ mpc.el code could use it for the volume widget), tho I wonder if the
+ resulting efficiency will be sufficient.
+** Spread Semantic.
+** Improve the "code snippets" support: consolidate skeleton.el, tempo.el,
+ and expand.el (any other?) and then advertise/use/improve it.
+** Improve VC: yes, there's a lot of work to be done there :-(
+ And most of it could/should make it into Emacs-23.3.
+** package manager.
+
+** Random things that cross my mind right now that I'd like to see (some of
+them from my local hacks), but it's not obvious at all whether they'll
+make it.
+*** multiple inheritance for keymaps (to get rid of the
+ fix_submap_inheritance hack and to more cleanly express the
+ relationship between minibuffer-local-*-map): I've had this locally
+ for a long time, but the details of the semantics is somewhat ... delicate.
+*** Derive from prog-mode in more places, close bug#5532.
+*** prog-mode could/should provide a better fill-paragraph default
+ that uses syntax-tables to recognize string/comment boundaries.
+*** provide more completion-at-point-functions. Make existing
+ in-buffer completion use completion-at-point.
+*** "functional" function-key-map that would make it easy to add (and
+ remove) mappings like "FOO-mouse-4 -> FOO-scroll-down",
+ "FOO-tab -> ?\FOO-\t", "uppercase -> lowercase", "[fringe KEY...] ->
+ [KEY]", "H-FOO -> M-FOO", "C-x C-y FOO -> H-FOO", ...
+
+
+* Simple tasks. These don't require much Emacs knowledge, they are
suitable for anyone from beginners to experts.
** Convert modes that use view-mode to be derived from special-mode instead.
** erase-buffer should perhaps disregard read-only properties of text.
-** Make occur correctly handle matches that span more than one line,
- as well as overlapping matches.
-
** Fix the kill/yank treatment of invisible text. At the moment,
invisible text is placed in the kill-ring, so that the contents of
the ring may not correspond to the text as displayed to the user.
** Enhance scroll-bar to handle tall line (similar to line-move).
-** Make occur handle multi-line matches cleanly with context.
-
** In Custom buffers, put the option that turns a mode on or off first,
using a heuristic of some kind?
http://lists.gnu.org/archive/html/emacs-devel/2008-08/msg00456.html
* Important features:
-
+** Extended text-properties (to make overlays "obsolete")
+*** Several text-property planes
+This would get us rid of font-lock-face property (and I'd be happy to
+get rid of char-property-alias-alist as well) since font-lock would
+simply use the `face' property in the `font-lock' plane.
+Each property would come with an Elisp merge-function. The merge
+would be performed in add-text-properties.
+*** zero-width text-properties.
** Having tabs above a window to switch buffers in it.
** "Perspectives" are named persistent window configurations. We have
@end text
+@next 'finish
+
@node Setting up a NNTP server
@text
Run M-x assistant and use the news-server.ast file as input.
@end text
+@next 'finish
+
\f
@c Local variables:
@c mode: texinfo
@node Setting up the news server name and port number
-@variable server :string (gnus-getenv-nntpserver)
+@variable server :string (or (gnus-getenv-nntpserver) "your-server-here")
@variable port :number 119
-@validate (assistant-validate-connect-to-server server port)
+@validate (or (assistant-validate-connect-to-server server port) (y-or-n-p "Do you want to use the server anyway, although you can't confirm it's valid?"))
@result gnus-select-method (list 'nntp server (list 'nntp-server port))
@text
Usenet news is usually read from your Internet service prodider's news
Server name: @variable{server}
Port number: @variable{port}
+
@end text
@next t "User name and password"
-
@node User name and password
@type interstitial
@next
/* XPM */
static char * down_xpm[] = {
-"8 12 4 1",
+"9 9 4 1",
" c none",
-". c gray90",
-"X c gray45",
-"O c gray75",
-"........",
-".OOOOOOX",
-" .OOOOX ",
-" .OOOOX ",
-" .OOX ",
-" .OOX ",
-" OX ",
-" OX ",
-" ",
-" ",
-" ",
-" "};
+". c black",
+"x c gray45",
+"+ c white",
+".........",
+".x+++++x.",
+" .+++++. ",
+" .x+++x. ",
+" .+++. ",
+" .x+x. ",
+" .+. ",
+" .x. ",
+" . "};
/* XPM */
static char * right_xpm[] = {
-"8 12 4 1",
+"9 9 4 1",
" c none",
-". c gray90",
-"X c gray45",
-"O c gray75",
-".. ",
-"..O. ",
-"..OOO. ",
-"..OOOOOX",
-"..OOOOXX",
-"..OOXX ",
-"..XX ",
-"OO ",
-" ",
-" ",
-" ",
-" " };
+". c black",
+"x c gray45",
+"+ c white",
+".. ",
+".x.. ",
+".++x.. ",
+".++++x.. ",
+".++++++x.",
+".++++x.. ",
+".++x.. ",
+".x.. ",
+".. "};
% Reference Card for Org Mode
-\def\orgversionnumber{6.33x}
-\def\versionyear{2009} % latest update
+\def\orgversionnumber{6.35i}
+\def\versionyear{2010} % latest update
\def\year{2010} % latest copyright year
%**start of header
% Specify how many you want here.
\columnsperpage=3
-% Set letterpaper to 0 for A4 paper, 1 for letter (US) paper. Useful
-% only when columnsperpage is 2 or 3.
-\letterpaper=0
-
% PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
% a landscape layout.
\input pdflayout.sty
% Nothing else needs to be changed below this line.
% Copyright (C) 1987, 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005,
-% 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+% 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
% This file is part of GNU Emacs.
\section{Getting Started}
%
-\vskip -2mm
-\beginexample%
-(add-to-list 'auto-mode-alist '("\\\\.org\$" . org-mode))
-(define-key global-map "\\C-cl" 'org-store-link)$^1$
-(define-key global-map "\\C-ca" 'org-agenda)$^1$
-\endexample
+%\vskip -2mm
+%\beginexample%
+%(add-to-list 'auto-mode-alist '("\\\\.org\$" . org-mode))
+%(define-key global-map "\\C-cl" 'org-store-link)$^1$
+%(define-key global-map "\\C-ca" 'org-agenda)$^1$
+%\endexample
%
\metax{To read the on-line documentation try}{M-x org-info}
{\bf Regions}
-\key{cut rectangular region}{C-c C-x C-w}
-\key{copy rectangular region}{C-c C-x M-w}
-\key{paste rectangular region}{C-c C-x C-y}
+\metax{cut/copy/paste rectangular region}{C-c C-x C-w/M-w/C-y}
+%\key{copy rectangular region}{C-c C-x M-w}
+%\key{paste rectangular region}{C-c C-x C-y}
\key{fill paragraph across selected cells}{C-c C-q}
{\bf Miscellaneous}
+++ /dev/null
-# There are only three real source files in this directory:
-#
-# "dir", ".cvsignore", and this file, ".arch-inventory"
-
-# Everything else is generated at compile time. Unfortunately, the "backup"
-# category overrides the "source" category, so we have to have horrible
-# regexp that matches everything _except_ "dir"...
-
-# 1 or 2 characters long
-backup ^[a-zA-Z0-9][-_.a-zA-Z0-9]?$
-# 4 or more characters long
-backup ^[a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9]+$
-# 3 chars long, but 1st char not "d"
-backup ^[abce-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9]$
-# 3 chars long, but 2nd char not "i"
-backup ^[a-zA-Z0-9][-_.a-hj-zA-Z0-9][-_.a-zA-Z0-9]$
-# 3 chars long, but 3rd char not "r"
-backup ^[a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-qs-zA-Z0-9]$
-
-# arch-tag: 60144ab9-cdc1-45b6-8193-b9683c80ec86
+++ /dev/null
-# Auto-generated files, which ignore.
-precious ^(stamp-subdir|changed\..*|leim-list\.el)$
-
-# arch-tag: a4cda8ae-2a52-4d85-bd29-14e25c7ed2a2
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (install): Remove references to CVS-related files.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
* quail/vntelex.el: Fix "af" rule (Bug#5836).
+2010-03-27 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in ($(TIT), $(MISC_DIC), leim-list.el): Enclose the
+ argument of "-l" in $(ARGQUOTE), in case it includes blanks or
+ other special characters.
+
+2010-03-18 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (maintainer-clean): Use bootstrap-clean.
+ (extraclean): Fix deletion patterns.
+
+ * Makefile.in (dot): Remove, since ../ is used throughout the
+ other Makefiles.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-02-16 Kenichi Handa <handa@m17n.org>
* SKK-DIC/SKK-JISYO.L: Updated to the latest version.
GZIP_PROG = @GZIP_PROG@
-# On IBM RS6000, double-dot gets screwed up.
-dot = .
-
# Which Emacs to use to convert TIT files to Emacs Lisp files,
# byte-compile Emacs Lisp files, and generate the file leim-list.el.
-BUILT-EMACS = ${dot}${dot}/src/emacs
+BUILT-EMACS = ../src/emacs
-buildlisppath=${srcdir}/${dot}${dot}/lisp
+buildlisppath=${srcdir}/../lisp
# How to run Emacs.
RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
# To ensure that we can run Emacs. This target is ignored (never
# being hit) if a user changes default value of EMACS.
-${dot}${dot}/src/emacs:
+../src/emacs:
cd ../src; ${MAKE} ${MFLAGS} emacs
${SUBDIRS}:
install: all
if [ ! -d ${INSTALLDIR} ] ; then \
- umask 022; ${srcdir}/${dot}${dot}/mkinstalldirs ${INSTALLDIR}; \
+ umask 022; ${srcdir}/../mkinstalldirs ${INSTALLDIR}; \
else true; fi
if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
rm -f ${INSTALLDIR}/leim-list.el; \
tar -chf - quail/* ja-dic \
| (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
fi; \
- rm -rf ${INSTALLDIR}/CVS ${INSTALLDIR}/*/CVS; \
- rm -f ${INSTALLDIR}/.cvsignore ${INSTALLDIR}/*/.cvsignore; \
rm -f ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \
rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \
rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \
# bootstrapping should not leave non-fresh .elc files behind.
bootstrap-clean: clean
rm -f ${WORLD}
+## FIXME some compiled files go to srcdir, some don't?
+# cd ${srcdir}; rm -f *.elc */*.elc
distclean: clean
if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
rm -f Makefile
-maintainer-clean: distclean
- rm -f ${WORLD}
+maintainer-clean: distclean bootstrap-clean
extraclean: maintainer-clean
- -rm -f *~ \#* m/?*~ s/?*~
+ -rm -f *~ \#* */*~ */\#*
.PHONY: check-declare
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
# this can break with GNU Make 3.81 and later if sh.exe is used.
$(TIT):
- $(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \
+ $(RUN_EMACS) -l \
+ $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
--eval $(ARGQUOTE)(batch-titdic-convert t)$(ARGQUOTE) \
-dir quail $(srcdir)/CXTERM-DIC
- $(RUN_EMACS) -l $(buildlisppath)/international/quail \
+ $(RUN_EMACS) -l \
+ $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
-f batch-byte-compile $(TIT:.elc=.el)
# Rule to generate quail/*.el from MISC_DIC/*.tit.
$(MISC_DIC):
- $(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \
+ $(RUN_EMACS) -l \
+ $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
-f batch-miscdic-convert -dir quail $(srcdir)/MISC-DIC
- $(RUN_EMACS) -l $(buildlisppath)/international/quail \
+ $(RUN_EMACS) -l \
+ $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
-f batch-byte-compile $(MISC_DIC:.elc=.el)
#
# this can break with GNU Make 3.81 and later if sh.exe is used.
leim-list.el: $(SUBDIRS) $(WORLD) $(srcdir)/leim-ext.el
- $(DEL) leim-list.el
- $(RUN_EMACS) -l $(buildlisppath)/international/quail \
+ $(RUN_EMACS) -l \
+ $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
--eval $(ARGQUOTE)(update-leim-list-file $(DQUOTE).$(DQUOTE))$(ARGQUOTE)
$(RUN_EMACS) --eval $(ARGQUOTE)(w32-append-code-lines $(DQUOTE)$@$(DQUOTE) $(DQUOTE)$(srcdir)/leim-ext.el$(DQUOTE))$(ARGQUOTE)
+++ /dev/null
-# Auto-generated lisp files, which ignore.
-precious ^([A-Z0-9].*|tsang-.*|quick-.*)\.el$
-
-# arch-tag: 3d0d3e6b-f7c3-4dce-9135-a72ba7fe095d
+++ /dev/null
-# Ignore binaries
-backup ^(test-distrib|make-docfile|profile|digest-doc|movemail|fakemail|blessmail|hexl|update-game-score|etags|ctags|emacsclient|b2m|ebrowse|sorted-doc)$
-
-# Building actually makes a copy/link of the source file
-precious ^(ctags\.c)$
-
-# Windows generates this
-backup ^(DOC)$
-
-# arch-tag: da33b3d6-170d-4fe5-9eb8-ed2753bc9b4f
+2010-05-22 Jan Djärv <jan.h.d@swipnet.se>
+
+ * Makefile.in (STAMP_INST_SCRIPTS, STAMP_SCRIPS): New (Bug #6246).
+ (all): Depend onSTAMP_INST_SCRIPTS, STAMP_SCRIPS (Bug #6246).
+ (stamp-rcs2log, stamp-rcs-checkin, stamp-grep-changelog, stamp-vcdiff):
+ New rules (Bug #6246).
+ (clean): Remove stamp-* (Bug #6246).
+
+2010-05-12 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (INSTALLABLES): Remove @LIB_SRC_EXTRA_INSTALLABLES@.
+
+2010-05-11 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (.m.o): Remove, there are no .m files.
+ (BASE_CFLAGS): New variable.
+ (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Use $BASE_CFLAGS.
+ (check): Update the message.
+ (update-game-score${EXEEXT}): Do not use $MOVE_FLAGS.
+
+ * Makefile.in: Convert comments to makefile format.
+
+ * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset.
+ (config.h) [MSDOS]: Do not include.
+
+2010-05-10 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBS_SYSTEM): Set with configure, not cpp.
+ (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM.
+ (NOT_C_CODE): Remove, no longer used.
+ (config.h) [!MSDOS]: No longer include.
+ (LOADLIBES): Use LIBS_SYSTEM as a variable.
+
+ * Makefile.in (BLESSMAIL_TARGET): Set with configure, not cpp.
+
+2010-05-08 Christoph <cschol2112@googlemail.com> (tiny change)
+
+ * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis
+ for macros for nmake compatibility.
+
+2010-05-08 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (THIS_IS_MAKEFILE): Remove, unused.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
-2010-05-05 Christoph <cschol2112@googlemail.com> (tiny change)
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in: Minimize blessmail-related cpp usage.
+ (BLESSMAIL_TARGET): New variable.
+ (MOVEMAIL_NEEDS_BLESSING): Remove, replace by above variable.
+ (blessmail): Always define this rule.
+ (need-blessmail): New rule, split out from maybe-blessmail.
+ (maybe-blessmail): Use BLESSMAIL_TARGET.
+
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
+ @c_switch_system@, @c_switch_machine@.
+
+2010-04-26 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (LIBS_MACHINE): Remove all uses, unused.
+
+2010-04-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Move to the
+ non-cpp section.
+
+2010-04-11 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Define using
+ autoconf, not cpp.
+ (ALL_CFLAGS): Use them as make variables.
+
+2010-04-07 Christoph <cschol2112@googlemail.com> (tiny change)
* makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis
for macros for nmake compatibility.
possibility of symlink attack when movemail is setgid mail
(CVE-2010-0825).
-2010-03-19 Tetsurou Okazaki <okazaki@be.to> (tiny change)
+2010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove extern errno declarations.
+ * movemail.c:
+ * etags.c:
+ * emacsclient.c: Remove extern errno declarations.
+
+2010-03-20 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+ (LIBHESIOD, LIBRESOLV): Make previous change a bit more friendly by
+ defining these as Makefile variables.
+ (LIBS_MOVE): Add LIBS_MAIL into this.
+ (movemail${EXEEXT}): Just use LIBS_MOVE, not LIBS_MAIL as well.
+
+2010-03-18 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+ (HESIODLIB, LIBS_MAIL): Set using autoconf rather than cpp.
+ (BASE_CFLAGS): Remove (identical to CPP_CFLAGS).
+
+2010-03-18 Tetsurou Okazaki <okazaki@be.to> (tiny change)
+
+ * Makefile.in (uninstall): Handle the case where archlibdir does not
+ exist. (Bug#5720)
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
- * Makefile.in (uninstall): Handle the case where archlibdir does
- not exist. (Bug#5720)
+ * Branch for 23.2.
2010-02-20 Kevin Ryde <user42@zip.com.au>
2000-03-02 Gerd Moellmann <gerd@gnu.org>
- * etags.c (lisp_suffixes) Add `LSP'.
+ * etags.c (lisp_suffixes): Add `LSP'.
2000-02-10 Francesco Potortì <pot@gnu.org>
# Makefile for lib-src subdirectory in GNU Emacs.
# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
CC=@CC@
CFLAGS=@CFLAGS@
version=@version@
+## Used in $archlibdir.
configuration=@configuration@
EXEEXT=@EXEEXT@
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
# Program name transformation.
TRANSFORM = @program_transform_name@
# ========================== Lists of Files ===========================
-# Things that a user might actually run,
-# which should be installed in bindir.
-INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} b2m${EXEEXT} ebrowse${EXEEXT} @LIB_SRC_EXTRA_INSTALLABLES@
+# Things that a user might actually run, which should be installed in bindir.
+INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
+ b2m${EXEEXT} ebrowse${EXEEXT}
+
INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
+STAMP_INST_SCRIPTS = stamp-rcs-checkin stamp-grep-changelog
# Things that Emacs runs internally, or during the build process,
# which should not be installed in bindir.
-UTILITIES= profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \
+UTILITIES = profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \
movemail${EXEEXT} fakemail${EXEEXT} \
hexl${EXEEXT} update-game-score${EXEEXT}
# Like UTILITIES, but they're not system-dependent, and should not be
# deleted by the distclean target.
SCRIPTS= rcs2log vcdiff
+STAMP_SCRIPTS= stamp-rcs2log stamp-vcdiff
EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
-# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
-# MAIL_USE_POP Support mail retrieval from a POP mailbox.
-# MAIL_USE_MMDF Support MMDF mailboxes.
-# MAIL_USE_FLOCK Use flock for file locking (see the comments
-# about locking in movemail.c)
-# MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
-# it (instead of just emptying it).
-# KERBEROS Support Kerberized POP.
-# KRB5 Support Kerberos Version 5 pop instead of
-# Version 4 (define this in addition to
-# KERBEROS).
-# HESIOD Support Hesiod lookups of user mailboxes.
-# MAILHOST A string, the host name of the default POP
-# mail host for the site.
+# Specify additional -D flags for movemail. Options:
+# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
+# See the comments about locking in movemail.c. Normally the values
+# set by configure should be correct and you should not need to do anything.
+# If neither flag is set, you need to use blessmail.
MOVE_FLAGS=
-# ========================== start of cpp stuff =======================
-/* From here on, comments must be done in C syntax. */
-
-#define THIS_IS_MAKEFILE
-#define NOT_C_CODE
-#include "../src/config.h"
-
-/* Some s/SYSTEM.h files define this to request special libraries. */
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-
-/* Some m/MACHINE.h files define this to request special libraries. */
-#ifndef LIBS_MACHINE
-#define LIBS_MACHINE
-#endif
-
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-
-#ifndef C_SWITCH_MACHINE
-#define C_SWITCH_MACHINE
-#endif
-
-#undef MOVEMAIL_NEEDS_BLESSING
-#ifndef MAIL_USE_FLOCK
-#ifndef MAIL_USE_LOCKF
-#define MOVEMAIL_NEEDS_BLESSING
-#endif
-#endif
-
-#ifdef MOVEMAIL_NEEDS_BLESSING
-#define BLESSMAIL blessmail
-#else
-#define BLESSMAIL
-#endif
-
-#ifdef KERBEROS
-# ifdef HAVE_LIBKRB
- KRB4LIB = -lkrb
-# else
-# ifdef HAVE_LIBKRB4
- KRB4LIB = -lkrb4
-# endif
-# endif
-# ifdef HAVE_LIBDES
- DESLIB = -ldes
-# else
-# ifdef HAVE_LIBDES425
- DESLIB = -ldes425
-# endif
-# endif
-# ifdef HAVE_LIBKRB5
- KRB5LIB = -lkrb5
-# endif
-# ifdef HAVE_LIBK5CRYPTO
- CRYPTOLIB = -lk5crypto
-# else
-# ifdef HAVE_LIBCRYPTO
- CRYPTOLIB = -lcrypto
-# endif
-# endif
-# ifdef HAVE_LIBCOM_ERR
- COM_ERRLIB = -lcom_err
-# endif
-#endif /* KERBEROS */
-
-/* If HESIOD is defined, set this to "-lhesiod". */
-#ifdef HAVE_LIBHESIOD
-# ifdef HAVE_LIBRESOLV
- HESIODLIB= -lhesiod -lresolv
-# else
- HESIODLIB= -lhesiod
-# endif
-#endif
-
-LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
-
-#ifdef HAVE_LIBLOCKFILE
-LIBS_MAIL=-llockfile
-#else
-#ifdef HAVE_LIBMAIL
-LIBS_MAIL=-lmail
-#endif
-#endif
-
-LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
-
-/* We need to #define emacs to get the right versions of some files.
- Some other files - those shared with other GNU utilities - need
- HAVE_CONFIG_H #defined before they know they can take advantage of
- the information in ../src/config.h. */
-ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
- -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
-LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
- -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
-CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
- -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
-/* This was all of CPP_CFLAGS except -Demacs.
- Now that -Demacs has been deleted from CPP_CFLAGS,
- this is actually the same as CPP_CFLAGS, but let\'s not delete it yet. */
-BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
- -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
-\f
-.SUFFIXES: .m
+## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
+BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
+
+## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
+KRB4LIB=@KRB4LIB@
+## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
+DESLIB=@DESLIB@
+## -lkrb5 if HAVE_LIBKRB5
+KRB5LIB=@KRB5LIB@
+## -lk5crypto if HAVE_LIBK5CRYPTO or -lcrypto if HAVE_LIBCRYPTO
+CRYPTOLIB=@CRYPTOLIB@
+## -lcom_err if HAVE_LIBCOM_ERR
+COM_ERRLIB=@COM_ERRLIB@
+## -lhesiod if HAVE_LIBHESIOD
+LIBHESIOD=@LIBHESIOD@
+## -lresolv if HAVE_LIBRESOLV
+LIBRESOLV=@LIBRESOLV@
+## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
+LIBS_MAIL=@LIBS_MAIL@
+
+## Extra libraries to use when linking movemail.
+LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
+ $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
+
+## Some systems define this to request special libraries.
+LIBS_SYSTEM = @LIBS_SYSTEM@
+
+# Those files shared with other GNU utilities need HAVE_CONFIG_H
+# defined before they know they can take advantage of the information
+# in ../src/config.h.
+BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \
+ -I. -I../src -I${srcdir} -I${srcdir}/../src
+
+ALL_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
+LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
+CPP_CFLAGS = ${BASE_CFLAGS} ${CPPFLAGS} ${CFLAGS}
+
+LOADLIBES=$(LIBS_SYSTEM)
-/* This is the default compilation command.
- But we should never rely on it, because some make version
- failed to find it for getopt.o.
- Using an explicit command made it work. */
+\f
+## This is the default compilation command.
+## But we should never rely on it, because some make version failed to
+## find it for getopt.o.
+## Using an explicit command made it work.
.c.o:
${CC} -c ${CPP_CFLAGS} $<
-.m.o:
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
-
-all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
+all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} ${STAMP_INST_SCRIPTS} ${STAMP_SCRIPTS}
-/* These targets copy the scripts into the build directory
-so that they can be run from there in an uninstalled Emacs.
-The "-" is prepended because some versions of cp barf when
-srcdir is the current directory, and thus the file will be
-copied into itself. */
-rcs2log: $(srcdir)/rcs2log
+## These targets copy the scripts into the build directory so that
+## they can be run from there in an uninstalled Emacs.
+## The "-" is prepended because some versions of cp barf when srcdir
+## is the current directory, and thus the file will be copied into itself.
+stamp-rcs2log: $(srcdir)/rcs2log
-cp -p $(srcdir)/rcs2log rcs2log
+ touch $@
-rcs-checkin: $(srcdir)/rcs-checkin
+stamp-rcs-checkin: $(srcdir)/rcs-checkin
-cp -p $(srcdir)/rcs-checkin rcs-checkin
+ touch $@
-grep-changelog: $(srcdir)/grep-changelog
+stamp-grep-changelog: $(srcdir)/grep-changelog
-cp -p $(srcdir)/grep-changelog grep-changelog
+ touch $@
-vcdiff: $(srcdir)/vcdiff
+stamp-vcdiff: $(srcdir)/vcdiff
-cp -p $(srcdir)/vcdiff vcdiff
+ touch $@
-#ifdef MOVEMAIL_NEEDS_BLESSING
+## Only used if we need blessmail, but no harm in always defining.
+## This makes the actual blessmail executable.
blessmail:
$(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
chmod +x blessmail
-#endif
-maybe-blessmail: BLESSMAIL
-#ifdef MOVEMAIL_NEEDS_BLESSING
-/* Don\'t charge ahead and do it! Let the installer decide.
- ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT} */
+## This checks if we need to run blessmail.
+## Do not charge ahead and do it! Let the installer decide.
+need-blessmail: blessmail
@if [ `wc -l <blessmail` != 2 ] ; then \
dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
echo Assuming $$dir is really the mail spool directory, you should; \
echo as root, to give movemail${EXEEXT} appropriate permissions.; \
echo Do that after running make install.; \
fi
-#endif
-/* Install the internal utilities. Until they are installed, we can
- just run them directly from lib-src. */
+## This is the target invoked by the top-level Makefile.
+maybe-blessmail: $(BLESSMAIL_TARGET)
+
+## Install the internal utilities. Until they are installed, we can
+## just run them directly from lib-src.
+## If the chown/chmod commands fail, that is not a big deal.
+## update-game-score will detect at runtime that it is not setuid,
+## and handle things accordingly.
$(DESTDIR)${archlibdir}: all
@echo
@echo "Installing utilities run internally by Emacs."
umask 022; $(top_srcdir)/mkinstalldirs $(DESTDIR)${gamedir}; \
touch $(DESTDIR)${gamedir}/snake-scores; \
touch $(DESTDIR)${gamedir}/tetris-scores
-/* If the following commands fail, that is not a big deal.
- update-game-score will detect at runtime that it is not setuid,
- and handle things accordingly. */
-if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
chown ${gameuser} $(DESTDIR)${gamedir}; \
chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
done)
- (cd $(DESTDIR)${archlibdir} && \
- rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
+ if [ -d $(DESTDIR)${archlibdir} ]; then \
+ (cd $(DESTDIR)${archlibdir} && \
+ rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}) \
+ fi
mostlyclean:
-rm -f core *.o getopt.h getopt.h-t
clean: mostlyclean
-rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
- -rm -f fns*.el *.tab.c *.tab.h
+ -rm -f fns*.el *.tab.c *.tab.h stamp-*
distclean: clean
-rm -f TAGS
extraclean: maintainer-clean
-rm -f *~ \#*
-/* Test the contents of the directory. */
+## Test the contents of the directory.
check:
- @echo "We don't have any tests for GNU Emacs yet."
+ @echo "We don't have any tests for the lib-src/ directory yet."
tags: TAGS
TAGS: etags${EXEEXT}
etags *.[ch]
-/* This verifies that the non-ASCII characters in the file \`testfile\'
- have not been clobbered by whatever means were used to copy and
- distribute Emacs. If they were clobbered, all the .elc files were
- clobbered too. */
+## This verifies that the non-ASCII characters in the file \`testfile\'
+## have not been clobbered by whatever means were used to copy and
+## distribute Emacs. If they were clobbered, all the .elc files were
+## clobbered too.
test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
$(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
./test-distrib ${srcdir}/testfile
-/* We need the following in order to create a <getopt.h> when the system
- does not have one that works with the given compiler. */
+## We need the following in order to create a <getopt.h> when the system
+## does not have one that works with the given compiler.
GETOPT_H = @GETOPT_H@
getopt.h: getopt_.h
cp $(srcdir)/getopt_.h $@-t
REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
- ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+ ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
+ ${srcdir}/../src/regex.c
etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
- $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
+ $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
+ -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
+ $(REGEXPOBJ) $(LOADLIBES) -o etags
ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
- $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
+ $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
+ ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
-/* We depend on etags to assure that parallel makes don\'t write two
- etags.o files on top of each other. */
+## We depend on etags to assure that parallel makes do not write two
+## etags.o files on top of each other.
ctags${EXEEXT}: etags${EXEEXT}
- $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
+ $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
+ -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
+ $(REGEXPOBJ) $(LOADLIBES) -o ctags
profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
$(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
- $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
+ $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
+ -o make-docfile
digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
$(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
$(GETOPTOBJS) $(LOADLIBES) -o b2m
movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
- $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
+ $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
+ $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
- $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
+ $(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) \
+ $(LOADLIBES) -o update-game-score
update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
$(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
-DHAVE_SHARED_GAME_DIR="\"$(gamedir)\""
+
+## Makefile ends here.
#define SEND_BUFFER_SIZE 4096
extern char *strerror ();
-extern int errno;
/* Buffer to accumulate data to send in TCP connections. */
char send_buffer[SEND_BUFFER_SIZE + 1];
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
-#ifndef errno
- extern int errno;
-#endif
#include <sys/types.h>
#include <sys/stat.h>
.PHONY: $(ALL)
-VERSION = 23.2.50
+VERSION = 24.0.50
LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
-DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
#endif
#endif
-#ifndef errno
-extern int errno;
-#endif
char *strerror ();
#ifdef HAVE_INDEX
extern char *index __P ((const char *, int));
+++ /dev/null
-# Auto-generated lisp files, which ignore
-precious ^(loaddefs|finder-inf|cus-load)\.el$
-
-# arch-tag: fc62dc9f-3a91-455b-b8e7-d49df66beee0
-2010-05-19 Uday S Reddy <u.s.reddy@cs.bham.ac.uk> (tiny change)
+2010-05-24 Uday S Reddy <u.s.reddy@cs.bham.ac.uk> (tiny change)
* textmodes/fill.el (fill-region): Don't fill past the end (bug#6201).
+2010-05-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (read-quoted-char): Resolve modifiers after key
+ remapping (bug#6212).
+
+2010-05-22 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.el (image-refresh): Define as an alias for image-flush.
+
+ * image-mode.el (image-toggle-display-image): Caller changed.
+
+2010-05-21 Juri Linkov <juri@jurta.org>
+
+ * progmodes/grep.el (grep-read-files): Fix multi-pattern aliases.
+ Remove "all" from grep-files-aliases. Split grep-files-aliases by
+ whitespace, call wildcard-to-regexp on substrings and concat them
+ with "\\|". (Bug#6114)
+
+2010-05-21 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-engine.el (c-parse-state-get-strategy):
+ Replace parameter `here' with `here-' and `here-plus', which sandwich
+ any pertinent CPP construct.
+ (c-remove-stale-state-cache-backwards): Fix a bug which happens
+ when doing (c-parse-state) in a CPP construct: Exclude any "new"
+ CPP construct from taking part in the scanning.
+
+2010-05-21 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-do-copy-or-rename-file)
+ (tramp-handle-file-local-copy, tramp-maybe-open-connection):
+ Tune `with-progress-reporter' messages.
+ (tramp-handle-vc-registered):
+ * net/tramp-fish.el (tramp-fish-handle-file-local-copy)
+ (tramp-fish-handle-insert-file-contents)
+ (tramp-fish-maybe-open-connection):
+ * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
+ * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file)
+ (tramp-imap-handle-insert-file-contents)
+ (tramp-imap-handle-file-local-copy): Use `with-progress-reporter'.
+
+2010-05-21 Juanma Barranquero <lekktu@gmail.com>
+
+ * add-log.el (change-log-font-lock-keywords):
+ Highlight all authors in multi-author entries.
+
+ * smerge-mode.el (smerge-refine-ignore-whitespace)
+ (smerge-refine-weight-hack, smerge-refine, smerge-makeup-conflict):
+ Fix typos in docstrings.
+ (smerge-resolve, smerge-refine-subst): Reflow docstrings.
+
+2010-05-21 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/fortran.el (fortran-mode):
+ * progmodes/f90.el (f90-mode): Derive from prog-mode.
+
+ * loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer
+ having a relative path in src/Makefile.in.
+
+2010-05-20 Kevin Ryde <user42@zip.com.au>
+
+ * help-mode.el (help-make-xrefs): For Info node links turn
+ newlines into spaces. Link node names with newlines are matched
+ by help-xref-info-regexp and buttonized, this change ensures they
+ can be followed successfully with RET. (Bug#6206)
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * locate.el (locate): Use pop-to-buffer instead of
+ switch-to-buffer-other-window. (Bug#6204)
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * replace.el (replace-highlight): Fix lazy-highlighting
+ for `M-s w str M-% str RET'.
+
+2009-12-15 Masatake YAMATO <yamato@redhat.com>
+
+ * isearch.el (isearch-yank-word-or-char): Pull next subword
+ when `subword-mode' is activated. (Bug#6220)
+
+2010-05-20 Mark A. Hershberger <mah@everybody.org>
+
+ * isearch.el (isearch-update-post-hook): New hook.
+ (isearch-update): Use the new hook. (Bug#6225)
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-mode-map): Bind more keys to isearch-help-map:
+ [f1], [help], and (char-to-string help-char) instead of "\C-h".
+ (Bug#6222)
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-yank-string): Use isearch-process-search-string.
+ (Bug#6223)
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * dired-x.el (dired-jump, dired-jump-other-window): Add arg
+ FILE-NAME to read from the minibuffer when called interactively
+ with prefix argument instead of using buffer-file-name.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00534.html
+
+ * dired.el: Update autoloads.
+
+2010-05-20 Chong Yidong <cyd@stupidchicken.com>
+
+ * nxml/nxml-mode.el (nxml-mode-map): Bind C-c / to
+ nxml-finish-element, for consistency with SGML mode.
+
+ * progmodes/octave-mod.el (octave-mode-map): Bind C-c / to
+ octave-close-block.
+
+2010-05-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * composite.el: Require cl when compiling.
+ (reference-point-alist, compose-gstring-for-graphic)
+ (compose-gstring-for-terminal): Fix typos in docstrings.
+
+2010-05-19 Juri Linkov <juri@jurta.org>
+
+ * emacs-lisp/cl-macs.el (window-parameter): Add defsetf with
+ set-window-parameter.
+
+2010-05-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
+ where appropriate.
+ (tramp-maybe-open-connection): Use it.
+
+2010-05-19 Eli Zaretskii <eliz@gnu.org>
+
+ * simple.el (move-end-of-line): Make sure we are at line beginning
+ before backing up to end of previous line.
+
+2010-05-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * password-cache.el (password-cache-remove): Fix docstring.
+
+ * net/secrets.el: Autoload the widget functions.
+ (secrets-search-items, secrets-create-item)
+ (secrets-get-attributes, secrets-expand-item): Attributes will be
+ stored on the password database without leading ":", as all other
+ clients do as well.
+ (secrets-mode): Fix docstring.
+ (secrets-show-secrets): Provide it as autoloaded command only when
+ D-Bus support is available. Check existence of Secret Service API.
+
+2010-05-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * indent.el (indent-region): Deactivate region (bug#6200).
+
+2010-05-19 Glenn Morris <rgm@gnu.org>
+
+ * vc-dir.el (vc-dir): Don't pop-up-windows. (Bug#6204)
+
+2010-05-19 Kenichi Handa <handa@m17n.org>
+
+ * composite.el: Register compose-gstring-for-graphic in
+ composition-function-table only for combining characters (Mn, Mc, Me).
+
+2010-05-18 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-trail.el (calc-trail-isearch-forward)
+ (calc-trail-isearch-backward): Ensure that the new window
+ point is set correctly.
+
2010-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (read-quoted-char): Resolve modifiers after key
remapping (bug#6212).
-2010-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
+2010-05-18 Michael Albinus <michael.albinus@gmx.de>
- * tmm.el (tmm-prompt): Don't try to precompute bindings.
- (tmm-get-keymap): Compute shortcuts (bug#6171).
+ Add visualization code for secrets.
+ * net/secrets.el (secrets-mode): New major mode.
+ (secrets-show-secrets, secrets-show-collections)
+ (secrets-expand-collection, secrets-expand-item)
+ (secrets-tree-widget-after-toggle-function)
+ (secrets-tree-widget-show-password): New defuns.
-2010-05-10 Glenn Morris <rgm@gnu.org>
+2010-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
- * desktop.el (desktop-save-buffer-p): Don't mistakenly include
- all dired buffers, even tramp ones. (Bug#5755) [Backport from trunk]
+ * emacs-lisp/smie.el (smie-next-sexp): Break inf-loop at BOB.
+ (smie-backward-sexp, smie-forward-sexp): Remove boundary condition now
+ handled in smie-next-sexp.
+ (smie-indent-calculate): Provide a starting indentation (so the
+ recursion is well-founded ;-).
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+ Fix handling of non-associative equal levels.
+ * emacs-lisp/smie.el (smie-prec2-levels): Choose distinct levels even
+ when it's not needed.
+ (smie-op-left, smie-op-right): New functions.
+ (smie-next-sexp): New function, extracted from smie-backward-sexp.
+ Better handle equal levels to distinguish the associative case from
+ the "multi-keyword construct" case.
+ (smie-backward-sexp, smie-forward-sexp): Use it.
- * Version 23.2 released.
+2010-05-18 Juanma Barranquero <lekktu@gmail.com>
-2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+ * progmodes/prolog.el (smie-indent-basic): Declare for byte-compiler.
+
+ * emacs-lisp/smie.el (smie-precs-precedence-table, smie-backward-sexp)
+ (smie-forward-sexp, smie-indent-calculate): Fix typos in docstrings.
+
+2010-05-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Provide a simple generic indentation engine and use it for Prolog.
+ * emacs-lisp/smie.el: New file.
+ * progmodes/prolog.el (prolog-smie-op-levels)
+ (prolog-smie-indent-rules): New var.
+ (prolog-mode-variables): Use them to configure SMIE.
+ (prolog-indent-line, prolog-indent-level): Remove.
+
+2010-05-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-vec.el (math-vector-avg): Put the vector elements in
+ order before computing the averages.
+
+2010-05-16 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-vec.el (calc-histogram):
+ (calcFunc-histogram): Allow vectors as inputs.
+ (math-vector-avg): New function.
+
+ * calc/calc-ext.el (math-group-float): Have the number of digits
+ being grouped depend on the radix (Bug#6189).
+
+2010-05-15 Ken Raeburn <raeburn@raeburn.org>
+
+ * version.el (emacs-copyright, emacs-version): Don't define here,
+ now that emacs.c defines it.
+
+2010-05-15 Eli Zaretskii <eliz@gnu.org>
+
+ * international/mule-cmds.el (mule-menu-keymap): Fix definition of
+ "Describe Language Environment" menu item.
+
+ * language/hebrew.el ("Hebrew", "Windows-1255"): Doc fix.
+
+ Bidi-sensitive movement with arrow keys.
+ * subr.el (right-arrow-command, left-arrow-command): New functions.
+
+ * bindings.el (global-map): Bind them to right and left arrow keys.
+
+ Don't override standard definition of convert-standard-filename.
+ * files.el (convert-standard-filename): Call
+ w32-convert-standard-filename and dos-convert-standard-filename on
+ the corresponding systems.
+
+ * w32-fns.el (w32-convert-standard-filename): Rename from
+ convert-standard-filename. Doc fix.
+
+ * dos-fns.el (dos-convert-standard-filename): Doc fix.
+ (convert-standard-filename): Don't defalias.
+ (register-name-alist, make-register, register-value)
+ (set-register-value, intdos): Obsolete aliases for the
+ corresponding dos-* functions and variables.
+ (dos-intdos): Add a doc string.
+
+2010-05-15 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-aent.el (math-read-token, math-find-user-tokens):
+ * calc/calc-lang.el (math-read-big-rec, math-lang-read-symbol):
+ (math-compose-tex-func):
+ * calc/calccomp.el (math-compose-expr):
+ * calc/calc-ext.el (math-format-flat-expr-fancy):
+ * calc/calc-store.el (calc-read-var-name):
+ * calc/calc-units.el (calc-explain-units-rec): Allow Greek letters.
+
+ * calc/calc.el (var-π, var-φ, var-γ): New variables.
+ * calc/calc-aent.el (math-read-replacement-list): Add "micro" symbol.
+ * calc/calc-units.el (math-unit-prefixes): Add mu for micro.
+ (math-standard-units): Add units.
+
+2010-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/asm-mode.el (asm-mode):
+ * progmodes/prolog.el (prolog-mode): Use define-derived-mode.
+
+ * pcomplete.el (pcomplete-completions-at-point): New function,
+ extracted from pcomplete-std-complete.
+ (pcomplete-std-complete): Use it.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
+ Remove references to CVS, RCS and Old directories.
+
+2010-05-14 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-bin.el (math-format-twos-complement): Group digits when
+ appropriate.
+
+2010-05-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sh-script.el (sh-mode-default-syntax-table): Remove.
+ (sh-mode-syntax-table): Give it a default value instead.
+ (sh-header-marker): Make buffer-local.
+ (sh-mode): Move make-local-variable to the corresponding setq.
+ (sh-add-completer): Avoid gratuitously let-binding a buffer-local var.
+ Use complete-with-action.
+
+ * simple.el (prog-mode): New (abstract) major mode.
+ * emacs-lisp/lisp-mode.el (emacs-lisp-mode, lisp-mode): Use it.
+ * progmodes/sh-script.el (sh-mode): Remove redundant var assignment.
+
+2010-05-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/sql.el (sql-oracle-program): Reflow docstring.
+ (sql-oracle-scan-on, sql-sybase-program, sql-product-font-lock)
+ (sql-add-product-keywords, sql-highlight-product, sql-set-product)
+ (sql-make-alternate-buffer-name, sql-placeholders-filter)
+ (sql-escape-newlines-filter, sql-input-sender)
+ (sql-send-magic-terminator, sql-sybase): Fix typos in docstrings.
+
+2010-05-13 Chong Yidong <cyd@stupidchicken.com>
+
+ Add TeX open-block and close-block keybindings to SGML, and vice versa.
+
+ * textmodes/tex-mode.el (tex-mode-map): Bind C-c C-t to
+ latex-open-block and C-c / to latex-close-block.
+
+ * textmodes/sgml-mode.el (sgml-mode-map): Bind C-c C-o to sgml-tag
+ and C-c C-e to sgml-close-tag.
+
+2010-05-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (with-progress-reporter): Create reporter object
+ only when the message would be displayed. Handle nested calls.
+ (tramp-handle-load, tramp-handle-file-local-copy)
+ (tramp-handle-insert-file-contents, tramp-handle-write-region)
+ (tramp-maybe-send-script, tramp-find-shell):
+ Use `with-progress-reporter'.
+ (tramp-handle-dired-compress-file, tramp-maybe-open-connection):
+ Fix message text.
+
+ * net/tramp-smb.el (tramp-smb-handle-copy-file)
+ (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
+ (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection):
+ Use `with-progress-reporter'.
+
+2010-05-13 Agustín Martín <agustin.martin@hispalinux.es>
+
+ * ispell.el (ispell-init-process): Do not kill ispell process
+ everytime when spellchecking from the minibuffer (bug#6143).
+
+2010-05-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sh-script.el (sh-mode): Use define-derived-mode.
+
+ * dos-fns.el: Add "dos-" prefix for namespace control.
+ (convert-standard-filename): Define as alias for
+ dos-convert-standard-filename but only if applicable.
+
+2010-05-12 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun):
+ Push the mark at the start of these functions when appropriate.
+
+2010-05-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (completion-cycle-threshold): New custom var.
+ (completion--do-completion): Use it.
+ (minibuffer-complete): Use cycling if appropriate.
+
+2010-05-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * dirtrack.el (dirtrackp): Remove defcustom; don't make automatically
+ buffer-local (it's an obsolete alias for `dirtrack-mode') (bug#6173).
+
+2010-05-11 Juri Linkov <juri@jurta.org>
+
+ * scroll-all.el (scroll-all-check-to-scroll):
+ Add `scroll-up-command' and `scroll-down-command' (bug#6164).
+
+2010-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * iimage.el (iimage-mode-map): Move initialization into declaration.
+ (iimage-mode-buffer): Use with-silent-modifications.
+ Simplify calling convention. Adjust callers.
+ (iimage-mode): Don't run hook redundantly.
+
+ * minibuffer.el (completion-pcm--pattern->regex):
+ Fix last change (bug#6160).
+
+2010-05-10 Juri Linkov <juri@jurta.org>
+
+ Remove nodes visited during Isearch from the Info history.
+ * info.el (Info-isearch-initial-history)
+ (Info-isearch-initial-history-list): New variables.
+ (Info-isearch-start): Record initial values of
+ Info-isearch-initial-history and Info-isearch-initial-history-list.
+ Add Info-isearch-end to isearch-mode-end-hook.
+ (Info-isearch-end): New function.
+
+2010-05-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-do-file-attributes-with-stat): Add space in
+ format string, in order to work around a bug in pdksh.
+ Reported by Gilles Pion <gpion@lfdj.com>.
+ (tramp-handle-verify-visited-file-modtime): Do not send a command
+ when the connection is not established.
+ (tramp-handle-set-file-times): Simplify the check for utc.
+
+2010-05-10 Juanma Barranquero <lekktu@gmail.com>
+
+ Fix use of `filter-buffer-substring' (rework previous change).
+ * emulation/cua-base.el (cua--filter-buffer-noprops): New function.
+ (cua-repeat-replace-region):
+ * emulation/cua-rect.el (cua--extract-rectangle, cua-incr-rectangle):
+ * emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
+ (cua-cut-region-to-global-mark): Use it.
+
+2010-05-09 Michael R. Mauger <mmaug@yahoo.com>
+
+ * progmodes/sql.el: Version 2.1.
+ (sql-product-alist): Redesign structure of product info.
+ (sql-product, sql-user, sql-server, sql-database): Safe variables.
+ (sql-port, sql-port-history): New variables.
+ (sql-interactive-product): New variable.
+ (sql-send-terminator): New variable.
+ (sql-imenu-generic-expression): Add "Types" imenu entry.
+ (sql-oracle-login-params, sql-sqlite-login-params)
+ (sql-mysql-login-params, sql-solid-login-params)
+ (sql-sybase-login-params, sql-informix-login-params)
+ (sql-ingres-login-params, sql-ms-login-params)
+ (sql-postgres-login-params, sql-interbase-login-params)
+ (sql-db2-login-params, sql-linter-login-params)
+ (sql-oracle-scan-on): New variables.
+ (sql-mode-map): Add C-c C-i to start interactive mode.
+ (sql-mode-menu): Update existing menu entries.
+ (sql-font-lock-keywords-builder): Compile-time font-lock optimization.
+ (sql-mode-oracle-font-lock-keywords)
+ (sql-mode-postgres-font-lock-keywords)
+ (sql-mode-ms-font-lock-keywords)
+ (sql-mode-sybase-font-lock-keywords)
+ (sql-mode-informix-font-lock-keywords)
+ (sql-mode-interbase-font-lock-keywords)
+ (sql-mode-ingres-font-lock-keywords)
+ (sql-mode-solid-font-lock-keywords)
+ (sql-mode-mysql-font-lock-keywords)
+ (sql-mode-sqlite-font-lock-keywords)
+ (sql-mode-db2-font-lock-keywords)
+ (sql-mode-linter-font-lock-keywords): Update initialization to
+ reduce run-time complexity.
+ (sql-add-product, sql-del-product): New functions.
+ (sql-set-product-feature, sql-get-product-feature): New functions.
+ (sql-product-font-lock): Update product API.
+ (sql-add-product-keywords): New function.
+ (sql-highlight-product): Update product API.
+ (sql-help-list-products): New function.
+ (sql-help): Dynamically lists free and non-free products.
+ (sql-get-login): Correct bug in handling history and added
+ prompt for port.
+ (sql-copy-column): Copy without properties.
+ (sqli-input-sender): Apply filters to SQLi input.
+ (sql-query-placeholders-and-send): Obey `sql-oracle-scan-on' setting.
+ Implement as a filter.
+ (sql-escape-newlines-filter): Implement as a filter.
+ (sql-remove-tabs-filter): New function.
+ (sql-send-magic-terminator): New function.
+ (sql-send-string): Implement magic terminator.
+ (sql-send-region): Use `sql-send-string'.
+ (sql-interactive-mode): Use product API.
+ (sql-product-interactive): Use product API.
+ (sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
+ (sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
+ (sql-db2, sql-linter): Use `sql-product-interactive'.
+ (sql-connect): New function.
+ (sql-connect-oracle, sql-connect-sybase, sql-connect-informix)
+ (sql-connect-sqlite, sql-connect-mysql, sql-connect-solid)
+ (sql-connect-ingres, sql-connect-ms, sql-connect-postgres)
+ (sql-connect-interbase, sql-connect-db2, sql-connect-linter):
+ Use `sql-connect'.
+
+2010-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (completion-pcm-complete-word-inserts-delimiters):
+ New custom variable.
+ (completion-pcm--string->pattern): Use it.
+ (completion-pcm--pattern->regex, completion-pcm--pattern->string):
+ Make it handle any symbol as `any'.
+ (completion-pcm--merge-completions): Extract common suffix for the new
+ `prefix' symbol as well.
+ (completion-substring--all-completions): Use the new `prefix' symbol.
+
+2010-05-09 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
+ not bound.
+ (tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT.
+ (tramp-compat-funcall): New defmacro.
+ (tramp-compat-line-beginning-position)
+ (tramp-compat-line-end-position)
+ (tramp-compat-temporary-file-directory)
+ (tramp-compat-make-temp-file, tramp-compat-file-attributes)
+ (tramp-compat-copy-file, tramp-compat-copy-directory)
+ (tramp-compat-delete-file, tramp-compat-delete-directory)
+ (tramp-compat-number-sequence, tramp-compat-process-running-p)
+ * net/tramp.el (top, with-progress-reporter)
+ (tramp-rfn-eshadow-setup-minibuffer)
+ (tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times)
+ (tramp-handle-dired-compress-file, tramp-handle-shell-command)
+ (tramp-completion-mode-p, tramp-check-for-regexp)
+ (tramp-open-connection-setup-interactive-shell)
+ (tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd)
+ (tramp-time-diff, tramp-coding-system-change-eol-conversion)
+ (tramp-set-process-query-on-exit-flag, tramp-unload-tramp)
+ * net/tramp-cmds.el (tramp-cleanup-all-connections)
+ (tramp-reporter-dump-variable, tramp-load-report-modules)
+ (tramp-append-tramp-buffers)
+ * net/tramp-gvfs.el (tramp-gvfs-handle-file-selinux-context): Use it.
+
+ * net/tramp-imap.el (top): Autoload `epg-make-context'.
+
+2010-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/compile.el (compilation-buffer-modtime): Rename from
+ buffer-modtime. Adjust users.
- * international/mule.el (auto-coding-alist): Only purecopy
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
+
+ * international/mule.el (auto-coding-alist): Only purecopy
car of each item, not the whole list (Bug#6083).
-2010-05-02 Chong Yidong <cyd@stupidchicken.com>
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* progmodes/js.el (js-mode): Make paragraph variables local before
calling c-setup-paragraph-variables (Bug#6071).
-2010-05-01 Eli Zaretskii <eliz@gnu.org>
+2010-05-08 Eli Zaretskii <eliz@gnu.org>
* composite.el (compose-region, reference-point-alist): Fix typos
in the doc strings.
-2010-04-28 Alexander Klimov <alserkli@inbox.ru> (tiny change)
+2010-05-08 Alexander Klimov <alserkli@inbox.ru> (tiny change)
* calc/calc-graph.el (calc-graph-plot): Use the proper form for
gnuplot's "set" command.
-2010-04-26 Juanma Barranquero <lekktu@gmail.com>
+2010-05-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * abbrev.el (last-abbrev-text): Doc fix.
+ (abbrev-prefix-mark): Don't escape parenthesis.
+
+2010-05-08 Andreas Schwab <schwab@linux-m68k.org>
+
+ * composite.el (find-composition): Doc fix.
+
+2010-05-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/sql.el (sql-electric-stuff): Fix typo in tag.
+ (sql-oracle-program, sql-sqlite-options)
+ (sql-query-placeholders-and-send): Doc fixes.
+ (sql-set-product, sql-interactive-mode): Reflow docstrings.
+ (sql-imenu-generic-expression, sql-buffer)
+ (sql-mode-ansi-font-lock-keywords, sql-mode-oracle-font-lock-keywords)
+ (sql-mode-postgres-font-lock-keywords, sql-mode-ms-font-lock-keywords)
+ (sql-mode-sybase-font-lock-keywords)
+ (sql-mode-informix-font-lock-keywords)
+ (sql-mode-interbase-font-lock-keywords)
+ (sql-mode-ingres-font-lock-keywords, sql-mode-solid-font-lock-keywords)
+ (sql-mode-mysql-font-lock-keywords, sql-mode-sqlite-font-lock-keywords)
+ (sql-mode-db2-font-lock-keywords, sql-mode-font-lock-keywords)
+ (sql-product-feature, sql-highlight-product)
+ (comint-line-beginning-position, sql-rename-buffer)
+ (sql-toggle-pop-to-buffer-after-send-region sql-oracle)
+ (sql-sybase, sql-informix, sql-sqlite, sql-mysql, sql-solid)
+ (sql-ingres, sql-ms, sql-postgres, sql-interbase, sql-db2, sql-linter):
+ Fix typos in docstrings.
+
+2010-05-08 Juri Linkov <juri@jurta.org>
+
+ * info.el (Info-fontify-node): Put Info-breadcrumbs to the `display'
+ property instead of `invisible' and `after-string' (bug#5998).
+
+2010-05-08 Juri Linkov <juri@jurta.org>
+
+ * image-mode.el (image-mode-as-text): Fix typo in docstring.
+
+2010-05-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * filecache.el (file-cache-add-directory-list)
+ (file-cache-add-directory-recursively): Fix typos in docstrings.
+
+2010-05-08 Kenichi Handa <handa@m17n.org>
+
+ * language/indian.el (gurmukhi-composable-pattern): Fix typo.
+ (gujarati-composable-pattern): Fix typo.
+
+2010-05-08 Kenichi Handa <handa@m17n.org>
+
+ * language/indian.el (oriya-composable-pattern)
+ (tamil-composable-pattern, malayalam-composable-pattern):
+ Add two-part vowels to "v" (vowel sign).
+
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
+
+ * files.el (copy-directory): Handle symlinks (Bug#5982).
+
+2010-05-08 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vc-hg.el (vc-hg-state): Use HGRCPATH, not HGRC.
+ (vc-hg-working-revision): Likewise. Use hg parents, not hg parent
+ (Bug#5846).
+
+2010-05-08 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/lisp.el (lisp-completion-at-point): Give it a doc string.
+
+ * minibuffer.el (completion-at-point): Doc fix.
+
+2010-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * electric.el (Electric-command-loop): Minor tweak.
+
+ * ebuff-menu.el (electric-buffer-list): Try and make it behave a bit
+ better with dedicated windows.
+
+2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * Version 23.2 released.
+
+2010-05-07 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
+ Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Highlight vendor specific properties.
+ * textmodes/css-mode.el (css-proprietary-nmstart-re): New var.
+ (css-proprietary-property): New face.
+ (css-font-lock-keywords): Use them.
+
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ * cus-start.el (all): Add native condition for tool-bar-* symbols.
+
+2010-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * textmodes/dns-mode.el (auto-mode-alist): Add entry for .zone files.
+ * files.el (auto-mode-alist): Remove redundant entries.
+
+ * files.el (auto-save-mode): Move to simple.el to fix bootstrap.
+ * simple.el (auto-save-mode): Move from files.el.
+ * minibuffer.el (completion--common-suffix): Fix copy&paste error.
+
+2010-05-07 Christian von Roques <roques@mti.ag> (tiny change)
+
+ * lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592).
+
+2010-05-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mail/binhex.el (binhex-decode-region-internal)
+ * mail/uudecode.el (uudecode-decode-region-internal)
+ * net/dns.el (dns-read-string-name, dns-write, dns-read)
+ (dns-read-type, dns-query)
+ * pgg-parse.el (pgg-parse-armor)
+ * pgg.el (pgg-verify-region)
+ * sha1.el (sha1-string-external): Don't run set-buffer-multibyte for
+ XEmacs.
+
+ * net/imap.el (imap-disable-multibyte): Redefine it as a macro.
+
+2010-05-07 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
+
+ Fix use of `filter-buffer-substring' (4th arg NOPROPS removed).
+ * emulation/cua-base.el (cua-repeat-replace-region):
+ * emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
+ (cua-cut-region-to-global-mark):
+ Remove text properties with `set-text-properties'.
+
+2010-05-06 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (top, with-progress-reporter):
+ Use `symbol-function' inside `funcall'.
+
+ * net/tramp-compat.el (tramp-compat-file-attributes)
+ (tramp-compat-delete-file, tramp-compat-delete-directory):
+ Handle only `wrong-number-of-arguments' error.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Fix typo.
+ (tramp-gvfs-handle-file-selinux-context): Use `symbol-function'
+ inside `funcall'.
+
+2010-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (completion--sreverse, completion--common-suffix):
+ New functions.
+ (completion-pcm--merge-completions): Extract common suffix when safe.
+
+ * emacs-lisp/easy-mmode.el (define-minor-mode):
+ Make :variable more flexible.
+ * files.el (auto-save-mode): Use it to define using define-minor-mode.
+
+2010-05-05 Juri Linkov <juri@jurta.org>
+
+ Add `slow' and `history' tags to the desktop data.
+
+ * info.el (Info-virtual-nodes) [*Index*]: Add `slow' tag.
+ (Info-virtual-files) [*Apropos*]: Add `slow' tag.
+ (Info-finder-find-node): Require `finder.el' to be able
+ to restore node from the desktop.
+ (Info-desktop-buffer-misc-data): Save all nodes. Save additional
+ data `Info-history' and `slow' tag in the assoc list.
+ (Info-restore-desktop-buffer): Don't restore nodes with the
+ `slow' tag. Restore `Info-history'.
+
+2010-05-05 Michael Albinus <michael.albinus@gmx.de>
+
+ Add FORCE argument to `delete-file'.
+
+ * net/ange-ftp.el (ange-ftp-del-tmp-name): Make it a defun,
+ forcing to delete the temporary file.
+ (ange-ftp-delete-file): Add FORCE arg.
+ (ange-ftp-rename-remote-to-remote)
+ (ange-ftp-rename-local-to-remote, ange-ftp-rename-remote-to-local)
+ (ange-ftp-load, ange-ftp-compress, ange-ftp-uncompress):
+ Force file deletion.
+
+ * net/tramp-compat.el (tramp-compat-delete-file): New defun.
+
+ * net/tramp.el (tramp-handle-delete-file): Add FORCE arg.
+ (tramp-handle-make-symbolic-link, tramp-handle-load)
+ (tramp-do-copy-or-rename-file-via-buffer)
+ (tramp-do-copy-or-rename-file-directly)
+ (tramp-do-copy-or-rename-file-out-of-band)
+ (tramp-handle-process-file, tramp-handle-call-process-region)
+ (tramp-handle-shell-command, tramp-handle-file-local-copy)
+ (tramp-handle-insert-file-contents, tramp-handle-write-region)
+ (tramp-delete-temp-file-function): Use `tramp-compat-delete-file'.
+
+ * net/tramp-fish.el (tramp-fish-handle-delete-file): Add FORCE arg.
+ (tramp-fish-handle-make-symbolic-link)
+ (tramp-fish-handle-process-file): Use `tramp-compat-delete-file'.
+
+ * net/tramp-ftp.el (tramp-ftp-file-name-handler):
+ Use `tramp-compat-delete-file'.
+
+ * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Add FORCE arg.
+ (tramp-gvfs-handle-write-region): Use `tramp-compat-delete-file'.
+
+ * net/tramp-imap.el (tramp-imap-handle-delete-file): Add FORCE arg.
+ (tramp-imap-do-copy-or-rename-file): Use `tramp-compat-delete-file'.
+
+ * net/tramp-smb.el (tramp-smb-handle-delete-file): Add FORCE arg.
+ (tramp-smb-handle-copy-file, tramp-smb-handle-file-local-copy)
+ (tramp-smb-handle-rename-file, tramp-smb-handle-write-region): Use
+ `tramp-compat-delete-file'.
+
+2010-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Minor cleanups.
+ * subr.el (add-minor-mode): Use push.
+ * mail/supercite.el (sc-electric-mode): Use more descriptive arg name.
+ * emulation/edt.el (edt-select-mode): Simplify.
+
+ Use define-minor-mode in more cases.
+ * term/tvi970.el (tvi970-set-keypad-mode):
+ * simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode)
+ (normal-erase-is-backspace-mode):
+ * scroll-bar.el (scroll-bar-mode): Use it and define-minor-mode.
+ (set-scroll-bar-mode-1): (Re)move to its sole caller.
+ (get-scroll-bar-mode): New function.
+ * emacs-lisp/cl-macs.el (eq): Handle a non-variable first arg.
+
+ Use define-minor-mode for less obvious cases.
+ * emacs-lisp/easy-mmode.el (define-minor-mode): Add :variable keyword.
+ * emacs-lisp/cl-macs.el (terminal-parameter, eq): Add setf method.
+ * international/iso-ascii.el (iso-ascii-mode):
+ * frame.el (auto-raise-mode, auto-lower-mode):
+ * composite.el (global-auto-composition-mode): Use define-minor-mode.
+
+2010-05-04 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-methods): Remove "-q" from `tramp-login-args'
+ in order to see error messages for failed logins.
+
+2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+
+ * diff.el (diff-sentinel):
+
+ * epg.el (epg--make-temp-file, epg-decrypt-string)
+ (epg-verify-string, epg-sign-string, epg-encrypt-string):
+
+ * jka-compr.el (jka-compr-partial-uncompress)
+ (jka-compr-call-process, jka-compr-write-region, jka-compr-load):
+
+ * server.el (server-sentinel): Use delete-file's new FORCE arg
+ (Bug#6070).
+
+2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use define-minor-mode where applicable.
+ * view.el (view-mode):
+ * type-break.el (type-break-query-mode)
+ (type-break-mode-line-message-mode):
+ * textmodes/reftex.el (reftex-mode):
+ * term/vt100.el (vt100-wide-mode):
+ * tar-mode.el (tar-subfile-mode):
+ * savehist.el (savehist-mode):
+ * ibuf-ext.el (ibuffer-auto-mode):
+ * composite.el (auto-composition-mode):
+ * progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode):
+ Use define-minor-mode.
+ (vhdl-mode): Use static mode-line format.
+ (vhdl-mode-line-update): Delete.
+ (vhdl-create-mode-menu, vhdl-activate-customizations)
+ (vhdl-hs-minor-mode): Don't bother calling it.
+
+2010-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * simple.el (with-wrapper-hook): Move.
+ (buffer-substring-filters): Mark obsolete.
+ (filter-buffer-substring-functions): New variable.
+ (filter-buffer-substring): Use it. Remove unused arg `noprops'.
+
+ Use a mode-line spec rather than a static string in Semantic.
+ * cedet/semantic/util-modes.el:
+ (semantic-minor-modes-format): New var to replace...
+ (semantic-minor-modes-status): Remove.
+ (semantic-mode-line-update): Construct a mode-line spec rather than
+ a static string so that mouse buttons can be used on individual minor
+ modes and so that semantic-mode-line-update only needs to be called
+ when global settings are changed.
+ (semantic-add-minor-mode, semantic-toggle-minor-mode-globally):
+ Call semantic-mode-line-update.
+ (semantic-toggle-minor-mode-globally): Don't assume mode is on
+ minor-mode-alist, check semantic-minor-mode-alist as well.
+ (semantic-stickyfunc-mode, semantic-show-parser-state-auto-marker)
+ (semantic-show-parser-state-marker, semantic-show-parser-state-mode)
+ (semantic-show-unmatched-syntax-mode, semantic-highlight-edits-mode):
+ * cedet/semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
+ * cedet/semantic/idle.el (semantic-idle-scheduler-mode)
+ (define-semantic-idle-service, semantic-idle-summary-mode):
+ * cedet/semantic/decorate/mode.el (semantic-decoration-mode):
+ Don't call semantic-mode-line-update any more.
+
+2010-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use define-minor-mode in CEDET where applicable.
+
+ * cedet/srecode/mode.el (srecode-minor-mode,global-srecode-minor-mode):
+ Use define-minor-mode.
+
+ * cedet/semantic/util-modes.el (semantic-add-minor-mode):
+ Remove unused arg `keymap' and code redundant with define-minor-mode.
+ (semantic-toggle-minor-mode-globally): Only handle arg -1 and 1.
+ (semantic-stickyfunc-mode, global-semantic-show-unmatched-syntax-mode)
+ (semantic-highlight-func-mode, global-semantic-show-parser-state-mode)
+ (global-semantic-highlight-edits-mode, semantic-highlight-edits-mode)
+ (semantic-show-unmatched-syntax-mode, semantic-show-parser-state-mode)
+ (global-semantic-stickyfunc-mode, global-semantic-highlight-func-mode):
+ Use define-minor-mode.
+ (semantic-stickyfunc-mode-setup, semantic-highlight-edits-mode-setup)
+ (semantic-show-unmatched-syntax-mode-setup)
+ (semantic-show-parser-state-mode-setup)
+ (semantic-highlight-func-mode-setup): Inline into sole caller.
+
+ * cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
+ (semantic-mru-bookmark-mode): Use define-minor-mode.
+ (semantic-mru-bookmark-mode-setup): Inline into sole caller.
+
+ * cedet/semantic/idle.el (define-semantic-idle-service):
+ Use define-minor-mode and inline setup function into its sole caller.
+ (semantic-idle-scheduler-mode-setup)
+ (semantic-idle-summary-mode-setup): Inline into sole caller.
+ (global-semantic-idle-scheduler-mode, semantic-idle-scheduler-mode):
+ Use define-minor-mode.
+
+ * cedet/semantic/decorate/mode.el (global-semantic-decoration-mode)
+ (semantic-decoration-mode): Use define-minor-mode.
+ (semantic-decoration-mode-setup): Inline into sole caller.
+
+ * cedet/ede/dired.el (ede-dired-minor-mode): Initialize in declaration.
+ (ede-dired-minor-mode): Use define-minor-mode and derived-mode-p.
+ (ede-dired-add-to-target): Use dolist.
+
+2010-05-01 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
+ Michael Albinus <michael.albinus@gmx.de>
+
+ Implement compression for inline methods.
+
+ * net/tramp.el (tramp-inline-compress-start-size): New defcustom.
+ (tramp-copy-size-limit): Allow also nil.
+ (tramp-inline-compress-commands): New defconst.
+ (tramp-find-inline-compress, tramp-get-inline-compress)
+ (tramp-get-inline-coding): New defuns.
+ (tramp-get-remote-coding, tramp-get-local-coding): Remove,
+ replaced by `tramp-get-inline-coding'.
+ (tramp-handle-file-local-copy, tramp-handle-write-region)
+ (tramp-method-out-of-band-p): Use `tramp-get-inline-coding'.
+
+2010-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * bindings.el (mode-line-abbrev-mode, mode-line-auto-fill-mode):
+ Remove unused functions.
+
+ * emacs-lisp/lisp-mode.el (lisp-mode): Use define-derived-mode.
+ Set find-tag-default-function as a variable rather than a property.
+
+ * minibuffer.el (tags-completion-at-point-function): Move to etags.el.
+ * progmodes/etags.el (tags-completion-at-point-function):
+ Remove left over interactive spec. Add autoloading stub.
+ (complete-tag): Use tags-completion-at-point-function.
+
+2010-04-30 Chong Yidong <cyd@stupidchicken.com>
+
+ * minibuffer.el (tags-completion-at-point-function): Fix return value.
+
+2010-04-30 Eli Zaretskii <eliz@gnu.org>
+
+ * composite.el (compose-region, reference-point-alist): Fix typos
+ in the doc strings.
+
+2010-04-29 Chong Yidong <cyd@stupidchicken.com>
+
+ * ido.el (ido-init-completion-maps): Remove C-v binding.
+ (ido-minibuffer-setup): Don't set cua-inhibit-cua-keys (Bug#5765).
+
+2010-04-29 Chong Yidong <cyd@stupidchicken.com>
+
+ * minibuffer.el (tags-completion-at-point-function): New function.
+ (completion-at-point-functions): Use it.
+
+ * cedet/semantic.el (semantic-completion-at-point-function): New function.
+ (semantic-mode): Use semantic-completion-at-point-function for
+ completion-at-point-functions instead.
+
+ * progmodes/etags.el (complete-tag): Revert last change.
+
+2010-04-29 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-mode.el (c-extend-region-for-CPP): Fix an
+ off-by-one error (in end of macro position).
+
+2010-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * net/browse-url.el (browse-url-firefox-program): Use iceweasel if
+ firefox is absent. Don't autoload.
+ (browse-url-galeon-program): Don't autoload.
+
+2010-04-28 Chong Yidong <cyd@stupidchicken.com>
+
+ * bindings.el (complete-symbol): Move into minibuffer.el.
+
+ * minibuffer.el (complete-tag): Move from etags.el. If tags
+ completion cannot be performed, return nil instead of signalling
+ an error.
+ (completion-at-point): Make it an alias for complete-symbol.
+ (complete-symbol): Move from bindings.el, and replace with the
+ body of completion-at-point.
+
+ * progmodes/etags.el (complete-tag): Move to minibuffer.el.
+
+ * cedet/semantic.el (semantic-mode): When enabled, add
+ semantic-ia-complete-symbol to completion-at-point-functions.
+
+ * cedet/semantic/ia.el (semantic-ia-complete-symbol): Return nil
+ if Semantic is not active.
+
+2010-04-28 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-remote-selinux-p): New defun.
+ (tramp-handle-file-selinux-context)
+ (tramp-handle-set-file-selinux-context): Use it.
+
+2010-04-28 Sam Steingold <sds@gnu.org>
+
+ * progmodes/bug-reference.el (bug-reference-url-format): Mark as
+ `safe-local-variable' if the value is a string or a symbol with
+ the property `bug-reference-url-format'.
+
+2010-04-28 Chong Yidong <cyd@stupidchicken.com>
+
+ * progmodes/bug-reference.el (bug-reference-url-format): Revert
+ 2010-04-27 change due to security risk.
+
+2010-04-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Make it possible to locally disable a globally enabled mode.
+ * simple.el (fundamental-mode): Run fundamental-mode-hook.
+ * emacs-lisp/derived.el (define-derived-mode): Use fundamental-mode
+ rather than kill-all-local-variables so it runs fundamental-mode-hook.
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Use fundamental-mode-hook to run MODE-enable-in-buffers earlier, so
+ that subsequent hooks get a chance to disable it.
+
+2010-04-27 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
+ Avoid re-enabling a minor mode after the user turned the minor mode
+ off if MODE-enable-in-buffers is run twice (typically once from
+ fundamental-mode's after-change-major-mode-hook and a second time from
+ run-mode-hook's own after-change-major-mode-hook).
+
+ * emacs-lisp/lisp.el (lisp-complete-symbol): Fail gracefully.
+
+2010-04-27 Sam Steingold <sds@gnu.org>
+
+ * progmodes/bug-reference.el (bug-reference-url-format): Mark as
+ `safe-local-variable' if the value is a string or a function, as
+ documented and implemented on 2010-04-02.
+
+2010-04-27 Juanma Barranquero <lekktu@gmail.com>
+
+ * ido.el (ido-buffer-internal): Bind `ido-use-virtual-buffers' to nil
+ when method is 'kill.
+
+2010-04-27 Agustín Martín <agustin.martin@hispalinux.es>
+
+ * ispell.el (ispell-init-process): Fix personal dictionary condition
+ in default directory check.
+ (ispell-init-process,ispell-kill-ispell,kill-buffer-hook):
+ Kill ispell process when killing its associated buffer.
+
+2010-04-27 Jan Djärv <jan.h.d@swipnet.se>
+
+ * desktop.el (desktop-kill): ask-if-new: Ask if desktop file exists,
+ but we aren't using it.
+
+2010-04-25 Jan Djärv <jan.h.d@swipnet.se>
+
+ * tool-bar.el (tool-bar-local-item-from-menu): Revert unintended
+ checkin in 2010-04-23T16:26:11Z!monnier@iro.umontreal.ca.
+
+2010-04-24 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/authors.el (authors-obsolete-files-regexps):
+ Ignore VCS-ignore files, and deleted nextstep preferences files.
+ (authors-ignored-files): Ignore deleted cedet test files, and "*.el".
+ (authors-ambiguous-files): New list.
+ (authors-valid-file-names): Add some deleted files.
+ (authors-renamed-files-alist): Add font-setting.el, edt-user.doc.
+ (authors-disambiguate-file-name): New function. (Bug#5501)
+ (authors-canonical-file-name): Doc fix.
+ Don't warn about obsolete files.
+ (authors-canonical-file-name, authors-scan-el):
+ Use authors-disambiguate-file-name.
+
+ * hfy-cmap.el (htmlfontify-load-rgb-file, hfy-fallback-colour-values):
+ Add autoload cookies.
+ (htmlfontify-unload-rgb-file, hfy-fallback-colour-values): Add docs.
+ (generated-autoload-file): Set file-local value to "htmlfontify.el".
+ * htmlfontify.el (caddr, cadddr): Remove fallback definitions.
+ They have definitions / compiler macros in cl.el.
+ (htmlfontify-load-rgb-file, hfy-fallback-colour-values):
+ Replace manual autoloads with generated ones.
+ (htmlfontify-unload-rgb-file): Remove autoload.
+ * Makefile.in (autoloads): Ensure htmlfontify.el is writable.
+
+2010-04-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/bytecomp.el (byte-compile-set-default): New function.
+ (byte-compile-setq-default): Optimize for the
+ single-var case and don't call byte-compile-form in this case to avoid
+ inf-loop with byte-compile-set-default.
+
+ * progmodes/compile.el (compilation-start): Abbreviate default directory.
+
+2010-04-23 Michael Albinus <michael.albinus@gmx.de>
+
+ Implement SELINUX backends.
+
+ * net/tramp.el (tramp-file-name-handler-alist):
+ Add `file-selinux-context' and `set-file-selinux-context'.
+ (tramp-handle-file-selinux-context)
+ (tramp-handle-set-file-selinux-context): New defuns.
+ (tramp-handle-copy-file, tramp-do-copy-or-rename-file):
+ Handle PRESERVE-SELINUX-CONTEXT.
+
+ * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
+ Add `file-selinux-context' and `set-file-selinux-context'.
+ (tramp-gvfs-handle-file-selinux-context)
+ (tramp-gvfs-handle-set-file-selinux-context): New defuns.
+ (tramp-gvfs-handle-copy-file): Handle PRESERVE-SELINUX-CONTEXT.
+
+ * net/ange-ftp.el (ange-ftp-copy-file):
+ * net/tramp-fish.el (tramp-fish-handle-copy-file):
+ * net/tramp-imap.el (tramp-imap-handle-copy-file):
+ * net/tramp-smb.el (tramp-smb-handle-copy-file):
+ Add PRESERVE-SELINUX-CONTEXT.
+
+2010-04-22 Michael Albinus <michael.albinus@gmx.de>
+
+ Synchronize with Tramp repository.
+
+ * net/tramp.el (with-connection-property, tramp-completion-mode-p)
+ (tramp-action-process-alive, tramp-action-out-of-band)
+ (tramp-check-for-regexp, tramp-file-name-p, tramp-equal-remote)
+ (tramp-exists-file-name-handler): Fix docstring.
+ (with-progress-reporter): New defmacro.
+ (tramp-do-copy-or-rename-file, tramp-handle-dired-compress-file)
+ (tramp-maybe-open-connection): Use it.
+
+2010-04-22 Noah Lavine <noah549@gmail.com> (tiny change)
+
+ Detect ssh 'ControlMaster' argument automatically in some cases.
+
+ * net/tramp.el (tramp-detect-ssh-controlmaster): New defun.
+ (tramp-default-method): Use it.
+
+2010-04-22 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-handle-copy-file): Add new optional
+ parameter `preserve-selinux-context'.
+ (tramp-file-name-for-operation): Add `set-file-selinux-context'.
+
+2010-04-22 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-completion-handle-file-name-all-completions):
+ Ensure, that non remote files are still checked. Oops.
+
+2010-04-21 Michael Albinus <michael.albinus@gmx.de>
+
+ Fix Bug#5840.
+
+ * icomplete.el (icomplete-completions): Use `non-essential'.
+
+ * net/tramp.el (tramp-connectable-p): New defun.
+ (tramp-handle-expand-file-name)
+ (tramp-completion-handle-file-name-all-completions)
+ (tramp-completion-handle-file-name-completion): Use it.
+
+2010-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/lisp.el (lisp-completion-at-point): Try and handle errors.
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * vc-dir.el (vc-dir-tool-bar-map): Add :label on some tool bar items.
+
+ * tool-bar.el (tool-bar-setup): Add :label on some tool bar items.
+
+ * loadup.el: Load dynamic-setting.el if feature dynamic-setting
+ is present.
+
+ * info.el (info-tool-bar-map): Add labels.
+
+ * cus-start.el (all): Add tool-bar-style and tool-bar-max-label-size.
+
+ * cus-edit.el (custom-commands): Add labels for tool bar.
+ (custom-buffer-create-internal, Custom-mode): Adjust for
+ labels in custom-commands.
+
+ * dynamic-setting.el: Renamed from font-setting.el.
+
+2010-04-21 John Wiegley <jwiegley@gmail.com>
+
+ * ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o
+ toggles the use of virtual buffers.
+ (ido-buffer-internal): Guard `ido-use-virtual-buffers' global
+ value.
+ (ido-toggle-virtual-buffers): New function.
+
+2010-04-21 Juanma Barranquero <lekktu@gmail.com>
+
+ Use `define-derived-mode'; fix window selection; doc fixes.
+ * play/tetris.el (tetris, tetris-update-speed-function)
+ (tetris-tty-colors, tetris-x-colors, tetris-move-bottom)
+ (tetris-move-left, tetris-move-right, tetris-rotate-prev)
+ (tetris-rotate-next, tetris-end-game, tetris-start-game)
+ (tetris-pause-game): Fix typos in docstrings.
+ (tetris-mode-map, tetris-null-map):
+ Move initialization into declaration.
+ (tetris-mode): Define with `define-derived-mode';
+ set show-trailing-whitespace to nil.
+ (tetris): Prefer window already displaying the "*Tetris*" buffer.
+
+2010-04-21 Karel Klíč <kklic@redhat.com>
+
+ * files.el (backup-buffer): Handle SELinux context, and return it
+ if a backup was made by renaming.
+ (backup-buffer-copy): Set SELinux context to the target file.
+ (basic-save-buffer): Set SELinux context of the newly written file.
+ (basic-save-buffer-1): Now it also returns any SELinux context.
+ (basic-save-buffer-2): Set SELinux context of the newly created file,
+ and return it.
+ * net/tramp.el (tramp-file-name-for-operation):
+ Add file-selinux-context.
+
+2010-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Make the log-edit comments use RFC822 format throughout.
+
+ * vc.el (vc-checkin, vc-modify-change-comment):
+ Adjust to new vc-start/finish-logentry.
+ (vc-find-conflicted-file): New command.
+ (vc-transfer-file): Adjust to new vc-checkin.
+ (vc-next-action): Improve scoping.
+
+ * vc-hg.el (vc-hg-log-edit-mode): Remove.
+ (vc-hg-checkin): Remove extra arg. Use log-edit-extract-headers.
+
+ * vc-git.el (vc-git-log-edit-mode): Remove.
+ (vc-git-checkin): Remove extra arg. Use log-edit-extract-headers.
+ (vc-git-commits-coding-system): Rename from git-commits-coding-system.
+
+ * vc-dispatcher.el (vc-log-edit): Shorten names for log-edit-show-files.
+ (vc-start-logentry): Remove argument `extra'.
+ (vc-finish-logentry): Remove extra args.
+
+ * vc-bzr.el (vc-bzr-log-edit-mode): Remove.
+ (vc-bzr-checkin): Remove extra arg. Use log-edit-extract-headers.
+ (vc-bzr-conflicted-files): New function.
+
+ * log-edit.el (log-edit-extra-flags)
+ (log-edit-before-checkin-process): Remove.
+ (log-edit-summary, log-edit-header, log-edit-unknown-header): New faces.
+ (log-edit-headers-alist): New var.
+ (log-edit-header-contents-regexp): New const.
+ (log-edit-match-to-eoh): New function.
+ (log-edit-font-lock-keywords): Use them.
+ (log-edit): Insert a "Summary:" header as default.
+ (log-edit-mode): Mark font-lock rules as case-insensitive.
+ (log-edit-done): Cleanup headers.
+ (log-view-process-buffer): Remove.
+ (log-edit-extract-headers): New function to replace it.
+
+2010-04-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * subr.el (default-direction-reversed): Remove obsolescence info.
+
+2010-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-dispatcher.el (vc-finish-logentry): Don't mess so badly with the
+ windows/frames.
+
+ * emacs-lisp/lisp.el (lisp-completion-at-point): Complete around point.
+ I.e. include text after point in the completion region.
+ Also, return nil when we're not after/in a symbol.
+
+ * international/mule-cmds.el (view-hello-file): Don't fiddle with the
+ default enable-multibyte-characters.
+
+2010-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * international/mule.el: Help the user choose a valid coding-system.
+ (read-buffer-file-coding-system): New function.
+ (set-buffer-file-coding-system): Use it. Prompt the user if the
+ coding-system cannot encode all the chars.
+
+ * vc-bzr.el: Use standard *vc* and *vc-diff* buffers.
+ (vc-bzr-shelve-show, vc-bzr-shelve-apply)
+ (vc-bzr-shelve-apply-and-keep, vc-bzr-shelve-snapshot):
+ Don't use *vc-bzr-shelve*.
+
+2010-04-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * cedet/ede/pmake.el (ede-proj-makefile-insert-variables):
+ Don't destroy list before using it.
+
+2010-04-19 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Fix the version number for added files.
+ * vc-hg.el (vc-hg-working-revision): Check if the file is
+ registered after hg parent fails (Bug#5961).
+
+2010-04-19 Glenn Morris <rgm@gnu.org>
+
+ * htmlfontify.el (htmlfontify-buffer)
+ (htmlfontify-copy-and-link-dir): Autoload entry points.
+
+2010-04-19 Magnus Henoch <magnus.henoch@gmail.com>
+
+ * vc-hg.el (vc-hg-annotate-extract-revision-at-line): Expand file
+ name relative to the project root (Bug#5960).
+
+2010-04-19 Glenn Morris <rgm@gnu.org>
+
+ * vc-git.el (vc-git-print-log): Doc fix.
+
+2010-04-19 Óscar Fuentes <ofv@wanadoo.es>
+
+ * ido.el (ido-file-internal): Fix 2009-12-02 change.
+
+2010-04-19 Christoph <cschol2112@googlemail.com> (tiny change)
+
+ * progmodes/grep.el (grep-compute-defaults): Fix handling of host
+ default settings (Bug#5928).
+
+2010-04-19 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/fortran.el (fortran-match-and-skip-declaration):
+ New function.
+ (fortran-font-lock-keywords-3): Use it. (Bug#1385)
+
+2010-04-19 Kenichi Handa <handa@m17n.org>
+
+ * language/indian.el (malayalam-composable-pattern): Fix previous
+ change (add U+0D4D "SIGN VIRAMA").
+ (oriya-composable-pattern): Add U+0B30 and fix typo in the regexp.
+ (tamil-composable-pattern): Fix typo in the regexp.
+ (telugu-composable-pattern): Fix U+0C4D and typo in the regexp.
+ (kannada-composable-pattern): Fix U+0CB0 and typo in the regexp.
+ (malayalam-composable-pattern): Fix U+0D4D and typo in the regexp.
+
+2010-04-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * textmodes/tex-mode.el (latex-mode): Revert 2008-03-03 change to
+ paragraph-separate (Bug#5821).
+
+2010-04-19 Juri Linkov <juri@jurta.org>
+
+ Put breadcrumbs on overlay instead of inserting to buffer (bug#5809).
+
+ * info.el (Info-find-node-2): Comment out code that skips
+ breadcrumbs line.
+ (Info-mouse-follow-link): New command.
+ (Info-link-keymap): New keymap.
+ (Info-breadcrumbs): Rename from `Info-insert-breadcrumbs'.
+ Return a string with links instead of inserting breadcrumbs
+ to the Info buffer.
+ (Info-fontify-node): Comment out code that inserts breadcrumbs.
+ Instead of putting the `invisible' text property over the Info
+ header, make an overlay over the Info header with the `invisible'
+ property and `after-string' set to the string returned by
+ `Info-breadcrumbs'.
+
+2010-04-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * help.el (help-window-setup-finish): Doc fix (Bug#5830).
+ Reported by monkey@sandpframing.com.
+
+2010-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * tmm.el (tmm-prompt): Remove obsolete call to x-popup-menu.
+ (tmm-get-keymap): Add key-binding shortcuts now that they're not
+ available in the "keyseq cache" any more.
+
+ * custom.el (defcustom): Add edebug spec.
+
+2010-04-18 Juri Linkov <juri@jurta.org>
+
+ Test for special mode-class in view-buffer instead of view-file (bug#5513).
+
+ * view.el (view-file, view-buffer): Move test for special mode-class
+ from view-file to view-buffer.
+
+ * tar-mode.el (tar-extract): Turn if's into one cond
+ like in arc-mode.el.
+
+2010-04-18 Juri Linkov <juri@jurta.org>
+
+ Add 7z archive format support (bug#5475).
+
+ * arc-mode.el (archive-zip-extract): Try to find 7z executable.
+ (archive-7z-extract): New defcustom.
+ (archive-find-type): Add magic string for 7z.
+ (archive-extract-by-stdout): Add new optional arg `stderr-file'.
+ If `stderr-file' is non-nil, use `(t stderr-file)' for the
+ `buffer' arg of `call-process'.
+ (archive-zip-extract): Check `archive-zip-extract' for "7z" and
+ call the function `archive-7z-extract' with the variable
+ `archive-7z-extract' let-bound to `archive-zip-extract'.
+ (archive-7z-summarize, archive-7z-extract): New functions.
+
+ * international/mule.el (auto-coding-alist):
+ * files.el (auto-mode-alist): Add 7z file extension.
+
+2010-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * loadup.el: Setup hash-cons for pure data.
+
+ Fix duplicate entries in cedet's loaddefs.el files.
+ * emacs-lisp/autoload.el (autoload-file-load-name): Be more clever.
+ Should make most file-local generated-autoload-file unnecessary.
+ (print-readably): Silence warnings.
+ (autoload-find-destination): Take load-name as an arg to make sure
+ it's the same as the one that will be in the file.
+ (autoload-generate-file-autoloads): Adjust to above changes.
+ Try to make the dataflow a bit simpler.
+
+ * cvs-status.el (cvs-refontify): Remove unused.
+
+2010-04-18 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.el (calc-mode-map): Bind "O" to `calc-missing-key'.
+
+ * calc-bin.el (calc-radix): Have the "O" option turn on
+ twos-complement mode.
+
+2010-04-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
+ Add `calc-option-prefix-help' to calc-help autoloads.
+ (calc-inverse): Add "Option" to message, as appropriate.
+ (calc-hyperbolic): Add "Option" to message, as appropriate.
+ (calc-option, calc-is-option): New functions.
+
+ * calc-help.el (calc-full-help): Add `calc-option-help'.
+ (calc-option-prefix-help): New function.
+
+ * calc-misc.el (calc-help): Add "Option" entry.
+
+ * calc.el (calc-local-var-list): Add `calc-option-flag'.
+ (calc-option-flag): New variable.
+ (calc-do): Set `calc-option-flag to nil.
+ (calc-set-mode-line): Add "Opt " as appropriate.
+
+2010-04-16 Juri Linkov <juri@jurta.org>
+
+ Move scrolling commands from simple.el to window.el
+ because their primitives are implemented in window.c.
+
+ * simple.el (scroll-error-top-bottom)
+ (scroll-up-command, scroll-down-command, scroll-up-line)
+ (scroll-down-line, scroll-other-window-down)
+ (beginning-of-buffer-other-window, end-of-buffer-other-window):
+ * window.el (scroll-error-top-bottom)
+ (scroll-up-command, scroll-down-command, scroll-up-line)
+ (scroll-down-line, scroll-other-window-down)
+ (beginning-of-buffer-other-window, end-of-buffer-other-window):
+ Move from simple.el to window.el because their primitives are
+ implemented in window.c.
+
+2010-04-16 Juri Linkov <juri@jurta.org>
+
+ * isearch.el (isearch-lookup-scroll-key): Check both
+ `isearch-scroll' and `scroll-command' properties.
+ (scroll-up, scroll-down): Remove `isearch-scroll' property.
+
+ * mwheel.el (mwheel-scroll): Remove `isearch-scroll' property.
+
+ * simple.el (scroll-up-command, scroll-down-command)
+ (scroll-up-line, scroll-down-line): Remove `isearch-scroll' property.
+
+2010-04-15 Juri Linkov <juri@jurta.org>
+
+ * simple.el (scroll-up-command, scroll-down-command)
+ (scroll-up-line, scroll-down-line): Put `scroll-command'
+ property on the these symbols. Remove them from
+ `scroll-preserve-screen-position-commands'.
+
+ * mwheel.el (mwheel-scroll): Put `scroll-command' and
+ `isearch-scroll' properties on the `mwheel-scroll' symbol.
+ Remove it from `scroll-preserve-screen-position-commands'.
+
+ * isearch.el (isearch-allow-scroll): Doc fix.
+
+2010-04-15 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-error-with-buffer): Don't show the
+ connection buffer when we are in completion mode.
+ (tramp-file-name-handler): Catch the error for some operations
+ when we are in completion mode. This gives the user the chance to
+ correct the file name in the minibuffer.
+
+2010-04-15 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/verilog-mode.el (verilog-forward-sexp): Avoid free variable.
+
+2010-04-15 Juanma Barranquero <lekktu@gmail.com>
+
+ Simplify by using `define-derived-mode'.
+ * info.el (Info-mode):
+ * calendar/todo-mode.el (todo-mode):
+ * play/gomoku.el (gomoku-mode): Define with `define-derived-mode'.
+ (gomoku-mode-map): Move initialization into declaration.
+
+2010-04-14 Michael Albinus <michael.albinus@gmx.de>
+
+ Fix Bug#5840.
+ * ido.el (ido-file-name-all-completions-1):
+ * minibuffer.el (minibuffer-completion-help):
+ * net/tramp.el (tramp-completion-mode-p): Use `non-essential'.
+
+2010-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * simple.el (non-essential): New var.
+
+ Add a new field `location' to bookmarks for non-file bookmarks.
+ * bookmark.el (bookmark-location): Use the new field, if present.
+ (bookmark-insert-location): Undo last change, not needed any more.
+ * man.el (Man-bookmark-make-record):
+ * woman.el (woman-bookmark-make-record): Add `location' field.
+
+2010-04-14 Juri Linkov <juri@jurta.org>
+
+ * simple.el (scroll-error-top-bottom): New defcustom.
+ (scroll-up-command, scroll-down-command): Use it. Doc fix.
+
+ * emulation/pc-select.el (pc-select-override-scroll-error):
+ Obsolete in favor of `scroll-error-top-bottom'.
+
+2010-04-14 Juri Linkov <juri@jurta.org>
+
+ * tutorial.el (tutorial--default-keys): Rebind `C-v' to
+ `scroll-up-command' and `M-v' to `scroll-down-command'.
+
+ * emulation/cua-rect.el (cua--init-rectangles):
+ * forms.el (forms--change-commands):
+ * image-mode.el (image-mode-map):
+ Remap scroll-down-command and scroll-up-command
+ in addition to scroll-down and scroll-up.
+
+2010-04-14 Juri Linkov <juri@jurta.org>
+
+ * mwheel.el (scroll-preserve-screen-position-commands):
+ Add mwheel-scroll to this list of commands.
+
+ * simple.el (scroll-preserve-screen-position-commands):
+ Add scroll-up-command, scroll-down-command, scroll-up-line,
+ scroll-down-line to this list of commands.
+
+2010-04-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * obsolete/complete.el: Move from lisp/complete.el.
+
+ * pcomplete.el (pcomplete-here*): Fix mistaken change (bug#5935).
+
+ * emacs-lisp/easy-mmode.el (define-minor-mode): Passing a nil argument
+ to the minor mode function now turns the mode ON unconditionally.
+
+2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-dir.el (vc-dir-kill-line): New command.
+ (vc-dir-mode-map): Bind it to C-k.
+
+ * bookmark.el (bookmark-insert-location): Handle a nil filename.
+
+ * woman.el: Add bookmark declarations to silence the compiler.
+ (bookmark-prop-get): Use `man-args' rather than `filename' as a first
+ step to compatibility between man and woman bookmarks.
+ Adjust for Man-default-bookmark-title renaming.
+ (woman-bookmark-jump): Adjust accordingly. Don't forget to autoload.
+
+ * man.el: Add bookmark declarations to silence the compiler.
+ (Man-name-local-regexp): Make it match NAME as well.
+ (Man-getpage-in-background): Return the buffer.
+ (Man-notify-when-ready): Use `case'.
+ (man-set-default-bookmark-title): Rename to Man-default-bookmark-title.
+ Don't hardcode "NAME". Simplify.
+ (Man-bookmark-make-record): Use Man-arguments rather than buffer-name.
+ Rename from Man-bookmark-make-record.
+ (Man-bookmark-jump): Rename from man-bookmark-jump. Simplify now that
+ we have the actual man-args. Use Man-getpage-in-background rather
+ than `man' since the arg is already processed. Let bookmark.el do the
+ window handling. Only wait for the relevant process.
+ Don't forget to autoload.
+
+ * bookmark.el (bookmark-default-file): Use locate-user-emacs-file.
+
+2010-04-12 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * woman.el (woman-bookmark-make-record, woman-bookmark-jump):
+ New functions.
+ (woman-mode): Setup bookmark support.
+
+ * man.el (man-set-default-bookmark-title, man-bookmark-make-record)
+ (man-bookmark-jump): New functions.
+ (Man-mode): Setup bookmark support.
+
+2010-04-10 Jari Aalto <jari.aalto@cante.net>
+
+ * comint.el (comint-password-prompt-regexp): Use regexp-opt, and
+ recognize ssh-keygen prompt (Bug#2817).
+
+2010-04-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-do-copy-or-rename-file): Add progress reporter.
+
+2010-04-10 Michael Albinus <michael.albinus@gmx.de>
+
+ Synchronize with Tramp repository.
+
+ * net/tramp.el (tramp-completion-function-alist)
+ (tramp-file-name-regexp, tramp-chunksize)
+ (tramp-local-coding-commands, tramp-remote-coding-commands):
+ Fix docstring.
+ (tramp-remote-process-environment): Use `format' instead of `concat'.
+ (tramp-handle-directory-files-and-attributes)
+ (tramp-get-remote-path): Use `copy-tree'.
+ (tramp-handle-file-name-all-completions): Backward/ XEmacs
+ compatibility: Use `completion-ignore-case' if
+ `read-file-name-completion-ignore-case' does not exist.
+ (tramp-do-copy-or-rename-file-directly): Do not use
+ `tramp-handle-file-remote-p'.
+ (tramp-do-copy-or-rename-file-out-of-band):
+ Use `tramp-compat-delete-directory'.
+ (tramp-do-copy-or-rename-file-out-of-band)
+ (tramp-compute-multi-hops, tramp-maybe-open-connection):
+ Use `format-spec-make'.
+ (tramp-find-foreign-file-name-handler)
+ (tramp-advice-make-auto-save-file-name)
+ (tramp-set-auto-save-file-modes): Remove superfluous check for
+ `stringp'. This is done inside `tramp-tramp-file-p'.
+ (tramp-debug-outline-regexp): New defconst.
+ (tramp-get-debug-buffer): Use it.
+ (tramp-check-for-regexp): Use (forward-line 1).
+ (tramp-set-auto-save-file-modes): Adapt version check.
+
+ * net/tramp-compat.el (tramp-advice-file-expand-wildcards):
+ Wrap call of `featurep' for 2nd argument.
+ (tramp-compat-make-temp-file): Simplify fallback implementation.
+ (tramp-compat-copy-tree): Remove function.
+ (tramp-compat-delete-directory): Provide implementation for older
+ Emacsen.
+
+ * net/tramp-fish.el (tramp-fish-handle-directory-files-and-attributes):
+ Do not use `tramp-fish-handle-file-attributes.
+
+ * net/trampver.el: Update release number.
+
+2010-04-10 Glenn Morris <rgm@gnu.org>
+
+ * progmodes/compile.el (compilation-save-buffers-predicate):
+ Add missing :version tag.
+
+2010-04-09 Sam Steingold <sds@gnu.org>
+
+ * progmodes/compile.el (compilation-save-buffers-predicate):
+ Remove the "autoload" cookie.
+
+ * progmodes/bug-reference.el (turn-on-bug-reference-mode)
+ (turn-on-bug-reference-prog-mode): Remove, `bug-reference-mode'
+ and `bug-reference-prog-mode' can be used in hooks directly.
+
+2010-04-09 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Add --author support to git commit.
+ * vc-git.el (vc-git-checkin): Pass extra-args to the commit command.
+ (vc-git-log-edit-mode): New minor mode.
+ (log-edit-mode, log-edit-extra-flags, log-edit-mode):
+ New declarations.
+
+2010-04-09 Eric Raymond <esr@snark.thyrsus.com>
+
+ * vc-hooks.el, vc-git.el: Improve documentation comments.
+
+2010-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Fix some of the problems in defsubst* (bug#5728).
+ * emacs-lisp/cl-macs.el (defsubst*): Don't substitute non-trivial args.
+ (cl-defsubst-expand): Do the substitutions simultaneously (bug#5728).
+
+2010-04-07 Sam Steingold <sds@gnu.org>
+
+ * progmodes/compile.el (compilation-save-buffers-predicate):
+ New custom variable.
+ (compile, recompile): Pass it to `save-some-buffers'.
+
+2010-04-07 Jan Djärv <jan.h.d@swipnet.se>
+
+ * wid-edit.el (widget-choose): Move cursor to the second line of
+ the buffer (Bug#5695).
+
+2010-04-07 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Add new VC methods: vc-log-incoming and vc-log-outgoing.
+ * vc.el (vc-print-log-setup-buttons): New function split out from
+ vc-print-log-internal.
+ (vc-log-internal-common): New function, a parametrized version of
+ vc-print-log-internal.
+ (vc-print-log-internal): Just call vc-log-internal-common with the
+ right arguments.
+ (vc-incoming-outgoing-internal):
+ (vc-log-incoming, vc-log-outgoing): New functions.
+ (vc-log-view-type): New permanent local variable.
+
+ * vc-hooks.el (vc-menu-map): Bind vc-log-incoming and vc-log-outgoing.
- * abbrev.el (last-abbrev-text): Doc fix.
- (abbrev-prefix-mark): Don't escape parenthesis.
+ * vc-bzr.el (vc-bzr-log-view-mode): Use vc-log-view-type instead
+ of the dynamic bound vc-short-log.
+ (vc-bzr-log-incoming, vc-bzr-log-outgoing): New functions.
-2010-04-24 Andreas Schwab <schwab@linux-m68k.org>
+ * vc-git.el (vc-git-log-outgoing): New function.
+ (vc-git-log-view-mode): Use vc-log-view-type instead
+ of the dynamic bound vc-short-log.
- * composite.el (find-composition): Doc fix.
+ * vc-hg.el (vc-hg-log-view-mode): Use vc-log-view-type instead
+ of the dynamic bound vc-short-log. Highlight the tag.
+ (vc-hg-log-incoming, vc-hg-log-outgoing): New functions.
+ (vc-hg-outgoing, vc-hg-incoming, vc-hg-outgoing-mode):
+ (vc-hg-incoming-mode): Remove.
+ (vc-hg-extra-menu-map): Do not bind vc-hg-incoming and vc-hg-outgoing.
-2010-04-24 Juanma Barranquero <lekktu@gmail.com>
+2010-04-07 Dan Nicolaescu <dann@ics.uci.edu>
- * progmodes/sql.el (sql-electric-stuff): Fix typo in tag.
- (sql-oracle-program, sql-sqlite-options)
- (sql-query-placeholders-and-send): Doc fixes.
- (sql-set-product, sql-interactive-mode): Reflow docstrings.
- (sql-imenu-generic-expression, sql-buffer)
- (sql-mode-ansi-font-lock-keywords, sql-mode-oracle-font-lock-keywords)
- (sql-mode-postgres-font-lock-keywords, sql-mode-ms-font-lock-keywords)
- (sql-mode-sybase-font-lock-keywords)
- (sql-mode-informix-font-lock-keywords)
- (sql-mode-interbase-font-lock-keywords)
- (sql-mode-ingres-font-lock-keywords, sql-mode-solid-font-lock-keywords)
- (sql-mode-mysql-font-lock-keywords, sql-mode-sqlite-font-lock-keywords)
- (sql-mode-db2-font-lock-keywords, sql-mode-font-lock-keywords)
- (sql-product-feature, sql-highlight-product)
- (comint-line-beginning-position, sql-rename-buffer)
- (sql-toggle-pop-to-buffer-after-send-region)
- (sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql, sql-solid)
- (sql-ingres, sql-ms, sql-postgres, sql-interbase, sql-db2, sql-linter):
- Fix typos in docstrings.
+ Fix default-directory for vc-root-diff.
+ * vc.el (vc-root-diff): Bind default-directory to the root
+ directory for the diff command.
-2010-04-23 Juri Linkov <juri@jurta.org>
+2010-04-07 Michael McNamara <mac@mail.brushroad.com>
- * info.el (Info-fontify-node): Put Info-breadcrumbs to the `display'
- property instead of `invisible' and `after-string' (bug#5998).
+ * progmodes/verilog-mode.el (verilog-forward-sexp):
+ (verilog-calc-1): Support "disable fork" and "fork wait" multi
+ word keywords, suggested by Steve Pearlmutter.
+ (verilog-pretty-declarations): Support lineup of declarations in
+ port lists.
+ (verilog-skip-backward-comments, verilog-skip-forward-comment-p):
+ fix bug for /* / comments
+ (verilog-backward-syntactic-ws, verilog-forward-syntactic-ws):
+ Speed up and simplfy as this is never called with a bound.
+ (verilog-pretty-declarations): Enhance to line up declarations
+ inside a parameter list, suggested by Alan Morgan.
+ (verilog-pretty-expr): Tune assignment regular expression match
+ string for corner cases; also use markers instead of character
+ number as indent changes the later.
-2010-04-23 Juri Linkov <juri@jurta.org>
+2010-04-07 Wilson Snyder <wsnyder@wsnyder.org>
- * image-mode.el (image-mode-as-text): Fix typo in docstring.
+ * progmodes/verilog-mode.el (verilog-type-keywords): Fix pulldown
+ as missing keyword.
+ (verilog-read-sub-decls-line): Fix comments in AUTO_TEMPLATE
+ causing truncation of AUTOWIRE signals. Reported by Bruce Tennant.
+ (verilog-auto-inst, verilog-auto-inst-port): Add vl_mbits for
+ AUTO_TEMPLATEs needing multiple array bits. Suggested by Bruce
+ Tennant.
+ (verilog-keywords):
+ (verilog-1800-2005-keywords, verilog-1800-2009-keywords): Add IEEE
+ 1800-2009 keywords, including "global.".
-2010-04-23 Juanma Barranquero <lekktu@gmail.com>
+2010-04-06 John Wiegley <jwiegley@gmail.com>
- * filecache.el (file-cache-add-directory-list)
- (file-cache-add-directory-recursively): Fix typos in docstrings.
+ * ido.el (ido-add-virtual-buffers-to-list): Fix duplicated names
+ appearing in buffer list (if a live buffer name matched a recentf
+ file basename). Should use uniquify to offer a real solution.
-2010-04-22 Kenichi Handa <handa@m17n.org>
+2010-04-06 John Wiegley <jwiegley@gmail.com>
+
+ * ido.el (ido-use-virtual-buffers, ido-virtual): Move a ChangeLog
+ comment to code, and add a :version tag.
+ (ido-virtual-buffers): Move defvar to fix byte-compiler warning.
- * language/indian.el (gurmukhi-composable-pattern): Fix typo.
- (gujarati-composable-pattern): Fix typo.
+2010-04-06 Juanma Barranquero <lekktu@gmail.com>
-2010-04-20 Kenichi Handa <handa@m17n.org>
+ Enable recentf-mode if using virtual buffers.
+ * ido.el (recentf-list): Declare for byte-compiler.
+ (ido-virtual-buffers): Move up to silence byte-compiler. Add docstring.
+ (ido-make-buffer-list): Simplify.
+ (ido-add-virtual-buffers-to-list): Simplify. Enable recentf-mode.
- * language/indian.el (oriya-composable-pattern)
- (tamil-composable-pattern, malayalam-composable-pattern): Add
- two-part vowels to "v" (vowel sign).
+2010-04-05 Juri Linkov <juri@jurta.org>
-2010-04-20 Chong Yidong <cyd@stupidchicken.com>
+ Scrolling commands which scroll a line instead of full screen.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01452.html
- * files.el (copy-directory): Handle symlinks (Bug#5982).
+ * simple.el (scroll-up-line, scroll-down-line): New commands.
+ Put property isearch-scroll=t on them.
- * progmodes/compile.el (compilation-next-error-function): Revert
- 2009-10-12 change (Bug#5983).
+ * emulation/ws-mode.el (scroll-down-line, scroll-up-line):
+ Remove commands.
-2010-04-20 Dan Nicolaescu <dann@ics.uci.edu>
+2010-04-05 Juri Linkov <juri@jurta.org>
- * vc-hg.el (vc-hg-state): Use HGRCPATH, not HGRC.
- (vc-hg-working-revision): Likewise. Use hg parents, not hg parent
- (Bug#5846).
+ Scrolling commands which do not signal errors at top/bottom.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01452.html
-2010-04-20 Glenn Morris <rgm@gnu.org>
+ * simple.el (scroll-up-command, scroll-down-command): New commands.
+ Put property isearch-scroll=t on them.
- * emacs-lisp/lisp.el (lisp-completion-at-point): Give it a doc string.
+ * bindings.el (global-map): Rebind [prior] from `scroll-down' to
+ `scroll-down-command' and [next] from `scroll-up' to
+ `scroll-up-command'.
- * minibuffer.el (completion-at-point): Doc fix.
+ * emulation/cua-base.el: Put property CUA=move on
+ `scroll-up-command' and `scroll-down-command'.
+ (cua--init-keymaps): Remap `scroll-up-command' to `cua-scroll-up'
+ and `scroll-down-command' to `cua-scroll-down'.
-2010-04-18 Chong Yidong <cyd@stupidchicken.com>
+2010-04-05 Juanma Barranquero <lekktu@gmail.com>
- * cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Don't
- destroy list before using it.
+ * help.el (describe-mode): Return nil.
-2010-04-17 Dan Nicolaescu <dann@ics.uci.edu>
+2010-04-04 John Wiegley <jwiegley@gmail.com>
- Fix the version number for added files.
- * vc-hg.el (vc-hg-working-revision): Check if the file is
- registered after hg parent fails (Bug#5961).
+ * ido.el (ido-use-virtual-buffers): New variable to indicate
+ whether "virtual buffer" support is enabled for IDO.
+ (ido-virtual): Face used to indicate virtual buffers in the list.
+ (ido-buffer-internal): If a buffer is chosen, and no such buffer
+ exists, but a virtual buffer of that name does (which would be why
+ it was in the list), recreate the buffer by reopening the file.
+ (ido-make-buffer-list): If virtual buffers are being used, call
+ `ido-add-virtual-buffers-to-list' before the make list hook.
+ (ido-virtual-buffers): New variable which contains a copy of the
+ current contents of the `recentf-list', albeit pared down for the
+ sake of speed, and with proper faces applied.
+ (ido-add-virtual-buffers-to-list): Using the `recentf-list',
+ create a list of "virtual buffers" to present to the user in
+ addition to the currently open set. Note that this logic could
+ get rather slow if that list is too large. With the default
+ `recentf-max-saved-items' of 200, there is little speed penalty.
-2010-04-17 Glenn Morris <rgm@gnu.org>
+2010-04-03 Stefan Monnier <monnier@iro.umontreal.ca>
- * htmlfontify.el (htmlfontify-buffer)
- (htmlfontify-copy-and-link-dir): Autoload entry points.
+ * font-lock.el: Require CL when compiling.
+ (font-lock-turn-on-thing-lock): Use `case'.
-2010-04-17 Magnus Henoch <magnus.henoch@gmail.com>
+2010-04-03 Eli Zaretskii <eliz@gnu.org>
- * vc-hg.el (vc-hg-annotate-extract-revision-at-line): Expand file
- name relative to the project root (Bug#5960).
+ * emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli
+ Zaretskii.
-2010-04-16 Glenn Morris <rgm@gnu.org>
+2010-04-02 Juanma Barranquero <lekktu@gmail.com>
- * vc-git.el (vc-git-print-log): Doc fix.
+ * cedet/semantic/imenu.el (semantic-imenu-bucketize-type-members)
+ (semantic-create-imenu-directory-index): Fix typos in docstrings.
+ (semantic-imenu-goto-function): Reflow docstring.
-2010-04-14 Óscar Fuentes <ofv@wanadoo.es>
+2010-04-02 Juri Linkov <juri@jurta.org>
- * ido.el (ido-file-internal): Fix 2009-12-02 change.
+ * ehelp.el (electric-help-orig-major-mode):
+ New buffer-local variable.
+ (electric-help-mode): Set it to original major-mode. Doc fix.
+ (with-electric-help): Use `electric-help-orig-major-mode' instead
+ of (default-value 'major-mode). Doc fix.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00069.html
-2010-04-14 Christoph <cschol2112@googlemail.com> (tiny change)
+2010-04-02 Sam Steingold <sds@gnu.org>
- * progmodes/grep.el (grep-compute-defaults): Fix handling of host
- default settings (Bug#5928).
+ * vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling
+ `vc-hg-command' with a list of flags.
-2010-04-10 Glenn Morris <rgm@gnu.org>
+ * progmodes/bug-reference.el (bug-reference-bug-regexp):
+ Also accept "patch" and "RFE".
+ (bug-reference-fontify): `bug-reference-url-format' can also be a
+ function to be able to handle the bug kind.
+ (turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add.
- * progmodes/fortran.el (fortran-match-and-skip-declaration):
- New function.
- (fortran-font-lock-keywords-3): Use it. (Bug#1385)
+2010-04-02 Jan Djärv <jan.h.d@swipnet.se>
-2010-04-07 Kenichi Handa <handa@m17n.org>
+ * tmm.el (tmm-get-keymap): Check with symbolp before passing
+ value to fboundp, it may not be a symbol.
- * language/indian.el (malayalam-composable-pattern): Fix previous
- change (add U+0D4D "SIGN VIRAMA").
- (oriya-composable-pattern): Add U+0B30 and fix typo in the regexp.
- (tamil-composable-pattern): Fix typo in the regexp.
- (telugu-composable-pattern): Fix U+0C4D and typo in the regexp.
- (kannada-composable-pattern): Fix U+0CB0 and typo in the regexp.
- (malayalam-composable-pattern): Fix U+0D4D and typo in the regexp.
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
-2010-04-06 Chong Yidong <cyd@stupidchicken.com>
+ * cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
- * textmodes/tex-mode.el (latex-mode): Revert 2008-03-03 change to
- paragraph-separate (Bug#5821).
+2010-03-31 Juri Linkov <juri@jurta.org>
-2010-04-05 Juri Linkov <juri@jurta.org>
+ * simple.el (next-line, previous-line): Re-throw a signal
+ with `signal' instead of using `ding'.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01432.html
- Put breadcrumbs on overlay instead of inserting to buffer (bug#5809).
+2010-03-31 Juri Linkov <juri@jurta.org>
- * info.el (Info-find-node-2): Comment out code that skips
- breadcrumbs line.
- (Info-mouse-follow-link): New command.
- (Info-link-keymap): New keymap.
- (Info-breadcrumbs): Rename from `Info-insert-breadcrumbs'.
- Return a string with links instead of inserting breadcrumbs
- to the Info buffer.
- (Info-fontify-node): Comment out code that inserts breadcrumbs.
- Instead of putting the `invisible' text property over the Info
- header, make an overlay over the Info header with the `invisible'
- property and `after-string' set to the string returned by
- `Info-breadcrumbs'.
+ * simple.el (keyboard-escape-quit): Raise deselecting the active
+ region higher than exiting the minibuffer.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00904.html
-2010-04-03 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Juri Linkov <juri@jurta.org>
- * help.el (help-window-setup-finish): Doc fix (Bug#5830).
- Reported by monkey@sandpframing.com.
+ * image.el (image-animated-p): Use `image-metadata' instead of
+ `image-extension-data'. Get GIF extenstion data from metadata
+ property `extension-data'.
-2010-04-02 Juanma Barranquero <lekktu@gmail.com>
+2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
- * cedet/semantic/imenu.el (semantic-imenu-bucketize-type-members)
- (semantic-create-imenu-directory-index): Fix typos in docstrings.
- (semantic-imenu-goto-function): Reflow docstring.
+ * simple.el (append-to-buffer): Simplify.
-2010-03-30 Tomas Abrahamsson <tab@lysator.liu.se>
+2010-03-31 Tomas Abrahamsson <tab@lysator.liu.se>
* textmodes/artist.el (artist-mode): Fix typo in docstring.
Reported by Alex Schröder <kensanata@gmail.com>. (Bug#5807)
-2010-03-30 Kenichi Handa <handa@m17n.org>
+2010-03-31 Kenichi Handa <handa@m17n.org>
* language/sinhala.el (composition-function-table): Fix regexp for
the new Unicode specification.
(telugu-composable-pattern): New variables to cope with the new
Unicode specification. Use them in composition-function-table.
-2010-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
+2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
Make tmm-menubar work for the Buffers menu again (bug#5726).
* tmm.el (tmm-prompt): Also handle keymap entries in the form of
vectors rather than cons cells, as used in menu-bar-update-buffers.
-2010-03-28 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
* progmodes/js.el (js-auto-indent-flag, js-mode-map)
(js-insert-and-indent): Revert 2009-08-15 change, restoring
* mail/sendmail.el (mail-default-directory): Doc fix.
-2010-03-27 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
* mail/sendmail.el (mail-default-directory): Doc fix.
-2010-03-27 Eli Zaretskii <eliz@gnu.org>
+2010-03-31 Eli Zaretskii <eliz@gnu.org>
* subr.el (version-regexp-alist, version-to-list)
(version-list-<, version-list-=, version-list-<=)
(version-list-not-zero, version<, version<=, version=): Doc fix.
(Bug#5744).
-2010-03-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
- Nick Roberts <nickrob@snap.net.nz>
-
- * progmodes/gdb-ui.el (gdb-apple-test): New function.
- (gdb-init-1): Use it.
-
-2010-02-10 Dan Nicolaescu <dann@ics.uci.edu>
+2010-02-31 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el (vc-root-diff): Doc fix.
-2010-03-25 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
* vc.el (vc-print-log, vc-print-root-log): Doc fix.
* simple.el (append-to-buffer): Fix last change.
-2010-03-24 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
* simple.el (append-to-buffer): Ensure that point is preserved if
BUFFER is the current buffer. Suggested by YAMAMOTO Mitsuharu.
(Bug#5749)
+2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (auto-mode-case-fold): Change default to t.
+
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ * dired-x.el (dired-omit-mode): Doc fix.
+
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ * replace.el (occur-accumulate-lines): Move occur-engine related
+ functions `occur-accumulate-lines' and `occur-engine-add-prefix'
+ to be located after `occur-engine'.
+
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ Make occur handle multi-line matches cleanly with context.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01280.html
+
+ * replace.el (occur-accumulate-lines): Add optional arg `pt'.
+ (occur-engine): Add local variables `ret', `prev-after-lines',
+ `prev-lines'. Use more arguments for `occur-context-lines'.
+ Set first elem of its returned list to `data', and the second elem
+ to `prev-after-lines'. Don't print the separator line.
+ In the end, print remaining context after-lines.
+ (occur-context-lines): Add new arguments `begpt', `endpt',
+ `lines', `prev-lines', `prev-after-lines'. Rewrite to combine
+ after-lines of the previous match with before-lines of the
+ current match and not overlap them. Return a list with two
+ values: the output line and the list of context after-lines.
+
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ * replace.el (occur-accumulate-lines): Fix a bug where the first
+ context line at the beginning of the buffer was missing.
+
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
+
+ * files.el: Make bidi-display-reordering safe variable for boolean
+ values.
+
+2010-03-29 Phil Hagelberg <phil@evri.com>
+ Chong Yidong <cyd@stupidchicken.com>
+
+ * subr.el: Extend progress reporters to perform "spinning".
+ (progress-reporter-update, progress-reporter-do-update):
+ Handle non-numeric value arguments.
+ (progress-reporter--pulse-characters): New var.
+
+2010-03-28 Chong Yidong <cyd@stupidchicken.com>
+
+ * progmodes/compile.el (compilation-start): Fix regexp detection
+ of initial cd command (Bug#5771).
+
+2010-03-28 Stefan Guath <stefan@automata.se> (tiny change)
+
+ * find-dired.el (find-dired): Use read-directory-name (Bug#5777).
+
+2010-03-27 Nick Roberts <nickrob@snap.net.nz>
+
+ Restore GDB/MI fuctionality removed by 2009-12-29T07:15:34Z!nickrob@snap.net.nz.
+ * lisp/progmodes/gdb-mi.el: Restore.
+ * lisp/progmodes/gdb-ui.el: Remove.
+ * lisp/progmodes/gud.el: Re-accommodate for gdb-mi.el.
+
+2010-03-25 Glenn Morris <rgm@gnu.org>
+
+ * desktop.el (desktop-save-buffer-p): Don't mistakenly include
+ all dired buffers, even tramp ones. (Bug#5755)
+
+2010-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Add "union tags" in mpc.el.
+ * mpc.el: Remove backward compatibility code.
+ (mpc-browser-tags): Change default.
+ (mpc--find-memoize-union-tags): New var.
+ (mpc-cmd-flush, mpc-cmd-special-tag-p): New fun.
+ (mpc-cmd-find): Handle the case where the playlist does not exist.
+ Handle union-tags.
+ (mpc-cmd-list): Use mpc-cmd-special-tag-p. Handle union-tags.
+ (mpc-cmd-add): Use mpc-cmd-flush.
+ (mpc-tagbrowser-tag-name): New fun.
+ (mpc-tagbrowser-buf): Use it.
+ (mpc-songs-refresh): Use cond. Move to point-min as a fallback.
+
2010-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
+ Misc cleanup.
+ * progmodes/make-mode.el (makefile-bsdmake-rule-action-regex):
+ Use replace-regexp-in-string.
+ (makefile-mode-abbrev-table): Merge defvar and define-abbrev-table.
+ (makefile-imake-mode-syntax-table): Move init into defvar.
+ (makefile-mode): Use define-derived-mode.
+
* progmodes/make-mode.el (makefile-rule-action-regex): Backtrack less.
(makefile-make-font-lock-keywords): Adjust rule since submatch 1 may
not be present any more.
* cedet/srecode/table.el (srecode-template-table): Fix docstring typo.
-2010-03-23 Glenn Morris <rgm@gnu.org>
+2010-03-24 Glenn Morris <rgm@gnu.org>
* textmodes/flyspell.el (sgml-lexical-context): Autoload it (Bug#5752).
-2010-03-21 Chong Yidong <cyd@stupidchicken.com>
+2010-03-24 Chong Yidong <cyd@stupidchicken.com>
* indent.el (indent-for-tab-command): Doc fix.
-2010-03-22 Juanma Barranquero <lekktu@gmail.com>
+2010-03-24 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-engine.el (c-remove-stale-state-cache):
+ Fix off-by-one error. Fixes bug #5747.
+
+2010-03-24 Juanma Barranquero <lekktu@gmail.com>
* image-dired.el (image-dired-display-thumbs): Fix typo in docstring.
(image-dired-read-comment): Doc fix.
(reftex-cite-punctuation, reftex-search-unrecursed-path-first)
(reftex-highlight-selection): Fix typos in docstrings.
-2010-03-19 Juanma Barranquero <lekktu@gmail.com>
+2010-03-24 Juanma Barranquero <lekktu@gmail.com>
* minibuffer.el (completion-in-region-functions): Fix docstring typos.
-2010-03-18 Glenn Morris <rgm@gnu.org>
+2010-03-24 Glenn Morris <rgm@gnu.org>
* mail/rmail.el (rmail-highlight-face): Restore option deleted
2008-02-13 without comment; mark it obsolete.
(rmail-highlight-headers): Use rmail-highlight-face once more.
-2010-03-16 Chong Yidong <cyd@stupidchicken.com>
+2010-03-24 Chong Yidong <cyd@stupidchicken.com>
* woman.el (woman2-process-escapes): Only consume the newline if
the filler character is on a line by itself (Bug#5729).
-2010-03-16 Kenichi Handa <handa@m17n.org>
+2010-03-24 Kenichi Handa <handa@m17n.org>
* language/indian.el (devanagari-composable-pattern): Add more
consonants.
-2010-03-14 Michael Albinus <michael.albinus@gmx.de>
+2010-03-24 Michael Albinus <michael.albinus@gmx.de>
* net/trampver.el: Update release number.
-2010-03-13 Glenn Morris <rgm@gnu.org>
+2010-03-24 Glenn Morris <rgm@gnu.org>
* Makefile.in (ELCFILES): Add cedet/semantic/imenu.el.
-2010-03-13 Michael Albinus <michael.albinus@gmx.de>
+2010-03-24 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-find-executable):
Use `tramp-get-connection-buffer'. Make the regexp for checking
(tramp-open-connection-setup-interactive-shell): Remove workaround
for OpenSolaris bug, it is not needed anymore.
-2010-03-13 Eric M. Ludlam <zappo@gnu.org>
+2010-03-24 Eric M. Ludlam <zappo@gnu.org>
* cedet/semantic/imenu.el: New file, from the CEDET repository
(Bug#5412).
-2010-03-12 Glenn Morris <rgm@gnu.org>
+2010-03-24 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-macs.el (defsubst*): Add autoload cookie. (Bug#4427)
-2010-03-11 Wilson Snyder <wsnyder@wsnyder.org>
+2010-03-24 Wilson Snyder <wsnyder@wsnyder.org>
* files.el (auto-mode-alist): Accept more verilog file patterns.
-2010-03-09 Miles Bader <miles@gnu.org>>
+2010-03-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-dir.el (vc-dir-headers): Abbreviate the working dir.
+
+2010-03-24 Glenn Morris <rgm@gnu.org>
+
+ * vc-bzr.el (vc-bzr-log-edit-mode): Add --fixes support to
+ log-edit-before-checkin-process.
+
+ * vc.el (vc-modify-change-comment): Pass MODE to vc-start-logentry.
+
+ * vc.el, vc-bzr.el, vc-hg.el (log-edit-mode): Declare.
+
+ * vc-dispatcher.el (vc-start-logentry): Doc fix.
+ (log-view-process-buffer, log-edit-extra-flags): Declare.
+
+ * log-edit.el (log-edit-before-checkin-process): Doc fix.
+
+ * cedet/semantic/bovine/c.el (semantic-c-describe-environment):
+ Consistently check ede-object is bound throughout.
+
+ * cedet/ede/project-am.el (ede-shell-run-something): Declare.
+
+2010-03-23 Sam Steingold <sds@gnu.org>
+
+ Fix bug#5620: recalculate all markers on compilation buffer
+ modifications, not on file modifications.
+ * progmodes/compile.el (buffer-modtime): New buffer-local variable:
+ the buffer modification time, for buffers not associated with files.
+ (compilation-mode): Create it.
+ (compilation-filter): Update it.
+ (compilation-next-error-function): Use it instead of
+ `visited-file-modtime' for timestamp.
+
+2010-03-23 Juri Linkov <juri@jurta.org>
+
+ Implement Occur multi-line matches.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01044.html
+
+ * replace.el (occur): Doc fix.
+ (occur-engine): Set `begpt' to the beginning of the first line.
+ Set `endpt' to the end of the last match line. At first, count
+ line numbers between `origpt' and `begpt'. Split out code from
+ `out-line' variable to new let-bindings `match-prefix' and
+ `match-str'. In `out-line' add non-numeric prefix to all
+ non-first lines of multi-line matches. Finally, count lines
+ between `begpt' and `endpt' and add to `lines'.
+
+2010-03-23 Juri Linkov <juri@jurta.org>
+
+ * replace.el (occur-accumulate-lines, occur-engine):
+ Use `occur-engine-line' instead of duplicate code.
+ (occur-engine-line): New function created from duplicate code
+ in `occur-accumulate-lines' and `occur-engine'.
+
+ * replace.el (occur-engine-line): Add optional arg `keep-props'.
+ (occur-accumulate-lines, occur-engine): Add arg `keep-props'.
+
+2010-03-23 Juri Linkov <juri@jurta.org>
+
+ * finder.el: Remove TODO tasks.
+
+ * info.el (Info-finder-find-node): Add node "all"
+ with all package info. Handle a list of multiple keywords
+ separated by comma.
+ (info-finder): In interactive use with a prefix argument,
+ use `completing-read-multiple' to read a list of keywords
+ separated by comma.
+
+2010-03-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Add a new completion style `substring'.
+ * minibuffer.el (completion-basic--pattern): New function.
+ (completion-basic-try-completion, completion-basic-all-completions):
+ Use it.
+ (completion-substring--all-completions)
+ (completion-substring-try-completion)
+ (completion-substring-all-completions): New functions.
+ (completion-styles-alist): New style `substring'.
+
+2010-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Get rid of .elc files after removal of the corresponding .el.
+ * Makefile.in (compile-clean): New target.
+ (compile-main): Use it.
+
+2010-03-22 Jan Djärv <jan.h.d@swipnet.se>
+
+ * Makefile.in (compile-main): cd to $(lisp) in a sub-shell, so we
+ don't do make there. When compiling with separate object dir, there
+ is no Makefile there.
+
+2010-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Get rid of the ELCFILES abomination, again.
+ * Makefile.in (update-elclist, ELCFILES, compile-last): Remove.
+ (all, compile): Don't call compile-last.
+ (compile-main): Build the "elcfiles" list dynamically.
+ (compile-targets): New (internal) target.
+
+2010-03-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makefile.in (top_srcdir): Define.
+ (abs_top_builddir): Define.
+ (srcdir): Don't append `/..'.
+ (EMACS): Use ${abs_top_builddir}.
+ (all, compile, compile-always, compile-last): Don't set emacswd.
+ (update-subdirs, update-authors): Use $(top_srcdir) instead of
+ $(srcdir).
+ (lisp): Use $(srcdir) instead of @srcdir@.
+
+2010-03-21 Juri Linkov <juri@jurta.org>
+
+ Fix message of multi-line occur regexps and multi-buffer header lines.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00457.html
+
+ * replace.el (occur-1): Don't display regexp if it is longer
+ than window-width. Use `query-replace-descr' to display regexp.
+ (occur-engine): Don't display regexp in the buffer header for
+ multi-buffer occur. Display a separate header line with total
+ match count and regexp for multi-buffer occur.
+ Use `query-replace-descr' to display regexp.
+
+2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * net/secrets.el: Fix parenthesis.
+ (secrets-enabled): Fix parenthesis.
+
+2010-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use more relative file and directory names.
+ * Makefile.in (EMACS): Arrange for it to work when we chdir.
+ (setwins, setwins_almost, setwins_for_subdirs):
+ Don't `cd'; output relative names.
+ (all, compile, compile-always, compile-last): Set emacswd.
+ (custom-deps, finder-data, autoloads, update-subdirs, compile-last):
+ Just cd to the lisp source dir so we can use relative file names.
+
+ * outline.el (hide-sublevels): Unfix the paren non-typo! (bug#5738).
+
+2010-03-20 Glenn Morris <rgm@gnu.org>
+
+ * textmodes/rst.el: Use faces for font-lock customization, and make the
+ old -face variables obsolete.
+ (rst-block, rst-external, rst-definition, rst-directive, rst-comment)
+ (rst-emphasis1, rst-emphasis2, rst-literal, rst-reference): New faces.
+ (rst-block-face, rst-external-face, rst-definition-face)
+ (rst-directive-face, rst-comment-face, rst-emphasis1-face)
+ (rst-emphasis2-face, rst-literal-face, rst-reference-face):
+ Make obsolete.
+ (rst-font-lock-keywords-function): Update for above changes.
+
+2010-03-20 Juri Linkov <juri@jurta.org>
+
+ * s-region.el:
+ * obsolete/s-region.el: Move to obsolete.
+
+2010-03-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * vc-dispatcher.el (vc-do-command): Remove reference to `vc-path'.
+
+2010-03-19 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vc-hooks.el (vc-path): Remove variable and obsolete declaration.
+
+2010-03-19 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Add special markup processing for commit logs.
+ * log-edit.el (log-edit-extra-flags): New variable.
+ (log-edit): Add new argument MODE. Use that mode when non-nil
+ instead of the log-view-mode.
+ (log-view-process-buffer): New function.
+
+ * vc.el: Document that the checkin method takes optional
+ arguments. Document new backend specific method: log-view-mode.
+ (vc-default-log-edit-mode): New function.
+ (vc-checkin): Use a backend specific log-view-mode.
+ Pass extra arguments to the checkin method.
+ (vc-modify-change-comment): Pass a dummy extra argument.
+
+ * vc-dispatcher.el (vc-log-edit): Add a mode argument, pass it to
+ log-edit.
+ (vc-start-logentry): Add a mode argument, pass it to vc-log-edit.
+ (vc-finish-logentry): Process the log buffer before passing it
+ down. Pass log-edit-extra-flags.
+
+ * vc-bzr.el (vc-bzr-checkin): Pass extra arguments to the commit
+ command.
+ (log-edit-extra-flags, log-edit-before-checkin-process):
+ New declarations.
+
+ * vc-hg.el (vc-hg-checkin): Pass extra arguments to the commit
+ command.
+ (log-edit-extra-flags, log-edit-before-checkin-process):
+ New declarations.
+ (vc-hg-log-edit-mode): New derived mode.
+
+ * vc-arch.el (vc-arch-checkin):
+ * vc-cvs.el (vc-cvs-checkin):
+ * vc-git.el (vc-git-checkin):
+ * vc-mtn.el (vc-mtn-checkin):
+ * vc-rcs.el (vc-rcs-checkin):
+ * vc-sccs.el (vc-sccs-checkin):
+ * vc-svn.el (vc-svn-checkin): Add an optional ignored argument.
+
+2010-03-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * outline.el (hide-sublevels): Don't hide trailing newline (and fix
+ parent typo).
+
+2010-03-19 Glenn Morris <rgm@gnu.org>
+
+ * password-cache.el (password-cache, password-cache-expiry): Autoload.
+
+2010-03-18 Glenn Morris <rgm@gnu.org>
+
+ * emacs-lisp/autoload.el (autoload-rubric): Doc fix.
+
+ * replace.el (query-replace-history): Give it a doc string.
+ (map-query-replace-regexp): Use query-replace-from-history-variable
+ and query-replace-to-history-variable.
+
+ * mail/hashcash.el (declare-function): Remove duplicate definition.
+
+ * mail/emacsbug.el (report-emacs-bug-pretest-address):
+ Make it an obsolete alias for report-emacs-bug-address.
+ (message-strip-special-text-properties): Declare.
+ (report-emacs-bug): Remove test for a pretest bug address.
+ Combine message-mode-specific code.
+
+ * mail/supercite.el: Don't require sendmail.
+ (mh-in-header-p): Declare rather than using with-no-warnings.
+ (sc-no-blank-line-or-header): Use rfc822-goto-eoh rather than
+ mail-header-end. Don't bind mysterious variable `kill-lines-magic'.
+
+ * calendar/cal-french.el: Convert to utf-8.
+
+ * files.el (interpreter-mode-alist): Use emacs-lisp-mode for
+ Emacs scripts.
+
+2010-03-16 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/secrets.el (secrets-enabled): New variable. Use it instead
+ of a subfeature.
+
+2010-03-15 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/secrets.el (top): Register the D-Bus signals only when the
+ service "org.freedesktop.secrets" can be pinged.
+ Provide subfeature `enabled'.
+
+2010-03-14 Juri Linkov <juri@jurta.org>
+
+ Add finder unknown keywords.
+
+ * finder.el (finder-unknown-keywords): New function.
+
+ * info.el (Info-finder-find-node): Use `finder-unknown-keywords'
+ to create a Finder node with unknown keywords.
+
+2010-03-14 Juri Linkov <juri@jurta.org>
+
+ * finder.el (finder-compile-keywords): Replace `princ' with
+ `prin1' on a list of symbols interned from keyword strings.
+
+ * emacs-lisp/lisp-mnt.el (lm-keywords-list): If `keywords' contains
+ a comma, then split keywords using a comma and optional whitespace.
+ Otherwise, split by whitespace.
+
+ * complete.el:
+ * face-remap.el:
+ * log-view.el:
+ * net/hmac-def.el:
+ * net/hmac-md5.el:
+ * net/netrc.el:
+ * progmodes/mixal-mode.el: Fix keywords.
+
+2010-03-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * Makefile.in (ELCFILES): Add net/secrets.elc.
+
+ * net/secrets.el: New file.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * facemenu.el (list-colors-display, list-colors-print): New arg
+ callback. Use it to allow selecting colors.
+
+ * wid-edit.el (widget-image-insert): Insert image prop even if the
+ current display is non-graphic.
+ (widget-field-value-set): New fun.
+ (editable-field): Use it.
+ (widget-field-value-get): Clean up unused var.
+ (widget-color-value-create, widget-color--choose-action):
+ New funs. Allow using list-colors-display to choose color.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * cus-edit.el: Resort topmost custom groups.
+ (custom-buffer-sort-alphabetically): Default to t.
+ (customize-apropos): Use apropos-parse-pattern.
+ (custom-search-field): New var.
+ (custom-buffer-create-internal): Add custom-apropos search field.
+ (custom-add-parent-links): Don't display parent doc.
+ (custom-group-value-create): Don't sort top-level custom group.
+ (custom-magic-value-create): Show visibility button before option name.
+
+ (custom-variable-state): New fun, from custom-variable-state-set.
+ (custom-variable-state-set): Use it.
+ (custom-group-value-create): Hide options with standard values
+ using the :hidden-states property. Use progress reporter.
+
+ (custom-show): Simplify.
+ (custom-visibility): Disable images by default.
+ (custom-variable): New property :hidden-states.
+ (custom-variable-value-create): Enable images for
+ custom-visibility widgets. Use :hidden-states property to
+ determine initial visibility.
+
+ * wid-edit.el (widget-image-find): Give images center ascent.
+ (visibility): Add :on-image and :off-image properties.
+ (widget-visibility-value-create): Use them.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * cus-edit.el (processes): Remove from development group.
+ (oop, hypermedia): Delete group.
+ (comm): Promote to top-level group.
+
+ * net/browse-url.el (browse-url):
+ * net/xesam.el (xesam):
+ * net/tramp.el (tramp):
+ * net/goto-addr.el (goto-address):
+ * net/ange-ftp.el (ange-ftp): Put in comm group.
+
+ * view.el (view): Remove from editing group.
+
+ * uniquify.el (uniquify): Put in files group.
+
+ * net/browse-url.el (browse-url):
+ * ps-print.el (postscript): Put in external group.
+
+ * cus-edit.el (outlines):
+ * textmodes/text-mode.el (text-mode-hook):
+ * textmodes/table.el (table):
+ * textmodes/picture.el (picture):
+ * outline.el (outlines): Put in wp group.
+
+ * nxml/nxml-mode.el (nxml): Remove from wp group.
+
+ * net/tramp-imap.el (tramp-imap): Put in tramp group.
+
+ * mail/metamail.el (metamail): Remove from hypermedia group.
+
+ * cus-edit.el (abbrev):
+ * whitespace.el (whitespace):
+ * vcursor.el (vcursor):
+ * reveal.el (reveal):
+ * hl-line.el (hl-line): Put in convenience group.
+
+ * epg-config.el (epg): Put in data group.
+
+ * emulation/pc-select.el (pc-select): Put in emulations group.
+
+ * calculator.el (calculator): Put in applications group.
+
+2010-03-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Add .dir-locals.el support for file-less buffers.
+ * files.el (hack-local-variables): Split out code to apply local
+ variable settings ...
+ (hack-local-variables-apply): ... here. New function.
+ (hack-dir-local-variables): Use the default directory for when the
+ buffer does not have an associated file.
+ (hack-dir-local-variables-non-file-buffer): New function.
+ * diff-mode.el (diff-mode):
+ * vc-annotate.el (vc-annotate-mode):
+ * vc-dir.el (vc-dir-mode):
+ * log-edit.el (log-edit-mode):
+ * log-view.el (log-view-mode): Call hack-dir-local-variables-non-file-buffer.
+
+2010-03-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Add support for shelving snapshots and for showing shelves.
+ * vc-bzr.el (vc-bzr-shelve-show, vc-bzr-shelve-show-at-point)
+ (vc-bzr-shelve-apply-and-keep-at-point, vc-bzr-shelve-snapshot):
+ New functions.
+ (vc-bzr-shelve-map, vc-bzr-shelve-menu-map)
+ (vc-bzr-extra-menu-map): Map them.
+
+2010-03-11 Glenn Morris <rgm@gnu.org>
+
+ * cus-edit.el (customize-changed-options-previous-release):
+ Bump to 23.1.
+
+ * image.el (image-animate-max-time): Fix :version tag.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
+2010-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-git.el (vc-git-revision-table): Include remote branches.
+
+2010-03-10 Kim F. Storm <storm@cua.dk>
+
+ Animated image API.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00211.html
+
+ * image.el (image-animate-max-time): New defcustom.
+ (image-animated-types): New defconst.
+ (create-animated-image, image-animate-timer)
+ (image-animate-start, image-animate-stop, image-animate-timeout)
+ (image-animated-p): New functions.
+
+ * image-mode.el (image-toggle-display-image):
+ Replace `create-image' with `create-animated-image'.
+
+2010-03-09 Miles Bader <miles@gnu.org>
* vc-git.el (vc-git-print-log): Use "tformat:" for shortlog,
instead of "format:"; this ensures that the output is
2010-03-07 Štěpán Němec <stepnem@gmail.com> (tiny change)
- * vc-git.el (vc-git-annotate-extract-revision-at-line): Use
- vc-git-root as default directory for revision path (Bug#5657).
+ * vc-git.el (vc-git-annotate-extract-revision-at-line):
+ Use vc-git-root as default directory for revision path (Bug#5657).
2010-03-06 Chong Yidong <cyd@stupidchicken.com>
2010-02-28 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el (dbus-introspect, dbus-get-property)
- (dbus-set-property, dbus-get-all-properties): Use
- `dbus-call-method' when noninteractive. (Bug#5645)
+ (dbus-set-property, dbus-get-all-properties):
+ Use `dbus-call-method' when noninteractive. (Bug#5645)
2010-02-28 Chong Yidong <cyd@stupidchicken.com>
2009-12-18 Ulf Jasper <ulf.jasper@web.de>
- * calendar/icalendar.el (icalendar--convert-tz-offset): Fixed
- timezone names.
- (icalendar--convert-tz-offset): Fixed the "last-day-problem".
+ * calendar/icalendar.el (icalendar--convert-tz-offset):
+ Fix timezone names.
+ (icalendar--convert-tz-offset): Fix the "last-day-problem".
(icalendar--add-diary-entry): Remove the trailing blank that
diary-make-entry inserts.
(tramp-advice-file-expand-wildcards): Remove it.
* net/tramp-compat.el (top): Autoload `tramp-handle-file-remote-p'.
- (tramp-advice-file-expand-wildcards): Moved from tramp.el.
+ (tramp-advice-file-expand-wildcards): Move from tramp.el.
Activate advice for older GNU Emacs versions. (Bug#5237)
2009-12-17 Juanma Barranquero <lekktu@gmail.com>
* files.el (hack-local-variables-filter): While ignoring duplicates,
don't take `mode' into account.
- (hack-local-variables-filter, hack-dir-local-variables): Don't
- remove duplicate `mode' from local-variables-alist (like `eval').
+ (hack-local-variables-filter, hack-dir-local-variables):
+ Don't remove duplicate `mode' from local-variables-alist (like `eval').
2009-12-17 Juri Linkov <juri@jurta.org>
- Make `dired-diff' more safe. (Bug#5225)
+ Make `dired-diff' safer. (Bug#5225)
* dired-aux.el (dired-diff): Signal an error when `file' equals to
`current' or when `file' is a directory of the `current' file.
2009-12-09 Vivek Dasmohapatra <vivek@etla.org>
- Drop some properties to avoid surprises.
+ Drop some properties to avoid surprises (bug#5002).
* htmlfontify.el (hfy-ignored-properties): New defcustom.
(hfy-fontify-buffer): Use it.
* Makefile.in (ELCFILES): Adapt to subword.el move.
2009-11-21 Thierry Volpiatto <thierry.volpiatto@gmail.com>
- Stefan Monnier <monnier@iro.umontreal.ca>
+ Stefan Monnier <monnier@iro.umontreal.ca>
* bookmark.el (bookmark-bmenu-bookmark-column): Remove var.
(bookmark-bmenu-list): Save name on `bookmark-name-prop' text-prop.
indent buffer only if called interactively (Bug#4452).
2009-09-19 Juanma Barranquero <lekktu@gmail.com>
- Eli Zaretskii <eliz@gnu.org>
+ Eli Zaretskii <eliz@gnu.org>
This fixes bug#4197 (merged to bug#865, though not identical).
* server.el (server-auth-dir): Add docstring note about FAT32.
Don't call substitute-in-file-name on diary-file.
2009-09-03 Eduard Wiebe <usenet@pusto.de>
- Stefan Monnier <monnier@iro.umontreal.ca>
+ Stefan Monnier <monnier@iro.umontreal.ca>
* mail/footnote.el (footnote-prefix): Make it a defcustom.
(footnote-mode-map): Move initialization into the declaration.
* progmodes/hideshow.el (hs-special-modes-alist): Add js-mode entry.
2009-08-14 Daniel Colascione <dan.colascione@gmail.com>
- Karl Landstrom <karl.landstrom@brgeight.se>
+ Karl Landstrom <karl.landstrom@brgeight.se>
* progmodes/js.el: New file.
XZ is the successor to LZMA: <http://tukaani.org/xz/>
2009-06-22 Dmitry Dzhus <dima@sphinx.net.ru>
- Nick Roberts <nickrob@snap.net.nz>
+ Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-mi.el: Pull further modified changes from Dmitry's
repository (http://sphinx.net.ru/hg/gdb-mi/).
* info.el:
(Info-select-node): Was searching unboundedly for "execute:".
(Info-follow-reference): Was called Info-footnote.
- Also, handle presence of spaces and newlines in ref names.
+ Also, handle presence of spaces and newlines in ref names.
(Info-extract-menu-node-name): Handle presence of spaces and
newlines in the node name.
(Info-menu): Handle presence of spaces and newlines in item
1985-10-28 Richard M. Stallman (rms@prep)
* rmail.el, rmailsum.el, rmailkwd.el, rmailmsc.el,
- rmailout.el, rmailedit.el:
+ * rmailout.el, rmailedit.el:
Install thoroughly rewritten rmail with many new features.
* debug.el (debug, debugger-mode):
(also, mail-yank-ignored-headers had a typo)
* rmail.el (rmail-get-new-mail, convert-to-babyl-format, ...)
- loaddefs.el
+ * loaddefs.el:
Remodularize inbox parsing. Add support(?) for mmdf inboxes.
Note that I can't seem to define definitive documentation of
what this format is; however the code installed seems to work
(bibtex-field-list, bibtex-find-crossref): Fix typos in error messages.
2005-01-24 Dan Nicolaescu <dann@ics.uci.edu>
- Juri Linkov <juri@jurta.org>
+ Juri Linkov <juri@jurta.org>
* textmodes/reftex-global.el (reftex-isearch-push-state-function)
(reftex-isearch-pop-state-function, reftex-isearch-isearch-search)
char-width-table. Don't make ethiopic and tibetan double column.
* textmodes/fill.el (fill-find-break-point-function-table):
- Don't set it up in defvar.
+ Don't set it up in defvar.
(fill-nospace-between-words-table): New variable.
(fill-delete-newlines): Check fill-nospace-between-words-table
instead of charset property nospace-between-words.
2008-02-01 Dave Love <fx@gnu.org>
* emacs-lisp/byte-opt.el (side-effect-free-fns):
- Add string-make-unibyte string-make-multibyte string-to-multibyte
- string-as-multibyte string-as-unibyte.
+ Add string-make-unibyte string-make-multibyte string-to-multibyte
+ string-as-multibyte string-as-unibyte.
2008-02-01 Dave Love <fx@gnu.org>
* ibuffer.el (ibuffer-mode): Fix typo in previous change.
2008-01-17 Vinicius Jose Latorre <viniciusjl@ig.com.br>
- Miles Bader <miles@gnu.org>
+ Miles Bader <miles@gnu.org>
* blank-mode.el: New file. Minor mode to visualize (HARD) SPACE,
TAB, NEWLINE. Miles Bader <miles@gnu.org> wrote the original code
(verilog-insert-indices): Escape braces in doc strings.
2007-12-08 Michael McNamara <mac@verilog.com>
- Wilson Snyder <wsnyder@wsnyder.org>
+ Wilson Snyder <wsnyder@wsnyder.org>
* progmodes/verilog-mode.el: New file.
Use native Emacs functions, when appropriate.
2007-08-01 Dan Nicolaescu <dann@ics.uci.edu>
- Stefan Monnier <monnier@iro.umontreal.ca>
+ Stefan Monnier <monnier@iro.umontreal.ca>
* vc.el: Document new VC operation `extra-menu'.
* paren.el (show-paren-function):
* simple.el (kill-forward-chars, kill-backward-chars):
- Use (+/- (point) N), instead of `forward-point'.
+ Use (+/- (point) N), instead of `forward-point'.
2009-03-19 Glenn Morris <rgm@gnu.org>
Don't activate node nil. (Bug#1569)
2009-01-22 Paul Reilly <pmr@pajato.com>
- Henrik Enberg <enberg@printf.se>
- Alex Schroeder <alex@gnu.org>
- Chong Yidong <cyd@stupidchicken.com>
- Richard M Stallman <rms@gnu.org>
- Glenn Morris <rgm@gnu.org>
- Juanma Barranquero <lekktu@gmail.com>
+ Henrik Enberg <enberg@printf.se>
+ Alex Schroeder <alex@gnu.org>
+ Chong Yidong <cyd@stupidchicken.com>
+ Richard M Stallman <rms@gnu.org>
+ Glenn Morris <rgm@gnu.org>
+ Juanma Barranquero <lekktu@gmail.com>
* mail/rmail.el: Code implementing Rmail-mbox functionality.
(rmail-attribute-header, rmail-keyword-header)
was orderly adjusted, nil otherwise.
2008-12-12 Juanma Barranquero <lekktu@gmail.com>
- Stefan Monnier <monnier@iro.umontreal.ca>
+ Stefan Monnier <monnier@iro.umontreal.ca>
* server.el (server-sentinel): Uncomment code to delete connection file.
(server-start): Save the connection file in the server property list.
terminal variable assignment.
2008-12-10 Yukihiro Matsumoto <matz@ruby-lang.org>
- Nobuyoshi Nakada <nobu@ruby-lang.org>
+ Nobuyoshi Nakada <nobu@ruby-lang.org>
* progmodes/ruby-mode.el: New file.
New aliases, to satisfy `define-derived-mode' expectations.
2008-11-15 Glenn Morris <rgm@gnu.org>
- Martin Rudalics <rudalics@gmx.at>
+ Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/find-func.el (find-function-advised-original): New.
(find-function-C-source, find-function-noselect):
(newsticker--treeview-propertize-tag): Show item title in tooltip.
2008-06-20 Martin Blais <blais@furius.ca>
- Stefan Merten <smerten@oekonux.de>
- David Goodger <goodger@python.org>
+ Stefan Merten <smerten@oekonux.de>
+ David Goodger <goodger@python.org>
* textmodes/rst.el: New file.
* term/linux.el (terminal-init-linux): Load t-mouse.
2008-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
- Drew Adams <drew.adams@oracle.com>
+ Drew Adams <drew.adams@oracle.com>
* info.el (Info-breadcrumbs-depth): New var.
(Info-insert-breadcrumbs): New function.
for useful options.
2008-03-01 Dan Nicolaescu <dann@ics.uci.edu>
- Glenn Morris <rgm@gnu.org>
+ Glenn Morris <rgm@gnu.org>
* emacs-lisp/bytecomp.el (byte-recompile-directory)
(byte-compile-file, batch-byte-compile, batch-byte-compile-file):
* ediff.el (ediff-toggle-read-only, ediff-patch-file): Check out
version controlled files before their buffers are modified.
(ediff-local-checkout-flag, ediff-toggle-read-only-function):
- New variables.
+ New variables.
* ediff.el (ediff-find-file, ediff-patch-file): Were getting
confused by symbolic links. Fixed.
1994-07-23 enami tsugutomo <enami@sys.ptg.sony.co.jp>
* lisp/add-log.el (add-log-current-defun): Skip doc string
- correctly even if it ends with line that starts space.
+ correctly even if it ends with line that starts space.
1994-07-22 Ed Reingold <reingold@albert.gnu.ai.mit.edu>
* solar.el (solar-sunrise, solar-sunset): Fix doc string.
(solar-time-string): Rewritten.
(solar-adj-time-for-dst): New function.
- (solar-sunrise-sunset, diary-sabbath-candles,
- solar-equinoxes-solstices): Revised to use the rewritten and new fcns.
+ (solar-sunrise-sunset, diary-sabbath-candles)
+ (solar-equinoxes-solstices): Revised to use the rewritten and new fcns.
* calendar.el (solar-holidays): Revised to use the rewritten and
- new fcns.
+ new fcns.
* lunar.el (lunar-phase): Revised to use the rewritten and new fcns.
When changing the environment, avoid need for setenv.
1996-01-05 Karl Eichwalder <ke@ke.Central.DE>
- Karl Fogel <kfogel@floss.red-bean.com>
+ Karl Fogel <kfogel@floss.red-bean.com>
* bookmark.el: "cyclic.com" addresses changed to "red-bean.com".
(bookmark-bmenu-mode-map): Don't bind C-k.
1995-10-09 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* etags.el (tags-table-check-computed-list): Map
- tags-expand-table-name over lists of included tables.
+ tags-expand-table-name over lists of included tables.
1995-10-09 Erik Naggum <erik@naggum.no>
* abbrev.el: Likewise.
1998-05-26 Emilio Lopes <Emilio.Lopes@Physik.TU-Muenchen.DE>
- Karl Fogel <kfogel@red-bean.com>
+ Karl Fogel <kfogel@red-bean.com>
* bookmark.el: Changes so bookmark list mode works with Info:
(bookmark-jump-noselect): Use an inner save-window-excursion.
2001-06-27 Francesco Potortì <pot@gnu.org>
- * uniquify.el: (uniquify-rationalize-file-buffer-names):
- Undo previous change.
+ * uniquify.el (uniquify-rationalize-file-buffer-names):
+ Undo previous change.
2001-06-27 Francesco Potortì <pot@gnu.org>
2000-09-05 Stefan Monnier <monnier@cs.yale.edu>
- * vc.el: (toplevel): Don't require `dired' at run-time.
+ * vc.el (toplevel): Don't require `dired' at run-time.
(vc-dired-resynch-file): Remove autoload cookie.
2000-09-05 Andre Spiegel <spiegel@gnu.org>
`vc-locking-user' semantics.
(vc-backend-merge): Remove.
- * vc-rcs.el, vc-scc.el: (vc-{sc,r}cs-check{in,out}): Update 'vc-state
+ * vc-rcs.el, vc-scc.el (vc-{sc,r}cs-check{in,out}): Update 'vc-state
rather than 'vc-locking-user.
* vc-rcs-hooks.el (vc-rcs-consult-headers): Adapt to new `vc-state'.
leading comma nicely. Extended to handle member initializers
too.
- * cc-engine.el: (c-beginning-of-inheritance-list,
- c-guess-basic-syntax): Fixed recognition of inheritance lists
+ * cc-engine.el (c-beginning-of-inheritance-list)
+ (c-guess-basic-syntax): Fixed recognition of inheritance lists
when the lines begins with a comma.
* cc-vars.el (c-offsets-alist): Changed default for
(backward-kill-word): Revert addition of * to interactive spec --
it's a feature.
- * paragraphs.el: (kill-paragraph, backward-kill-paragraph)
+ * paragraphs.el (kill-paragraph, backward-kill-paragraph)
(backward-kill-sentence, kill-sentence): Likewise.
* gud.el (gud-jdb-build-class-source-alist): Prepend space to
2000-02-10 Dave Love <fx@gnu.org>
- * wid-edit.el: (widgets) [defgroup]: Remove url link.
+ * wid-edit.el (widgets) [defgroup]: Remove url link.
(widget-color-choice-list, widget-color-history, widget-mouse-help):
Deleted.
(widget-specify-field, widget-specify-button): Don't use
-# Maintenance productions for the Lisp directory
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-# 2009, 2010 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/>.
-
-SHELL = /bin/sh
-
-lisp=@srcdir@
-VPATH=@srcdir@
-srcdir=@srcdir@/..
-
-# You can specify a different executable on the make command line,
-# e.g. "make EMACS=../src/emacs ...".
-
-EMACS = ../src/emacs
-
-# Command line flags for Emacs. This must include --multibyte,
-# otherwise some files will not compile.
-
-EMACSOPT = -batch --no-site-file --multibyte
-
-# Extra flags to pass to the byte compiler
-BYTE_COMPILE_EXTRA_FLAGS =
-# For example to not display the undefined function warnings you can use this:
-# BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
-# The example above is just for developers, it should not be used by default.
-
-lisptagsfiles1 = $(lisp)/*.el
-lisptagsfiles2 = $(lisp)/*/*.el
-lisptagsfiles3 = $(lisp)/*/*/*.el
-lisptagsfiles4 = $(lisp)/*/*/*/*.el
-ETAGS = ../lib-src/etags
-
-# Automatically generated autoload files, apart from lisp/loaddefs.el.
-# Note this includes only those files that need special rules to
-# build; ie it does not need to include things created via
-# generated-autoload-file (eg calc/calc-loaddefs.el).
-LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
- $(lisp)/calendar/diary-loaddefs.el \
- $(lisp)/calendar/hol-loaddefs.el \
- $(lisp)/mh-e/mh-loaddefs.el
-
-# Elisp files auto-generated.
-AUTOGENEL = loaddefs.el \
- $(LOADDEFS) \
- cus-load.el \
- finder-inf.el \
- subdirs.el \
- calc/calc-loaddefs.el \
- eshell/esh-groups.el \
- cedet/semantic/loaddefs.el \
- cedet/ede/loaddefs.el \
- cedet/srecode/loaddefs.el
-
-# Files to compile before others during a bootstrap. This is done to
-# speed up the bootstrap process.
-
-COMPILE_FIRST = \
- $(lisp)/emacs-lisp/bytecomp.elc \
- $(lisp)/emacs-lisp/byte-opt.elc \
- $(lisp)/emacs-lisp/autoload.elc
-
-# The actual Emacs command run in the targets below.
-
-emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
-
-# Common command to find subdirectories
-
-setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
- for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
- *) wins="$$wins $$wd/$$file" ;; \
- esac; \
- done
-
-# Find all subdirectories except `obsolete' and `term'.
-
-setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
- for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
- *) wins="$$wins $$wd/$$file" ;; \
- esac; \
- done
-
-# Find all subdirectories in which we might want to create subdirs.el
-
-setwins_for_subdirs=subdirs=`(cd $$wd; find . -type d -print)`; \
- for file in $$subdirs; do \
- case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \
- *) wins="$$wins $$wd/$$file" ;; \
- esac; \
- done
-
-# `compile-main' tends to be slower than `recompile' but can be parallelized
-# with "make -j" and results in more deterministic compilation warnings.
-# cus-load and finder-inf are not explicitly requested by anything, so
-# we add them here to make sure they get built.
-all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
- @: Let us check that we byte-compiled all the files.
- $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS)
-
-doit:
-
-# custom-deps and finder-data both used to scan _all_ the *.el files.
-# This could lead to problems in parallel builds if automatically
-# generated *.el files (eg loaddefs etc) were being changed at the same time.
-# One solution was to add autoloads as a prerequisite:
-# http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html
-# http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-12/msg00171.html
-# However, this meant that running these targets modified loaddefs.el,
-# every time (due to time-stamping). Calling these rules from
-# bootstrap-after would modify loaddefs after src/emacs, resulting
-# in make install remaking src/emacs for no real reason:
-# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html
-# Nowadays these commands don't scan automatically generated files,
-# since they will never contain any useful information
-# (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp).
-$(lisp)/cus-load.el:
- $(MAKE) $(MFLAGS) custom-deps
-custom-deps: doit
- wd=$(lisp); $(setwins_almost); \
- echo Directories: $$wins; \
- $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
-
-$(lisp)/finder-inf.el:
- $(MAKE) $(MFLAGS) finder-data
-finder-data: doit
- wd=$(lisp); $(setwins_almost); \
- echo Directories: $$wins; \
- $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
-
-# The chmod +w is to handle env var CVSREAD=1. Files named
-# are identified by being the value of `generated-autoload-file'.
-autoloads: $(LOADDEFS) doit
- chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
- $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
- $(lisp)/dired.el $(lisp)/ibuffer.el
- wd=$(lisp); $(setwins_almost); \
- echo Directories: $$wins; \
- $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
-
-# This is required by the bootstrap-emacs target in ../src/Makefile, so
-# we know that if we have an emacs executable, we also have a subdirs.el.
-$(lisp)/subdirs.el:
- $(MAKE) $(MFLAGS) update-subdirs
-update-subdirs: doit
- wd=$(lisp); $(setwins_for_subdirs); \
- for file in $$wins; do \
- $(srcdir)/update-subdirs $$file; \
- done;
-
-updates: update-subdirs autoloads finder-data custom-deps
-
-# This is useful after "bzr up".
-bzr-update: recompile autoloads finder-data custom-deps
-
-# For backwards compatibility:
-cvs-update: bzr-update
-
-# Update the AUTHORS file.
-
-update-authors:
- $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
-
-TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
- els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
- ${ETAGS} -o $@ $$els
-
-.PHONY: update-elclist
-
-## Post-bootstrap, find the list of .elc files and use sed to update
-## ELCFILES in Makefile.in.
-## Errors in the final sed are non-fatal, since they have no effect on
-## building Emacs. chmod +w is for CVSREAD=1.
-## "echo" is non-portable with regards to backslashes, eg between zsh
-## and bash. Hence the use of sed on line 2 below (line 1 seems to be OK).
-## http://lists.gnu.org/archive/html/emacs-devel/2008-05/msg01535.html
-update-elclist:
- echo "/^ELCFILES/,/^$$/c\\" > temp.sed
- echo "ELCFILES =" | sed -e 's/$$/ \\\\\\/' >> temp.sed
- LC_COLLATE=C ls $(lisp)/*.elc $(lisp)/*/*.elc $(lisp)/*/*/*.elc $(lisp)/*/*/*/*.elc | sed -e "s|^$(lisp)| \$$(lisp)|" -e 's/$$/ \\\\\\/' -e '$$ s/ \\\\//' >> temp.sed
- echo "" >> temp.sed
- -sed -f temp.sed $(lisp)/Makefile.in > temp-elcfiles || rm temp-elcfiles
- rm temp.sed
- @test -f temp-elcfiles || echo "Maintainer warning: failed to update Makefile.in. You can ignore this if you are not an Emacs developer."
- if test -f temp-elcfiles; then \
- chmod +w $(lisp)/Makefile.in; \
- mv -f temp-elcfiles $(lisp)/Makefile.in; \
- fi
- -(LC_COLLATE=C ls $(lisp)/*.elc $(lisp)/*/*.elc $(lisp)/*/*/*.elc $(lisp)/*/*/*/*.elc | sed 's/elc$$/el/'; \
- LC_COLLATE=C ls $(lisp)/*.el $(lisp)/*/*.el $(lisp)/*/*/*.el $(lisp)/*/*/*/*.el; \
- LC_COLLATE=C ls $(lisp)/*.el $(lisp)/*/*.el $(lisp)/*/*/*.el $(lisp)/*/*/*/*.el) | \
- sort | uniq -u | while read extra; do \
- echo "Found left over byte-compiled file: $${extra}c !!" ;\
- done
-
-## Explicitly list the .elc files, for the sake of parallel builds.
-## http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-05/msg00016.html
-## This can probably be done more elegantly, but needs to be portable.
-ELCFILES = \
- $(lisp)/abbrev.elc \
- $(lisp)/abbrevlist.elc \
- $(lisp)/add-log.elc \
- $(lisp)/align.elc \
- $(lisp)/allout.elc \
- $(lisp)/ansi-color.elc \
- $(lisp)/apropos.elc \
- $(lisp)/arc-mode.elc \
- $(lisp)/array.elc \
- $(lisp)/autoarg.elc \
- $(lisp)/autoinsert.elc \
- $(lisp)/autorevert.elc \
- $(lisp)/avoid.elc \
- $(lisp)/battery.elc \
- $(lisp)/bindings.elc \
- $(lisp)/bookmark.elc \
- $(lisp)/bs.elc \
- $(lisp)/buff-menu.elc \
- $(lisp)/button.elc \
- $(lisp)/calc/calc-aent.elc \
- $(lisp)/calc/calc-alg.elc \
- $(lisp)/calc/calc-arith.elc \
- $(lisp)/calc/calc-bin.elc \
- $(lisp)/calc/calc-comb.elc \
- $(lisp)/calc/calc-cplx.elc \
- $(lisp)/calc/calc-embed.elc \
- $(lisp)/calc/calc-ext.elc \
- $(lisp)/calc/calc-fin.elc \
- $(lisp)/calc/calc-forms.elc \
- $(lisp)/calc/calc-frac.elc \
- $(lisp)/calc/calc-funcs.elc \
- $(lisp)/calc/calc-graph.elc \
- $(lisp)/calc/calc-help.elc \
- $(lisp)/calc/calc-incom.elc \
- $(lisp)/calc/calc-keypd.elc \
- $(lisp)/calc/calc-lang.elc \
- $(lisp)/calc/calc-macs.elc \
- $(lisp)/calc/calc-map.elc \
- $(lisp)/calc/calc-math.elc \
- $(lisp)/calc/calc-menu.elc \
- $(lisp)/calc/calc-misc.elc \
- $(lisp)/calc/calc-mode.elc \
- $(lisp)/calc/calc-mtx.elc \
- $(lisp)/calc/calc-nlfit.elc \
- $(lisp)/calc/calc-poly.elc \
- $(lisp)/calc/calc-prog.elc \
- $(lisp)/calc/calc-rewr.elc \
- $(lisp)/calc/calc-rules.elc \
- $(lisp)/calc/calc-sel.elc \
- $(lisp)/calc/calc-stat.elc \
- $(lisp)/calc/calc-store.elc \
- $(lisp)/calc/calc-stuff.elc \
- $(lisp)/calc/calc-trail.elc \
- $(lisp)/calc/calc-undo.elc \
- $(lisp)/calc/calc-units.elc \
- $(lisp)/calc/calc-vec.elc \
- $(lisp)/calc/calc-yank.elc \
- $(lisp)/calc/calc.elc \
- $(lisp)/calc/calcalg2.elc \
- $(lisp)/calc/calcalg3.elc \
- $(lisp)/calc/calccomp.elc \
- $(lisp)/calc/calcsel2.elc \
- $(lisp)/calculator.elc \
- $(lisp)/calendar/appt.elc \
- $(lisp)/calendar/cal-bahai.elc \
- $(lisp)/calendar/cal-china.elc \
- $(lisp)/calendar/cal-coptic.elc \
- $(lisp)/calendar/cal-dst.elc \
- $(lisp)/calendar/cal-french.elc \
- $(lisp)/calendar/cal-hebrew.elc \
- $(lisp)/calendar/cal-html.elc \
- $(lisp)/calendar/cal-islam.elc \
- $(lisp)/calendar/cal-iso.elc \
- $(lisp)/calendar/cal-julian.elc \
- $(lisp)/calendar/cal-mayan.elc \
- $(lisp)/calendar/cal-menu.elc \
- $(lisp)/calendar/cal-move.elc \
- $(lisp)/calendar/cal-persia.elc \
- $(lisp)/calendar/cal-tex.elc \
- $(lisp)/calendar/cal-x.elc \
- $(lisp)/calendar/calendar.elc \
- $(lisp)/calendar/diary-lib.elc \
- $(lisp)/calendar/holidays.elc \
- $(lisp)/calendar/icalendar.elc \
- $(lisp)/calendar/lunar.elc \
- $(lisp)/calendar/parse-time.elc \
- $(lisp)/calendar/solar.elc \
- $(lisp)/calendar/time-date.elc \
- $(lisp)/calendar/timeclock.elc \
- $(lisp)/calendar/todo-mode.elc \
- $(lisp)/case-table.elc \
- $(lisp)/cdl.elc \
- $(lisp)/cedet/cedet-cscope.elc \
- $(lisp)/cedet/cedet-files.elc \
- $(lisp)/cedet/cedet-global.elc \
- $(lisp)/cedet/cedet-idutils.elc \
- $(lisp)/cedet/cedet.elc \
- $(lisp)/cedet/data-debug.elc \
- $(lisp)/cedet/ede.elc \
- $(lisp)/cedet/ede/autoconf-edit.elc \
- $(lisp)/cedet/ede/cpp-root.elc \
- $(lisp)/cedet/ede/dired.elc \
- $(lisp)/cedet/ede/emacs.elc \
- $(lisp)/cedet/ede/files.elc \
- $(lisp)/cedet/ede/linux.elc \
- $(lisp)/cedet/ede/locate.elc \
- $(lisp)/cedet/ede/make.elc \
- $(lisp)/cedet/ede/makefile-edit.elc \
- $(lisp)/cedet/ede/pconf.elc \
- $(lisp)/cedet/ede/pmake.elc \
- $(lisp)/cedet/ede/proj-archive.elc \
- $(lisp)/cedet/ede/proj-aux.elc \
- $(lisp)/cedet/ede/proj-comp.elc \
- $(lisp)/cedet/ede/proj-elisp.elc \
- $(lisp)/cedet/ede/proj-info.elc \
- $(lisp)/cedet/ede/proj-misc.elc \
- $(lisp)/cedet/ede/proj-obj.elc \
- $(lisp)/cedet/ede/proj-prog.elc \
- $(lisp)/cedet/ede/proj-scheme.elc \
- $(lisp)/cedet/ede/proj-shared.elc \
- $(lisp)/cedet/ede/proj.elc \
- $(lisp)/cedet/ede/project-am.elc \
- $(lisp)/cedet/ede/shell.elc \
- $(lisp)/cedet/ede/simple.elc \
- $(lisp)/cedet/ede/source.elc \
- $(lisp)/cedet/ede/speedbar.elc \
- $(lisp)/cedet/ede/srecode.elc \
- $(lisp)/cedet/ede/system.elc \
- $(lisp)/cedet/ede/util.elc \
- $(lisp)/cedet/inversion.elc \
- $(lisp)/cedet/mode-local.elc \
- $(lisp)/cedet/pulse.elc \
- $(lisp)/cedet/semantic.elc \
- $(lisp)/cedet/semantic/analyze.elc \
- $(lisp)/cedet/semantic/analyze/complete.elc \
- $(lisp)/cedet/semantic/analyze/debug.elc \
- $(lisp)/cedet/semantic/analyze/fcn.elc \
- $(lisp)/cedet/semantic/analyze/refs.elc \
- $(lisp)/cedet/semantic/bovine.elc \
- $(lisp)/cedet/semantic/bovine/c-by.elc \
- $(lisp)/cedet/semantic/bovine/c.elc \
- $(lisp)/cedet/semantic/bovine/debug.elc \
- $(lisp)/cedet/semantic/bovine/el.elc \
- $(lisp)/cedet/semantic/bovine/gcc.elc \
- $(lisp)/cedet/semantic/bovine/make-by.elc \
- $(lisp)/cedet/semantic/bovine/make.elc \
- $(lisp)/cedet/semantic/bovine/scm-by.elc \
- $(lisp)/cedet/semantic/bovine/scm.elc \
- $(lisp)/cedet/semantic/chart.elc \
- $(lisp)/cedet/semantic/complete.elc \
- $(lisp)/cedet/semantic/ctxt.elc \
- $(lisp)/cedet/semantic/db-debug.elc \
- $(lisp)/cedet/semantic/db-ebrowse.elc \
- $(lisp)/cedet/semantic/db-el.elc \
- $(lisp)/cedet/semantic/db-file.elc \
- $(lisp)/cedet/semantic/db-find.elc \
- $(lisp)/cedet/semantic/db-global.elc \
- $(lisp)/cedet/semantic/db-javascript.elc \
- $(lisp)/cedet/semantic/db-mode.elc \
- $(lisp)/cedet/semantic/db-ref.elc \
- $(lisp)/cedet/semantic/db-typecache.elc \
- $(lisp)/cedet/semantic/db.elc \
- $(lisp)/cedet/semantic/debug.elc \
- $(lisp)/cedet/semantic/decorate.elc \
- $(lisp)/cedet/semantic/decorate/include.elc \
- $(lisp)/cedet/semantic/decorate/mode.elc \
- $(lisp)/cedet/semantic/dep.elc \
- $(lisp)/cedet/semantic/doc.elc \
- $(lisp)/cedet/semantic/ede-grammar.elc \
- $(lisp)/cedet/semantic/edit.elc \
- $(lisp)/cedet/semantic/find.elc \
- $(lisp)/cedet/semantic/format.elc \
- $(lisp)/cedet/semantic/fw.elc \
- $(lisp)/cedet/semantic/grammar-wy.elc \
- $(lisp)/cedet/semantic/grammar.elc \
- $(lisp)/cedet/semantic/html.elc \
- $(lisp)/cedet/semantic/ia-sb.elc \
- $(lisp)/cedet/semantic/ia.elc \
- $(lisp)/cedet/semantic/idle.elc \
- $(lisp)/cedet/semantic/imenu.elc \
- $(lisp)/cedet/semantic/java.elc \
- $(lisp)/cedet/semantic/lex-spp.elc \
- $(lisp)/cedet/semantic/lex.elc \
- $(lisp)/cedet/semantic/mru-bookmark.elc \
- $(lisp)/cedet/semantic/sb.elc \
- $(lisp)/cedet/semantic/scope.elc \
- $(lisp)/cedet/semantic/senator.elc \
- $(lisp)/cedet/semantic/sort.elc \
- $(lisp)/cedet/semantic/symref.elc \
- $(lisp)/cedet/semantic/symref/cscope.elc \
- $(lisp)/cedet/semantic/symref/filter.elc \
- $(lisp)/cedet/semantic/symref/global.elc \
- $(lisp)/cedet/semantic/symref/grep.elc \
- $(lisp)/cedet/semantic/symref/idutils.elc \
- $(lisp)/cedet/semantic/symref/list.elc \
- $(lisp)/cedet/semantic/tag-file.elc \
- $(lisp)/cedet/semantic/tag-ls.elc \
- $(lisp)/cedet/semantic/tag-write.elc \
- $(lisp)/cedet/semantic/tag.elc \
- $(lisp)/cedet/semantic/texi.elc \
- $(lisp)/cedet/semantic/util-modes.elc \
- $(lisp)/cedet/semantic/util.elc \
- $(lisp)/cedet/semantic/wisent.elc \
- $(lisp)/cedet/semantic/wisent/comp.elc \
- $(lisp)/cedet/semantic/wisent/java-tags.elc \
- $(lisp)/cedet/semantic/wisent/javascript.elc \
- $(lisp)/cedet/semantic/wisent/javat-wy.elc \
- $(lisp)/cedet/semantic/wisent/js-wy.elc \
- $(lisp)/cedet/semantic/wisent/python-wy.elc \
- $(lisp)/cedet/semantic/wisent/python.elc \
- $(lisp)/cedet/semantic/wisent/wisent.elc \
- $(lisp)/cedet/srecode.elc \
- $(lisp)/cedet/srecode/args.elc \
- $(lisp)/cedet/srecode/compile.elc \
- $(lisp)/cedet/srecode/cpp.elc \
- $(lisp)/cedet/srecode/ctxt.elc \
- $(lisp)/cedet/srecode/dictionary.elc \
- $(lisp)/cedet/srecode/document.elc \
- $(lisp)/cedet/srecode/el.elc \
- $(lisp)/cedet/srecode/expandproto.elc \
- $(lisp)/cedet/srecode/extract.elc \
- $(lisp)/cedet/srecode/fields.elc \
- $(lisp)/cedet/srecode/filters.elc \
- $(lisp)/cedet/srecode/find.elc \
- $(lisp)/cedet/srecode/getset.elc \
- $(lisp)/cedet/srecode/insert.elc \
- $(lisp)/cedet/srecode/java.elc \
- $(lisp)/cedet/srecode/map.elc \
- $(lisp)/cedet/srecode/mode.elc \
- $(lisp)/cedet/srecode/semantic.elc \
- $(lisp)/cedet/srecode/srt-mode.elc \
- $(lisp)/cedet/srecode/srt-wy.elc \
- $(lisp)/cedet/srecode/srt.elc \
- $(lisp)/cedet/srecode/table.elc \
- $(lisp)/cedet/srecode/template.elc \
- $(lisp)/cedet/srecode/texi.elc \
- $(lisp)/chistory.elc \
- $(lisp)/cmuscheme.elc \
- $(lisp)/comint.elc \
- $(lisp)/compare-w.elc \
- $(lisp)/complete.elc \
- $(lisp)/completion.elc \
- $(lisp)/composite.elc \
- $(lisp)/cus-dep.elc \
- $(lisp)/cus-edit.elc \
- $(lisp)/cus-face.elc \
- $(lisp)/cus-start.elc \
- $(lisp)/cus-theme.elc \
- $(lisp)/custom.elc \
- $(lisp)/cvs-status.elc \
- $(lisp)/dabbrev.elc \
- $(lisp)/delim-col.elc \
- $(lisp)/delsel.elc \
- $(lisp)/descr-text.elc \
- $(lisp)/desktop.elc \
- $(lisp)/dframe.elc \
- $(lisp)/diff-mode.elc \
- $(lisp)/diff.elc \
- $(lisp)/dired-aux.elc \
- $(lisp)/dired-x.elc \
- $(lisp)/dired.elc \
- $(lisp)/dirtrack.elc \
- $(lisp)/disp-table.elc \
- $(lisp)/dnd.elc \
- $(lisp)/doc-view.elc \
- $(lisp)/dos-fns.elc \
- $(lisp)/dos-vars.elc \
- $(lisp)/dos-w32.elc \
- $(lisp)/double.elc \
- $(lisp)/ebuff-menu.elc \
- $(lisp)/echistory.elc \
- $(lisp)/ediff-diff.elc \
- $(lisp)/ediff-help.elc \
- $(lisp)/ediff-hook.elc \
- $(lisp)/ediff-init.elc \
- $(lisp)/ediff-merg.elc \
- $(lisp)/ediff-mult.elc \
- $(lisp)/ediff-ptch.elc \
- $(lisp)/ediff-util.elc \
- $(lisp)/ediff-vers.elc \
- $(lisp)/ediff-wind.elc \
- $(lisp)/ediff.elc \
- $(lisp)/edmacro.elc \
- $(lisp)/ehelp.elc \
- $(lisp)/electric.elc \
- $(lisp)/elide-head.elc \
- $(lisp)/emacs-lisp/advice.elc \
- $(lisp)/emacs-lisp/assoc.elc \
- $(lisp)/emacs-lisp/authors.elc \
- $(lisp)/emacs-lisp/autoload.elc \
- $(lisp)/emacs-lisp/avl-tree.elc \
- $(lisp)/emacs-lisp/backquote.elc \
- $(lisp)/emacs-lisp/benchmark.elc \
- $(lisp)/emacs-lisp/bindat.elc \
- $(lisp)/emacs-lisp/byte-opt.elc \
- $(lisp)/emacs-lisp/byte-run.elc \
- $(lisp)/emacs-lisp/bytecomp.elc \
- $(lisp)/emacs-lisp/chart.elc \
- $(lisp)/emacs-lisp/check-declare.elc \
- $(lisp)/emacs-lisp/checkdoc.elc \
- $(lisp)/emacs-lisp/cl-compat.elc \
- $(lisp)/emacs-lisp/cl-extra.elc \
- $(lisp)/emacs-lisp/cl-indent.elc \
- $(lisp)/emacs-lisp/cl-macs.elc \
- $(lisp)/emacs-lisp/cl-seq.elc \
- $(lisp)/emacs-lisp/cl.elc \
- $(lisp)/emacs-lisp/copyright.elc \
- $(lisp)/emacs-lisp/crm.elc \
- $(lisp)/emacs-lisp/cust-print.elc \
- $(lisp)/emacs-lisp/debug.elc \
- $(lisp)/emacs-lisp/derived.elc \
- $(lisp)/emacs-lisp/disass.elc \
- $(lisp)/emacs-lisp/easy-mmode.elc \
- $(lisp)/emacs-lisp/easymenu.elc \
- $(lisp)/emacs-lisp/edebug.elc \
- $(lisp)/emacs-lisp/eieio-base.elc \
- $(lisp)/emacs-lisp/eieio-comp.elc \
- $(lisp)/emacs-lisp/eieio-custom.elc \
- $(lisp)/emacs-lisp/eieio-datadebug.elc \
- $(lisp)/emacs-lisp/eieio-opt.elc \
- $(lisp)/emacs-lisp/eieio-speedbar.elc \
- $(lisp)/emacs-lisp/eieio.elc \
- $(lisp)/emacs-lisp/eldoc.elc \
- $(lisp)/emacs-lisp/elint.elc \
- $(lisp)/emacs-lisp/elp.elc \
- $(lisp)/emacs-lisp/ewoc.elc \
- $(lisp)/emacs-lisp/find-func.elc \
- $(lisp)/emacs-lisp/find-gc.elc \
- $(lisp)/emacs-lisp/float-sup.elc \
- $(lisp)/emacs-lisp/generic.elc \
- $(lisp)/emacs-lisp/gulp.elc \
- $(lisp)/emacs-lisp/helper.elc \
- $(lisp)/emacs-lisp/lisp-mnt.elc \
- $(lisp)/emacs-lisp/lisp-mode.elc \
- $(lisp)/emacs-lisp/lisp.elc \
- $(lisp)/emacs-lisp/lmenu.elc \
- $(lisp)/emacs-lisp/macroexp.elc \
- $(lisp)/emacs-lisp/map-ynp.elc \
- $(lisp)/emacs-lisp/pp.elc \
- $(lisp)/emacs-lisp/re-builder.elc \
- $(lisp)/emacs-lisp/regexp-opt.elc \
- $(lisp)/emacs-lisp/regi.elc \
- $(lisp)/emacs-lisp/ring.elc \
- $(lisp)/emacs-lisp/rx.elc \
- $(lisp)/emacs-lisp/shadow.elc \
- $(lisp)/emacs-lisp/sregex.elc \
- $(lisp)/emacs-lisp/syntax.elc \
- $(lisp)/emacs-lisp/tcover-ses.elc \
- $(lisp)/emacs-lisp/tcover-unsafep.elc \
- $(lisp)/emacs-lisp/testcover.elc \
- $(lisp)/emacs-lisp/timer.elc \
- $(lisp)/emacs-lisp/tq.elc \
- $(lisp)/emacs-lisp/trace.elc \
- $(lisp)/emacs-lisp/unsafep.elc \
- $(lisp)/emacs-lisp/warnings.elc \
- $(lisp)/emacs-lock.elc \
- $(lisp)/emerge.elc \
- $(lisp)/emulation/crisp.elc \
- $(lisp)/emulation/cua-base.elc \
- $(lisp)/emulation/cua-gmrk.elc \
- $(lisp)/emulation/cua-rect.elc \
- $(lisp)/emulation/edt-lk201.elc \
- $(lisp)/emulation/edt-mapper.elc \
- $(lisp)/emulation/edt-pc.elc \
- $(lisp)/emulation/edt-vt100.elc \
- $(lisp)/emulation/edt.elc \
- $(lisp)/emulation/keypad.elc \
- $(lisp)/emulation/pc-mode.elc \
- $(lisp)/emulation/pc-select.elc \
- $(lisp)/emulation/tpu-edt.elc \
- $(lisp)/emulation/tpu-extras.elc \
- $(lisp)/emulation/tpu-mapper.elc \
- $(lisp)/emulation/vi.elc \
- $(lisp)/emulation/vip.elc \
- $(lisp)/emulation/viper-cmd.elc \
- $(lisp)/emulation/viper-ex.elc \
- $(lisp)/emulation/viper-init.elc \
- $(lisp)/emulation/viper-keym.elc \
- $(lisp)/emulation/viper-macs.elc \
- $(lisp)/emulation/viper-mous.elc \
- $(lisp)/emulation/viper-util.elc \
- $(lisp)/emulation/viper.elc \
- $(lisp)/emulation/ws-mode.elc \
- $(lisp)/env.elc \
- $(lisp)/epa-dired.elc \
- $(lisp)/epa-file.elc \
- $(lisp)/epa-hook.elc \
- $(lisp)/epa-mail.elc \
- $(lisp)/epa.elc \
- $(lisp)/epg-config.elc \
- $(lisp)/epg.elc \
- $(lisp)/erc/erc-autoaway.elc \
- $(lisp)/erc/erc-backend.elc \
- $(lisp)/erc/erc-button.elc \
- $(lisp)/erc/erc-capab.elc \
- $(lisp)/erc/erc-compat.elc \
- $(lisp)/erc/erc-dcc.elc \
- $(lisp)/erc/erc-ezbounce.elc \
- $(lisp)/erc/erc-fill.elc \
- $(lisp)/erc/erc-goodies.elc \
- $(lisp)/erc/erc-hecomplete.elc \
- $(lisp)/erc/erc-ibuffer.elc \
- $(lisp)/erc/erc-identd.elc \
- $(lisp)/erc/erc-imenu.elc \
- $(lisp)/erc/erc-join.elc \
- $(lisp)/erc/erc-lang.elc \
- $(lisp)/erc/erc-list.elc \
- $(lisp)/erc/erc-log.elc \
- $(lisp)/erc/erc-match.elc \
- $(lisp)/erc/erc-menu.elc \
- $(lisp)/erc/erc-netsplit.elc \
- $(lisp)/erc/erc-networks.elc \
- $(lisp)/erc/erc-notify.elc \
- $(lisp)/erc/erc-page.elc \
- $(lisp)/erc/erc-pcomplete.elc \
- $(lisp)/erc/erc-replace.elc \
- $(lisp)/erc/erc-ring.elc \
- $(lisp)/erc/erc-services.elc \
- $(lisp)/erc/erc-sound.elc \
- $(lisp)/erc/erc-speedbar.elc \
- $(lisp)/erc/erc-spelling.elc \
- $(lisp)/erc/erc-stamp.elc \
- $(lisp)/erc/erc-track.elc \
- $(lisp)/erc/erc-truncate.elc \
- $(lisp)/erc/erc-xdcc.elc \
- $(lisp)/erc/erc.elc \
- $(lisp)/eshell/em-alias.elc \
- $(lisp)/eshell/em-banner.elc \
- $(lisp)/eshell/em-basic.elc \
- $(lisp)/eshell/em-cmpl.elc \
- $(lisp)/eshell/em-dirs.elc \
- $(lisp)/eshell/em-glob.elc \
- $(lisp)/eshell/em-hist.elc \
- $(lisp)/eshell/em-ls.elc \
- $(lisp)/eshell/em-pred.elc \
- $(lisp)/eshell/em-prompt.elc \
- $(lisp)/eshell/em-rebind.elc \
- $(lisp)/eshell/em-script.elc \
- $(lisp)/eshell/em-smart.elc \
- $(lisp)/eshell/em-term.elc \
- $(lisp)/eshell/em-unix.elc \
- $(lisp)/eshell/em-xtra.elc \
- $(lisp)/eshell/esh-arg.elc \
- $(lisp)/eshell/esh-cmd.elc \
- $(lisp)/eshell/esh-ext.elc \
- $(lisp)/eshell/esh-io.elc \
- $(lisp)/eshell/esh-mode.elc \
- $(lisp)/eshell/esh-module.elc \
- $(lisp)/eshell/esh-opt.elc \
- $(lisp)/eshell/esh-proc.elc \
- $(lisp)/eshell/esh-test.elc \
- $(lisp)/eshell/esh-util.elc \
- $(lisp)/eshell/esh-var.elc \
- $(lisp)/eshell/eshell.elc \
- $(lisp)/expand.elc \
- $(lisp)/ezimage.elc \
- $(lisp)/face-remap.elc \
- $(lisp)/facemenu.elc \
- $(lisp)/faces.elc \
- $(lisp)/ffap.elc \
- $(lisp)/filecache.elc \
- $(lisp)/files-x.elc \
- $(lisp)/files.elc \
- $(lisp)/filesets.elc \
- $(lisp)/find-cmd.elc \
- $(lisp)/find-dired.elc \
- $(lisp)/find-file.elc \
- $(lisp)/find-lisp.elc \
- $(lisp)/finder.elc \
- $(lisp)/flow-ctrl.elc \
- $(lisp)/foldout.elc \
- $(lisp)/follow.elc \
- $(lisp)/font-core.elc \
- $(lisp)/font-lock.elc \
- $(lisp)/font-setting.elc \
- $(lisp)/format-spec.elc \
- $(lisp)/format.elc \
- $(lisp)/forms.elc \
- $(lisp)/frame.elc \
- $(lisp)/fringe.elc \
- $(lisp)/generic-x.elc \
- $(lisp)/gnus/auth-source.elc \
- $(lisp)/gnus/canlock.elc \
- $(lisp)/gnus/compface.elc \
- $(lisp)/gnus/deuglify.elc \
- $(lisp)/gnus/earcon.elc \
- $(lisp)/gnus/ecomplete.elc \
- $(lisp)/gnus/flow-fill.elc \
- $(lisp)/gnus/gmm-utils.elc \
- $(lisp)/gnus/gnus-agent.elc \
- $(lisp)/gnus/gnus-art.elc \
- $(lisp)/gnus/gnus-async.elc \
- $(lisp)/gnus/gnus-audio.elc \
- $(lisp)/gnus/gnus-bcklg.elc \
- $(lisp)/gnus/gnus-bookmark.elc \
- $(lisp)/gnus/gnus-cache.elc \
- $(lisp)/gnus/gnus-cite.elc \
- $(lisp)/gnus/gnus-cus.elc \
- $(lisp)/gnus/gnus-delay.elc \
- $(lisp)/gnus/gnus-demon.elc \
- $(lisp)/gnus/gnus-diary.elc \
- $(lisp)/gnus/gnus-dired.elc \
- $(lisp)/gnus/gnus-draft.elc \
- $(lisp)/gnus/gnus-dup.elc \
- $(lisp)/gnus/gnus-eform.elc \
- $(lisp)/gnus/gnus-ems.elc \
- $(lisp)/gnus/gnus-fun.elc \
- $(lisp)/gnus/gnus-group.elc \
- $(lisp)/gnus/gnus-int.elc \
- $(lisp)/gnus/gnus-kill.elc \
- $(lisp)/gnus/gnus-logic.elc \
- $(lisp)/gnus/gnus-mh.elc \
- $(lisp)/gnus/gnus-ml.elc \
- $(lisp)/gnus/gnus-mlspl.elc \
- $(lisp)/gnus/gnus-move.elc \
- $(lisp)/gnus/gnus-msg.elc \
- $(lisp)/gnus/gnus-nocem.elc \
- $(lisp)/gnus/gnus-picon.elc \
- $(lisp)/gnus/gnus-range.elc \
- $(lisp)/gnus/gnus-registry.elc \
- $(lisp)/gnus/gnus-salt.elc \
- $(lisp)/gnus/gnus-score.elc \
- $(lisp)/gnus/gnus-setup.elc \
- $(lisp)/gnus/gnus-sieve.elc \
- $(lisp)/gnus/gnus-soup.elc \
- $(lisp)/gnus/gnus-spec.elc \
- $(lisp)/gnus/gnus-srvr.elc \
- $(lisp)/gnus/gnus-start.elc \
- $(lisp)/gnus/gnus-sum.elc \
- $(lisp)/gnus/gnus-topic.elc \
- $(lisp)/gnus/gnus-undo.elc \
- $(lisp)/gnus/gnus-util.elc \
- $(lisp)/gnus/gnus-uu.elc \
- $(lisp)/gnus/gnus-vm.elc \
- $(lisp)/gnus/gnus-win.elc \
- $(lisp)/gnus/gnus.elc \
- $(lisp)/gnus/html2text.elc \
- $(lisp)/gnus/ietf-drums.elc \
- $(lisp)/gnus/legacy-gnus-agent.elc \
- $(lisp)/gnus/mail-parse.elc \
- $(lisp)/gnus/mail-prsvr.elc \
- $(lisp)/gnus/mail-source.elc \
- $(lisp)/gnus/mailcap.elc \
- $(lisp)/gnus/message.elc \
- $(lisp)/gnus/messcompat.elc \
- $(lisp)/gnus/mm-bodies.elc \
- $(lisp)/gnus/mm-decode.elc \
- $(lisp)/gnus/mm-encode.elc \
- $(lisp)/gnus/mm-extern.elc \
- $(lisp)/gnus/mm-partial.elc \
- $(lisp)/gnus/mm-url.elc \
- $(lisp)/gnus/mm-util.elc \
- $(lisp)/gnus/mm-uu.elc \
- $(lisp)/gnus/mm-view.elc \
- $(lisp)/gnus/mml-sec.elc \
- $(lisp)/gnus/mml-smime.elc \
- $(lisp)/gnus/mml.elc \
- $(lisp)/gnus/mml1991.elc \
- $(lisp)/gnus/mml2015.elc \
- $(lisp)/gnus/nnagent.elc \
- $(lisp)/gnus/nnbabyl.elc \
- $(lisp)/gnus/nndb.elc \
- $(lisp)/gnus/nndiary.elc \
- $(lisp)/gnus/nndir.elc \
- $(lisp)/gnus/nndoc.elc \
- $(lisp)/gnus/nndraft.elc \
- $(lisp)/gnus/nneething.elc \
- $(lisp)/gnus/nnfolder.elc \
- $(lisp)/gnus/nngateway.elc \
- $(lisp)/gnus/nnheader.elc \
- $(lisp)/gnus/nnimap.elc \
- $(lisp)/gnus/nnir.elc \
- $(lisp)/gnus/nnkiboze.elc \
- $(lisp)/gnus/nnlistserv.elc \
- $(lisp)/gnus/nnmail.elc \
- $(lisp)/gnus/nnmaildir.elc \
- $(lisp)/gnus/nnmairix.elc \
- $(lisp)/gnus/nnmbox.elc \
- $(lisp)/gnus/nnmh.elc \
- $(lisp)/gnus/nnml.elc \
- $(lisp)/gnus/nnnil.elc \
- $(lisp)/gnus/nnoo.elc \
- $(lisp)/gnus/nnrss.elc \
- $(lisp)/gnus/nnslashdot.elc \
- $(lisp)/gnus/nnsoup.elc \
- $(lisp)/gnus/nnspool.elc \
- $(lisp)/gnus/nntp.elc \
- $(lisp)/gnus/nnultimate.elc \
- $(lisp)/gnus/nnvirtual.elc \
- $(lisp)/gnus/nnwarchive.elc \
- $(lisp)/gnus/nnweb.elc \
- $(lisp)/gnus/nnwfm.elc \
- $(lisp)/gnus/pop3.elc \
- $(lisp)/gnus/qp.elc \
- $(lisp)/gnus/rfc1843.elc \
- $(lisp)/gnus/rfc2045.elc \
- $(lisp)/gnus/rfc2047.elc \
- $(lisp)/gnus/rfc2104.elc \
- $(lisp)/gnus/rfc2231.elc \
- $(lisp)/gnus/score-mode.elc \
- $(lisp)/gnus/sieve-manage.elc \
- $(lisp)/gnus/sieve-mode.elc \
- $(lisp)/gnus/sieve.elc \
- $(lisp)/gnus/smiley.elc \
- $(lisp)/gnus/smime.elc \
- $(lisp)/gnus/spam-report.elc \
- $(lisp)/gnus/spam-stat.elc \
- $(lisp)/gnus/spam-wash.elc \
- $(lisp)/gnus/spam.elc \
- $(lisp)/gnus/starttls.elc \
- $(lisp)/gnus/utf7.elc \
- $(lisp)/gnus/webmail.elc \
- $(lisp)/gnus/yenc.elc \
- $(lisp)/gs.elc \
- $(lisp)/help-at-pt.elc \
- $(lisp)/help-fns.elc \
- $(lisp)/help-macro.elc \
- $(lisp)/help-mode.elc \
- $(lisp)/help.elc \
- $(lisp)/hex-util.elc \
- $(lisp)/hexl.elc \
- $(lisp)/hfy-cmap.elc \
- $(lisp)/hi-lock.elc \
- $(lisp)/hilit-chg.elc \
- $(lisp)/hippie-exp.elc \
- $(lisp)/hl-line.elc \
- $(lisp)/htmlfontify.elc \
- $(lisp)/ibuf-ext.elc \
- $(lisp)/ibuf-macs.elc \
- $(lisp)/ibuffer.elc \
- $(lisp)/icomplete.elc \
- $(lisp)/ido.elc \
- $(lisp)/ielm.elc \
- $(lisp)/iimage.elc \
- $(lisp)/image-dired.elc \
- $(lisp)/image-file.elc \
- $(lisp)/image-mode.elc \
- $(lisp)/image.elc \
- $(lisp)/imenu.elc \
- $(lisp)/indent.elc \
- $(lisp)/info-look.elc \
- $(lisp)/info-xref.elc \
- $(lisp)/info.elc \
- $(lisp)/informat.elc \
- $(lisp)/international/ccl.elc \
- $(lisp)/international/characters.elc \
- $(lisp)/international/fontset.elc \
- $(lisp)/international/isearch-x.elc \
- $(lisp)/international/iso-ascii.elc \
- $(lisp)/international/iso-cvt.elc \
- $(lisp)/international/iso-transl.elc \
- $(lisp)/international/ja-dic-cnv.elc \
- $(lisp)/international/ja-dic-utl.elc \
- $(lisp)/international/kinsoku.elc \
- $(lisp)/international/kkc.elc \
- $(lisp)/international/latexenc.elc \
- $(lisp)/international/latin1-disp.elc \
- $(lisp)/international/mule-cmds.elc \
- $(lisp)/international/mule-conf.elc \
- $(lisp)/international/mule-diag.elc \
- $(lisp)/international/mule-util.elc \
- $(lisp)/international/mule.elc \
- $(lisp)/international/ogonek.elc \
- $(lisp)/international/quail.elc \
- $(lisp)/international/robin.elc \
- $(lisp)/international/titdic-cnv.elc \
- $(lisp)/international/ucs-normalize.elc \
- $(lisp)/international/utf-7.elc \
- $(lisp)/isearch.elc \
- $(lisp)/isearchb.elc \
- $(lisp)/iswitchb.elc \
- $(lisp)/jit-lock.elc \
- $(lisp)/jka-cmpr-hook.elc \
- $(lisp)/jka-compr.elc \
- $(lisp)/json.elc \
- $(lisp)/kermit.elc \
- $(lisp)/kmacro.elc \
- $(lisp)/language/china-util.elc \
- $(lisp)/language/chinese.elc \
- $(lisp)/language/cyril-util.elc \
- $(lisp)/language/cyrillic.elc \
- $(lisp)/language/ethio-util.elc \
- $(lisp)/language/ethiopic.elc \
- $(lisp)/language/european.elc \
- $(lisp)/language/hanja-util.elc \
- $(lisp)/language/ind-util.elc \
- $(lisp)/language/indian.elc \
- $(lisp)/language/japan-util.elc \
- $(lisp)/language/korea-util.elc \
- $(lisp)/language/lao-util.elc \
- $(lisp)/language/thai-util.elc \
- $(lisp)/language/thai-word.elc \
- $(lisp)/language/tibet-util.elc \
- $(lisp)/language/tibetan.elc \
- $(lisp)/language/tv-util.elc \
- $(lisp)/language/viet-util.elc \
- $(lisp)/language/vietnamese.elc \
- $(lisp)/ledit.elc \
- $(lisp)/linum.elc \
- $(lisp)/loadhist.elc \
- $(lisp)/locate.elc \
- $(lisp)/log-edit.elc \
- $(lisp)/log-view.elc \
- $(lisp)/longlines.elc \
- $(lisp)/lpr.elc \
- $(lisp)/ls-lisp.elc \
- $(lisp)/macros.elc \
- $(lisp)/mail/binhex.elc \
- $(lisp)/mail/emacsbug.elc \
- $(lisp)/mail/feedmail.elc \
- $(lisp)/mail/footnote.elc \
- $(lisp)/mail/hashcash.elc \
- $(lisp)/mail/mail-extr.elc \
- $(lisp)/mail/mail-hist.elc \
- $(lisp)/mail/mail-utils.elc \
- $(lisp)/mail/mailabbrev.elc \
- $(lisp)/mail/mailalias.elc \
- $(lisp)/mail/mailclient.elc \
- $(lisp)/mail/mailheader.elc \
- $(lisp)/mail/mailpost.elc \
- $(lisp)/mail/metamail.elc \
- $(lisp)/mail/mspools.elc \
- $(lisp)/mail/reporter.elc \
- $(lisp)/mail/rfc2368.elc \
- $(lisp)/mail/rfc822.elc \
- $(lisp)/mail/rmail-spam-filter.elc \
- $(lisp)/mail/rmail.elc \
- $(lisp)/mail/rmailedit.elc \
- $(lisp)/mail/rmailkwd.elc \
- $(lisp)/mail/rmailmm.elc \
- $(lisp)/mail/rmailmsc.elc \
- $(lisp)/mail/rmailout.elc \
- $(lisp)/mail/rmailsort.elc \
- $(lisp)/mail/rmailsum.elc \
- $(lisp)/mail/sendmail.elc \
- $(lisp)/mail/smtpmail.elc \
- $(lisp)/mail/supercite.elc \
- $(lisp)/mail/uce.elc \
- $(lisp)/mail/undigest.elc \
- $(lisp)/mail/unrmail.elc \
- $(lisp)/mail/uudecode.elc \
- $(lisp)/makesum.elc \
- $(lisp)/man.elc \
- $(lisp)/master.elc \
- $(lisp)/mb-depth.elc \
- $(lisp)/md4.elc \
- $(lisp)/menu-bar.elc \
- $(lisp)/mh-e/mh-alias.elc \
- $(lisp)/mh-e/mh-buffers.elc \
- $(lisp)/mh-e/mh-comp.elc \
- $(lisp)/mh-e/mh-e.elc \
- $(lisp)/mh-e/mh-folder.elc \
- $(lisp)/mh-e/mh-funcs.elc \
- $(lisp)/mh-e/mh-identity.elc \
- $(lisp)/mh-e/mh-inc.elc \
- $(lisp)/mh-e/mh-junk.elc \
- $(lisp)/mh-e/mh-letter.elc \
- $(lisp)/mh-e/mh-limit.elc \
- $(lisp)/mh-e/mh-mime.elc \
- $(lisp)/mh-e/mh-print.elc \
- $(lisp)/mh-e/mh-scan.elc \
- $(lisp)/mh-e/mh-search.elc \
- $(lisp)/mh-e/mh-seq.elc \
- $(lisp)/mh-e/mh-show.elc \
- $(lisp)/mh-e/mh-speed.elc \
- $(lisp)/mh-e/mh-thread.elc \
- $(lisp)/mh-e/mh-tool-bar.elc \
- $(lisp)/mh-e/mh-utils.elc \
- $(lisp)/mh-e/mh-xface.elc \
- $(lisp)/midnight.elc \
- $(lisp)/minibuf-eldef.elc \
- $(lisp)/minibuffer.elc \
- $(lisp)/misc.elc \
- $(lisp)/misearch.elc \
- $(lisp)/mouse-copy.elc \
- $(lisp)/mouse-drag.elc \
- $(lisp)/mouse-sel.elc \
- $(lisp)/mouse.elc \
- $(lisp)/mpc.elc \
- $(lisp)/msb.elc \
- $(lisp)/mwheel.elc \
- $(lisp)/net/ange-ftp.elc \
- $(lisp)/net/browse-url.elc \
- $(lisp)/net/dbus.elc \
- $(lisp)/net/dig.elc \
- $(lisp)/net/dns.elc \
- $(lisp)/net/eudc-bob.elc \
- $(lisp)/net/eudc-export.elc \
- $(lisp)/net/eudc-hotlist.elc \
- $(lisp)/net/eudc-vars.elc \
- $(lisp)/net/eudc.elc \
- $(lisp)/net/eudcb-bbdb.elc \
- $(lisp)/net/eudcb-ldap.elc \
- $(lisp)/net/eudcb-mab.elc \
- $(lisp)/net/eudcb-ph.elc \
- $(lisp)/net/goto-addr.elc \
- $(lisp)/net/hmac-def.elc \
- $(lisp)/net/hmac-md5.elc \
- $(lisp)/net/imap-hash.elc \
- $(lisp)/net/imap.elc \
- $(lisp)/net/ldap.elc \
- $(lisp)/net/mairix.elc \
- $(lisp)/net/net-utils.elc \
- $(lisp)/net/netrc.elc \
- $(lisp)/net/newst-backend.elc \
- $(lisp)/net/newst-plainview.elc \
- $(lisp)/net/newst-reader.elc \
- $(lisp)/net/newst-ticker.elc \
- $(lisp)/net/newst-treeview.elc \
- $(lisp)/net/newsticker.elc \
- $(lisp)/net/ntlm.elc \
- $(lisp)/net/quickurl.elc \
- $(lisp)/net/rcirc.elc \
- $(lisp)/net/rcompile.elc \
- $(lisp)/net/rlogin.elc \
- $(lisp)/net/sasl-cram.elc \
- $(lisp)/net/sasl-digest.elc \
- $(lisp)/net/sasl-ntlm.elc \
- $(lisp)/net/sasl.elc \
- $(lisp)/net/snmp-mode.elc \
- $(lisp)/net/socks.elc \
- $(lisp)/net/telnet.elc \
- $(lisp)/net/tls.elc \
- $(lisp)/net/tramp-cache.elc \
- $(lisp)/net/tramp-cmds.elc \
- $(lisp)/net/tramp-compat.elc \
- $(lisp)/net/tramp-fish.elc \
- $(lisp)/net/tramp-ftp.elc \
- $(lisp)/net/tramp-gvfs.elc \
- $(lisp)/net/tramp-gw.elc \
- $(lisp)/net/tramp-imap.elc \
- $(lisp)/net/tramp-smb.elc \
- $(lisp)/net/tramp-uu.elc \
- $(lisp)/net/tramp.elc \
- $(lisp)/net/trampver.elc \
- $(lisp)/net/webjump.elc \
- $(lisp)/net/xesam.elc \
- $(lisp)/net/zeroconf.elc \
- $(lisp)/newcomment.elc \
- $(lisp)/novice.elc \
- $(lisp)/nxml/nxml-enc.elc \
- $(lisp)/nxml/nxml-glyph.elc \
- $(lisp)/nxml/nxml-maint.elc \
- $(lisp)/nxml/nxml-mode.elc \
- $(lisp)/nxml/nxml-ns.elc \
- $(lisp)/nxml/nxml-outln.elc \
- $(lisp)/nxml/nxml-parse.elc \
- $(lisp)/nxml/nxml-rap.elc \
- $(lisp)/nxml/nxml-uchnm.elc \
- $(lisp)/nxml/nxml-util.elc \
- $(lisp)/nxml/rng-cmpct.elc \
- $(lisp)/nxml/rng-dt.elc \
- $(lisp)/nxml/rng-loc.elc \
- $(lisp)/nxml/rng-maint.elc \
- $(lisp)/nxml/rng-match.elc \
- $(lisp)/nxml/rng-nxml.elc \
- $(lisp)/nxml/rng-parse.elc \
- $(lisp)/nxml/rng-pttrn.elc \
- $(lisp)/nxml/rng-uri.elc \
- $(lisp)/nxml/rng-util.elc \
- $(lisp)/nxml/rng-valid.elc \
- $(lisp)/nxml/rng-xsd.elc \
- $(lisp)/nxml/xmltok.elc \
- $(lisp)/nxml/xsd-regexp.elc \
- $(lisp)/obsolete/awk-mode.elc \
- $(lisp)/obsolete/fast-lock.elc \
- $(lisp)/obsolete/iso-acc.elc \
- $(lisp)/obsolete/iso-insert.elc \
- $(lisp)/obsolete/iso-swed.elc \
- $(lisp)/obsolete/lazy-lock.elc \
- $(lisp)/obsolete/levents.elc \
- $(lisp)/obsolete/lucid.elc \
- $(lisp)/obsolete/old-whitespace.elc \
- $(lisp)/obsolete/options.elc \
- $(lisp)/obsolete/resume.elc \
- $(lisp)/obsolete/rnews.elc \
- $(lisp)/obsolete/rnewspost.elc \
- $(lisp)/obsolete/sc.elc \
- $(lisp)/obsolete/scribe.elc \
- $(lisp)/obsolete/swedish.elc \
- $(lisp)/obsolete/sym-comp.elc \
- $(lisp)/obsolete/vc-mcvs.elc \
- $(lisp)/obsolete/x-menu.elc \
- $(lisp)/org/org-agenda.elc \
- $(lisp)/org/org-archive.elc \
- $(lisp)/org/org-ascii.elc \
- $(lisp)/org/org-attach.elc \
- $(lisp)/org/org-bbdb.elc \
- $(lisp)/org/org-bibtex.elc \
- $(lisp)/org/org-clock.elc \
- $(lisp)/org/org-colview.elc \
- $(lisp)/org/org-compat.elc \
- $(lisp)/org/org-crypt.elc \
- $(lisp)/org/org-datetree.elc \
- $(lisp)/org/org-docbook.elc \
- $(lisp)/org/org-exp-blocks.elc \
- $(lisp)/org/org-exp.elc \
- $(lisp)/org/org-faces.elc \
- $(lisp)/org/org-feed.elc \
- $(lisp)/org/org-footnote.elc \
- $(lisp)/org/org-freemind.elc \
- $(lisp)/org/org-gnus.elc \
- $(lisp)/org/org-habit.elc \
- $(lisp)/org/org-html.elc \
- $(lisp)/org/org-icalendar.elc \
- $(lisp)/org/org-id.elc \
- $(lisp)/org/org-indent.elc \
- $(lisp)/org/org-info.elc \
- $(lisp)/org/org-inlinetask.elc \
- $(lisp)/org/org-install.elc \
- $(lisp)/org/org-irc.elc \
- $(lisp)/org/org-jsinfo.elc \
- $(lisp)/org/org-latex.elc \
- $(lisp)/org/org-list.elc \
- $(lisp)/org/org-mac-message.elc \
- $(lisp)/org/org-macs.elc \
- $(lisp)/org/org-mew.elc \
- $(lisp)/org/org-mhe.elc \
- $(lisp)/org/org-mobile.elc \
- $(lisp)/org/org-mouse.elc \
- $(lisp)/org/org-plot.elc \
- $(lisp)/org/org-protocol.elc \
- $(lisp)/org/org-publish.elc \
- $(lisp)/org/org-remember.elc \
- $(lisp)/org/org-rmail.elc \
- $(lisp)/org/org-src.elc \
- $(lisp)/org/org-table.elc \
- $(lisp)/org/org-timer.elc \
- $(lisp)/org/org-vm.elc \
- $(lisp)/org/org-w3m.elc \
- $(lisp)/org/org-wl.elc \
- $(lisp)/org/org-xoxo.elc \
- $(lisp)/org/org.elc \
- $(lisp)/outline.elc \
- $(lisp)/paren.elc \
- $(lisp)/password-cache.elc \
- $(lisp)/pcmpl-cvs.elc \
- $(lisp)/pcmpl-gnu.elc \
- $(lisp)/pcmpl-linux.elc \
- $(lisp)/pcmpl-rpm.elc \
- $(lisp)/pcmpl-unix.elc \
- $(lisp)/pcomplete.elc \
- $(lisp)/pcvs-defs.elc \
- $(lisp)/pcvs-info.elc \
- $(lisp)/pcvs-parse.elc \
- $(lisp)/pcvs-util.elc \
- $(lisp)/pcvs.elc \
- $(lisp)/pgg-def.elc \
- $(lisp)/pgg-gpg.elc \
- $(lisp)/pgg-parse.elc \
- $(lisp)/pgg-pgp.elc \
- $(lisp)/pgg-pgp5.elc \
- $(lisp)/pgg.elc \
- $(lisp)/play/5x5.elc \
- $(lisp)/play/animate.elc \
- $(lisp)/play/blackbox.elc \
- $(lisp)/play/bubbles.elc \
- $(lisp)/play/cookie1.elc \
- $(lisp)/play/decipher.elc \
- $(lisp)/play/dissociate.elc \
- $(lisp)/play/doctor.elc \
- $(lisp)/play/dunnet.elc \
- $(lisp)/play/fortune.elc \
- $(lisp)/play/gamegrid.elc \
- $(lisp)/play/gametree.elc \
- $(lisp)/play/gomoku.elc \
- $(lisp)/play/handwrite.elc \
- $(lisp)/play/hanoi.elc \
- $(lisp)/play/landmark.elc \
- $(lisp)/play/life.elc \
- $(lisp)/play/meese.elc \
- $(lisp)/play/morse.elc \
- $(lisp)/play/mpuz.elc \
- $(lisp)/play/pong.elc \
- $(lisp)/play/snake.elc \
- $(lisp)/play/solitaire.elc \
- $(lisp)/play/spook.elc \
- $(lisp)/play/studly.elc \
- $(lisp)/play/tetris.elc \
- $(lisp)/play/yow.elc \
- $(lisp)/play/zone.elc \
- $(lisp)/printing.elc \
- $(lisp)/proced.elc \
- $(lisp)/progmodes/ada-mode.elc \
- $(lisp)/progmodes/ada-prj.elc \
- $(lisp)/progmodes/ada-stmt.elc \
- $(lisp)/progmodes/ada-xref.elc \
- $(lisp)/progmodes/antlr-mode.elc \
- $(lisp)/progmodes/asm-mode.elc \
- $(lisp)/progmodes/autoconf.elc \
- $(lisp)/progmodes/bug-reference.elc \
- $(lisp)/progmodes/cap-words.elc \
- $(lisp)/progmodes/cc-align.elc \
- $(lisp)/progmodes/cc-awk.elc \
- $(lisp)/progmodes/cc-bytecomp.elc \
- $(lisp)/progmodes/cc-cmds.elc \
- $(lisp)/progmodes/cc-compat.elc \
- $(lisp)/progmodes/cc-defs.elc \
- $(lisp)/progmodes/cc-engine.elc \
- $(lisp)/progmodes/cc-fonts.elc \
- $(lisp)/progmodes/cc-langs.elc \
- $(lisp)/progmodes/cc-menus.elc \
- $(lisp)/progmodes/cc-mode.elc \
- $(lisp)/progmodes/cc-styles.elc \
- $(lisp)/progmodes/cc-vars.elc \
- $(lisp)/progmodes/cfengine.elc \
- $(lisp)/progmodes/cmacexp.elc \
- $(lisp)/progmodes/compile.elc \
- $(lisp)/progmodes/cperl-mode.elc \
- $(lisp)/progmodes/cpp.elc \
- $(lisp)/progmodes/cwarn.elc \
- $(lisp)/progmodes/dcl-mode.elc \
- $(lisp)/progmodes/delphi.elc \
- $(lisp)/progmodes/ebnf-abn.elc \
- $(lisp)/progmodes/ebnf-bnf.elc \
- $(lisp)/progmodes/ebnf-dtd.elc \
- $(lisp)/progmodes/ebnf-ebx.elc \
- $(lisp)/progmodes/ebnf-iso.elc \
- $(lisp)/progmodes/ebnf-otz.elc \
- $(lisp)/progmodes/ebnf-yac.elc \
- $(lisp)/progmodes/ebnf2ps.elc \
- $(lisp)/progmodes/ebrowse.elc \
- $(lisp)/progmodes/etags.elc \
- $(lisp)/progmodes/executable.elc \
- $(lisp)/progmodes/f90.elc \
- $(lisp)/progmodes/flymake.elc \
- $(lisp)/progmodes/fortran.elc \
- $(lisp)/progmodes/gdb-ui.elc \
- $(lisp)/progmodes/glasses.elc \
- $(lisp)/progmodes/grep.elc \
- $(lisp)/progmodes/gud.elc \
- $(lisp)/progmodes/hideif.elc \
- $(lisp)/progmodes/hideshow.elc \
- $(lisp)/progmodes/icon.elc \
- $(lisp)/progmodes/idlw-complete-structtag.elc \
- $(lisp)/progmodes/idlw-help.elc \
- $(lisp)/progmodes/idlw-shell.elc \
- $(lisp)/progmodes/idlw-toolbar.elc \
- $(lisp)/progmodes/idlwave.elc \
- $(lisp)/progmodes/inf-lisp.elc \
- $(lisp)/progmodes/js.elc \
- $(lisp)/progmodes/ld-script.elc \
- $(lisp)/progmodes/m4-mode.elc \
- $(lisp)/progmodes/make-mode.elc \
- $(lisp)/progmodes/mantemp.elc \
- $(lisp)/progmodes/meta-mode.elc \
- $(lisp)/progmodes/mixal-mode.elc \
- $(lisp)/progmodes/modula2.elc \
- $(lisp)/progmodes/octave-inf.elc \
- $(lisp)/progmodes/octave-mod.elc \
- $(lisp)/progmodes/pascal.elc \
- $(lisp)/progmodes/perl-mode.elc \
- $(lisp)/progmodes/prolog.elc \
- $(lisp)/progmodes/ps-mode.elc \
- $(lisp)/progmodes/python.elc \
- $(lisp)/progmodes/ruby-mode.elc \
- $(lisp)/progmodes/scheme.elc \
- $(lisp)/progmodes/sh-script.elc \
- $(lisp)/progmodes/simula.elc \
- $(lisp)/progmodes/sql.elc \
- $(lisp)/progmodes/subword.elc \
- $(lisp)/progmodes/tcl.elc \
- $(lisp)/progmodes/vera-mode.elc \
- $(lisp)/progmodes/verilog-mode.elc \
- $(lisp)/progmodes/vhdl-mode.elc \
- $(lisp)/progmodes/which-func.elc \
- $(lisp)/progmodes/xscheme.elc \
- $(lisp)/ps-bdf.elc \
- $(lisp)/ps-def.elc \
- $(lisp)/ps-mule.elc \
- $(lisp)/ps-print.elc \
- $(lisp)/ps-samp.elc \
- $(lisp)/recentf.elc \
- $(lisp)/rect.elc \
- $(lisp)/register.elc \
- $(lisp)/repeat.elc \
- $(lisp)/replace.elc \
- $(lisp)/reposition.elc \
- $(lisp)/reveal.elc \
- $(lisp)/rfn-eshadow.elc \
- $(lisp)/rot13.elc \
- $(lisp)/ruler-mode.elc \
- $(lisp)/s-region.elc \
- $(lisp)/savehist.elc \
- $(lisp)/saveplace.elc \
- $(lisp)/sb-image.elc \
- $(lisp)/scroll-all.elc \
- $(lisp)/scroll-bar.elc \
- $(lisp)/scroll-lock.elc \
- $(lisp)/select.elc \
- $(lisp)/server.elc \
- $(lisp)/ses.elc \
- $(lisp)/sha1.elc \
- $(lisp)/shadowfile.elc \
- $(lisp)/shell.elc \
- $(lisp)/simple.elc \
- $(lisp)/skeleton.elc \
- $(lisp)/smerge-mode.elc \
- $(lisp)/sort.elc \
- $(lisp)/soundex.elc \
- $(lisp)/speedbar.elc \
- $(lisp)/startup.elc \
- $(lisp)/strokes.elc \
- $(lisp)/subr.elc \
- $(lisp)/t-mouse.elc \
- $(lisp)/tabify.elc \
- $(lisp)/talk.elc \
- $(lisp)/tar-mode.elc \
- $(lisp)/tempo.elc \
- $(lisp)/term.elc \
- $(lisp)/term/common-win.elc \
- $(lisp)/term/internal.elc \
- $(lisp)/term/ns-win.elc \
- $(lisp)/term/pc-win.elc \
- $(lisp)/term/rxvt.elc \
- $(lisp)/term/sun.elc \
- $(lisp)/term/sup-mouse.elc \
- $(lisp)/term/tty-colors.elc \
- $(lisp)/term/tvi970.elc \
- $(lisp)/term/vt100.elc \
- $(lisp)/term/w32-win.elc \
- $(lisp)/term/w32console.elc \
- $(lisp)/term/x-win.elc \
- $(lisp)/term/xterm.elc \
- $(lisp)/terminal.elc \
- $(lisp)/textmodes/artist.elc \
- $(lisp)/textmodes/bib-mode.elc \
- $(lisp)/textmodes/bibtex-style.elc \
- $(lisp)/textmodes/bibtex.elc \
- $(lisp)/textmodes/conf-mode.elc \
- $(lisp)/textmodes/css-mode.elc \
- $(lisp)/textmodes/dns-mode.elc \
- $(lisp)/textmodes/enriched.elc \
- $(lisp)/textmodes/fill.elc \
- $(lisp)/textmodes/flyspell.elc \
- $(lisp)/textmodes/ispell.elc \
- $(lisp)/textmodes/makeinfo.elc \
- $(lisp)/textmodes/nroff-mode.elc \
- $(lisp)/textmodes/page-ext.elc \
- $(lisp)/textmodes/page.elc \
- $(lisp)/textmodes/paragraphs.elc \
- $(lisp)/textmodes/picture.elc \
- $(lisp)/textmodes/po.elc \
- $(lisp)/textmodes/refbib.elc \
- $(lisp)/textmodes/refer.elc \
- $(lisp)/textmodes/refill.elc \
- $(lisp)/textmodes/reftex-auc.elc \
- $(lisp)/textmodes/reftex-cite.elc \
- $(lisp)/textmodes/reftex-dcr.elc \
- $(lisp)/textmodes/reftex-global.elc \
- $(lisp)/textmodes/reftex-index.elc \
- $(lisp)/textmodes/reftex-parse.elc \
- $(lisp)/textmodes/reftex-ref.elc \
- $(lisp)/textmodes/reftex-sel.elc \
- $(lisp)/textmodes/reftex-toc.elc \
- $(lisp)/textmodes/reftex-vars.elc \
- $(lisp)/textmodes/reftex.elc \
- $(lisp)/textmodes/remember.elc \
- $(lisp)/textmodes/rst.elc \
- $(lisp)/textmodes/sgml-mode.elc \
- $(lisp)/textmodes/spell.elc \
- $(lisp)/textmodes/table.elc \
- $(lisp)/textmodes/tex-mode.elc \
- $(lisp)/textmodes/texinfmt.elc \
- $(lisp)/textmodes/texinfo.elc \
- $(lisp)/textmodes/texnfo-upd.elc \
- $(lisp)/textmodes/text-mode.elc \
- $(lisp)/textmodes/tildify.elc \
- $(lisp)/textmodes/two-column.elc \
- $(lisp)/textmodes/underline.elc \
- $(lisp)/thingatpt.elc \
- $(lisp)/thumbs.elc \
- $(lisp)/time-stamp.elc \
- $(lisp)/time.elc \
- $(lisp)/timezone.elc \
- $(lisp)/tmm.elc \
- $(lisp)/tool-bar.elc \
- $(lisp)/tooltip.elc \
- $(lisp)/tree-widget.elc \
- $(lisp)/tutorial.elc \
- $(lisp)/type-break.elc \
- $(lisp)/uniquify.elc \
- $(lisp)/url/url-about.elc \
- $(lisp)/url/url-auth.elc \
- $(lisp)/url/url-cache.elc \
- $(lisp)/url/url-cid.elc \
- $(lisp)/url/url-cookie.elc \
- $(lisp)/url/url-dav.elc \
- $(lisp)/url/url-dired.elc \
- $(lisp)/url/url-expand.elc \
- $(lisp)/url/url-file.elc \
- $(lisp)/url/url-ftp.elc \
- $(lisp)/url/url-gw.elc \
- $(lisp)/url/url-handlers.elc \
- $(lisp)/url/url-history.elc \
- $(lisp)/url/url-http.elc \
- $(lisp)/url/url-imap.elc \
- $(lisp)/url/url-irc.elc \
- $(lisp)/url/url-ldap.elc \
- $(lisp)/url/url-mailto.elc \
- $(lisp)/url/url-methods.elc \
- $(lisp)/url/url-misc.elc \
- $(lisp)/url/url-news.elc \
- $(lisp)/url/url-nfs.elc \
- $(lisp)/url/url-ns.elc \
- $(lisp)/url/url-parse.elc \
- $(lisp)/url/url-privacy.elc \
- $(lisp)/url/url-proxy.elc \
- $(lisp)/url/url-util.elc \
- $(lisp)/url/url-vars.elc \
- $(lisp)/url/url.elc \
- $(lisp)/userlock.elc \
- $(lisp)/vc-annotate.elc \
- $(lisp)/vc-arch.elc \
- $(lisp)/vc-bzr.elc \
- $(lisp)/vc-cvs.elc \
- $(lisp)/vc-dav.elc \
- $(lisp)/vc-dir.elc \
- $(lisp)/vc-dispatcher.elc \
- $(lisp)/vc-git.elc \
- $(lisp)/vc-hg.elc \
- $(lisp)/vc-hooks.elc \
- $(lisp)/vc-mtn.elc \
- $(lisp)/vc-rcs.elc \
- $(lisp)/vc-sccs.elc \
- $(lisp)/vc-svn.elc \
- $(lisp)/vc.elc \
- $(lisp)/vcursor.elc \
- $(lisp)/view.elc \
- $(lisp)/vt-control.elc \
- $(lisp)/vt100-led.elc \
- $(lisp)/w32-fns.elc \
- $(lisp)/w32-vars.elc \
- $(lisp)/wdired.elc \
- $(lisp)/whitespace.elc \
- $(lisp)/wid-browse.elc \
- $(lisp)/wid-edit.elc \
- $(lisp)/widget.elc \
- $(lisp)/windmove.elc \
- $(lisp)/window.elc \
- $(lisp)/winner.elc \
- $(lisp)/woman.elc \
- $(lisp)/x-dnd.elc \
- $(lisp)/xml.elc \
- $(lisp)/xt-mouse.elc
-
-# The src/Makefile.in has its own set of dependencies and when they decide
-# that one Lisp file needs to be re-compiled, we had better recompile it as
-# well, otherwise every subsequent make will again call us, until we finally
-# end up deciding that yes, the file deserves recompilation.
-# One option is to try and reproduce exactly the same dependencies here as
-# we have in src/Makefile.in, but it turns out to be painful
-# (e.g. src/Makefile.in may have a dependency for ../lisp/foo.elc where we
-# only know of $(lisp)/foo.elc). So instead we provide a direct way for
-# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
-# Use byte-compile-refresh-preloaded to try and work around some of
-# the most common problems of not bootstrapping from a clean state.
-compile-onefile:
- @echo Compiling $(THEFILE)
- @# Use byte-compile-refresh-preloaded to try and work around some of
- @# the most common bootstrapping problems.
- @$(emacs) -l bytecomp -f byte-compile-refresh-preloaded $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(THEFILE)
-
-# Files MUST be compiled one by one. If we compile several files in a
-# row (i.e., in the same instance of Emacs) we can't make sure that
-# the compilation environment is clean. We also set the load-path of
-# the Emacs used for compilation to the current directory and its
-# subdirectories, to make sure require's and load's in the files being
-# compiled find the right files.
-
-.SUFFIXES: .elc .el
-
-# An old-fashioned suffix rule, which, according to the GNU Make manual,
-# cannot have prerequisites.
-# Note that if a .el file is removed from the repository without
-# updating ELCFILES, make will abort.
-.el.elc:
- @echo Compiling $<
- @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
-
-.PHONY: compile-first compile-main compile-last compile compile-always
-
-compile-first: $(COMPILE_FIRST)
-
-compile-main: $(ELCFILES)
-
-# Compile all Lisp files, but don't recompile those that are up to
-# date. Some .el files don't get compiled because they set the
-# local variable no-byte-compile.
-# Calling make recursively because suffix rule cannot have prerequisites.
-# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
-# sub-makes that run rules that use it, for the sake of some non-GNU makes.
-compile: $(LOADDEFS) autoloads compile-first
- $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS)
- $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS)
-
-## Doing this causes make install to dump another emacs.
-# $(MAKE) $(MFLAGS) update-elclist
-
-# Compile all Lisp files. This is like `compile' but compiles files
-# unconditionally. Some files don't actually get compiled because they
-# set the local variable no-byte-compile.
-compile-always: doit
- cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
- $(MAKE) $(MFLAGS) compile EMACS=$(EMACS)
-
-## In case any files are missing from ELCFILES.
-compile-last:
- @wd=$(lisp); $(setwins); \
- els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
- for el in $$els; do \
- test -f $$el || continue; \
- test -f $${el}c && continue; \
- GREP_OPTIONS= grep 'no-byte-compile: t' $$el > /dev/null && continue; \
- sel=`echo $$el | sed "s|^$(lisp)|\\$$(lisp)|"`; \
- echo "Maintainer warning: $$sel missing from \$$ELCFILES?"; \
- echo "Compiling $$el"; \
- $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
- done
-
-compile-calc:
- for el in $(lisp)/calc/*.el; do \
- echo Compiling $$el; \
- $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
- done
-
-# Backup compiled Lisp files in elc.tar.gz. If that file already
-# exists, make a backup of it.
-
-backup-compiled-files:
- -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
- -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc $(lisp)/*/*/*.elc $(lisp)/*/*/*/*.elc
-
-# Compile Lisp files, but save old compiled files first.
-
-compile-after-backup: backup-compiled-files compile-always
-
-# Recompile all Lisp files which are newer than their .elc files and compile
-# new ones.
-# This has the same effect as compile-main (followed up with compile-last,
-# if ELCFILES is out of date). recompile has some advantages:
-# i) It is faster (on a single processor), since it only has to start
-# Emacs once. It was 33% faster on a test with a random 10% of the .el
-# files needing recompilation.
-# ii) The explicit cc-mode dependency.
-# recompile's disadvantages are:
-# i) Not parallelizable.
-# ii) Compiling multiple files in the same instance of Emacs is wrong,
-# since the environment of later files is affected by definitions in
-# earlier ones.
-recompile: doit $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
- $(emacs) --eval "(batch-byte-recompile-directory 0)" $(lisp)
-
-# Update MH-E internal autoloads. These are not to be confused with
-# the autoloads for the MH-E entry points, which are already in loaddefs.el.
-MH_E_DIR = $(lisp)/mh-e
-## MH_E_SRC avoids a circular dependency warning for mh-loaddefs.el.
-MH_E_SRC = $(MH_E_DIR)/mh-acros.el $(MH_E_DIR)/mh-alias.el \
- $(MH_E_DIR)/mh-buffers.el $(MH_E_DIR)/mh-compat.el \
- $(MH_E_DIR)/mh-comp.el $(MH_E_DIR)/mh-e.el \
- $(MH_E_DIR)/mh-folder.el $(MH_E_DIR)/mh-funcs.el \
- $(MH_E_DIR)/mh-gnus.el $(MH_E_DIR)/mh-identity.el \
- $(MH_E_DIR)/mh-inc.el $(MH_E_DIR)/mh-junk.el \
- $(MH_E_DIR)/mh-letter.el $(MH_E_DIR)/mh-limit.el \
- $(MH_E_DIR)/mh-mime.el $(MH_E_DIR)/mh-print.el \
- $(MH_E_DIR)/mh-scan.el $(MH_E_DIR)/mh-search.el \
- $(MH_E_DIR)/mh-seq.el $(MH_E_DIR)/mh-show.el \
- $(MH_E_DIR)/mh-speed.el $(MH_E_DIR)/mh-thread.el \
- $(MH_E_DIR)/mh-tool-bar.el $(MH_E_DIR)/mh-utils.el \
- $(MH_E_DIR)/mh-xface.el
-
-mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
-$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
- $(emacs) -l autoload \
- --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
- --eval "(setq make-backup-files nil)" \
- -f batch-update-autoloads $(MH_E_DIR)
-
-CAL_DIR = $(lisp)/calendar
-## Those files that may contain internal calendar autoload cookies.
-## Avoids circular dependency warning for *-loaddefs.el.
-CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
- $(CAL_DIR)/cal-coptic.el $(CAL_DIR)/cal-dst.el \
- $(CAL_DIR)/cal-french.el $(CAL_DIR)/cal-hebrew.el \
- $(CAL_DIR)/cal-html.el $(CAL_DIR)/cal-islam.el \
- $(CAL_DIR)/cal-iso.el $(CAL_DIR)/cal-julian.el \
- $(CAL_DIR)/cal-mayan.el $(CAL_DIR)/cal-menu.el \
- $(CAL_DIR)/cal-move.el $(CAL_DIR)/cal-persia.el \
- $(CAL_DIR)/cal-tex.el $(CAL_DIR)/cal-x.el \
- $(CAL_DIR)/calendar.el $(CAL_DIR)/diary-lib.el \
- $(CAL_DIR)/holidays.el $(CAL_DIR)/lunar.el \
- $(CAL_DIR)/solar.el
-
-$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
- $(emacs) -l autoload \
- --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
- --eval "(setq make-backup-files nil)" \
- -f batch-update-autoloads $(CAL_DIR)
-
-$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
- $(emacs) -l autoload \
- --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
- --eval "(setq make-backup-files nil)" \
- -f batch-update-autoloads $(CAL_DIR)
-
-$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
- $(emacs) -l autoload \
- --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
- --eval "(setq make-backup-files nil)" \
- -f batch-update-autoloads $(CAL_DIR)
-
-# Prepare a bootstrap in the lisp subdirectory.
-#
-# Build loaddefs.el to make sure it's up-to-date. If it's not, that
-# might lead to errors during the bootstrap because something fails to
-# autoload as expected. If there is no emacs binary, then we can't
-# build autoloads yet. In that case we have to use ldefs-boot.el.
-# Bootstrap should always work with ldefs-boot.el. Therefore,
-# whenever a new autoload cookie gets added that is necessary during
-# bootstrapping, ldefs-boot.el should be updated by overwriting it with
-# an up-to-date copy of loaddefs.el that is uncorrupted by
-# local changes. (Because loaddefs.el is an automatically generated
-# file, we don't want to store it in the source repository).
-
-bootstrap-clean:
- cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)
-
-distclean:
- -rm -f ./Makefile
-
-maintainer-clean: distclean bootstrap-clean
-
-.PHONY: check-declare
-
-check-declare:
- $(emacs) -l $(lisp)/emacs-lisp/check-declare \
- --eval '(check-declare-directory "$(lisp)")'
-
-# Dependencies
-
-# CC Mode uses a compile time macro system which causes a compile time
-# dependency in cc-*.elc files on the macros in other cc-*.el and the
-# version string in cc-defs.el.
-$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
- $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\
- $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
- $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
- $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
- $(lisp)/progmodes/cc-vars.elc: \
- $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
-
-$(lisp)/progmodes/cc-align.elc: \
- $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-cmds.elc: \
- $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-compat.elc: \
- $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
- $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
- $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
-
-$(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
- $(lisp)/progmodes/cc-vars.elc
-
-$(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
- $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
- $(lisp)/font-lock.elc
-
-$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
- $(lisp)/emacs-lisp/cl.elc
-
-$(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
- $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
- $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
- $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc
-
-$(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
- $(lisp)/progmodes/cc-align.elc
-
-$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
-
-# MH-E dependencies, mainly to prevent failures with parallel
-# compilation, due to race conditions between writing a given FOO.elc
-# file and another file being compiled that says "(require FOO)",
-# which causes Emacs to try to read FOO.elc.
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\
- $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\
- $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\
- $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
- $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\
- $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
- $(MH_E_DIR)/mh-e.elc
-
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\
- $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\
- $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
- $(lisp)/emacs-lisp/cl.elc
-
-$(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\
- $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\
- $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\
- $(MH_E_DIR)/mh-scan.elc
-
-$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\
- $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\
- $(lisp)/gnus/gnus-util.elc
-
-$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\
- $(lisp)/progmodes/which-func.elc
-
-$(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
- $(MH_E_DIR)/mh-utils.elc:\
- $(lisp)/font-lock.elc
-
-$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc
-
-$(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc
-
-$(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \
- $(lisp)/cus-face.elc
-
-$(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \
- $(lisp)/gnus/mm-view.elc $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc
-
-$(MH_E_DIR)/mh-print.elc: $(lisp)/ps-print.elc
-
-$(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc
-
-$(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc
-
-$(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc
-
-$(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc
-
-# Makefile ends here.
+# Maintenance productions for the Lisp directory
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+# 2009, 2010 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/>.
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+abs_top_builddir = @abs_top_builddir@
+lisp = $(srcdir)
+VPATH = $(srcdir)
+
+# You can specify a different executable on the make command line,
+# e.g. "make EMACS=../src/emacs ...".
+
+# We sometimes change directory before running Emacs (typically when
+# building out-of-tree, we chdir to the source directory), so we need
+# to use an absolute file name.
+EMACS = ${abs_top_builddir}/src/emacs
+
+# Command line flags for Emacs. This must include --multibyte,
+# otherwise some files will not compile.
+
+EMACSOPT = -batch --no-site-file --multibyte
+
+# Extra flags to pass to the byte compiler
+BYTE_COMPILE_EXTRA_FLAGS =
+# For example to not display the undefined function warnings you can use this:
+# BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
+# The example above is just for developers, it should not be used by default.
+
+lisptagsfiles1 = $(lisp)/*.el
+lisptagsfiles2 = $(lisp)/*/*.el
+lisptagsfiles3 = $(lisp)/*/*/*.el
+lisptagsfiles4 = $(lisp)/*/*/*/*.el
+ETAGS = ../lib-src/etags
+
+# Automatically generated autoload files, apart from lisp/loaddefs.el.
+# Note this includes only those files that need special rules to
+# build; ie it does not need to include things created via
+# generated-autoload-file (eg calc/calc-loaddefs.el).
+LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
+ $(lisp)/calendar/diary-loaddefs.el \
+ $(lisp)/calendar/hol-loaddefs.el \
+ $(lisp)/mh-e/mh-loaddefs.el
+
+# Elisp files auto-generated.
+AUTOGENEL = loaddefs.el \
+ $(LOADDEFS) \
+ cus-load.el \
+ finder-inf.el \
+ subdirs.el \
+ calc/calc-loaddefs.el \
+ eshell/esh-groups.el \
+ cedet/semantic/loaddefs.el \
+ cedet/ede/loaddefs.el \
+ cedet/srecode/loaddefs.el
+
+# Files to compile before others during a bootstrap. This is done to
+# speed up the bootstrap process.
+
+COMPILE_FIRST = \
+ $(lisp)/emacs-lisp/bytecomp.elc \
+ $(lisp)/emacs-lisp/byte-opt.elc \
+ $(lisp)/emacs-lisp/autoload.elc
+
+# The actual Emacs command run in the targets below.
+
+emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
+
+# Common command to find subdirectories
+setwins=subdirs=`(find . -type d -print)`; \
+ for file in $$subdirs; do \
+ case $$file in */.* | */.*/* | */=* ) ;; \
+ *) wins="$$wins $$file" ;; \
+ esac; \
+ done
+
+# Find all subdirectories except `obsolete' and `term'.
+setwins_almost=subdirs=`(find . -type d -print)`; \
+ for file in $$subdirs; do \
+ case $$file in */.* | */.*/* | */=* | */obsolete | */term ) ;; \
+ *) wins="$$wins $$file" ;; \
+ esac; \
+ done
+
+# Find all subdirectories in which we might want to create subdirs.el
+setwins_for_subdirs=subdirs=`(find . -type d -print)`; \
+ for file in $$subdirs; do \
+ case $$file in */.* | */.*/* | */=* | */cedet* ) ;; \
+ *) wins="$$wins $$file" ;; \
+ esac; \
+ done
+
+# `compile-main' tends to be slower than `recompile' but can be parallelized
+# with "make -j" and results in more deterministic compilation warnings.
+# cus-load and finder-inf are not explicitly requested by anything, so
+# we add them here to make sure they get built.
+all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
+
+doit:
+
+# custom-deps and finder-data both used to scan _all_ the *.el files.
+# This could lead to problems in parallel builds if automatically
+# generated *.el files (eg loaddefs etc) were being changed at the same time.
+# One solution was to add autoloads as a prerequisite:
+# http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html
+# http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-12/msg00171.html
+# However, this meant that running these targets modified loaddefs.el,
+# every time (due to time-stamping). Calling these rules from
+# bootstrap-after would modify loaddefs after src/emacs, resulting
+# in make install remaking src/emacs for no real reason:
+# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html
+# Nowadays these commands don't scan automatically generated files,
+# since they will never contain any useful information
+# (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp).
+$(lisp)/cus-load.el:
+ $(MAKE) $(MFLAGS) custom-deps
+custom-deps: doit
+ cd $(lisp); $(setwins_almost); \
+ echo Directories: $$wins; \
+ $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
+
+$(lisp)/finder-inf.el:
+ $(MAKE) $(MFLAGS) finder-data
+finder-data: doit
+ cd $(lisp); $(setwins_almost); \
+ echo Directories: $$wins; \
+ $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
+
+# The chmod +w is to handle env var CVSREAD=1. Files named
+# are identified by being the value of `generated-autoload-file'.
+autoloads: $(LOADDEFS) doit
+ chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
+ $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
+ $(lisp)/dired.el $(lisp)/ibuffer.el $(lisp)/htmlfontify.el
+ cd $(lisp); $(setwins_almost); \
+ echo Directories: $$wins; \
+ $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
+
+# This is required by the bootstrap-emacs target in ../src/Makefile, so
+# we know that if we have an emacs executable, we also have a subdirs.el.
+$(lisp)/subdirs.el:
+ $(MAKE) $(MFLAGS) update-subdirs
+update-subdirs: doit
+ cd $(lisp); $(setwins_for_subdirs); \
+ for file in $$wins; do \
+ $(top_srcdir)/update-subdirs $$file; \
+ done;
+
+updates: update-subdirs autoloads finder-data custom-deps
+
+# This is useful after "bzr up".
+bzr-update: recompile autoloads finder-data custom-deps
+
+# For backwards compatibility:
+cvs-update: bzr-update
+
+# Update the AUTHORS file.
+
+update-authors:
+ $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
+
+TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+ els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
+ ${ETAGS} -o $@ $$els
+
+# The src/Makefile.in has its own set of dependencies and when they decide
+# that one Lisp file needs to be re-compiled, we had better recompile it as
+# well, otherwise every subsequent make will again call us, until we finally
+# end up deciding that yes, the file deserves recompilation.
+# One option is to try and reproduce exactly the same dependencies here as
+# we have in src/Makefile.in, but it turns out to be painful
+# (e.g. src/Makefile.in may have a dependency for ../lisp/foo.elc where we
+# only know of $(lisp)/foo.elc). So instead we provide a direct way for
+# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
+# Use byte-compile-refresh-preloaded to try and work around some of
+# the most common problems of not bootstrapping from a clean state.
+compile-onefile:
+ @echo Compiling $(THEFILE)
+ @# Use byte-compile-refresh-preloaded to try and work around some of
+ @# the most common bootstrapping problems.
+ @$(emacs) -l bytecomp -f byte-compile-refresh-preloaded $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(THEFILE)
+
+# Files MUST be compiled one by one. If we compile several files in a
+# row (i.e., in the same instance of Emacs) we can't make sure that
+# the compilation environment is clean. We also set the load-path of
+# the Emacs used for compilation to the current directory and its
+# subdirectories, to make sure require's and load's in the files being
+# compiled find the right files.
+
+.SUFFIXES: .elc .el
+
+# An old-fashioned suffix rule, which, according to the GNU Make manual,
+# cannot have prerequisites.
+.el.elc:
+ @echo Compiling $<
+ @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
+
+.PHONY: compile-first compile-main compile compile-always
+
+compile-first: $(COMPILE_FIRST)
+
+# In `compile-main' we could directly do
+# ... | xargs $(MAKE) $(MFLAGS) EMACS="$(EMACS)"
+# and it works, but it generates a lot of messages like
+# make[2]: « gnus/gnus-mlspl.elc » is up to date.
+# so instead, we use "xargs echo" to split the list of file into manageable
+# chunks and then use an intermediate `compile-targets' target so the
+# actual targets (the .elc files) are not mentioned as targets on the
+# make command line.
+
+
+.PHONY: compile-targets
+# TARGETS is set dynamically in the recursive call from `compile-main'.
+compile-targets: $(TARGETS)
+
+# Compile all the Elisp files that need it. Beware: it approximates
+# `no-byte-compile', so watch out for false-positives!
+compile-main: compile-clean
+ @(cd $(lisp); $(setwins); \
+ els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
+ for el in $$els; do \
+ test -f $$el || continue; \
+ test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
+ echo "$${el}c"; \
+ done | xargs echo) | \
+ while read chunk; do \
+ $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
+ done
+
+.PHONY: compile-clean
+# Erase left-over .elc files that do not have a corresponding .el file.
+compile-clean:
+ @cd $(lisp); $(setwins); \
+ elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
+ for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
+ if test -f "$$el" -o \! -f "$${el}c"; then :; else \
+ echo rm "$${el}c"; \
+ rm "$${el}c"; \
+ fi \
+ done
+
+# Compile all Lisp files, but don't recompile those that are up to
+# date. Some .el files don't get compiled because they set the
+# local variable no-byte-compile.
+# Calling make recursively because suffix rule cannot have prerequisites.
+# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
+# sub-makes that run rules that use it, for the sake of some non-GNU makes.
+compile: $(LOADDEFS) autoloads compile-first
+ $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS)
+
+# Compile all Lisp files. This is like `compile' but compiles files
+# unconditionally. Some files don't actually get compiled because they
+# set the local variable no-byte-compile.
+compile-always: doit
+ cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
+ $(MAKE) $(MFLAGS) compile EMACS=$(EMACS)
+
+compile-calc:
+ for el in $(lisp)/calc/*.el; do \
+ echo Compiling $$el; \
+ $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
+ done
+
+# Backup compiled Lisp files in elc.tar.gz. If that file already
+# exists, make a backup of it.
+
+backup-compiled-files:
+ -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
+ -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc $(lisp)/*/*/*.elc $(lisp)/*/*/*/*.elc
+
+# Compile Lisp files, but save old compiled files first.
+
+compile-after-backup: backup-compiled-files compile-always
+
+# Recompile all Lisp files which are newer than their .elc files and compile
+# new ones.
+# This has the same effect as compile-main. recompile has some advantages:
+# i) It is faster (on a single processor), since it only has to start
+# Emacs once. It was 33% faster on a test with a random 10% of the .el
+# files needing recompilation.
+# ii) The explicit cc-mode dependency.
+# recompile's disadvantages are:
+# i) Not parallelizable.
+# ii) Compiling multiple files in the same instance of Emacs is wrong,
+# since the environment of later files is affected by definitions in
+# earlier ones.
+recompile: doit $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
+ $(emacs) --eval "(batch-byte-recompile-directory 0)" $(lisp)
+
+# Update MH-E internal autoloads. These are not to be confused with
+# the autoloads for the MH-E entry points, which are already in loaddefs.el.
+MH_E_DIR = $(lisp)/mh-e
+## MH_E_SRC avoids a circular dependency warning for mh-loaddefs.el.
+MH_E_SRC = $(MH_E_DIR)/mh-acros.el $(MH_E_DIR)/mh-alias.el \
+ $(MH_E_DIR)/mh-buffers.el $(MH_E_DIR)/mh-compat.el \
+ $(MH_E_DIR)/mh-comp.el $(MH_E_DIR)/mh-e.el \
+ $(MH_E_DIR)/mh-folder.el $(MH_E_DIR)/mh-funcs.el \
+ $(MH_E_DIR)/mh-gnus.el $(MH_E_DIR)/mh-identity.el \
+ $(MH_E_DIR)/mh-inc.el $(MH_E_DIR)/mh-junk.el \
+ $(MH_E_DIR)/mh-letter.el $(MH_E_DIR)/mh-limit.el \
+ $(MH_E_DIR)/mh-mime.el $(MH_E_DIR)/mh-print.el \
+ $(MH_E_DIR)/mh-scan.el $(MH_E_DIR)/mh-search.el \
+ $(MH_E_DIR)/mh-seq.el $(MH_E_DIR)/mh-show.el \
+ $(MH_E_DIR)/mh-speed.el $(MH_E_DIR)/mh-thread.el \
+ $(MH_E_DIR)/mh-tool-bar.el $(MH_E_DIR)/mh-utils.el \
+ $(MH_E_DIR)/mh-xface.el
+
+mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
+$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
+ $(emacs) -l autoload \
+ --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
+ --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq make-backup-files nil)" \
+ -f batch-update-autoloads $(MH_E_DIR)
+
+CAL_DIR = $(lisp)/calendar
+## Those files that may contain internal calendar autoload cookies.
+## Avoids circular dependency warning for *-loaddefs.el.
+CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
+ $(CAL_DIR)/cal-coptic.el $(CAL_DIR)/cal-dst.el \
+ $(CAL_DIR)/cal-french.el $(CAL_DIR)/cal-hebrew.el \
+ $(CAL_DIR)/cal-html.el $(CAL_DIR)/cal-islam.el \
+ $(CAL_DIR)/cal-iso.el $(CAL_DIR)/cal-julian.el \
+ $(CAL_DIR)/cal-mayan.el $(CAL_DIR)/cal-menu.el \
+ $(CAL_DIR)/cal-move.el $(CAL_DIR)/cal-persia.el \
+ $(CAL_DIR)/cal-tex.el $(CAL_DIR)/cal-x.el \
+ $(CAL_DIR)/calendar.el $(CAL_DIR)/diary-lib.el \
+ $(CAL_DIR)/holidays.el $(CAL_DIR)/lunar.el \
+ $(CAL_DIR)/solar.el
+
+$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
+ $(emacs) -l autoload \
+ --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
+ --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq make-backup-files nil)" \
+ -f batch-update-autoloads $(CAL_DIR)
+
+$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
+ $(emacs) -l autoload \
+ --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
+ --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq make-backup-files nil)" \
+ -f batch-update-autoloads $(CAL_DIR)
+
+$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
+ $(emacs) -l autoload \
+ --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
+ --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq make-backup-files nil)" \
+ -f batch-update-autoloads $(CAL_DIR)
+
+# Prepare a bootstrap in the lisp subdirectory.
+#
+# Build loaddefs.el to make sure it's up-to-date. If it's not, that
+# might lead to errors during the bootstrap because something fails to
+# autoload as expected. If there is no emacs binary, then we can't
+# build autoloads yet. In that case we have to use ldefs-boot.el.
+# Bootstrap should always work with ldefs-boot.el. Therefore,
+# whenever a new autoload cookie gets added that is necessary during
+# bootstrapping, ldefs-boot.el should be updated by overwriting it with
+# an up-to-date copy of loaddefs.el that is uncorrupted by
+# local changes. (Because loaddefs.el is an automatically generated
+# file, we don't want to store it in the source repository).
+
+bootstrap-clean:
+ cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)
+
+distclean:
+ -rm -f ./Makefile
+
+maintainer-clean: distclean bootstrap-clean
+
+.PHONY: check-declare
+
+check-declare:
+ $(emacs) -l $(lisp)/emacs-lisp/check-declare \
+ --eval '(check-declare-directory "$(lisp)")'
+
+# Dependencies
+
+# CC Mode uses a compile time macro system which causes a compile time
+# dependency in cc-*.elc files on the macros in other cc-*.el and the
+# version string in cc-defs.el.
+$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
+ $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\
+ $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
+ $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
+ $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
+ $(lisp)/progmodes/cc-vars.elc: \
+ $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
+
+$(lisp)/progmodes/cc-align.elc: \
+ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
+
+$(lisp)/progmodes/cc-cmds.elc: \
+ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
+
+$(lisp)/progmodes/cc-compat.elc: \
+ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
+ $(lisp)/progmodes/cc-engine.elc
+
+$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
+ $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
+
+$(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
+ $(lisp)/progmodes/cc-vars.elc
+
+$(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
+ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
+ $(lisp)/font-lock.elc
+
+$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
+ $(lisp)/emacs-lisp/cl.elc
+
+$(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
+ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
+ $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
+ $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc
+
+$(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
+ $(lisp)/progmodes/cc-align.elc
+
+$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
+
+# MH-E dependencies, mainly to prevent failures with parallel
+# compilation, due to race conditions between writing a given FOO.elc
+# file and another file being compiled that says "(require FOO)",
+# which causes Emacs to try to read FOO.elc.
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\
+ $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\
+ $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\
+ $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
+ $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\
+ $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
+ $(MH_E_DIR)/mh-e.elc
+
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\
+ $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\
+ $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
+ $(lisp)/emacs-lisp/cl.elc
+
+$(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\
+ $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\
+ $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\
+ $(MH_E_DIR)/mh-scan.elc
+
+$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\
+ $(lisp)/gnus/gnus-util.elc
+
+$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\
+ $(lisp)/progmodes/which-func.elc
+
+$(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
+ $(MH_E_DIR)/mh-utils.elc:\
+ $(lisp)/font-lock.elc
+
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc
+
+$(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc
+
+$(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \
+ $(lisp)/cus-face.elc
+
+$(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \
+ $(lisp)/gnus/mm-view.elc $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc
+
+$(MH_E_DIR)/mh-print.elc: $(lisp)/ps-print.elc
+
+$(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc
+
+$(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc
+
+$(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc
+
+$(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc
+
+# Makefile ends here.
;; wrongly with a non-date line existing as a random note. In
;; addition, using any kind of fixed setting like this doesn't
;; work if a user customizes add-log-time-format.
- ("^[0-9-]+ +\\|^\\(Sun\\|Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\) [A-z][a-z][a-z] [0-9:+ ]+"
+ ("^[0-9-]+ +\\|^ \\{11,\\}\\|^\\(Sun\\|Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\) [A-z][a-z][a-z] [0-9:+ ]+"
(0 'change-log-date-face)
;; Name and e-mail; some people put e-mail in parens, not angles.
("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil
(allout-show-to-offshoot)))
;;;_ #3 Internal Position State-Tracking -- "allout-recent-*" funcs
-;;; All the basic outline functions that directly do string matches to
-;;; evaluate heading prefix location set the variables
-;;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end'
-;;; when successful. Functions starting with `allout-recent-' all
-;;; use this state, providing the means to avoid redundant searches
-;;; for just-established data. This optimization can provide
-;;; significant speed improvement, but it must be employed carefully.
+;; All the basic outline functions that directly do string matches to
+;; evaluate heading prefix location set the variables
+;; `allout-recent-prefix-beginning' and `allout-recent-prefix-end'
+;; when successful. Functions starting with `allout-recent-' all
+;; use this state, providing the means to avoid redundant searches
+;; for just-established data. This optimization can provide
+;; significant speed improvement, but it must be employed carefully.
;;;_ = allout-recent-prefix-beginning
(defvar allout-recent-prefix-beginning 0
"Buffer point of the start of the last topic prefix encountered.")
;; ARCHIVE TYPES: Currently only the archives below are handled, but the
;; structure for handling just about anything is in place.
;;
-;; Arc Lzh Zip Zoo Rar
-;; ----------------------------------------
-;; View listing Intern Intern Intern Intern Y
-;; Extract member Y Y Y Y Y
-;; Save changed member Y Y Y Y N
-;; Add new member N N N N N
-;; Delete member Y Y Y Y N
-;; Rename member Y Y N N N
-;; Chmod - Y Y - N
-;; Chown - Y - - N
-;; Chgrp - Y - - N
+;; Arc Lzh Zip Zoo Rar 7z
+;; --------------------------------------------
+;; View listing Intern Intern Intern Intern Y Y
+;; Extract member Y Y Y Y Y Y
+;; Save changed member Y Y Y Y N N
+;; Add new member N N N N N N
+;; Delete member Y Y Y Y N N
+;; Rename member Y Y N N N N
+;; Chmod - Y Y - N N
+;; Chown - Y - - N N
+;; Chgrp - Y - - N N
;;
;; Special thanks to Bill Brodie <wbrodie@panix.com> for very useful tips
;; on the first released version of this package.
;; Zip archive configuration
(defcustom archive-zip-extract
- (if (and (not (executable-find "unzip"))
- (executable-find "pkunzip"))
- '("pkunzip" "-e" "-o-")
- '("unzip" "-qq" "-c"))
+ (cond ((executable-find "unzip") '("unzip" "-qq" "-c"))
+ ((executable-find "7z") '("7z" "x" "-so"))
+ ((executable-find "pkunzip") '("pkunzip" "-e" "-o-"))
+ (t '("unzip" "-qq" "-c")))
"Program and its options to run in order to extract a zip file member.
Extraction should happen to standard output. Archive and member name will
be added."
:type '(list (string :tag "Program")
- (repeat :tag "Options"
- :inline t
- (string :format "%v")))
+ (repeat :tag "Options"
+ :inline t
+ (string :format "%v")))
:group 'archive-zip)
;; For several reasons the latter behavior is not desirable in general.
:inline t
(string :format "%v")))
:group 'archive-zoo)
+;; ------------------------------
+;; 7z archive configuration
+
+(defcustom archive-7z-extract
+ '("7z" "x" "-so")
+ "Program and its options to run in order to extract a 7z file member.
+Extraction should happen to standard output. Archive and member name will
+be added."
+ :type '(list (string :tag "Program")
+ (repeat :tag "Options"
+ :inline t
+ (string :format "%v")))
+ :group 'archive-7z)
+
;; -------------------------------------------------------------------------
;;; Section: Variables
((and (looking-at "MZ")
(re-search-forward "Rar!" (+ (point) 100000) t))
'rar-exe)
+ ((looking-at "7z\274\257\047\034") '7z)
(t (error "Buffer format not recognized")))))
;; -------------------------------------------------------------------------
(archive-maybe-update t))
(or (not (buffer-name buffer))
(cond
- (view-p (view-buffer
- buffer (and just-created 'kill-buffer-if-not-modified)))
+ (view-p
+ (view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
((eq other-window-p 'display) (display-buffer buffer))
(other-window-p (switch-to-buffer-other-window buffer))
(t (switch-to-buffer buffer))))))
(archive-delete-local tmpfile)
success))
-(defun archive-extract-by-stdout (archive name command)
+(defun archive-extract-by-stdout (archive name command &optional stderr-file)
(apply 'call-process
(car command)
nil
- t
+ (if stderr-file (list t stderr-file) t)
nil
(append (cdr command) (list archive name))))
(apply 'vector (nreverse files))))
(defun archive-zip-extract (archive name)
- (if (member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
- (archive-*-extract archive name archive-zip-extract)
+ (cond
+ ((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
+ (archive-*-extract archive name archive-zip-extract))
+ ((equal (car archive-zip-extract) "7z")
+ (let ((archive-7z-extract archive-zip-extract))
+ (archive-7z-extract archive name)))
+ (t
(archive-extract-by-stdout
archive
;; unzip expands wildcards in NAME, so we need to quote it.
;; FIXME: Does pkunzip need similar treatment?
+ ;; (7z doesn't need to quote wildcards)
(if (equal (car archive-zip-extract) "unzip")
(shell-quote-argument name)
name)
- archive-zip-extract)))
+ archive-zip-extract))))
(defun archive-zip-write-file-member (archive descr)
(archive-*-write-file-member
(if tmpbuf (kill-buffer tmpbuf))
(delete-file tmpfile))))
+;; -------------------------------------------------------------------------
+;;; Section: 7z Archives
+(defun archive-7z-summarize ()
+ (let ((maxname 10)
+ (maxsize 5)
+ (file buffer-file-name)
+ (files ()))
+ (with-temp-buffer
+ (call-process "7z" nil t nil "l" "-slt" file)
+ (goto-char (point-min))
+ (re-search-forward "^-+\n")
+ (while (re-search-forward "^Path = \\(.*\\)\n" nil t)
+ (goto-char (match-end 0))
+ (let ((name (match-string 1))
+ (size (save-excursion
+ (and (re-search-forward "^Size = \\(.*\\)\n")
+ (match-string 1))))
+ (time (save-excursion
+ (and (re-search-forward "^Modified = \\(.*\\)\n")
+ (match-string 1)))))
+ (if (> (length name) maxname) (setq maxname (length name)))
+ (if (> (length size) maxsize) (setq maxsize (length size)))
+ (push (vector name name nil nil time nil nil size)
+ files))))
+ (setq files (nreverse files))
+ (goto-char (point-min))
+ (let* ((format (format " %%%ds %%s %%s" maxsize))
+ (sep (format format (make-string maxsize ?-) "-------------------" ""))
+ (column (length sep)))
+ (insert (format format "Size " "Date Time " " Filename") "\n")
+ (insert sep (make-string maxname ?-) "\n")
+ (archive-summarize-files (mapcar (lambda (desc)
+ (let ((text
+ (format format
+ (aref desc 7)
+ (aref desc 4)
+ (aref desc 1))))
+ (vector text
+ column
+ (length text))))
+ files))
+ (insert sep (make-string maxname ?-) "\n")
+ (apply 'vector files))))
+
+(defun archive-7z-extract (archive name)
+ (let ((tmpfile (make-temp-file "7z-stderr")))
+ ;; 7z doesn't provide a `quiet' option to suppress non-essential
+ ;; stderr messages. So redirect stderr to a temp file and display it
+ ;; in the echo area when it contains error messages.
+ (prog1 (archive-extract-by-stdout
+ archive name archive-7z-extract tmpfile)
+ (with-temp-buffer
+ (insert-file-contents tmpfile)
+ (unless (search-forward "Everything is Ok" nil t)
+ (message "%s" (buffer-string)))
+ (delete-file tmpfile)))))
+
+;; -------------------------------------------------------------------------
;;; Section `ar' archives.
;; TODO: we currently only handle the basic format of ar archives,
(force-mode-line-update)))
-(defun mode-line-abbrev-mode (event)
- "Turn off `abbrev-mode' from the mode-line."
- (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (abbrev-mode)
- (force-mode-line-update)))
-
-
-(defun mode-line-auto-fill-mode (event)
- "Turn off `auto-fill-mode' from the mode-line."
- (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (auto-fill-mode)
- (force-mode-line-update)))
-
-
(defvar mode-line-input-method-map
(let ((map (make-sparse-keymap)))
(define-key map [mode-line mouse-2]
(define-key esc-map "\t" 'complete-symbol)
-(defun complete-symbol (arg)
- "Perform tags completion on the text around point.
-If a tags table is loaded, call `complete-tag'.
-Otherwise, if Semantic is active, call `semantic-ia-complete-symbol'.
-
-With a prefix argument, this command does completion within
-the collection of symbols listed in the index of the manual for the
-language you are using."
- (interactive "P")
- (cond (arg
- (info-complete-symbol))
- ((or tags-table-list tags-file-name)
- (complete-tag))
- ((and (fboundp 'semantic-ia-complete-symbol)
- (fboundp 'semantic-active-p)
- (semantic-active-p))
- (semantic-ia-complete-symbol))
- (t
- (error "%s"
- (substitute-command-keys
- "No completions available; use \\[visit-tags-table] \
-or \\[semantic-mode]")))))
-
;; Reduce total amount of space we must allocate during this function
;; that we will not need to keep permanently.
(garbage-collect)
(define-key global-map [C-home] 'beginning-of-buffer)
(define-key global-map [M-home] 'beginning-of-buffer-other-window)
(define-key esc-map [home] 'beginning-of-buffer-other-window)
-(define-key global-map [left] 'backward-char)
+(define-key global-map [left] 'left-arrow-command)
(define-key global-map [up] 'previous-line)
-(define-key global-map [right] 'forward-char)
+(define-key global-map [right] 'right-arrow-command)
(define-key global-map [down] 'next-line)
-(define-key global-map [prior] 'scroll-down)
-(define-key global-map [next] 'scroll-up)
+(define-key global-map [prior] 'scroll-down-command)
+(define-key global-map [next] 'scroll-up-command)
(define-key global-map [C-up] 'backward-paragraph)
(define-key global-map [C-down] 'forward-paragraph)
(define-key global-map [C-prior] 'scroll-right)
(if bookmark-file
;; In case user set `bookmark-file' in her .emacs:
bookmark-file
- (convert-standard-filename "~/.emacs.bmk"))
+ (locate-user-emacs-file "bookmarks" ".emacs.bmk"))
"File in which to save bookmarks by default."
:type 'file
:group 'bookmark)
(or no-history (bookmark-maybe-historicize-string bookmark))
(let ((start (point)))
(prog1
- (insert (bookmark-location bookmark)) ; *Return this line*
+ (insert (bookmark-location bookmark))
(if (display-mouse-p)
(add-text-properties
start
(defalias 'bookmark-locate 'bookmark-insert-location)
(defun bookmark-location (bookmark)
- "Return the name of the file associated with BOOKMARK, or nil if none.
+ "Return a description of the location of BOOKMARK.
BOOKMARK may be a bookmark name (a string) or a bookmark record."
(bookmark-maybe-load-default-file)
- (bookmark-get-filename bookmark))
+ ;; We could call the `handler' and ask for it to construct a description
+ ;; dynamically: it would open up several new possibilities, but it
+ ;; would have the major disadvantage of forcing to load each and
+ ;; every handler when the user calls bookmark-menu.
+ (or (bookmark-prop-get bookmark 'location)
+ (bookmark-get-filename bookmark)
+ "-- Unknown location --"))
;;;###autoload
+++ /dev/null
-# Auto-generated lisp files, which ignore
-precious ^(.*-loaddefs)\.el$
-
-# arch-tag: 5258f69e-459b-449b-bdd7-bdbd5f948cb9
Summary of changes to "Calc"
------- -- ------- -- ----
+Emacs 24.1
+
+* Gave `calc-histogram' the option of using a vector to determine the bins.
+
+* Added "O" option prefix.
+
+* Used "O" prefix to "d r" (`calc-radix') to turn on twos-complement mode.
+
Emacs 23.2
* Added twos-complement display.
("≥" ">=")
("≦" "<=")
("≧" ">=")
+ ("µ" "μ")
;; fractions
("¼" "(1:4)") ; 1/4
("½" "(1:2)") ; 1/2
(cond ((and (stringp (car p))
(or (> (length (car p)) 1) (equal (car p) "$")
(equal (car p) "\""))
- (string-match "[^a-zA-Z0-9]" (car p)))
+ (string-match "[^a-zA-Zα-ωΑ-Ω0-9]" (car p)))
(let ((s (regexp-quote (car p))))
- (if (string-match "\\`[a-zA-Z0-9]" s)
+ (if (string-match "\\`[a-zA-Zα-ωΑ-Ω0-9]" s)
(setq s (concat "\\<" s)))
- (if (string-match "[a-zA-Z0-9]\\'" s)
+ (if (string-match "[a-zA-Zα-ωΑ-Ω0-9]\\'" s)
(setq s (concat s "\\>")))
(or (assoc s math-toks)
(progn
math-expr-data (math-match-substring math-exp-str 0)
math-exp-pos (match-end 0)))
((or (and (>= ch ?a) (<= ch ?z))
- (and (>= ch ?A) (<= ch ?Z)))
+ (and (>= ch ?A) (<= ch ?Z))
+ (and (>= ch ?α) (<= ch ?ω))
+ (and (>= ch ?Α) (<= ch ?Ω)))
(string-match
(cond
((and (memq calc-language calc-lang-allow-underscores)
(memq calc-language calc-lang-allow-percentsigns))
- "[a-zA-Z0-9_'#]*")
+ "[a-zA-Zα-ωΑ-Ω0-9_'#]*")
((memq calc-language calc-lang-allow-underscores)
- "[a-zA-Z0-9_#]*")
- (t "[a-zA-Z0-9'#]*"))
+ "[a-zA-Zα-ωΑ-Ω0-9_#]*")
+ (t "[a-zA-Zα-ωΑ-Ω0-9'#]*"))
math-exp-str math-exp-pos)
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
(or (eq math-exp-pos 0)
(and (not (memq calc-language
calc-lang-allow-underscores))
- (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
+ (eq (string-match "[^])}\"a-zA-Zα-ωΑ-Ω0-9'$]_"
math-exp-str (1- math-exp-pos))
(1- math-exp-pos))))))
(or (and (memq calc-language calc-lang-c-type-hex)
(string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
- (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
+ (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
math-exp-str math-exp-pos))
(setq math-exp-token 'number
math-expr-data (math-match-substring math-exp-str 0)
(progn
(calc-change-mode
(list 'calc-number-radix 'calc-twos-complement-mode)
- (list n (and (or (= n 2) (= n 8) (= n 16)) arg)) t)
+ (list n (or arg (calc-is-option))) t)
;; also change global value so minibuffer sees it
(setq-default calc-number-radix calc-number-radix))
(setq n calc-number-radix))
(len (length num)))
(if (< len digs)
(setq num (concat (make-string (- digs len) ?0) num))))
+ (when calc-group-digits
+ (setq num (math-group-float num)))
(concat
(number-to-string calc-number-radix)
"##"
(define-key calc-mode-map "J" 'calc-conj)
(define-key calc-mode-map "L" 'calc-ln)
(define-key calc-mode-map "N" 'calc-eval-num)
+ (define-key calc-mode-map "O" 'calc-option)
(define-key calc-mode-map "P" 'calc-pi)
(define-key calc-mode-map "Q" 'calc-sqrt)
(define-key calc-mode-map "R" 'calc-round)
calc-d-prefix-help calc-describe-function calc-describe-key
calc-describe-key-briefly calc-describe-variable calc-f-prefix-help
calc-full-help calc-g-prefix-help calc-help-prefix
-calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help
+calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help
calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help
calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help
calc-t-prefix-help calc-u-prefix-help calc-v-prefix-help)
(with-current-buffer calc-main-buffer
calc-hyperbolic-flag)
calc-hyperbolic-flag))
- (msg (if hyp-flag
- "Inverse Hyperbolic..."
- "Inverse...")))
+ (opt-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-option-flag)
+ calc-option-flag))
+ (msg
+ (cond
+ ((and opt-flag hyp-flag) "Option Inverse Hyperbolic...")
+ (hyp-flag "Inverse Hyperbolic...")
+ (opt-flag "Option Inverse...")
+ (t "Inverse..."))))
(calc-fancy-prefix 'calc-inverse-flag msg n)))
(defconst calc-fancy-prefix-map
(with-current-buffer calc-main-buffer
calc-inverse-flag)
calc-inverse-flag))
- (msg (if inv-flag
- "Inverse Hyperbolic..."
- "Hyperbolic...")))
+ (opt-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-option-flag)
+ calc-option-flag))
+ (msg
+ (cond
+ ((and opt-flag inv-flag) "Option Inverse Hyperbolic...")
+ (opt-flag "Option Hyperbolic...")
+ (inv-flag "Inverse Hyperbolic...")
+ (t "Hyperbolic..."))))
(calc-fancy-prefix 'calc-hyperbolic-flag msg n)))
(defun calc-hyperbolic-func ()
(defun calc-is-hyperbolic ()
calc-hyperbolic-flag)
+(defun calc-option (&optional n)
+ (interactive "P")
+ (let* ((inv-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-inverse-flag)
+ calc-inverse-flag))
+ (hyp-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-hyperbolic-flag)
+ calc-hyperbolic-flag))
+ (msg
+ (cond
+ ((and hyp-flag inv-flag) "Option Inverse Hyperbolic...")
+ (hyp-flag "Option Hyperbolic...")
+ (inv-flag "Option Inverse...")
+ (t "Option..."))))
+ (calc-fancy-prefix 'calc-option-flag msg n)))
+
+(defun calc-is-option ()
+ calc-option-flag)
+
(defun calc-keep-args (&optional n)
(interactive "P")
(calc-fancy-prefix 'calc-keep-args-flag "Keep args..." n))
(concat "-" (math-format-flat-expr (nth 1 a) 1000)))
(t
(concat (math-remove-dashes
- (if (string-match "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+ (if (string-match "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
(symbol-name (car a)))
(math-match-substring (symbol-name (car a)) 1)
(symbol-name (car a))))
(defun math-group-float (str) ; [X X]
(let* ((pt (or (string-match "[^0-9a-zA-Z]" str) (length str)))
- (g (if (integerp calc-group-digits) (math-abs calc-group-digits) 3))
+ (g (if (integerp calc-group-digits) (math-abs calc-group-digits)
+ (if (memq calc-number-radix '(2 16)) 4 3)))
(i pt))
(if (and (integerp calc-group-digits) (< calc-group-digits 0))
(while (< (setq i (+ (1+ i) g)) (length str))
n temp))
(math-div n d)))
-
-
(defun calcFunc-fdiv (a b) ; [R I I] [Public]
- (if (Math-num-integerp a)
- (if (Math-num-integerp b)
- (if (Math-zerop b)
- (math-reject-arg a "*Division by zero")
- (math-make-frac (math-trunc a) (math-trunc b)))
- (math-reject-arg b 'integerp))
- (math-reject-arg a 'integerp)))
+ (cond
+ ((Math-num-integerp a)
+ (cond
+ ((Math-num-integerp b)
+ (if (Math-zerop b)
+ (math-reject-arg a "*Division by zero")
+ (math-make-frac (math-trunc a) (math-trunc b))))
+ ((eq (car-safe b) 'frac)
+ (if (Math-zerop (nth 1 b))
+ (math-reject-arg a "*Division by zero")
+ (math-make-frac (math-mul (math-trunc a) (nth 2 b)) (nth 1 b))))
+ (t (math-reject-arg b 'integerp))))
+ ((eq (car-safe a) 'frac)
+ (cond
+ ((Math-num-integerp b)
+ (if (Math-zerop b)
+ (math-reject-arg a "*Division by zero")
+ (math-make-frac (cadr a) (math-mul (nth 2 a) (math-trunc b)))))
+ ((eq (car-safe b) 'frac)
+ (if (Math-zerop (nth 1 b))
+ (math-reject-arg a "*Division by zero")
+ (math-make-frac (math-mul (nth 1 a) (nth 2 b)) (math-mul (nth 2 a) (nth 1 b)))))
+ (t (math-reject-arg b 'integerp))))
+ (t
+ (math-reject-arg a 'integerp))))
(provide 'calc-frac)
'(calc-inverse-prefix-help
calc-hyperbolic-prefix-help
calc-inv-hyp-prefix-help
+ calc-option-prefix-help
calc-a-prefix-help
calc-b-prefix-help
calc-c-prefix-help
"I H + a S (general invert func); v h (rtail)")
"inverse-hyperbolic" nil))
+(defun calc-option-prefix-help ()
+ (interactive)
+ (calc-do-prefix-help
+ '("")
+ "option" nil))
(defun calc-f-prefix-help ()
(interactive)
(put 'pascal 'math-lang-read-symbol
'((?\$
(eq (string-match
- "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)"
+ "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)"
math-exp-str math-exp-pos)
math-exp-pos)
(setq math-exp-token 'number
(put 'fortran 'math-lang-read-symbol
'((?\.
- (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\."
+ (eq (string-match "\\.[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω]?\\."
math-exp-str math-exp-pos) math-exp-pos)
(setq math-exp-token 'punc
math-expr-data (upcase (math-match-substring math-exp-str 0))
'((?\\
(< math-exp-pos (1- (length math-exp-str)))
(progn
- (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+ (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+ (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
math-exp-str math-exp-pos))
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
(defun math-compose-tex-var (a prec)
(if (and calc-language-option
(not (= calc-language-option 0))
- (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'"
+ (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'"
(symbol-name (nth 1 a))))
(if (eq calc-language 'latex)
(format "\\text{%s}" (symbol-name (nth 1 a)))
(let (left right)
(if (and calc-language-option
(not (= calc-language-option 0))
- (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" func))
+ (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'" func))
(if (< (prefix-numeric-value calc-language-option) 0)
(setq func (format "\\%s" func))
(setq func (if (eq calc-language 'latex)
'((?\\
(< math-exp-pos (1- (length math-exp-str)))
(progn
- (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+ (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\\\text *{\\([a-zA-Z0-9]+\\)}"
+ (string-match "\\\\text *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
math-exp-str math-exp-pos)
- (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+ (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
math-exp-str math-exp-pos))
(setq math-exp-token 'symbol
math-exp-pos (match-end 0)
;; Variable name or function call.
((or (and (>= other-char ?a) (<= other-char ?z))
- (and (>= other-char ?A) (<= other-char ?Z)))
+ (and (>= other-char ?A) (<= other-char ?Z))
+ (and (>= other-char ?α) (<= other-char ?ω))
+ (and (>= other-char ?Α) (<= other-char ?Ω)))
(setq line (nth v math-read-big-lines))
- (string-match "\\([a-zA-Z'_]+\\) *" line math-rb-h1)
+ (string-match "\\([a-zA-Zα-ωΑ-Ω'_]+\\) *" line math-rb-h1)
(setq h (match-end 1)
widest (match-end 0)
p (math-match-substring line 1))
(declare-function calc-inv-hyp-prefix-help "calc-help" ())
(declare-function calc-inverse-prefix-help "calc-help" ())
(declare-function calc-hyperbolic-prefix-help "calc-help" ())
+(declare-function calc-option-prefix-help "calc-help" ())
(declare-function calc-explain-why "calc-stuff" (why &optional more))
(declare-function calc-clear-command-flag "calc-ext" (f))
(declare-function calc-roll-down-with-selections "calc-sel" (n m))
(let ((msgs
'("Press `h' for complete help; press `?' repeatedly for a summary"
"Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit"
- "Letter keys: SHIFT + Undo, reDo; Keep-args; Inverse, Hyperbolic"
+ "Letter keys: SHIFT + Undo, reDo; Keep-args; Inverse, Hyperbolic, Option"
"Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB"
"Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi"
"Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro"
(calc-inv-hyp-prefix-help)
(calc-inverse-prefix-help))
(calc-hyperbolic-prefix-help))
- (setq calc-help-phase
- (if (eq this-command last-command)
- (% (1+ calc-help-phase) (1+ (length msgs)))
- 0))
- (let ((msg (nth calc-help-phase msgs)))
- (message "%s" (if msg
- (concat msg ":"
- (make-string (- (apply 'max
- (mapcar 'length
- msgs))
- (length msg)) 32)
- " [?=MORE]")
- "")))))))
-
+ (if calc-option-flag
+ (calc-option-prefix-help)
+ (setq calc-help-phase
+ (if (eq this-command last-command)
+ (% (1+ calc-help-phase) (1+ (length msgs)))
+ 0))
+ (let ((msg (nth calc-help-phase msgs)))
+ (message "%s" (if msg
+ (concat msg ":"
+ (make-string (- (apply 'max
+ (mapcar 'length
+ msgs))
+ (length msg)) 32)
+ " [?=MORE]")
+ ""))))))))
+
'calc-read-var-name-history)))))
(setq calc-aborted-prefix "")
(and (not (equal var "var-"))
- (if (string-match "\\`\\([-a-zA-Z0-9]+\\) *:?=" var)
+ (if (string-match "\\`\\([-a-zA-Zα-ωΑ-Ω0-9]+\\) *:?=" var)
(if (null calc-given-value-flag)
(error "Assignment is not allowed in this command")
(let ((svar (intern (substring var 0 (match-end 1)))))
(defun calc-trail-isearch-forward ()
(interactive)
(calc-with-trail-buffer
- (save-window-excursion
- (select-window (get-buffer-window (current-buffer)))
- (let ((search-exit-char ?\r))
- (isearch-forward)))
- (calc-trail-here)))
+ (let ((win (get-buffer-window (current-buffer)))
+ pos)
+ (save-window-excursion
+ (select-window win)
+ (isearch-forward)
+ (setq pos (point)))
+ (goto-char pos)
+ (set-window-point win pos)
+ (calc-trail-here))))
(defun calc-trail-isearch-backward ()
(interactive)
(calc-with-trail-buffer
- (save-window-excursion
- (select-window (get-buffer-window (current-buffer)))
- (let ((search-exit-char ?\r))
- (isearch-backward)))
- (calc-trail-here)))
+ (let ((win (get-buffer-window (current-buffer)))
+ pos)
+ (save-window-excursion
+ (select-window win)
+ (isearch-backward)
+ (setq pos (point)))
+ (goto-char pos)
+ (set-window-point win pos)
+ (calc-trail-here))))
(defun calc-trail-yank (arg)
(interactive "P")
;;; Units table last updated 9-Jan-91 by Ulrich Mueller (ulm@vsnhd1.cern.ch)
;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov)
-;;; Updated April 2002 by Jochen Küpper
+;;; Updated April 2002 by Jochen Küpper
;;; Updated August 2007, using
;;; CODATA (http://physics.nist.gov/cuu/Constants/index.html)
;;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html)
;;; ESUWM (Encyclopaedia of Scientific Units, Weights and
-;;; Measures, by François Cardarelli)
+;;; Measures, by François Cardarelli)
;;; All conversions are exact unless otherwise noted.
(defvar math-standard-units
"1.602176487 10^-19 C (*)") ;;(approx) CODATA
( V "W/A" "Volt" )
( ohm "V/A" "Ohm" )
+ ( Ω "ohm" "Ohm" )
( mho "A/V" "Mho" )
( S "A/V" "Siemens" )
( F "C/V" "Farad" )
"6.62606896 10^-34 J s (*)")
( hbar "h / (2 pi)" "Planck's constant" ) ;; Exact
( mu0 "4 pi 10^(-7) H/m" "Permeability of vacuum") ;; Exact
+ ( μ0 "mu0" "Permeability of vacuum") ;; Exact
( eps0 "1 / (mu0 c^2)" "Permittivity of vacuum" )
+ ( ε0 "eps0" "Permittivity of vacuum" )
( G "6.67428*10^(-11) m^3/(kg s^2)" "Gravitational constant" nil
"6.67428 10^-11 m^3/(kg s^2) (*)")
( Nav "6.02214179*10^(23) / mol" "Avogadro's constant" nil
"1.674927211 10^-27 kg (*)")
( mmu "1.88353130*10^(-28) kg" "Muon rest mass" nil
"1.88353130 10^-28 kg (*)")
+ ( mμ "mmu" "Muon rest mass" nil
+ "1.88353130 10^-28 kg (*)")
( Ryd "10973731.568527 /m" "Rydberg's constant" nil
"10973731.568527 /m (*)")
( k "1.3806504*10^(-23) J/K" "Boltzmann's constant" nil
"1.3806504 10^-23 J/K (*)")
( alpha "7.2973525376*10^(-3)" "Fine structure constant" nil
"7.2973525376 10^-3 (*)")
+ ( α "alpha" "Fine structure constant" nil
+ "7.2973525376 10^-3 (*)")
( muB "927.400915*10^(-26) J/T" "Bohr magneton" nil
"927.400915 10^-26 J/T (*)")
( muN "5.05078324*10^(-27) J/T" "Nuclear magneton" nil
( ?c (^ 10 -2) "Centi" )
( ?m (^ 10 -3) "Milli" )
( ?u (^ 10 -6) "Micro" )
+ ( ?μ (^ 10 -6) "Micro" )
( ?n (^ 10 -9) "Nano" )
( ?p (^ 10 -12) "Pico" )
( ?f (^ 10 -15) "Femto" )
(let ((name (or (nth 2 u) (symbol-name (car u)))))
(if (eq (aref name 0) ?\*)
(setq name (substring name 1)))
- (if (string-match "[^a-zA-Z0-9']" name)
- (if (string-match "^[a-zA-Z0-9' ()]*$" name)
+ (if (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
+ (if (string-match "^[a-zA-Zα-ωΑ-Ω0-9' ()]*$" name)
(while (setq pos (string-match "[ ()]" name))
(setq name (concat (substring name 0 pos)
(if (eq (aref name pos) 32) "-" "")
(setq name (concat (nth 2 (assq (aref (symbol-name
(nth 1 expr)) 0)
math-unit-prefixes))
- (if (and (string-match "[^a-zA-Z0-9']" name)
+ (if (and (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
(not (memq (car u) '(mHg gf))))
(concat "-" name)
(downcase name)))))
(provide 'calc-units)
-;; Local Variables:
-;; coding: iso-latin-1
-;; End:
-
;; arch-tag: e993314f-3adc-4191-be61-4ef8874881c4
;;; calc-units.el ends here
(calc-enter-result 1 "grad" (list 'calcFunc-grade (calc-top-n 1))))))
(defun calc-histogram (n)
- (interactive "NNumber of bins: ")
+ (interactive "P")
+ (unless (natnump n)
+ (setq n (math-read-expr (read-string "Centers of bins: "))))
(calc-slow-wrapper
(if calc-hyperbolic-flag
(calc-enter-result 2 "hist" (list 'calcFunc-histogram
(calc-top-n 2)
(calc-top-n 1)
- (prefix-numeric-value n)))
+ n))
(calc-enter-result 1 "hist" (list 'calcFunc-histogram
(calc-top-n 1)
- (prefix-numeric-value n))))))
+ n)))))
(defun calc-transpose (arg)
(interactive "P")
(if (Math-vectorp wts)
(or (= (length vec) (length wts))
(math-dimension-error)))
- (or (natnump n)
- (math-reject-arg n 'fixnatnump))
- (let ((res (make-vector n 0))
- (vp vec)
- (wvec (Math-vectorp wts))
- (wp wts)
- bin)
- (while (setq vp (cdr vp))
- (setq bin (car vp))
- (or (natnump bin)
- (setq bin (math-floor bin)))
- (and (natnump bin)
- (< bin n)
- (aset res bin (math-add (aref res bin)
- (if wvec (car (setq wp (cdr wp))) wts)))))
- (cons 'vec (append res nil))))
+ (cond ((natnump n)
+ (let ((res (make-vector n 0))
+ (vp vec)
+ (wvec (Math-vectorp wts))
+ (wp wts)
+ bin)
+ (while (setq vp (cdr vp))
+ (setq bin (car vp))
+ (or (natnump bin)
+ (setq bin (math-floor bin)))
+ (and (natnump bin)
+ (< bin n)
+ (aset res bin
+ (math-add (aref res bin)
+ (if wvec (car (setq wp (cdr wp))) wts)))))
+ (cons 'vec (append res nil))))
+ ((Math-vectorp n) ;; n is a vector of midpoints
+ (let* ((bds (math-vector-avg n))
+ (res (make-vector (1- (length n)) 0))
+ (vp (cdr vec))
+ (wvec (Math-vectorp wts))
+ (wp wts)
+ num)
+ (while vp
+ (setq num (car vp))
+ (let ((tbds (cdr bds))
+ (i 0))
+ (while (and tbds (Math-lessp (car tbds) num))
+ (setq i (1+ i))
+ (setq tbds (cdr tbds)))
+ (aset res i
+ (math-add (aref res i)
+ (if wvec (car (setq wp (cdr wp))) wts))))
+ (setq vp (cdr vp)))
+ (cons 'vec (append res nil))))
+ (t
+ (math-reject-arg n "*Expecting an integer or vector"))))
+
+;;; Replace a vector [a b c ...] with a vector of averages
+;;; [(a+b)/2 (b+c)/2 ...]
+(defun math-vector-avg (vec)
+ (let ((vp (sort (copy-sequence (cdr vec)) 'math-beforep))
+ (res nil))
+ (while (and vp (cdr vp))
+ (setq res (cons (math-div (math-add (car vp) (cadr vp)) 2) res)
+ vp (cdr vp)))
+ (cons 'vec (reverse res))))
;;; Set operations.
calc-matrix-mode
calc-inverse-flag
calc-hyperbolic-flag
+ calc-option-flag
calc-keep-args-flag
calc-angle-mode
calc-number-radix
"If non-nil, next operation is Inverse.")
(defvar calc-hyperbolic-flag nil
"If non-nil, next operation is Hyperbolic.")
+(defvar calc-option-flag nil
+ "If non-nil, next operation has Optional behavior.")
(defvar calc-keep-args-flag nil
"If non-nil, next operation should not remove its arguments from stack.")
(defvar calc-function-open "("
(defvar math-working-step-2 nil)
(defvar var-i '(special-const (math-imaginary 1)))
(defvar var-pi '(special-const (math-pi)))
+(defvar var-π '(special-const (math-pi)))
(defvar var-e '(special-const (math-e)))
(defvar var-phi '(special-const (math-phi)))
+(defvar var-φ '(special-const (math-phi)))
(defvar var-gamma '(special-const (math-gamma-const)))
+(defvar var-γ '(special-const (math-gamma-const)))
(defvar var-Modes '(special-const (math-get-modes-vec)))
(mapc (lambda (v) (or (boundp v) (set v nil)))
(mapc (lambda (x) (define-key map (char-to-string x) 'undefined))
"lOW")
(mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
- (concat "ABCDEFGHIJKLMNPQRSTUVXZabcdfghjkmoprstuvwxyz"
+ (concat "ABCDEFGHIJKLMNOPQRSTUVXZabcdfghjkmoprstuvwxyz"
":\\|!()[]<>{},;=~`\C-k\C-w\C-_"))
(define-key map "\M-w" 'calc-missing-key)
(define-key map "\M-k" 'calc-missing-key)
(calc-select-buffer)
(setq calc-inverse-flag nil
calc-hyperbolic-flag nil
+ calc-option-flag nil
calc-keep-args-flag nil)))
(when (memq 'do-edit calc-command-flags)
(switch-to-buffer (get-buffer-create "*Calc Edit*")))
(> (calc-stack-size) 0)
(calc-top 1 'sel)) "Sel " "")
(if calc-display-dirty "Dirty " "")
+ (if calc-option-flag "Opt " "")
(if calc-inverse-flag "Inv " "")
(if calc-hyperbolic-flag "Hyp " "")
(if calc-keep-args-flag "Keep " "")
(and prevc nextc
(or (and (>= nextc ?a) (<= nextc ?z))
(and (>= nextc ?A) (<= nextc ?Z))
+ (and (>= nextc ?α) (<= nextc ?ω))
+ (and (>= nextc ?Α) (<= nextc ?Ω))
(and (>= nextc ?0) (<= nextc ?9))
(memq nextc '(?. ?_ ?#
?\( ?\[ ?\{))
(not (math-tex-expr-is-flat (nth 1 a))))))
(list 'horiz
(if lr "\\left" "")
- (if (string-match "\\`u\\([^a-zA-Z]\\)\\'" (car op))
+ (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'" (car op))
(substring (car op) 1)
(car op))
(if (or lr (> (length (car op)) 2)) " " "")
(t
(let ((rhs (math-compose-expr (nth 1 a) (nth 3 op))))
(list 'horiz
- (let ((ops (if (string-match "\\`u\\([^a-zA-Z]\\)\\'"
+ (let ((ops (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'"
(car op))
(substring (car op) 1)
(car op))))
(setq func (car func2)))
(setq func (math-remove-dashes
(if (string-match
- "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+ "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
(symbol-name func))
(math-match-substring (symbol-name func) 1)
(symbol-name func))))
:prefix "calculator"
:version "21.1"
:group 'tools
- :group 'convenience)
+ :group 'applications)
(defcustom calculator-electric-mode nil
"Run `calculator' electrically, in the echo area.
+++ /dev/null
-# Auto-generated lisp files, which ignore
-precious ^(.*-loaddefs)\.el$
-
-# arch-tag: 6246cac0-cd69-4d59-8677-c1451a4d5831
;;; cal-french.el --- calendar functions for the French Revolutionary calendar
;; Copyright (C) 1988, 1989, 1992, 1994, 1995, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Free Software Foundation, Inc.
;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
;; Maintainer: Glenn Morris <rgm@gnu.org>
"Array of month names in the French calendar.")
(defconst calendar-french-multibyte-month-name-array
- ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
- "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"]
+ ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
+ "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"]
"Array of multibyte month names in the French calendar.")
(defconst calendar-french-day-name-array
"Array of special day names in the French calendar.")
(defconst calendar-french-multibyte-special-days-array
- ["de la Vertu" "du Génie" "du Travail" "de la Raison" "des Récompenses"
- "de la Révolution"]
+ ["de la Vertu" "du Génie" "du Travail" "de la Raison" "des Récompenses"
+ "de la Révolution"]
"Array of multibyte special day names in the French calendar.")
(defun calendar-french-accents-p ()
(cond
((< y 1) "")
((= m 13) (format (if (calendar-french-accents-p)
- "Jour %s de l'Année %d de la Révolution"
+ "Jour %s de l'Année %d de la Révolution"
"Jour %s de l'Anne'e %d de la Re'volution")
(aref (calendar-french-special-days-array) (1- d))
y))
(t (format
(if (calendar-french-accents-p)
- "%d %s an %d de la Révolution"
+ "%d %s an %d de la Révolution"
"%d %s an %d de la Re'volution")
d
(aref (calendar-french-month-name-array) (1- m))
(year (progn
(calendar-read
(if (calendar-french-accents-p)
- "Année de la Révolution (>0): "
+ "Année de la Révolution (>0): "
"Anne'e de la Re'volution (>0): ")
(lambda (x) (> x 0))
(number-to-string
(provide 'cal-french)
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
;; arch-tag: 7e8045a3-8609-46b5-9cde-cf40ce541cf9
;;; cal-french.el ends here
;; As calendar reads .todo-do before todo-mode is loaded.
;;;###autoload
-(defun todo-mode ()
- "Major mode for editing TODO lists.
-
-\\{todo-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'todo-mode)
- (setq mode-name "TODO")
- (use-local-map todo-mode-map)
- (easy-menu-add todo-menu)
- (run-mode-hooks 'todo-mode-hook))
+(define-derived-mode todo-mode nil "TODO"
+ "Major mode for editing TODO lists."
+ (easy-menu-add todo-menu))
(defvar date)
(defvar entry)
;; This provides a dired interface to EDE, allowing users to modify
;; their project file by adding files (or whatever) directly from a
;; dired buffer.
-
+(eval-when-compile (require 'cl))
(require 'easymenu)
(require 'dired)
(require 'ede)
;;; Code:
-(defvar ede-dired-minor-mode nil
- "Non-nil when in ede dired minor mode.")
-(make-variable-buffer-local 'ede-dired-minor-mode)
-
-(defvar ede-dired-keymap nil
+(defvar ede-dired-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map ".a" 'ede-dired-add-to-target)
+ (define-key map ".t" 'ede-new-target)
+ (define-key map ".s" 'ede-speedbar)
+ (define-key map ".C" 'ede-compile-project)
+ (define-key map ".d" 'ede-make-dist)
+
+ (easy-menu-define
+ ede-dired-menu map "EDE Dired Minor Mode Menu"
+ '("Project"
+ [ "Add files to target" ede-dired-add-to-target (ede-current-project) ]
+ ( "Build" :filter ede-build-forms-menu)
+ "-"
+ [ "Create Project" ede-new (not (ede-current-project)) ]
+ [ "Create Target" ede-new-target (ede-current-project) ]
+ "-"
+ ( "Customize Project" :filter ede-customize-forms-menu )
+ [ "View Project Tree" ede-speedbar (ede-current-project) ]
+ ))
+ map)
"Keymap used for ede dired minor mode.")
-(if ede-dired-keymap
- nil
- (setq ede-dired-keymap (make-sparse-keymap))
- (define-key ede-dired-keymap ".a" 'ede-dired-add-to-target)
- (define-key ede-dired-keymap ".t" 'ede-new-target)
- (define-key ede-dired-keymap ".s" 'ede-speedbar)
- (define-key ede-dired-keymap ".C" 'ede-compile-project)
- (define-key ede-dired-keymap ".d" 'ede-make-dist)
-
- (easy-menu-define
- ede-dired-menu ede-dired-keymap "EDE Dired Minor Mode Menu"
- '("Project"
- [ "Add files to target" ede-dired-add-to-target (ede-current-project) ]
- ( "Build" :filter ede-build-forms-menu)
- "-"
- [ "Create Project" ede-new (not (ede-current-project)) ]
- [ "Create Target" ede-new-target (ede-current-project) ]
- "-"
- ( "Customize Project" :filter ede-customize-forms-menu )
- [ "View Project Tree" ede-speedbar (ede-current-project) ]
- ))
- )
-
-(defun ede-dired-minor-mode (&optional arg)
+(define-minor-mode ede-dired-minor-mode
"A minor mode that should only be activated in DIRED buffers.
-If ARG is nil, toggle, if it is a positive number, force on, if
+If ARG is nil or a positive number, force on, if
negative, force off."
- (interactive "P")
- (if (not (or (eq major-mode 'dired-mode)
- (eq major-mode 'vc-dired-mode)))
- (error "Not in DIRED mode"))
- (setq ede-dired-minor-mode
- (not (or (and (null arg) ede-dired-minor-mode)
- (<= (prefix-numeric-value arg) 0))))
- (if (and (not (ede-directory-project-p default-directory))
- (not (interactive-p)))
- (setq ede-dired-minor-mode nil))
- )
+ :lighter " EDE" :keymap ede-dired-keymap
+ (unless (derived-mode-p 'dired-mode)
+ (setq ede-dired-minor-mode nil)
+ (error "Not in DIRED mode"))
+ (unless (or (ede-directory-project-p default-directory)
+ (interactive-p))
+ (setq ede-dired-minor-mode nil)))
(defun ede-dired-add-to-target (target)
"Add a file, or all marked files into a TARGET."
(let ((ede-object (ede-current-project)))
(ede-invoke-method 'project-interactive-select-target
"Add files to Target: "))))
- (let ((files (dired-get-marked-files t)))
- (while files
- (project-add-file target (car files))
- ;; Find the buffer for this files, and set it's ede-object
- (if (get-file-buffer (car files))
- (with-current-buffer (get-file-buffer (car files))
- (setq ede-object nil)
- (setq ede-object (ede-buffer-object (current-buffer)))))
- ;; Increment.
- (setq files (cdr files)))))
-
-;; Minor mode management.
-(add-to-list 'minor-mode-alist '(ede-dired-minor-mode " EDE"))
-(let ((a (assoc 'ede-dired-minor-mode minor-mode-map-alist)))
- (if a
- (setcdr a ede-dired-keymap)
- (add-to-list 'minor-mode-map-alist (cons 'ede-dired-minor-mode
- ede-dired-keymap))))
+ (dolist (file (dired-get-marked-files t))
+ (project-add-file target file)
+ ;; Find the buffer for this files, and set it's ede-object
+ (if (get-file-buffer file)
+ (with-current-buffer (get-file-buffer file)
+ (setq ede-object nil)
+ (setq ede-object (ede-buffer-object (current-buffer)))))))
(provide 'ede/dired)
(funcall project-am-debug-target-function cmd))
(kill-buffer tb))))
+(declare-function ede-shell-run-something "ede/shell")
+
(defmethod project-run-target ((obj project-am-objectcode))
"Run the current project target in comint buffer."
(let ((tb (get-buffer-create " *padt*"))
(require 'semantic/db-ebrowse)
(semanticdb-load-ebrowse-caches)))
(add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+ ;; Add semantic-ia-complete-symbol to
+ ;; completion-at-point-functions, so that it is run from
+ ;; M-TAB.
+ (add-hook 'completion-at-point-functions
+ 'semantic-completion-at-point-function)
(if global-ede-mode
(define-key cedet-menu-map [cedet-menu-separator] '("--")))
(dolist (b (buffer-list))
(semantic-new-buffer-fcn))))
;; Disable all Semantic features.
(remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+ (remove-hook 'completion-at-point-functions
+ 'semantic-completion-at-point-function)
(define-key cedet-menu-map [cedet-menu-separator] nil)
(define-key cedet-menu-map [semantic-options-separator] nil)
;; FIXME: handle semanticdb-load-ebrowse-caches
(if (and (boundp mode) (eval mode))
(funcall mode -1)))))
+(defun semantic-completion-at-point-function ()
+ 'semantic-ia-complete-symbol)
+
;;; Autoload some functions that are not in semantic/loaddefs
(autoload 'global-semantic-idle-completions-mode "semantic/idle"
(when (arrayp semantic-lex-spp-project-macro-symbol-obarray)
(princ "\n Project symbol map:\n")
- (princ " Your project symbol map is derived from the EDE object:\n ")
- (princ (object-print ede-object))
+ (when (and (boundp 'ede-object) ede-object)
+ (princ " Your project symbol map is derived from the EDE object:\n ")
+ (princ (object-print ede-object)))
(princ "\n\n")
(let ((macros nil))
(mapatoms
;; Generic mode for handling basic highlighting and decorations.
;;
-(defcustom global-semantic-decoration-mode nil
- "*If non-nil, enable global use of command `semantic-decoration-mode'.
-When this mode is activated, decorations specified by
-`semantic-decoration-styles'."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/decorate/mode
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-decoration-mode (if val 1 -1))))
-
;;;###autoload
-(defun global-semantic-decoration-mode (&optional arg)
+(define-minor-mode global-semantic-decoration-mode
"Toggle global use of option `semantic-decoration-mode'.
Decoration mode turns on all active decorations as specified
-by `semantic-decoration-styles'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-decoration-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-decoration-mode arg)))
+by `semantic-decoration-styles'."
+ :global t :group 'semantic :group 'semantic-modes
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic/decorate/mode
+ (semantic-toggle-minor-mode-globally
+ 'semantic-decoration-mode (if global-semantic-decoration-mode 1 -1)))
(defcustom semantic-decoration-mode-hook nil
"Hook run at the end of function `semantic-decoration-mode'."
:group 'semantic
:type 'hook)
-;;;;###autoload
-(defvar semantic-decoration-mode nil
- "Non-nil if command `semantic-decoration-mode' is enabled.
-Use the command `semantic-decoration-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-decoration-mode)
-
-(defun semantic-decoration-mode-setup ()
- "Setup the `semantic-decoration-mode' minor mode.
-The minor mode can be turned on only if the semantic feature is available
-and the current buffer was set up for parsing. Return non-nil if the
+(define-minor-mode semantic-decoration-mode
+ "Minor mode for decorating tags.
+Decorations are specified in `semantic-decoration-styles'.
+You can define new decoration styles with
+`define-semantic-decoration-style'.
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
+;;
+;;\\{semantic-decoration-map}"
+ nil nil nil
(if semantic-decoration-mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
'semantic-decorate-tags-after-full-reparse nil t)
;; Add decorations to available tags. The above hooks ensure
;; that new tags will be decorated when they become available.
- (semantic-decorate-add-decorations (semantic-fetch-available-tags))
- )
+ (semantic-decorate-add-decorations (semantic-fetch-available-tags)))
;; Remove decorations from available tags.
(semantic-decorate-clear-decorations (semantic-fetch-available-tags))
;; Cleanup any leftover crap too.
(remove-hook 'semantic-after-partial-cache-change-hook
'semantic-decorate-tags-after-partial-reparse t)
(remove-hook 'semantic-after-toplevel-cache-change-hook
- 'semantic-decorate-tags-after-full-reparse t)
- )
- semantic-decoration-mode)
-
-(defun semantic-decoration-mode (&optional arg)
- "Minor mode for decorating tags.
-Decorations are specified in `semantic-decoration-styles'.
-You can define new decoration styles with
-`define-semantic-decoration-style'.
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled."
-;;
-;;\\{semantic-decoration-map}"
- (interactive
- (list (or current-prefix-arg
- (if semantic-decoration-mode 0 1))))
- (setq semantic-decoration-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-decoration-mode)))
- (semantic-decoration-mode-setup)
- (run-hooks 'semantic-decoration-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "decoration-mode minor mode %sabled"
- (if semantic-decoration-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-decoration-mode)
+ 'semantic-decorate-tags-after-full-reparse t)))
(semantic-add-minor-mode 'semantic-decoration-mode
- ""
- nil)
+ "")
(defun semantic-decorate-tags-after-full-reparse (tag-list)
"Add decorations after a complete reparse of the current buffer.
If POS is nil, default to point.
Completion options are calculated with `semantic-analyze-possible-completions'."
(interactive "d")
- (or pos (setq pos (point)))
- ;; Calculating completions is a two step process.
- ;;
- ;; The first analyzer the current context, which finds tags
- ;; for all the stuff that may be references by the code around
- ;; POS.
- ;;
- ;; The second step derives completions from that context.
- (let* ((a (semantic-analyze-current-context pos))
- (syms (semantic-ia-get-completions a pos))
- (pre (car (reverse (oref a prefix))))
- )
- ;; If PRE was actually an already completed symbol, it doesn't
- ;; come in as a string, but as a tag instead.
- (if (semantic-tag-p pre)
- ;; We will try completions on it anyway.
- (setq pre (semantic-tag-name pre)))
- ;; Complete this symbol.
- (if (null syms)
- (progn
- ;(message "No smart completions found. Trying senator-complete-symbol.")
+ (when (semantic-active-p)
+ (or pos (setq pos (point)))
+ ;; Calculating completions is a two step process.
+ ;;
+ ;; The first analyzer the current context, which finds tags for
+ ;; all the stuff that may be references by the code around POS.
+ ;;
+ ;; The second step derives completions from that context.
+ (let* ((a (semantic-analyze-current-context pos))
+ (syms (semantic-ia-get-completions a pos))
+ (pre (car (reverse (oref a prefix)))))
+ ;; If PRE was actually an already completed symbol, it doesn't
+ ;; come in as a string, but as a tag instead.
+ (if (semantic-tag-p pre)
+ ;; We will try completions on it anyway.
+ (setq pre (semantic-tag-name pre)))
+ ;; Complete this symbol.
+ (if (null syms)
(if (semantic-analyze-context-p a)
;; This is a clever hack. If we were unable to find any
;; smart completions, lets divert to how senator derives
;; completions.
;;
- ;; This is a way of making this fcn more useful since the
- ;; smart completion engine sometimes failes.
- (semantic-complete-symbol)))
- ;; Use try completion to seek a common substring.
- (let ((tc (try-completion (or pre "") syms)))
- (if (and (stringp tc) (not (string= tc (or pre ""))))
- (let ((tok (semantic-find-first-tag-by-name
- tc syms)))
- ;; Delete what came before...
- (when (and (car (oref a bounds)) (cdr (oref a bounds)))
- (delete-region (car (oref a bounds))
- (cdr (oref a bounds)))
- (goto-char (car (oref a bounds))))
- ;; We have some new text. Stick it in.
- (if tok
- (semantic-ia-insert-tag tok)
- (insert tc)))
- ;; We don't have new text. Show all completions.
- (when (cdr (oref a bounds))
- (goto-char (cdr (oref a bounds))))
- (with-output-to-temp-buffer "*Completions*"
- (display-completion-list
- (mapcar semantic-ia-completion-format-tag-function syms))
- ))))))
+ ;; This is a way of making this fcn more useful since
+ ;; the smart completion engine sometimes failes.
+ (semantic-complete-symbol))
+ ;; Use try completion to seek a common substring.
+ (let ((tc (try-completion (or pre "") syms)))
+ (if (and (stringp tc) (not (string= tc (or pre ""))))
+ (let ((tok (semantic-find-first-tag-by-name
+ tc syms)))
+ ;; Delete what came before...
+ (when (and (car (oref a bounds)) (cdr (oref a bounds)))
+ (delete-region (car (oref a bounds))
+ (cdr (oref a bounds)))
+ (goto-char (car (oref a bounds))))
+ ;; We have some new text. Stick it in.
+ (if tok
+ (semantic-ia-insert-tag tok)
+ (insert tc)))
+ ;; We don't have new text. Show all completions.
+ (when (cdr (oref a bounds))
+ (goto-char (cdr (oref a bounds))))
+ (with-output-to-temp-buffer "*Completions*"
+ (display-completion-list
+ (mapcar semantic-ia-completion-format-tag-function syms)))))))))
(defcustom semantic-ia-completion-menu-format-tag-function
'semantic-uml-concise-prototype-nonterminal
;; The minor mode portion of this code just sets up the minor mode
;; which does the initial scheduling of the idle timers.
;;
-;;;###autoload
-(defcustom global-semantic-idle-scheduler-mode nil
- "*If non-nil, enable global use of idle-scheduler mode."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/idle
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-idle-scheduler-mode (if val 1 -1))))
(defcustom semantic-idle-scheduler-mode-hook nil
"Hook run at the end of the function `semantic-idle-scheduler-mode'."
(or (<= semantic-idle-scheduler-max-buffer-size 0)
(< (buffer-size) semantic-idle-scheduler-max-buffer-size))))
-(defun semantic-idle-scheduler-mode-setup ()
- "Setup option `semantic-idle-scheduler-mode'.
-The minor mode can be turned on only if semantic feature is available
-and the current buffer was set up for parsing. When minor mode is
-enabled parse the current buffer if needed. Return non-nil if the
-minor mode is enabled."
- (if semantic-idle-scheduler-mode
- (if (not (and (featurep 'semantic) (semantic-active-p)))
- (progn
- ;; Disable minor mode if semantic stuff not available
- (setq semantic-idle-scheduler-mode nil)
- (error "Buffer %s was not set up idle time scheduling"
- (buffer-name)))
- (semantic-idle-scheduler-setup-timers)))
- semantic-idle-scheduler-mode)
-
;;;###autoload
-(defun semantic-idle-scheduler-mode (&optional arg)
+(define-minor-mode semantic-idle-scheduler-mode
"Minor mode to auto parse buffer following a change.
When this mode is off, a buffer is only rescanned for tokens when
some command requests the list of available tokens. When idle-scheduler
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-idle-scheduler-mode 0 1))))
- (setq semantic-idle-scheduler-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-idle-scheduler-mode)))
- (semantic-idle-scheduler-mode-setup)
- (run-hooks 'semantic-idle-scheduler-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "idle-scheduler minor mode %sabled"
- (if semantic-idle-scheduler-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-idle-scheduler-mode)
+ nil nil nil
+ (if semantic-idle-scheduler-mode
+ (if (not (and (featurep 'semantic) (semantic-active-p)))
+ (progn
+ ;; Disable minor mode if semantic stuff not available
+ (setq semantic-idle-scheduler-mode nil)
+ (error "Buffer %s was not set up idle time scheduling"
+ (buffer-name)))
+ (semantic-idle-scheduler-setup-timers))))
(semantic-add-minor-mode 'semantic-idle-scheduler-mode
- "ARP"
- nil)
+ "ARP")
\f
;;; SERVICES services
;;
(mode (intern (concat (symbol-name name) "-mode")))
(hook (intern (concat (symbol-name name) "-mode-hook")))
(map (intern (concat (symbol-name name) "-mode-map")))
- (setup (intern (concat (symbol-name name) "-mode-setup")))
(func (intern (concat (symbol-name name) "-idle-function"))))
`(eval-and-compile
- (defun ,global (&optional arg)
+ (define-minor-mode ,global
,(concat "Toggle " (symbol-name global) ".
With ARG, turn the minor mode on if ARG is positive, off otherwise.
When this minor mode is enabled, `" (symbol-name mode) "' is
turned on in every Semantic-supported buffer.")
- (interactive "P")
- (setq ,global
- (semantic-toggle-minor-mode-globally
- ',mode arg)))
-
- (defcustom ,global nil
- ,(concat "Non-nil if `" (symbol-name mode) "' is enabled.")
+ :global t
:group 'semantic
:group 'semantic-modes
- :type 'boolean
:require 'semantic/idle
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (,global (if val 1 -1))))
+ (semantic-toggle-minor-mode-globally
+ ',mode (if ,global 1 -1)))
+ ;; FIXME: Get rid of this when define-minor-mode does it for us.
(defcustom ,hook nil
,(concat "Hook run at the end of function `" (symbol-name mode) "'.")
:group 'semantic
km)
,(concat "Keymap for `" (symbol-name mode) "'."))
- (defvar ,mode nil
- ,(concat "Non-nil if the minor mode `" (symbol-name mode) "' is enabled.
-Use the command `" (symbol-name mode) "' to change this variable."))
- (make-variable-buffer-local ',mode)
-
- (defun ,setup ()
- ,(concat "Set up `" (symbol-name mode) "'.
-Return non-nil if the minor mode is enabled.")
+ (define-minor-mode ,mode
+ ,doc
+ :keymap ,map
(if ,mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
(error "Buffer %s was not set up for parsing"
(buffer-name)))
;; Enable the mode mode
- (semantic-idle-scheduler-add #',func)
- )
+ (semantic-idle-scheduler-add #',func))
;; Disable the mode mode
- (semantic-idle-scheduler-remove #',func)
- )
- ,mode)
-
- (defun ,mode (&optional arg)
- ,doc
- (interactive
- (list (or current-prefix-arg
- (if ,mode 0 1))))
- (setq ,mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not ,mode)))
- (,setup)
- (run-hooks ,hook)
- (if (called-interactively-p 'interactive)
- (message "%s %sabled"
- (symbol-name ',mode)
- (if ,mode "en" "dis")))
- (semantic-mode-line-update)
- ,mode)
+ (semantic-idle-scheduler-remove #',func)))
(semantic-add-minor-mode ',mode
- "" ; idle schedulers are quiet?
- ,map)
+ "") ; idle schedulers are quiet?
(defun ,func ()
,(concat "Perform idle activity for the minor mode `"
of the lexical token at point whenever Emacs is idle."
:group 'semantic
:group 'semantic-modes
- (semantic-idle-summary-mode-setup)
- (semantic-mode-line-update))
-
-(defun semantic-idle-summary-refresh-echo-area ()
- (and semantic-idle-summary-mode
- eldoc-last-message
- (if (and (not executing-kbd-macro)
- (not (and (boundp 'edebug-active) edebug-active))
- (not cursor-in-echo-area)
- (not (eq (selected-window) (minibuffer-window))))
- (eldoc-message eldoc-last-message)
- (setq eldoc-last-message nil))))
-
-(defun semantic-idle-summary-mode-setup ()
- "Set up `semantic-idle-summary-mode'."
(if semantic-idle-summary-mode
;; Enable the mode
(progn
(add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))
;; Disable the mode
(semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function)
- (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))
- semantic-idle-summary-mode)
+ (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)))
+
+(defun semantic-idle-summary-refresh-echo-area ()
+ (and semantic-idle-summary-mode
+ eldoc-last-message
+ (if (and (not executing-kbd-macro)
+ (not (and (boundp 'edebug-active) edebug-active))
+ (not cursor-in-echo-area)
+ (not (eq (selected-window) (minibuffer-window))))
+ (eldoc-message eldoc-last-message)
+ (setq eldoc-last-message nil))))
(semantic-add-minor-mode 'semantic-idle-summary-mode "")
\f
;;;###autoload
-(defun global-semantic-idle-scheduler-mode (&optional arg)
+(define-minor-mode global-semantic-idle-scheduler-mode
"Toggle global use of option `semantic-idle-scheduler-mode'.
The idle scheduler will automatically reparse buffers in idle time,
and then schedule other jobs setup with `semantic-idle-scheduler-add'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t
+ :group 'semantic
+ :group 'semantic-modes
;; When turning off, disable other idle modes.
- (when (or (and (numberp arg) (< arg 0))
- (and (null arg) global-semantic-idle-scheduler-mode))
+ (when (null global-semantic-idle-scheduler-mode)
(global-semantic-idle-summary-mode -1)
(global-semantic-idle-tag-highlight-mode -1)
(global-semantic-idle-completions-mode -1))
- (setq global-semantic-idle-scheduler-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-idle-scheduler-mode arg)))
+ (semantic-toggle-minor-mode-globally
+ 'semantic-idle-scheduler-mode
+ (if global-semantic-idle-scheduler-mode 1 -1)))
\f
;;; Completion Popup Mode
;;
;; Tracking minor mode.
-(defcustom global-semantic-mru-bookmark-mode nil
- "If non-nil, enable `semantic-mru-bookmark-mode' globally.
-When this mode is enabled, Emacs keeps track of which tags have
-been edited, and you can re-visit them with \\[semantic-mrub-switch-tags]."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic-util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-mru-bookmark-mode (if val 1 -1))))
-
;;;###autoload
-(defun global-semantic-mru-bookmark-mode (&optional arg)
+(define-minor-mode global-semantic-mru-bookmark-mode
"Toggle global use of option `semantic-mru-bookmark-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-mru-bookmark-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-mru-bookmark-mode arg)))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic :group 'semantic-modes
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic-util-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-mru-bookmark-mode (if global-semantic-mru-bookmark-mode 1 -1)))
(defcustom semantic-mru-bookmark-mode-hook nil
"*Hook run at the end of function `semantic-mru-bookmark-mode'."
km)
"Keymap for mru-bookmark minor mode.")
-(defvar semantic-mru-bookmark-mode nil
- "Non-nil if mru-bookmark minor mode is enabled.
-Use the command `semantic-mru-bookmark-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-mru-bookmark-mode)
+(define-minor-mode semantic-mru-bookmark-mode
+ "Minor mode for tracking tag-based bookmarks automatically.
+When this mode is enabled, Emacs keeps track of which tags have
+been edited, and you can re-visit them with \\[semantic-mrub-switch-tags].
+
+\\{semantic-mru-bookmark-mode-map}
-(defun semantic-mru-bookmark-mode-setup ()
- "Setup option `semantic-mru-bookmark-mode'.
-The minor mode can be turned on only if semantic feature is available
-and the current buffer was set up for parsing. When minor mode is
-enabled parse the current buffer if needed. Return non-nil if the
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
+ :keymap semantic-mru-bookmark-mode-map
(if semantic-mru-bookmark-mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
(add-hook 'semantic-edits-new-change-hooks
'semantic-mru-bookmark-change-hook-fcn nil t)
(add-hook 'semantic-edits-move-change-hooks
- 'semantic-mru-bookmark-change-hook-fcn nil t)
- )
+ 'semantic-mru-bookmark-change-hook-fcn nil t))
;; Remove hooks
(remove-hook 'semantic-edits-new-change-hooks
'semantic-mru-bookmark-change-hook-fcn t)
(remove-hook 'semantic-edits-move-change-hooks
- 'semantic-mru-bookmark-change-hook-fcn t)
- )
- semantic-mru-bookmark-mode)
-
-(defun semantic-mru-bookmark-mode (&optional arg)
- "Minor mode for tracking tag-based bookmarks automatically.
-When this mode is enabled, Emacs keeps track of which tags have
-been edited, and you can re-visit them with \\[semantic-mrub-switch-tags].
-
-\\{semantic-mru-bookmark-mode-map}
-
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-mru-bookmark-mode 0 1))))
- (setq semantic-mru-bookmark-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-mru-bookmark-mode)))
- (semantic-mru-bookmark-mode-setup)
- (run-hooks 'semantic-mru-bookmark-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "mru-bookmark minor mode %sabled"
- (if semantic-mru-bookmark-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-mru-bookmark-mode)
+ 'semantic-mru-bookmark-change-hook-fcn t)))
(semantic-add-minor-mode 'semantic-mru-bookmark-mode
- "k"
- semantic-mru-bookmark-mode-map)
+ "k")
;;; COMPLETING READ
;;
;;
;;; Code:
+
+;; FIXME: compiling util-modes.el seems to require loading util-modes.el,
+;; so if the previous compilation generated a file that fails to load,
+;; recompiling fails to fix the problem.
(require 'semantic)
;;; Group for all semantic enhancing modes
:set (lambda (sym val)
(set-default sym val)
;; Update status of all Semantic enabled buffers
- (semantic-map-buffers
- #'semantic-mode-line-update)))
+ (semantic-mode-line-update)))
(defcustom semantic-mode-line-prefix
(propertize "S" 'face 'bold)
:require 'semantic/util-modes
:initialize 'custom-initialize-default)
-(defvar semantic-minor-modes-status nil
- "String showing Semantic minor modes which are locally enabled.
+(defvar semantic-minor-modes-format nil
+ "Mode line format showing Semantic minor modes which are locally enabled.
It is displayed in the mode line.")
-(make-variable-buffer-local 'semantic-minor-modes-status)
+(put 'semantic-minor-modes-format 'risky-local-variable t)
(defvar semantic-minor-mode-alist nil
"Alist saying how to show Semantic minor modes in the mode line.
Like variable `minor-mode-alist'.")
(defun semantic-mode-line-update ()
- "Update display of Semantic minor modes in the mode line.
+ "Update mode line format of Semantic minor modes.
Only minor modes that are locally enabled are shown in the mode line."
- (setq semantic-minor-modes-status nil)
- (if semantic-update-mode-line
- (let ((ml semantic-minor-mode-alist)
- mm ms see)
- (while ml
- (setq mm (car ml)
- ms (cadr mm)
- mm (car mm)
- ml (cdr ml))
- (when (and (symbol-value mm)
- ;; Only show local minor mode status
- (not (memq mm semantic-init-hook)))
- (and ms
- (symbolp ms)
- (setq ms (symbol-value ms)))
- (and (stringp ms)
- (not (member ms see)) ;; Don't duplicate same status
- (setq see (cons ms see)
- ms (if (string-match "^[ ]*\\(.+\\)" ms)
- (match-string 1 ms)))
- (setq semantic-minor-modes-status
- (if semantic-minor-modes-status
- (concat semantic-minor-modes-status "/" ms)
- ms)))))
- (if semantic-minor-modes-status
- (setq semantic-minor-modes-status
- (concat
- " "
- (if (string-match "^[ ]*\\(.+\\)"
- semantic-mode-line-prefix)
- (match-string 1 semantic-mode-line-prefix)
- "S")
- "/"
- semantic-minor-modes-status))))))
+ (setq semantic-minor-modes-format nil)
+ (dolist (x semantic-minor-mode-alist)
+ (setq minor-mode-alist (delq (assq (car x) minor-mode-alist)
+ minor-mode-alist)))
+ (when semantic-update-mode-line
+ (let ((locals '()))
+ ;; Select the minor modes that aren't enabled globally and who
+ ;; have a non-empty "name".
+ (dolist (x semantic-minor-mode-alist)
+ (unless (or (memq (car x) semantic-init-hook)
+ (not (string-match "^[ ]*\\(.+\\)" (cadr x))))
+ (push (list (car x) (concat "/" (match-string 1 (cadr x)))) locals)))
+ ;; Then build the format spec.
+ (when locals
+ (let ((prefix (if (string-match "^[ ]*\\(.+\\)"
+ semantic-mode-line-prefix)
+ (match-string 1 semantic-mode-line-prefix)
+ "S")))
+ (setq semantic-minor-modes-format
+ `((:eval (if (or ,@(mapcar 'car locals))
+ ,(concat " " prefix)))))
+ ;; It would be easier to just put `locals' inside
+ ;; semantic-minor-modes-format, but then things like
+ ;; mode-line-minor-mode-help can't find the right major mode
+ ;; any more. So instead, we carefully put the minor modes
+ ;; in minor-mode-alist.
+ (let* ((elem (or (assq 'semantic-minor-modes-format
+ minor-mode-alist)
+ ;; FIXME: This entry is meaningless for
+ ;; mode-line-minor-mode-help.
+ '(semantic-minor-modes-format
+ semantic-minor-modes-format)))
+ (tail (or (memq elem minor-mode-alist)
+ (setq minor-mode-alist
+ (cons elem minor-mode-alist)))))
+ (setcdr tail (nconc locals (cdr tail)))))))))
(defun semantic-desktop-ignore-this-minor-mode (buffer)
"Installed as a minor-mode initializer for Desktop mode.
BUFFER is the buffer to not initialize a Semantic minor mode in."
nil)
-(defun semantic-add-minor-mode (toggle name &optional keymap)
+(defun semantic-add-minor-mode (toggle name)
"Register a new Semantic minor mode.
TOGGLE is a symbol which is the name of a buffer-local variable that
is toggled on or off to say whether the minor mode is active or not.
NAME specifies what will appear in the mode line when the minor mode
is active. NAME should be either a string starting with a space, or a
-symbol whose value is such a string.
-
-Optional KEYMAP is the keymap for the minor mode that will be added to
-`minor-mode-map-alist'."
- ;; Add a dymmy semantic minor mode to display the status
- (or (assq 'semantic-minor-modes-status minor-mode-alist)
- (setq minor-mode-alist (cons (list 'semantic-minor-modes-status
- 'semantic-minor-modes-status)
- minor-mode-alist)))
- (if (fboundp 'add-minor-mode)
- ;; Emacs 21 & XEmacs
- (add-minor-mode toggle "" keymap)
- ;; Emacs 20
- (or (assq toggle minor-mode-alist)
- (setq minor-mode-alist (cons (list toggle "") minor-mode-alist)))
- (or (not keymap)
- (assq toggle minor-mode-map-alist)
- (setq minor-mode-map-alist (cons (cons toggle keymap)
- minor-mode-map-alist))))
+symbol whose value is such a string."
;; Record how to display this minor mode in the mode line
(let ((mm (assq toggle semantic-minor-mode-alist)))
(if mm
(setcdr mm (list name))
(setq semantic-minor-mode-alist (cons (list toggle name)
semantic-minor-mode-alist))))
+ (semantic-mode-line-update)
;; Semantic minor modes don't work w/ Desktop restore.
;; This line will disable this minor mode from being restored
;; by Desktop.
(when (boundp 'desktop-minor-mode-handlers)
(add-to-list 'desktop-minor-mode-handlers
- (cons toggle 'semantic-desktop-ignore-this-minor-mode)))
- )
+ (cons toggle 'semantic-desktop-ignore-this-minor-mode))))
(defun semantic-toggle-minor-mode-globally (mode &optional arg)
"Toggle minor mode MODE in every Semantic enabled buffer.
Return non-nil if MODE is turned on in every Semantic enabled buffer.
-If ARG is positive, enable, if it is negative, disable. If ARG is
-nil, then toggle. Otherwise do nothing. MODE must be a valid minor
-mode defined in `minor-mode-alist' and must be too an interactive
-function used to toggle the mode."
- (or (and (fboundp mode) (assq mode minor-mode-alist))
+If ARG is positive, enable, if it is negative, disable.
+MODE must be a valid minor mode defined in `minor-mode-alist' and must be
+too an interactive function used to toggle the mode."
+ ;; FIXME: All callers should pass a -1 or +1 argument.
+ (or (and (fboundp mode) (or (assq mode minor-mode-alist) ;Needed?
+ (assq mode semantic-minor-mode-alist)))
(error "Semantic minor mode %s not found" mode))
- (if (not arg)
- (if (memq mode semantic-init-hook)
- (setq arg -1)
- (setq arg 1)))
- ;; Add or remove the MODE toggle function from
- ;; `semantic-init-hook'. Then turn MODE on or off in every
- ;; Semantic enabled buffer.
+ ;; Add or remove the MODE toggle function from `semantic-init-hook'.
(cond
;; Turn off if ARG < 0
- ((< arg 0)
- (remove-hook 'semantic-init-hook mode)
- (semantic-map-buffers #'(lambda () (funcall mode -1)))
- nil)
+ ((< arg 0) (remove-hook 'semantic-init-hook mode))
;; Turn on if ARG > 0
- ((> arg 0)
- (add-hook 'semantic-init-hook mode)
- (semantic-map-buffers #'(lambda () (funcall mode 1)))
- t)
+ ((> arg 0) (add-hook 'semantic-init-hook mode))
;; Otherwise just check MODE state
(t
- (memq mode semantic-init-hook))
- ))
+ (error "semantic-toggle-minor-mode-globally: arg should be -1 or 1")))
+ ;; Update the minor mode format.
+ (semantic-mode-line-update)
+ ;; Then turn MODE on or off in every Semantic enabled buffer.
+ (semantic-map-buffers #'(lambda () (funcall mode arg))))
\f
;;;;
;;;; Minor mode to highlight areas that a user edits.
;;;;
;;;###autoload
-(defun global-semantic-highlight-edits-mode (&optional arg)
+(define-minor-mode global-semantic-highlight-edits-mode
"Toggle global use of option `semantic-highlight-edits-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-highlight-edits-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-highlight-edits-mode arg)))
-
-;;;###autoload
-(defcustom global-semantic-highlight-edits-mode nil
- "If non-nil enable global use of variable `semantic-highlight-edits-mode'.
-When this mode is enabled, changes made to a buffer are highlighted
-until the buffer is reparsed."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-highlight-edits-mode (if val 1 -1))))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic :group 'semantic-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-highlight-edits-mode
+ (if global-semantic-highlight-edits-mode 1 -1)))
(defcustom semantic-highlight-edits-mode-hook nil
"Hook run at the end of function `semantic-highlight-edits-mode'."
km)
"Keymap for highlight-edits minor mode.")
-(defvar semantic-highlight-edits-mode nil
- "Non-nil if highlight-edits minor mode is enabled.
-Use the command `semantic-highlight-edits-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-highlight-edits-mode)
-
-(defun semantic-highlight-edits-mode-setup ()
- "Setup option `semantic-highlight-edits-mode'.
-The minor mode can be turned on only if semantic feature is available
-and the current buffer was set up for parsing. When minor mode is
-enabled parse the current buffer if needed. Return non-nil if the
+;;;###autoload
+(define-minor-mode semantic-highlight-edits-mode
+ "Minor mode for highlighting changes made in a buffer.
+Changes are tracked by semantic so that the incremental parser can work
+properly.
+This mode will highlight those changes as they are made, and clear them
+when the incremental parser accounts for those edits.
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
+ :keymap semantic-highlight-edits-mode-map
(if semantic-highlight-edits-mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
(buffer-name)))
(semantic-make-local-hook 'semantic-edits-new-change-hooks)
(add-hook 'semantic-edits-new-change-hooks
- 'semantic-highlight-edits-new-change-hook-fcn nil t)
- )
+ 'semantic-highlight-edits-new-change-hook-fcn nil t))
;; Remove hooks
(remove-hook 'semantic-edits-new-change-hooks
- 'semantic-highlight-edits-new-change-hook-fcn t)
- )
- semantic-highlight-edits-mode)
-
-;;;###autoload
-(defun semantic-highlight-edits-mode (&optional arg)
- "Minor mode for highlighting changes made in a buffer.
-Changes are tracked by semantic so that the incremental parser can work
-properly.
-This mode will highlight those changes as they are made, and clear them
-when the incremental parser accounts for those edits.
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-highlight-edits-mode 0 1))))
- (setq semantic-highlight-edits-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-highlight-edits-mode)))
- (semantic-highlight-edits-mode-setup)
- (run-hooks 'semantic-highlight-edits-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "highlight-edits minor mode %sabled"
- (if semantic-highlight-edits-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-highlight-edits-mode)
+ 'semantic-highlight-edits-new-change-hook-fcn t)))
(semantic-add-minor-mode 'semantic-highlight-edits-mode
- "e"
- semantic-highlight-edits-mode-map)
-
+ "e")
\f
;;;;
;;;; Minor mode to show unmatched-syntax elements
;;;;
;;;###autoload
-(defun global-semantic-show-unmatched-syntax-mode (&optional arg)
+(define-minor-mode global-semantic-show-unmatched-syntax-mode
"Toggle global use of option `semantic-show-unmatched-syntax-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-show-unmatched-syntax-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-show-unmatched-syntax-mode arg)))
-
-;;;###autoload
-(defcustom global-semantic-show-unmatched-syntax-mode nil
- "If non-nil, enable global use of `semantic-show-unmatched-syntax-mode'.
-When this mode is enabled, syntax in the current buffer which the
-semantic parser cannot match is highlighted with a red underline."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-show-unmatched-syntax-mode (if val 1 -1))))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic :group 'semantic-modes
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic/util-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-show-unmatched-syntax-mode
+ (if global-semantic-show-unmatched-syntax-mode 1 -1)))
(defcustom semantic-show-unmatched-syntax-mode-hook nil
"Hook run at the end of function `semantic-show-unmatched-syntax-mode'."
km)
"Keymap for command `semantic-show-unmatched-syntax-mode'.")
-(defvar semantic-show-unmatched-syntax-mode nil
- "Non-nil if show-unmatched-syntax minor mode is enabled.
-Use the command `semantic-show-unmatched-syntax-mode' to change this
-variable.")
-(make-variable-buffer-local 'semantic-show-unmatched-syntax-mode)
-
-(defun semantic-show-unmatched-syntax-mode-setup ()
- "Setup the `semantic-show-unmatched-syntax' minor mode.
-The minor mode can be turned on only if semantic feature is available
-and the current buffer was set up for parsing. When minor mode is
-enabled parse the current buffer if needed. Return non-nil if the
-minor mode is enabled."
+;;;###autoload
+(define-minor-mode semantic-show-unmatched-syntax-mode
+ "Minor mode to highlight unmatched lexical syntax tokens.
+When a parser executes, some elements in the buffer may not match any
+parser rules. These text characters are considered unmatched syntax.
+Often time, the display of unmatched syntax can expose coding
+problems before the compiler is run.
+
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
+minor mode is enabled.
+
+\\{semantic-show-unmatched-syntax-mode-map}"
+ :keymap semantic-show-unmatched-syntax-mode-map
(if semantic-show-unmatched-syntax-mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
(remove-hook 'semantic-pre-clean-token-hooks
'semantic-clean-token-of-unmatched-syntax t)
;; Cleanup unmatched-syntax highlighting
- (semantic-clean-unmatched-syntax-in-buffer))
- semantic-show-unmatched-syntax-mode)
-
-;;;###autoload
-(defun semantic-show-unmatched-syntax-mode (&optional arg)
- "Minor mode to highlight unmatched lexical syntax tokens.
-When a parser executes, some elements in the buffer may not match any
-parser rules. These text characters are considered unmatched syntax.
-Often time, the display of unmatched syntax can expose coding
-problems before the compiler is run.
-
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled.
-
-\\{semantic-show-unmatched-syntax-mode-map}"
- (interactive
- (list (or current-prefix-arg
- (if semantic-show-unmatched-syntax-mode 0 1))))
- (setq semantic-show-unmatched-syntax-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-show-unmatched-syntax-mode)))
- (semantic-show-unmatched-syntax-mode-setup)
- (run-hooks 'semantic-show-unmatched-syntax-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "show-unmatched-syntax minor mode %sabled"
- (if semantic-show-unmatched-syntax-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-show-unmatched-syntax-mode)
+ (semantic-clean-unmatched-syntax-in-buffer)))
(semantic-add-minor-mode 'semantic-show-unmatched-syntax-mode
- "u"
- semantic-show-unmatched-syntax-mode-map)
+ "u")
(defun semantic-show-unmatched-syntax-next ()
"Move forward to the next occurrence of unmatched syntax."
;;;;
;;;###autoload
-(defcustom global-semantic-show-parser-state-mode nil
- "If non-nil enable global use of `semantic-show-parser-state-mode'.
-When enabled, the current parse state of the current buffer is displayed
-in the mode line. See `semantic-show-parser-state-marker' for details
-on what is displayed."
- :group 'semantic
- :type 'boolean
- :require 'semantic/util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-show-parser-state-mode (if val 1 -1))))
-
-;;;###autoload
-(defun global-semantic-show-parser-state-mode (&optional arg)
+(define-minor-mode global-semantic-show-parser-state-mode
"Toggle global use of option `semantic-show-parser-state-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-show-parser-state-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-show-parser-state-mode arg)))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic/util-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-show-parser-state-mode
+ (if global-semantic-show-parser-state-mode 1 -1)))
(defcustom semantic-show-parser-state-mode-hook nil
"Hook run at the end of function `semantic-show-parser-state-mode'."
km)
"Keymap for show-parser-state minor mode.")
-(defvar semantic-show-parser-state-mode nil
- "Non-nil if show-parser-state minor mode is enabled.
-Use the command `semantic-show-parser-state-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-show-parser-state-mode)
-
-(defun semantic-show-parser-state-mode-setup ()
- "Setup option `semantic-show-parser-state-mode'.
-The minor mode can be turned on only if semantic feature is available
-and the current buffer was set up for parsing. When minor mode is
-enabled parse the current buffer if needed. Return non-nil if the
+;;;###autoload
+(define-minor-mode semantic-show-parser-state-mode
+ "Minor mode for displaying parser cache state in the modeline.
+The cache can be in one of three states. They are
+Up to date, Partial reparse needed, and Full reparse needed.
+The state is indicated in the modeline with the following characters:
+ `-' -> The cache is up to date.
+ `!' -> The cache requires a full update.
+ `~' -> The cache needs to be incrementally parsed.
+ `%' -> The cache is not currently parseable.
+ `@' -> Auto-parse in progress (not set here.)
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
+ :keymap semantic-show-parser-state-mode-map
(if semantic-show-parser-state-mode
(if (not (and (featurep 'semantic) (semantic-active-p)))
(progn
'semantic-show-parser-state-auto-marker nil t)
(semantic-make-local-hook 'semantic-after-idle-scheduler-reparse-hook)
(add-hook 'semantic-after-idle-scheduler-reparse-hook
- 'semantic-show-parser-state-marker nil t)
- )
+ 'semantic-show-parser-state-marker nil t))
;; Remove parts of mode line
(setq mode-line-modified
(delq 'semantic-show-parser-state-string mode-line-modified))
(remove-hook 'semantic-before-idle-scheduler-reparse-hook
'semantic-show-parser-state-auto-marker t)
(remove-hook 'semantic-after-idle-scheduler-reparse-hook
- 'semantic-show-parser-state-marker t)
- )
- semantic-show-parser-state-mode)
-
-;;;###autoload
-(defun semantic-show-parser-state-mode (&optional arg)
- "Minor mode for displaying parser cache state in the modeline.
-The cache can be in one of three states. They are
-Up to date, Partial reparse needed, and Full reparse needed.
-The state is indicated in the modeline with the following characters:
- `-' -> The cache is up to date.
- `!' -> The cache requires a full update.
- `~' -> The cache needs to be incrementally parsed.
- `%' -> The cache is not currently parseable.
- `@' -> Auto-parse in progress (not set here.)
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-show-parser-state-mode 0 1))))
- (setq semantic-show-parser-state-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-show-parser-state-mode)))
- (semantic-show-parser-state-mode-setup)
- (run-hooks 'semantic-show-parser-state-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "show-parser-state minor mode %sabled"
- (if semantic-show-parser-state-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-show-parser-state-mode)
+ 'semantic-show-parser-state-marker t)))
(semantic-add-minor-mode 'semantic-show-parser-state-mode
- ""
- semantic-show-parser-state-mode-map)
+ "")
(defvar semantic-show-parser-state-string nil
"String showing the parser state for this buffer.
(t
"-")))
;;(message "Setup mode line indicator to [%s]" semantic-show-parser-state-string)
- (semantic-mode-line-update))
+ )
(defun semantic-show-parser-state-auto-marker ()
"Hook function run before an autoparse.
to indicate a parse in progress."
(unless (semantic-parse-tree-up-to-date-p)
(setq semantic-show-parser-state-string "@")
- (semantic-mode-line-update)
;; For testing.
;;(sit-for 1)
))
;;;;
;;;###autoload
-(defun global-semantic-stickyfunc-mode (&optional arg)
+(define-minor-mode global-semantic-stickyfunc-mode
"Toggle global use of option `semantic-stickyfunc-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-stickyfunc-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-stickyfunc-mode arg)))
-
-;;;###autoload
-(defcustom global-semantic-stickyfunc-mode nil
- "If non-nil, enable global use of `semantic-stickyfunc-mode'.
-This minor mode only works for Emacs 21 or later.
-When enabled, the header line is enabled, and the first line
-of the current function or method is displayed in it.
-This makes it appear that the first line of that tag is
-`sticky' to the top of the window."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-stickyfunc-mode (if val 1 -1))))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic :group 'semantic-modes
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic/util-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-stickyfunc-mode (if global-semantic-stickyfunc-mode 1 -1)))
(defcustom semantic-stickyfunc-mode-hook nil
"Hook run at the end of function `semantic-stickyfunc-mode'."
(describe-function 'semantic-stickyfunc-mode)) t])
)
-(defvar semantic-stickyfunc-mode nil
- "Non-nil if stickyfunc minor mode is enabled.
-Use the command `semantic-stickyfunc-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-stickyfunc-mode)
-
(defcustom semantic-stickyfunc-indent-string
(if (and window-system (not (featurep 'xemacs)))
(concat
(t nil))
"The header line format used by stickyfunc mode.")
-(defun semantic-stickyfunc-mode-setup ()
- "Setup option `semantic-stickyfunc-mode'.
-For semantic enabled buffers, make the function declaration for the top most
-function \"sticky\". This is accomplished by putting the first line of
-text for that function in the header line."
+;;;###autoload
+(define-minor-mode semantic-stickyfunc-mode
+ "Minor mode to show the title of a tag in the header line.
+Enables/disables making the header line of functions sticky.
+A function (or other tag class specified by
+`semantic-stickyfunc-sticky-classes') has a header line, meaning the
+first line which describes the rest of the construct. This first
+line is what is displayed in the header line.
+
+With prefix argument ARG, turn on if positive, otherwise off. The
+minor mode can be turned on only if semantic feature is available and
+the current buffer was set up for parsing. Return non-nil if the
+minor mode is enabled."
+ ;; Don't need indicator. It's quite visible
+ :keymap semantic-stickyfunc-mode-map
(if semantic-stickyfunc-mode
(progn
(unless (and (featurep 'semantic) (semantic-active-p))
semantic-stickyfunc-header-line-format)))
(set (make-local-variable 'semantic-stickyfunc-old-hlf)
header-line-format))
- (setq header-line-format semantic-stickyfunc-header-line-format)
- )
+ (setq header-line-format semantic-stickyfunc-header-line-format))
;; Disable sticky func mode
;; Restore previous buffer local value of header line format if
;; the current one is the sticky func one.
(kill-local-variable 'header-line-format)
(when (local-variable-p 'semantic-stickyfunc-old-hlf (current-buffer))
(setq header-line-format semantic-stickyfunc-old-hlf)
- (kill-local-variable 'semantic-stickyfunc-old-hlf))))
- semantic-stickyfunc-mode)
-
-;;;###autoload
-(defun semantic-stickyfunc-mode (&optional arg)
- "Minor mode to show the title of a tag in the header line.
-Enables/disables making the header line of functions sticky.
-A function (or other tag class specified by
-`semantic-stickyfunc-sticky-classes') has a header line, meaning the
-first line which describes the rest of the construct. This first
-line is what is displayed in the header line.
-
-With prefix argument ARG, turn on if positive, otherwise off. The
-minor mode can be turned on only if semantic feature is available and
-the current buffer was set up for parsing. Return non-nil if the
-minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-stickyfunc-mode 0 1))))
- (setq semantic-stickyfunc-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-stickyfunc-mode)))
- (semantic-stickyfunc-mode-setup)
- (run-hooks 'semantic-stickyfunc-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "Stickyfunc minor mode %sabled"
- (if semantic-stickyfunc-mode "en" "dis")))
- (semantic-mode-line-update)
- semantic-stickyfunc-mode)
+ (kill-local-variable 'semantic-stickyfunc-old-hlf)))))
(defvar semantic-stickyfunc-sticky-classes
'(function type)
(semantic-add-minor-mode 'semantic-stickyfunc-mode
- "" ;; Don't need indicator. It's quite visible
- semantic-stickyfunc-mode-map)
+ "") ;; Don't need indicator. It's quite visible
\f
;; from the tag going off the top of the screen.
;;;###autoload
-(defun global-semantic-highlight-func-mode (&optional arg)
+(define-minor-mode global-semantic-highlight-func-mode
"Toggle global use of option `semantic-highlight-func-mode'.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-semantic-highlight-func-mode
- (semantic-toggle-minor-mode-globally
- 'semantic-highlight-func-mode arg)))
-
-;;;###autoload
-(defcustom global-semantic-highlight-func-mode nil
- "If non-nil, enable global use of `semantic-highlight-func-mode'.
-When enabled, the first line of the current tag is highlighted."
- :group 'semantic
- :group 'semantic-modes
- :type 'boolean
- :require 'semantic/util-modes
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-semantic-highlight-func-mode (if val 1 -1))))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'semantic :group 'semantic-modes
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'semantic/util-modes
+ (semantic-toggle-minor-mode-globally
+ 'semantic-highlight-func-mode
+ (if global-semantic-highlight-func-mode 1 -1)))
(defcustom semantic-highlight-func-mode-hook nil
"Hook run at the end of function `semantic-highlight-func-mode'."
)
(select-window startwin)))
-(defvar semantic-highlight-func-mode nil
- "Non-nil if highlight-func minor mode is enabled.
-Use the command `semantic-highlight-func-mode' to change this variable.")
-(make-variable-buffer-local 'semantic-highlight-func-mode)
-
(defvar semantic-highlight-func-ct-overlay nil
"Overlay used to highlight the tag the cursor is in.")
(make-variable-buffer-local 'semantic-highlight-func-ct-overlay)
"Face used to show the top of current function."
:group 'semantic-faces)
-
-(defun semantic-highlight-func-mode-setup ()
- "Setup option `semantic-highlight-func-mode'.
-For Semantic enabled buffers, highlight the first line of the
-current tag declaration."
- (if semantic-highlight-func-mode
- (progn
- (unless (and (featurep 'semantic) (semantic-active-p))
- ;; Disable minor mode if semantic stuff not available
- (setq semantic-highlight-func-mode nil)
- (error "Buffer %s was not set up for parsing" (buffer-name)))
- ;; Setup our hook
- (add-hook 'post-command-hook 'semantic-highlight-func-highlight-current-tag nil t)
- )
- ;; Disable highlight func mode
- (remove-hook 'post-command-hook 'semantic-highlight-func-highlight-current-tag t)
- (semantic-highlight-func-highlight-current-tag t)
- )
- semantic-highlight-func-mode)
-
;;;###autoload
-(defun semantic-highlight-func-mode (&optional arg)
+(define-minor-mode semantic-highlight-func-mode
"Minor mode to highlight the first line of the current tag.
Enables/disables making the current function's first line light up.
A function (or other tag class specified by
minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled."
- (interactive
- (list (or current-prefix-arg
- (if semantic-highlight-func-mode 0 1))))
- (setq semantic-highlight-func-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not semantic-highlight-func-mode)))
- (semantic-highlight-func-mode-setup)
- (run-hooks 'semantic-highlight-func-mode-hook)
- (if (called-interactively-p 'interactive)
- (message "Highlight-Func minor mode %sabled"
- (if semantic-highlight-func-mode "en" "dis")))
- semantic-highlight-func-mode)
+ :lighter nil ;; Don't need indicator. It's quite visible.
+ (if semantic-highlight-func-mode
+ (progn
+ (unless (and (featurep 'semantic) (semantic-active-p))
+ ;; Disable minor mode if semantic stuff not available
+ (setq semantic-highlight-func-mode nil)
+ (error "Buffer %s was not set up for parsing" (buffer-name)))
+ ;; Setup our hook
+ (add-hook 'post-command-hook
+ 'semantic-highlight-func-highlight-current-tag nil t))
+ ;; Disable highlight func mode
+ (remove-hook 'post-command-hook
+ 'semantic-highlight-func-highlight-current-tag t)
+ (semantic-highlight-func-highlight-current-tag t)))
(defun semantic-highlight-func-highlight-current-tag (&optional disable)
"Highlight the current tag under point.
nil)
(semantic-add-minor-mode 'semantic-highlight-func-mode
- "" ;; Don't need indicator. It's quite visible
- nil)
+ "") ;; Don't need indicator. It's quite visible
(provide 'semantic/util-modes)
;;; Code:
-(defcustom global-srecode-minor-mode nil
- "Non-nil in buffers with Semantic Recoder macro keybindings."
- :group 'srecode
- :type 'boolean
- :require 'srecode/mode
- :initialize 'custom-initialize-default
- :set (lambda (sym val)
- (global-srecode-minor-mode (if val 1 -1))))
-
-(defvar srecode-minor-mode nil
- "Non-nil in buffers with Semantic Recoder macro keybindings.")
-(make-variable-buffer-local 'srecode-minor-mode)
-
(defcustom srecode-minor-mode-hook nil
"Hook run at the end of the function `srecode-minor-mode'."
:group 'srecode
"Keymap for srecode minor mode.")
;;;###autoload
-(defun srecode-minor-mode (&optional arg)
+(define-minor-mode srecode-minor-mode
"Toggle srecode minor mode.
With prefix argument ARG, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
minor mode is enabled.
\\{srecode-mode-map}"
- (interactive
- (list (or current-prefix-arg
- (if srecode-minor-mode 0 1))))
- ;; Flip the bits.
- (setq srecode-minor-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
- (not srecode-minor-mode)))
+ :keymap srecode-mode-map
;; If we are turning things on, make sure we have templates for
;; this mode first.
(when srecode-minor-mode
(mapcar (lambda (map)
(srecode-map-entries-for-mode map major-mode))
(srecode-get-maps))))
- (setq srecode-minor-mode nil))
- )
- ;; Run hooks if we are turning this on.
- (when srecode-minor-mode
- (run-hooks 'srecode-minor-mode-hook))
- srecode-minor-mode)
+ (setq srecode-minor-mode nil))))
;;;###autoload
-(defun global-srecode-minor-mode (&optional arg)
+(define-minor-mode global-srecode-minor-mode
"Toggle global use of srecode minor mode.
-If ARG is positive, enable, if it is negative, disable.
-If ARG is nil, then toggle."
- (interactive "P")
- (setq global-srecode-minor-mode
- (semantic-toggle-minor-mode-globally
- 'srecode-minor-mode arg)))
+If ARG is positive or nil, enable, if it is negative, disable."
+ :global t :group 'srecode
+ ;; Not needed because it's autoloaded instead.
+ ;; :require 'srecode/mode
+ (semantic-toggle-minor-mode-globally
+ 'srecode-minor-mode (if global-srecode-minor-mode 1 -1)))
;; Use the semantic minor mode magic stuff.
-(semantic-add-minor-mode 'srecode-minor-mode "" srecode-mode-map)
+(semantic-add-minor-mode 'srecode-minor-mode "")
;;; Menu Filters
;;
:type 'integer
:group 'comint)
-;; FIXME: this should be defcustom
(defcustom comint-input-ring-size 500
"Size of the input history ring in `comint-mode'."
:type 'integer
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
;; Something called "perforce" uses "Enter password:".
(defcustom comint-password-prompt-regexp
- "\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
-Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)\
-\[Pp]assword\\( (again)\\)?\\|\
-pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
-\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'"
+ (concat
+ "^\\("
+ (regexp-opt
+ '("Enter" "Enter same" "Old" "old" "New" "new" "'s" "login"
+ "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "[sudo]" "Repeat" "Bad"))
+ " +\\)?"
+ (regexp-opt
+ '("password" "Password" "passphrase" "Passphrase"
+ "pass phrase" "Pass phrase"))
+ "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?\
+\\(?: for [^:]+\\)?:\\s *\\'")
"Regexp matching prompts for passwords in the inferior process.
This is used by `comint-watch-for-password-prompt'."
:type 'regexp
;;; Code:
+(eval-when-compile (require 'cl))
+
(defconst reference-point-alist
'((tl . 0) (tc . 1) (tr . 2)
(Bl . 3) (Bc . 4) (Br . 5)
+----+-----+ <--- new descent
A composition rule may have the form \(GLOBAL-REF-POINT
-NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specifies how much
+NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much
to shift NEW-REF-POINT from GLOBAL-REF-POINT. In this case, XOFF
and YOFF are integers in the range -100..100 representing the
shifting percentage against the font size.")
(defun compose-gstring-for-graphic (gstring)
"Compose glyph-string GSTRING for graphic display.
-Non-spacing characters are composed with the preceding base
+Combining characters are composed with the preceding base
character. If the preceding character is not a base character,
-each non-spacing character is composed as a spacing character by
+each combining character is composed as a spacing character by
a padding space before and/or after the character.
-All non-spacing characters has this function in
+All non-spacing characters have this function in
`composition-function-table' unless overwritten."
(let* ((header (lgstring-header gstring))
(nchars (lgstring-char-len gstring))
[nil 0 compose-gstring-for-graphic])))
(map-char-table
#'(lambda (key val)
- (if (= val 0)
+ (if (memq val '(Mn Mc Me))
(set-char-table-range composition-function-table key elt)))
- char-width-table))
+ unicode-category-table))
(defun compose-gstring-for-terminal (gstring)
"Compose glyph string GSTRING for terminal display.
Non-spacing characters are composed with the preceding base
character. If the preceding character is not a base character,
each non-spacing character is composed as a spacing character by
-a prepending a space before it."
+prepending a space before it."
(let* ((header (lgstring-header gstring))
(nchars (lgstring-char-len gstring))
(nglyphs (lgstring-glyph-len gstring))
(setq func 'compose-gstring-for-terminal))
(funcall func gstring))))
-(make-variable-buffer-local 'auto-composition-mode)
(put 'auto-composition-mode 'permanent-local t)
(make-variable-buffer-local 'auto-composition-function)
(setq-default auto-composition-function 'auto-compose-chars)
;;;###autoload
-(defun auto-composition-mode (&optional arg)
+(define-minor-mode auto-composition-mode
"Toggle Auto Composition mode.
With ARG, turn Auto Composition mode off if and only if ARG is a non-positive
number; if ARG is nil, toggle Auto Composition mode; anything else turns Auto
by functions registered in `composition-function-table' (which see).
You can use `global-auto-composition-mode' to turn on
-Auto Composition mode in all buffers (this is the default)."
- (interactive "P")
- (setq auto-composition-mode
- (if arg
- (or (not (integerp arg)) (> arg 0))
- (not auto-composition-mode))))
+Auto Composition mode in all buffers (this is the default).")
;;;###autoload
-(defun global-auto-composition-mode (&optional arg)
+(define-minor-mode global-auto-composition-mode
"Toggle Auto-Composition mode in every possible buffer.
With prefix arg, turn Global-Auto-Composition mode on if and only if arg
is positive.
See `auto-composition-mode' for more information on Auto-Composition mode."
- (interactive "P")
- (setq-default auto-composition-mode
- (if arg
- (or (not (integerp arg)) (> arg 0))
- (not (default-value 'auto-composition-mode)))))
+ :variable (default-value 'auto-composition-mode))
+
(defalias 'toggle-auto-composition 'auto-composition-mode)
\f
"Basic text editing facilities."
:group 'emacs)
+(defgroup convenience nil
+ "Convenience features for faster editing."
+ :group 'emacs)
+
+(defgroup files nil
+ "Support for editing files."
+ :group 'emacs)
+
+(defgroup wp nil
+ "Support for editing text files."
+ :tag "Text"
+ :group 'emacs)
+
+(defgroup data nil
+ "Support for editing binary data files."
+ :group 'emacs)
+
(defgroup abbrev nil
"Abbreviation handling, typing shortcuts, macros."
:tag "Abbreviations"
- :group 'editing)
+ :group 'convenience)
(defgroup matching nil
"Various sorts of searching and matching."
(defgroup outlines nil
"Support for hierarchical outlining."
- :group 'editing)
+ :group 'wp)
(defgroup external nil
"Interfacing to external utilities."
:group 'emacs)
+(defgroup comm nil
+ "Communications, networking, and remote access to files."
+ :tag "Communication"
+ :group 'emacs)
+
(defgroup processes nil
"Process, subshell, compilation, and job control support."
- :group 'external
- :group 'development)
-
-(defgroup convenience nil
- "Convenience features for faster editing."
- :group 'emacs)
+ :group 'external)
(defgroup programming nil
"Support for programming in other languages."
"Programming tools."
:group 'programming)
-(defgroup oop nil
- "Support for object-oriented programming."
- :group 'programming)
-
(defgroup applications nil
"Applications written in Emacs."
:group 'emacs)
"Fitting Emacs with its environment."
:group 'emacs)
-(defgroup comm nil
- "Communications, networking, remote access to files."
- :tag "Communication"
- :group 'environment)
-
(defgroup hardware nil
"Support for interfacing with miscellaneous hardware."
:group 'environment)
"Support for Emacs frames and window systems."
:group 'environment)
-(defgroup data nil
- "Support for editing files of data."
- :group 'emacs)
-
-(defgroup files nil
- "Support for editing files."
- :group 'emacs)
-
-(defgroup wp nil
- "Word processing."
- :group 'emacs)
-
(defgroup tex nil
"Code related to the TeX formatter."
:link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
"Support for multiple fonts."
:group 'emacs)
-(defgroup hypermedia nil
- "Support for links between text or other media types."
- :group 'emacs)
-
(defgroup help nil
"Support for on-line help systems."
:group 'emacs)
:group 'custom-browse)
;;;###autoload
-(defcustom custom-buffer-sort-alphabetically nil
- "If non-nil, sort each customization group alphabetically in Custom buffer."
+(defcustom custom-buffer-sort-alphabetically t
+ "Whether to sort customization groups alphabetically in Custom buffer."
:type 'boolean
- :group 'custom-buffer)
+ :group 'custom-buffer
+ :version "24.1")
(defcustom custom-buffer-order-groups 'last
"If non-nil, order group members within each customization group.
(defvar custom-commands
'(("Set for current session" Custom-set t
"Apply all settings in this buffer to the current session"
- "index")
+ "index"
+ "Apply")
("Save for future sessions" Custom-save
(or custom-file user-init-file)
"Apply all settings in this buffer and save them for future Emacs sessions."
- "save")
+ "save"
+ "Save")
("Undo edits" Custom-reset-current t
"Restore all settings in this buffer to reflect their current values."
- "refresh")
+ "refresh"
+ "Undo")
("Reset to saved" Custom-reset-saved t
"Restore all settings in this buffer to their saved values (if any)."
- "undo")
+ "undo"
+ "Reset")
("Erase customizations" Custom-reset-standard
(or custom-file user-init-file)
"Un-customize all settings in this buffer and save them with standard values."
- "delete")
+ "delete"
+ "Uncustomize")
("Help for Customize" Custom-help t
"Get help for using Customize."
- "help")
- ("Exit" Custom-buffer-done t "Exit Customize." "exit")))
+ "help"
+ "Help")
+ ("Exit" Custom-buffer-done t "Exit Customize." "exit" "Exit")))
(defun Custom-help ()
"Read the node on Easy Customization in the Emacs manual."
(unless (eq symbol basevar)
(message "`%s' is an alias for `%s'" symbol basevar))))
-(defvar customize-changed-options-previous-release "22.1"
+(defvar customize-changed-options-previous-release "23.1"
"Version for `customize-changed-options' to refer back to by default.")
;; Packages will update this variable, so make it available.
(custom-buffer-create (custom-sort-items found t nil)
"*Customize Saved*"))))
+(declare-function apropos-parse-pattern "apropos" (pattern))
+
;;;###autoload
-(defun customize-apropos (regexp &optional all)
- "Customize all loaded options, faces and groups matching REGEXP.
-If ALL is `options', include only options.
-If ALL is `faces', include only faces.
-If ALL is `groups', include only groups.
-If ALL is t (interactively, with prefix arg), include variables
+(defun customize-apropos (pattern &optional type)
+ "Customize all loaded options, faces and groups matching PATTERN.
+PATTERN can be a word, a list of words (separated by spaces),
+or a regexp (using some regexp special characters). If it is a word,
+search for matches for that word as a substring. If it is a list of words,
+search for matches for any two (or more) of those words.
+
+If TYPE is `options', include only options.
+If TYPE is `faces', include only faces.
+If TYPE is `groups', include only groups.
+If TYPE is t (interactively, with prefix arg), include variables
that are not customizable options, as well as faces and groups
\(but we recommend using `apropos-variable' instead)."
- (interactive "sCustomize (regexp): \nP")
- (let ((found nil))
- (mapatoms (lambda (symbol)
- (when (string-match regexp (symbol-name symbol))
- (when (and (not (memq all '(faces options)))
- (get symbol 'custom-group))
- (push (list symbol 'custom-group) found))
- (when (and (not (memq all '(options groups)))
- (custom-facep symbol))
- (push (list symbol 'custom-face) found))
- (when (and (not (memq all '(groups faces)))
- (boundp symbol)
- (eq (indirect-variable symbol) symbol)
- (or (get symbol 'saved-value)
- (custom-variable-p symbol)
- (and (not (memq all '(nil options)))
- (get symbol 'variable-documentation))))
- (push (list symbol 'custom-variable) found)))))
+ (interactive (list (apropos-read-pattern "symbol") current-prefix-arg))
+ (require 'apropos)
+ (apropos-parse-pattern pattern)
+ (let (found tests)
+ (mapatoms
+ `(lambda (symbol)
+ (when (string-match apropos-regexp (symbol-name symbol))
+ ,(if (not (memq type '(faces options)))
+ '(if (get symbol 'custom-group)
+ (push (list symbol 'custom-group) found)))
+ ,(if (not (memq type '(options groups)))
+ '(if (custom-facep symbol)
+ (push (list symbol 'custom-face) found)))
+ ,(if (not (memq type '(groups faces)))
+ `(if (and (boundp symbol)
+ (eq (indirect-variable symbol) symbol)
+ (or (get symbol 'saved-value)
+ (custom-variable-p symbol)
+ ,(if (not (memq type '(nil options)))
+ '(get symbol 'variable-documentation))))
+ (push (list symbol 'custom-variable) found))))))
(if (not found)
(error "No %s matching %s"
- (if (eq all t)
- "items"
- (format "customizable %s"
- (if (memq all '(options faces groups))
- (symbol-name all)
- "items")))
- regexp)
+ (if (eq type t)
+ "items"
+ (format "customizable %s"
+ (if (memq type '(options faces groups))
+ (symbol-name type)
+ "items")))
+ pattern)
(custom-buffer-create
(custom-sort-items found t custom-buffer-order-groups)
"*Customize Apropos*"))))
(defvar custom-button-pressed nil
"Face used for pressed buttons in customization buffers.")
+(defcustom custom-search-field t
+ "If non-nil, show a search field in Custom buffers."
+ :type 'boolean
+ :version "24.1"
+ :group 'custom-buffer)
+
(defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box)
'(("unspecified" . unspecified))))
"If non-nil, indicate active buttons in a `raised-button' style.
(let ((init-file (or custom-file user-init-file)))
;; Insert verbose help at the top of the custom buffer.
(when custom-buffer-verbose-help
- (widget-insert "Editing a setting changes only the text in this buffer."
- (if init-file
- "
-To apply your changes, use the Save or Set buttons.
-Saving a change normally works by editing your init file."
- "
-Currently, these settings cannot be saved for future Emacs sessions,
-possibly because you started Emacs with `-q'.")
+ (widget-insert (if init-file
+ "To apply changes, use the Save or Set buttons."
+ "Custom settings cannot be saved; maybe you started Emacs with `-q'.")
"\nFor details, see ")
(widget-create 'custom-manual
:tag "Saving Customizations"
"(emacs)Top")
(widget-insert "."))
(widget-insert "\n")
+
+ ;; Insert the search field.
+ (when custom-search-field
+ (widget-insert "\n")
+ (let* ((echo "Search for custom items")
+ (search-widget
+ (widget-create
+ 'editable-field
+ :size 40 :help-echo echo
+ :action `(lambda (widget &optional event)
+ (customize-apropos (widget-value widget))))))
+ (widget-insert " ")
+ (widget-create-child-and-convert
+ search-widget 'push-button
+ :tag "Search"
+ :help-echo echo :action
+ (lambda (widget &optional event)
+ (customize-apropos (widget-value (widget-get widget :parent)))))
+ (widget-insert "\n")))
+
;; The custom command buttons are also in the toolbar, so for a
;; time they were not inserted in the buffer if the toolbar was in use.
;; But it can be a little confusing for the buffer layout to
;; mention that a custom buffer can in theory be created in a
;; frame with a toolbar, then later viewed in one without.
;; So now the buttons are always inserted in the buffer. (Bug#1326)
-;;; (when (not (and (bound-and-true-p tool-bar-mode) (display-graphic-p)))
(if custom-buffer-verbose-help
- (widget-insert "\n
- Operate on all settings in this buffer that are not marked HIDDEN:\n"))
- (let ((button (lambda (tag action active help icon)
+ (widget-insert "
+ Operate on all settings in this buffer:\n"))
+ (let ((button (lambda (tag action active help icon label)
(widget-insert " ")
(if (eval active)
(widget-create 'push-button :tag tag
(nth 3 entry)))
(form (widget-get parent :custom-form))
children)
- (while (string-match "\\`\\(.*\\)%c\\(.*\\)\\'" text)
- (setq text (concat (match-string 1 text)
- (symbol-name category)
- (match-string 2 text))))
- (when (and custom-magic-show
- (or (not hidden)
- (memq category custom-magic-show-hidden)))
- (insert " ")
+ (unless (eq state 'hidden)
+ (while (string-match "\\`\\(.*\\)%c\\(.*\\)\\'" text)
+ (setq text (concat (match-string 1 text)
+ (symbol-name category)
+ (match-string 2 text))))
+ (when (and custom-magic-show
+ (or (not hidden)
+ (memq category custom-magic-show-hidden)))
+ (insert " ")
+ (when (and (eq category 'group)
+ (not (and (eq custom-buffer-style 'links)
+ (> (widget-get parent :custom-level) 1))))
+ (insert-char ?\ (* custom-buffer-indent
+ (widget-get parent :custom-level))))
+ (push (widget-create-child-and-convert
+ widget 'choice-item
+ :help-echo "Change the state of this item."
+ :format (if hidden "%t" "%[%t%]")
+ :button-prefix 'widget-push-button-prefix
+ :button-suffix 'widget-push-button-suffix
+ :mouse-down-action 'widget-magic-mouse-down-action
+ :tag "State")
+ children)
+ (insert ": ")
+ (let ((start (point)))
+ (if (eq custom-magic-show 'long)
+ (insert text)
+ (insert (symbol-name state)))
+ (cond ((eq form 'lisp)
+ (insert " (lisp)"))
+ ((eq form 'mismatch)
+ (insert " (mismatch)")))
+ (put-text-property start (point) 'face 'custom-state))
+ (insert "\n"))
(when (and (eq category 'group)
(not (and (eq custom-buffer-style 'links)
(> (widget-get parent :custom-level) 1))))
(insert-char ?\ (* custom-buffer-indent
(widget-get parent :custom-level))))
- (push (widget-create-child-and-convert
- widget 'choice-item
- :help-echo "Change the state of this item."
- :format (if hidden "%t" "%[%t%]")
- :button-prefix 'widget-push-button-prefix
- :button-suffix 'widget-push-button-suffix
- :mouse-down-action 'widget-magic-mouse-down-action
- :tag "State")
- children)
- (insert ": ")
- (let ((start (point)))
- (if (eq custom-magic-show 'long)
- (insert text)
- (insert (symbol-name state)))
- (cond ((eq form 'lisp)
- (insert " (lisp)"))
- ((eq form 'mismatch)
- (insert " (mismatch)")))
- (put-text-property start (point) 'face 'custom-state))
- (insert "\n"))
- (when (and (eq category 'group)
- (not (and (eq custom-buffer-style 'links)
- (> (widget-get parent :custom-level) 1))))
- (insert-char ?\ (* custom-buffer-indent
- (widget-get parent :custom-level))))
- (when custom-magic-show-button
- (when custom-magic-show
- (let ((indent (widget-get parent :indent)))
- (when indent
- (insert-char ? indent))))
- (push (widget-create-child-and-convert
- widget 'choice-item
- :mouse-down-action 'widget-magic-mouse-down-action
- :button-face face
- :button-prefix ""
- :button-suffix ""
- :help-echo "Change the state."
- :format (if hidden "%t" "%[%t%]")
- :tag (if (memq form '(lisp mismatch))
- (concat "(" magic ")")
- (concat "[" magic "]")))
- children)
- (insert " "))
- (widget-put widget :children children)))
+ (when custom-magic-show-button
+ (when custom-magic-show
+ (let ((indent (widget-get parent :indent)))
+ (when indent
+ (insert-char ? indent))))
+ (push (widget-create-child-and-convert
+ widget 'choice-item
+ :mouse-down-action 'widget-magic-mouse-down-action
+ :button-face face
+ :button-prefix ""
+ :button-suffix ""
+ :help-echo "Change the state."
+ :format (if hidden "%t" "%[%t%]")
+ :tag (if (memq form '(lisp mismatch))
+ (concat "(" magic ")")
+ (concat "[" magic "]")))
+ children)
+ (insert " "))
+ (widget-put widget :children children))))
(defun custom-magic-reset (widget)
"Redraw the :custom-magic property of WIDGET."
(defun custom-show (widget value)
"Non-nil if WIDGET should be shown with VALUE by default."
(let ((show (widget-get widget :custom-show)))
- (cond ((null show)
- nil)
- ((eq t show)
- t)
- (t
- (funcall show widget value)))))
+ (if (functionp show)
+ (funcall show widget value)
+ show)))
(defun custom-load-widget (widget)
"Load all dependencies for WIDGET."
(insert ", "))))
(widget-put widget :buttons buttons))))
-(defun custom-add-parent-links (widget &optional initial-string
- doc-initial-string)
+(defun custom-add-parent-links (widget &optional initial-string doc-initial-string)
"Add \"Parent groups: ...\" to WIDGET if the group has parents.
The value is non-nil if any parents were found.
If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
symbol)
buttons)
(setq parents (cons symbol parents)))))
- (and (null (get name 'custom-links)) ;No links of its own.
- (= (length parents) 1) ;A single parent.
- (let* ((links (delq nil (mapcar (lambda (w)
- (unless (eq (widget-type w)
- 'custom-group-link)
- w))
- (get (car parents) 'custom-links))))
- (many (> (length links) 2)))
- (when links
- (let ((pt (point))
- (left-margin (+ left-margin 2)))
- (insert "\n" (or doc-initial-string "Group documentation:") " ")
- (while links
- (push (widget-create-child-and-convert
- widget (car links)
- :button-face 'custom-link
- :mouse-face 'highlight
- :pressed-face 'highlight)
- buttons)
- (setq links (cdr links))
- (cond ((null links)
- (insert ".\n"))
- ((null (cdr links))
- (if many
- (insert ", and ")
- (insert " and ")))
- (t
- (insert ", "))))
- (fill-region-as-paragraph pt (point))
- (delete-to-left-margin (1+ pt) (+ pt 2))))))
(if parents
(insert "\n")
(delete-region start (point)))
;;; The `custom-variable' Widget.
-;; When this was underlined blue, users confused it with a
-;; Mosaic-style hyperlink...
(defface custom-variable-tag
`((((class color)
(background dark))
(documentation-property variable 'variable-documentation)))
(define-widget 'custom-variable 'custom
- "Customize variable."
+ "A widget for displaying a Custom variable.
+
+The following property has a special meaning for this widget:
+:hidden-states - A list of widget states for which the widget's initial
+ contents should be hidden."
:format "%v"
:help-echo "Set or reset this variable."
:documentation-property #'custom-variable-documentation
:custom-form nil ; defaults to value of `custom-variable-default-form'
:value-create 'custom-variable-value-create
:action 'custom-variable-action
+ :hidden-states '(standard)
:custom-set 'custom-variable-set
:custom-mark-to-save 'custom-variable-mark-to-save
:custom-reset-current 'custom-redraw
(let* ((buttons (widget-get widget :buttons))
(children (widget-get widget :children))
(form (widget-get widget :custom-form))
- (state (widget-get widget :custom-state))
(symbol (widget-get widget :value))
(tag (widget-get widget :tag))
(type (custom-variable-type symbol))
(last (widget-get widget :custom-last))
(value (if (default-boundp symbol)
(funcall get symbol)
- (widget-get conv :value))))
- ;; If the widget is new, the child determines whether it is hidden.
- (cond (state)
- ((custom-show type value)
- (setq state 'unknown))
- (t
- (setq state 'hidden)))
+ (widget-get conv :value)))
+ (state (or (widget-get widget :custom-state)
+ (if (memq (custom-variable-state symbol value)
+ (widget-get widget :hidden-states))
+ 'hidden))))
+
;; If we don't know the state, see if we need to edit it in lisp form.
+ (unless state
+ (setq state (if (custom-show type value) 'unknown 'hidden)))
(when (eq state 'unknown)
(unless (widget-apply conv :match value)
- ;; (widget-apply (widget-convert type) :match value)
(setq form 'mismatch)))
;; Now we can create the child widget.
(cond ((eq custom-buffer-style 'tree)
((eq state 'hidden)
;; Indicate hidden value.
(push (widget-create-child-and-convert
- widget 'item
- :format "%{%t%}: "
- :sample-face 'custom-variable-tag
- :tag tag
- :parent widget)
- buttons)
- (push (widget-create-child-and-convert
- widget 'visibility
+ widget 'custom-visibility
:help-echo "Show the value of this option."
+ :on-image "down"
+ :on "Hide"
+ :off-image "right"
:off "Show Value"
:action 'custom-toggle-parent
nil)
+ buttons)
+ (insert " ")
+ (push (widget-create-child-and-convert
+ widget 'item
+ :format "%{%t%} "
+ :sample-face 'custom-variable-tag
+ :tag tag
+ :parent widget)
buttons))
((memq form '(lisp mismatch))
;; In lisp mode edit the saved value when possible.
+ (push (widget-create-child-and-convert
+ widget 'custom-visibility
+ :help-echo "Hide the value of this option."
+ :on "Hide"
+ :off "Show"
+ :on-image "down"
+ :off-image "right"
+ :action 'custom-toggle-parent
+ t)
+ buttons)
+ (insert " ")
(let* ((value (cond ((get symbol 'saved-value)
(car (get symbol 'saved-value)))
((get symbol 'standard-value)
(t
(custom-quote (widget-get conv :value))))))
(insert (symbol-name symbol) ": ")
- (push (widget-create-child-and-convert
- widget 'visibility
- :help-echo "Hide the value of this option."
- :on "Hide Value"
- :off "Show Value"
- :action 'custom-toggle-parent
- t)
- buttons)
- (insert " ")
(push (widget-create-child-and-convert
widget 'sexp
:button-face 'custom-variable-button-face
children)))
(t
;; Edit mode.
+ (push (widget-create-child-and-convert
+ widget 'custom-visibility
+ :help-echo "Hide or show this option."
+ :on "Hide"
+ :off "Show"
+ :on-image "down"
+ :off-image "right"
+ :action 'custom-toggle-parent
+ t)
+ buttons)
+ (insert " ")
(let* ((format (widget-get type :format))
tag-format value-format)
(unless (string-match ":" format)
:sample-face 'custom-variable-tag
tag)
buttons)
- (insert " ")
- (push (widget-create-child-and-convert
- widget 'visibility
- :help-echo "Hide the value of this option."
- :on "Hide Value"
- :off "Show Value"
- :action 'custom-toggle-parent
- t)
- buttons)
(push (widget-create-child-and-convert
widget type
:format value-format
;; Don't push it !!! Custom assumes that the first child is the
;; value one.
(setq children (append children (list comment-widget)))))
- ;; Update the rest of the properties properties.
+ ;; Update the rest of the properties.
(widget-put widget :custom-form form)
(widget-put widget :children children)
;; Now update the state.
(apply 'widget-apply (car (widget-get (widget-get widget :parent) :children))
:mouse-down-action args))
-(defun custom-variable-state-set (widget)
- "Set the state of WIDGET."
- (let* ((symbol (widget-value widget))
- (get (or (get symbol 'custom-get) 'default-value))
+(defun custom-variable-state (symbol val)
+ "Return the state of SYMBOL if its value is VAL.
+If SYMBOL has a non-nil `custom-get' property, it overrides VAL.
+Possible return values are `standard', `saved', `set', `themed',
+`changed', and `rogue'."
+ (let* ((get (or (get symbol 'custom-get) 'default-value))
(value (if (default-boundp symbol)
(funcall get symbol)
- (widget-get widget :value)))
+ val))
(comment (get symbol 'variable-comment))
tmp
- temp
- (state (cond ((progn (setq tmp (get symbol 'customized-value))
- (setq temp
- (get symbol 'customized-variable-comment))
- (or tmp temp))
- (if (condition-case nil
- (and (equal value (eval (car tmp)))
- (equal comment temp))
- (error nil))
- 'set
- 'changed))
- ((progn (setq tmp (get symbol 'theme-value))
- (setq temp (get symbol 'saved-variable-comment))
- (or tmp temp))
- (if (condition-case nil
- (and (equal comment temp)
- (equal value
- (eval
- (car (custom-variable-theme-value
- symbol)))))
- (error nil))
- (cond
- ((eq (caar tmp) 'user) 'saved)
- ((eq (caar tmp) 'changed)
- (if (condition-case nil
- (and (null comment)
- (equal value
- (eval
- (car (get symbol 'standard-value)))))
- (error nil))
- ;; The value was originally set outside
- ;; custom, but it was set to the standard
- ;; value (probably an autoloaded defcustom).
- 'standard
- 'changed))
- (t 'themed))
- 'changed))
- ((setq tmp (get symbol 'standard-value))
- (if (condition-case nil
- (and (equal value (eval (car tmp)))
- (equal comment nil))
- (error nil))
- 'standard
- 'changed))
- (t 'rogue))))
- (widget-put widget :custom-state state)))
+ temp)
+ (cond ((progn (setq tmp (get symbol 'customized-value))
+ (setq temp
+ (get symbol 'customized-variable-comment))
+ (or tmp temp))
+ (if (condition-case nil
+ (and (equal value (eval (car tmp)))
+ (equal comment temp))
+ (error nil))
+ 'set
+ 'changed))
+ ((progn (setq tmp (get symbol 'theme-value))
+ (setq temp (get symbol 'saved-variable-comment))
+ (or tmp temp))
+ (if (condition-case nil
+ (and (equal comment temp)
+ (equal value
+ (eval
+ (car (custom-variable-theme-value
+ symbol)))))
+ (error nil))
+ (cond
+ ((eq (caar tmp) 'user) 'saved)
+ ((eq (caar tmp) 'changed)
+ (if (condition-case nil
+ (and (null comment)
+ (equal value
+ (eval
+ (car (get symbol 'standard-value)))))
+ (error nil))
+ ;; The value was originally set outside
+ ;; custom, but it was set to the standard
+ ;; value (probably an autoloaded defcustom).
+ 'standard
+ 'changed))
+ (t 'themed))
+ 'changed))
+ ((setq tmp (get symbol 'standard-value))
+ (if (condition-case nil
+ (and (equal value (eval (car tmp)))
+ (equal comment nil))
+ (error nil))
+ 'standard
+ 'changed))
+ (t 'rogue))))
+
+(defun custom-variable-state-set (widget &optional state)
+ "Set the state of WIDGET to STATE.
+If STATE is nil, the value is computed by `custom-variable-state'."
+ (widget-put widget :custom-state
+ (or state (custom-variable-state (widget-value widget)
+ (widget-get widget :value)))))
(defun custom-variable-standard-value (widget)
(get (widget-value widget) 'standard-value))
:button-face 'custom-visibility
:pressed-face 'custom-visibility
:mouse-face 'highlight
- :pressed-face 'highlight)
+ :pressed-face 'highlight
+ :on-image nil
+ :off-image nil)
(defface custom-visibility
'((t :height 0.8 :inherit link))
(insert " " tag "\n")
(widget-put widget :buttons buttons))
(t
+ ;; Visibility.
+ (push (widget-create-child-and-convert
+ widget 'custom-visibility
+ :help-echo "Hide or show this face."
+ :on "Hide"
+ :off "Show"
+ :on-image "down"
+ :off-image "right"
+ :action 'custom-toggle-parent
+ (not (eq state 'hidden)))
+ buttons)
+ (insert " ")
;; Create tag.
(insert tag)
(widget-specify-sample widget begin (point))
:sample-face symbol
:tag "sample")
buttons)
- ;; Visibility.
- (insert " ")
- (push (widget-create-child-and-convert
- widget 'visibility
- :help-echo "Hide or show this face."
- :on "Hide Face"
- :off "Show Face"
- :action 'custom-toggle-parent
- (not (eq state 'hidden)))
- buttons)
;; Magic.
(insert "\n")
(let ((magic (widget-create-child-and-convert
(insert " " tag "\n")
(widget-put widget :buttons buttons)
(message "Creating group...")
- (let* ((members (custom-sort-items members
- custom-browse-sort-alphabetically
+ (let* ((members (custom-sort-items
+ members
+ ;; Never sort the top-level custom group.
+ (unless (eq symbol 'emacs)
+ custom-browse-sort-alphabetically)
custom-browse-order-groups))
(prefixes (widget-get widget :custom-prefixes))
(custom-prefix-list (custom-prefix-add symbol prefixes))
;; Nested style.
(t ;Visible.
+ ;; Draw a horizontal line (this works for both graphical
+ ;; and text displays):
+ (let ((p (point)))
+ (insert "\n")
+ (put-text-property p (1+ p) 'face '(:underline t))
+ (overlay-put (make-overlay p (1+ p))
+ 'before-string
+ (propertize "\n" 'face '(:underline t)
+ 'display '(space :align-to 999))))
+
;; Add parent groups references above the group.
- (if t ;;; This should test that the buffer
- ;;; was made to display a group.
- (when (eq level 1)
- (if (custom-add-parent-links widget
- "Parent groups:"
- "Parent group documentation:")
- (insert "\n"))))
- ;; Create level indicator.
+ (when (eq level 1)
+ (if (custom-add-parent-links widget "Parent groups:")
+ (insert "\n")))
(insert-char ?\ (* custom-buffer-indent (1- level)))
- (insert "/- ")
;; Create tag.
(let ((start (point)))
(insert tag " group: ")
(not (eq state 'hidden)))
buttons)
(insert " "))
- ;; Create more dashes.
- ;; Use 76 instead of 75 to compensate for the temporary "<"
- ;; added by `widget-insert'.
- (insert-char ?- (- 76 (current-column)
- (* custom-buffer-indent level)))
- (insert "\\\n")
+ (insert "\n")
;; Create magic button.
(let ((magic (widget-create-child-and-convert
widget 'custom-magic
?\ ))
;; Members.
(message "Creating group...")
- (let* ((members (custom-sort-items members
- custom-buffer-sort-alphabetically
- custom-buffer-order-groups))
+ (let* ((members (custom-sort-items
+ members
+ ;; Never sort the top-level custom group.
+ (unless (eq symbol 'emacs)
+ custom-buffer-sort-alphabetically)
+ custom-buffer-order-groups))
(prefixes (widget-get widget :custom-prefixes))
(custom-prefix-list (custom-prefix-add symbol prefixes))
- (length (length members))
+ (len (length members))
(count 0)
- (children (mapcar (lambda (entry)
- (widget-insert "\n")
- (message "\
-Creating group members... %2d%%"
- (/ (* 100.0 count) length))
- (setq count (1+ count))
- (prog1
- (widget-create-child-and-convert
- widget (nth 1 entry)
- :group widget
- :tag (custom-unlispify-tag-name
- (nth 0 entry))
- :custom-prefixes custom-prefix-list
- :custom-level (1+ level)
- :value (nth 0 entry))
- (unless (eq (preceding-char) ?\n)
- (widget-insert "\n"))))
- members)))
- (message "Creating group magic...")
+ (reporter (make-progress-reporter
+ "Creating group entries..." 0 len))
+ children)
+ (setq children
+ (mapcar
+ (lambda (entry)
+ (widget-insert "\n")
+ (progress-reporter-update reporter (setq count (1+ count)))
+ (let ((sym (nth 0 entry))
+ (type (nth 1 entry))
+ hidden-p)
+ (prog1
+ (widget-create-child-and-convert
+ widget type
+ :group widget
+ :tag (custom-unlispify-tag-name sym)
+ :custom-prefixes custom-prefix-list
+ :custom-level (1+ level)
+ :value sym)
+ (unless (eq (preceding-char) ?\n)
+ (widget-insert "\n")))))
+ members))
(mapc 'custom-magic-reset children)
- (message "Creating group state...")
(widget-put widget :children children)
(custom-group-state-update widget)
- (message "Creating group... done"))
+ (progress-reporter-done reporter))
;; End line
- (insert "\n")
- (insert-char ?\ (* custom-buffer-indent (1- level)))
- (insert "\\- " (widget-get widget :tag) " group end ")
- (insert-char ?- (- 75 (current-column) (* custom-buffer-indent level)))
- (insert "/\n")))))
+ (let ((p (point)))
+ (insert "\n")
+ (put-text-property p (1+ p) 'face '(:underline t))
+ (overlay-put (make-overlay p (1+ p))
+ 'before-string
+ (propertize "\n" 'face '(:underline t)
+ 'display '(space :align-to 999))))))))
(defvar custom-group-menu
`(("Set for Current Session" custom-group-set
(mapc
(lambda (arg)
(tool-bar-local-item-from-menu
- (nth 1 arg) (nth 4 arg) map custom-mode-map))
+ (nth 1 arg) (nth 4 arg) map custom-mode-map
+ :label (nth 5 arg)))
custom-commands)
(setq custom-tool-bar-map map))))
(make-local-variable 'custom-options)
(const :tag "Off (nil)" :value nil)
(const :tag "Immediate" :value t)
(number :tag "Delay by secs" :value 0.5)) "22.1")
+ (tool-bar-style
+ frames (choice
+ (const :tag "Images" :value image)
+ (const :tag "Text" :value text)
+ (const :tag "Both" :value both)
+ (const :tag "Both-horiz" :value both-horiz)
+ (const :tag "System default" :value nil)) "23.3")
+ (tool-bar-max-label-size frames integer "23.3")
+
;; xfaces.c
(scalable-fonts-allowed display boolean "22.1")
;; xfns.c
(fboundp 'define-fringe-bitmap))
((equal "font-use-system-font" (symbol-name symbol))
(featurep 'system-font-setting))
+ ;; Conditioned on x-create-frame, because that's
+ ;; the condition for loadup.el to preload tool-bar.el.
+ ((string-match "tool-bar-" (symbol-name symbol))
+ (fboundp 'x-create-frame))
(t t))))
(if (not (boundp symbol))
;; If variables are removed from C code, give an error here!
See Info node `(elisp) Customization' in the Emacs Lisp manual
for more information."
- (declare (doc-string 3))
+ (declare (doc-string 3) (debug (name body)))
;; It is better not to use backquote in this file,
;; because that makes a bootstrapping problem
;; if you need to recompile all the Lisp files using interpreted code.
tags)))
(defvar font-lock-mode)
-(defun cvs-refontify (beg end)
- (when (and (boundp 'font-lock-mode)
- font-lock-mode
- (fboundp 'font-lock-fontify-region))
- (font-lock-fontify-region (1- beg) (1+ end))))
+;; (defun cvs-refontify (beg end)
+;; (when (and (boundp 'font-lock-mode)
+;; font-lock-mode
+;; (fboundp 'font-lock-fontify-region))
+;; (font-lock-fontify-region (1- beg) (1+ end))))
(defun cvs-status-trees ()
"Look for a lists of tags, and replace them with trees."
(when (and desktop-save-mode
(let ((exists (file-exists-p (desktop-full-file-name))))
(or (eq desktop-save t)
- (and exists (memq desktop-save '(ask-if-new if-exists)))
+ (and exists (eq desktop-save 'if-exists))
+ ;; If it exists, but we aren't using it, we are going
+ ;; to ask for a new directory below.
+ (and exists desktop-dirname (eq desktop-save 'ask-if-new))
(and
(or (memq desktop-save '(ask ask-if-new))
(and exists (eq desktop-save 'ask-if-exists)))
(set (make-local-variable 'add-log-current-defun-function)
'diff-current-defun)
(set (make-local-variable 'add-log-buffer-file-name-function)
- (lambda () (diff-find-file-name nil 'noprompt))))
+ (lambda () (diff-find-file-name nil 'noprompt)))
+ (unless (buffer-file-name)
+ (hack-dir-local-variables-non-file-buffer)))
;;;###autoload
(define-minor-mode diff-minor-mode
"Code run when the diff process exits.
CODE is the exit code of the process. It should be 0 only if no diffs
were found."
- (if diff-old-temp-file (delete-file diff-old-temp-file))
- (if diff-new-temp-file (delete-file diff-new-temp-file))
+ (if diff-old-temp-file (delete-file diff-old-temp-file t))
+ (if diff-new-temp-file (delete-file diff-new-temp-file t))
(save-excursion
(goto-char (point-max))
(let ((inhibit-read-only t))
otherwise. Enabling and disabling is buffer-local.
If enabled, \"uninteresting\" files are not listed.
Uninteresting files are those whose filenames match regexp `dired-omit-files',
-plus those ending with extensions in `dired-omit-extensions'."
+plus those ending with extensions in `dired-omit-extensions'.
+
+To enable omitting in every Dired buffer, you can put in your ~/.emacs
+
+ (add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))
+
+See Info node `(dired-x) Omitting Variables' for more information."
:group 'dired-x
(if dired-omit-mode
;; This will mention how many lines were omitted:
;;; JUMP.
;;;###autoload
-(defun dired-jump (&optional other-window)
+(defun dired-jump (&optional other-window file-name)
"Jump to dired buffer corresponding to current buffer.
If in a file, dired the current directory and move to file's line.
If in Dired already, pop up a level and goto old directory's line.
In case the proper dired file line cannot be found, refresh the dired
-buffer and try again."
- (interactive "P")
- (let* ((file buffer-file-name)
+buffer and try again.
+When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
+Interactively with prefix argument, read FILE-NAME and
+move to its line in dired."
+ (interactive
+ (list nil (and current-prefix-arg
+ (read-file-name "Jump to dired file: "))))
+ (let* ((file (or file-name buffer-file-name))
(dir (if file (file-name-directory file) default-directory)))
- (if (eq major-mode 'dired-mode)
+ (if (and (eq major-mode 'dired-mode) (null file-name))
(progn
(setq dir (dired-current-directory))
(dired-up-directory other-window)
(dired-omit-mode)
(dired-goto-file file))))))))
-(defun dired-jump-other-window ()
+(defun dired-jump-other-window (&optional file-name)
"Like \\[dired-jump] (`dired-jump') but in other window."
- (interactive)
- (dired-jump t))
+ (interactive
+ (list (and current-prefix-arg
+ (read-file-name "Jump to dired file: "))))
+ (dired-jump t file-name))
\f
;;; OMITTING.
;;;***
\f
;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
-;;;;;; "bb37ec379c0a523368794491b691fd8d")
+;;;;;; "6c492aba3ca0d36a4cd7b02fb9c1cc10")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\
If in Dired already, pop up a level and goto old directory's line.
In case the proper dired file line cannot be found, refresh the dired
buffer and try again.
+When OTHER-WINDOW is non-nil, jump to dired buffer in other window.
+Interactively with prefix argument, read FILE-NAME and
+move to its line in dired.
-\(fn &optional OTHER-WINDOW)" t nil)
+\(fn &optional OTHER-WINDOW FILE-NAME)" t nil)
(autoload 'dired-do-relsymlink "dired-x" "\
Relative symlink all marked (or next ARG) files into a directory.
:group 'dirtrack
:type 'string)
-(defcustom dirtrackp t
- "If non-nil, directory tracking via `dirtrack' is enabled."
- :group 'dirtrack
- :type 'boolean)
-
-(make-variable-buffer-local 'dirtrackp)
-
(defcustom dirtrack-directory-function
(if (memq system-type (list 'ms-dos 'windows-nt 'cygwin))
'dirtrack-windows-directory-function
(declare-function int86 "dosfns.c")
(declare-function msdos-long-file-names "msdos.c")
-;; This overrides a trivial definition in files.el.
-(defun convert-standard-filename (filename)
- "Convert a standard file's name to something suitable for the current OS.
+;; See convert-standard-filename in files.el.
+(defun dos-convert-standard-filename (filename)
+ "Convert a standard file's name to something suitable for MS-DOS.
This means to guarantee valid names and perhaps to canonicalize
certain patterns.
+This function is called by `convert-standard-filename'.
+
On Windows and DOS, replace invalid characters. On DOS, make
-sure to obey the 8.3 limitations. On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+sure to obey the 8.3 limitations."
(if (or (not (stringp filename))
;; This catches the case where FILENAME is "x:" or "x:/" or
;; "/", thus preventing infinite recursion.
(let ((flen (length filename)))
;; If FILENAME has a trailing slash, remove it and recurse.
(if (memq (aref filename (1- flen)) '(?/ ?\\))
- (concat (convert-standard-filename
+ (concat (dos-convert-standard-filename
(substring filename 0 (1- flen)))
"/")
(let* (;; ange-ftp gets in the way for names like "/foo:bar".
(aset string (1- (length string)) lastchar))))
(concat (if (and (stringp dir)
(memq (aref dir dlen-m-1) '(?/ ?\\)))
- (concat (convert-standard-filename
+ (concat (dos-convert-standard-filename
(substring dir 0 dlen-m-1))
"/")
- (convert-standard-filename dir))
+ (dos-convert-standard-filename dir))
string))))))
(defun dos-8+3-filename (filename)
;; This is for the sake of standard file names elsewhere in Emacs that
;; are defined as constant strings or via defconst, and whose
-;; conversion via `convert-standard-filename' does not give good
+;; conversion via `dos-convert-standard-filename' does not give good
;; enough results.
(defun dosified-file-name (file-name)
"Return a variant of FILE-NAME that is valid on MS-DOS filesystems.
-This function is for those rare cases where `convert-standard-filename'
+This function is for those rare cases where `dos-convert-standard-filename'
does not do a job that is good enough, e.g. if you need to preserve the
file-name extension. It recognizes only certain specific file names
that are used in Emacs Lisp sources; any other file name will be
(defvar msdos-shells)
;; Override settings chosen at startup.
-(defun set-default-process-coding-system ()
+(defun dos-set-default-process-coding-system ()
(setq default-process-coding-system
(if (default-value 'enable-multibyte-characters)
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos))))
-(add-hook 'before-init-hook 'set-default-process-coding-system)
+(add-hook 'before-init-hook 'dos-set-default-process-coding-system)
;; File names defined in preloaded packages can be incorrect or
;; invalid if long file names were available during dumping, but not
(add-hook 'before-init-hook 'dos-reevaluate-defcustoms)
-(defvar register-name-alist
+(defvar dos-register-name-alist
'((ax . 0) (bx . 1) (cx . 2) (dx . 3) (si . 4) (di . 5)
(cflag . 6) (flags . 7)
(al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0))
(ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1))))
-(defun make-register ()
+(define-obsolete-variable-alias
+ 'register-name-alist 'dos-register-name-alist "24.1")
+
+(defun dos-make-register ()
(make-vector 8 0))
-(defun register-value (regs name)
- (let ((where (cdr (assoc name register-name-alist))))
+(define-obsolete-function-alias 'make-register 'dos-make-register "24.1")
+
+(defun dos-register-value (regs name)
+ (let ((where (cdr (assoc name dos-register-name-alist))))
(cond ((consp where)
(let ((tem (aref regs (car where))))
(if (zerop (cdr where))
(aref regs where))
(t nil))))
-(defun set-register-value (regs name value)
+(define-obsolete-function-alias 'register-value 'dos-register-value "24.1")
+
+(defun dos-set-register-value (regs name value)
(and (numberp value)
(>= value 0)
- (let ((where (cdr (assoc name register-name-alist))))
+ (let ((where (cdr (assoc name dos-register-name-alist))))
(cond ((consp where)
(let ((tem (aref regs (car where)))
(value (logand value 255)))
(aset regs where (logand value 65535))))))
regs)
-(defsubst intdos (regs)
+(define-obsolete-function-alias
+ 'set-register-value 'dos-set-register-value "24.1")
+
+(defsubst dos-intdos (regs)
+ "Issue the DOS Int 21h with registers REGS.
+
+REGS should be a vector produced by `dos-make-register'
+and `dos-set-register-value', which see."
(int86 33 regs))
+(define-obsolete-function-alias 'intdos 'dos-intdos "24.1")
+
;; Backward compatibility for obsolescent functions which
;; set screen size.
-(defun mode25 ()
+(defun dos-mode25 ()
"Changes the number of screen rows to 25."
(interactive)
(set-frame-size (selected-frame) 80 25))
-(defun mode4350 ()
+(define-obsolete-function-alias 'mode25 'dos-mode25 "24.1")
+
+(defun dos-mode4350 ()
"Changes the number of rows to 43 or 50.
Emacs always tries to set the screen height to 50 rows first.
If this fails, it will try to set it to 43 rows, on the assumption
nil ; the original built-in function returned nil
(set-frame-size (selected-frame) 80 43)))
+(define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1")
+
(provide 'dos-fns)
;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad
-;;; font-setting.el --- Support dynamic font changes
+;;; dynamic-setting.el --- Support dynamic changes
;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
;; Author: Jan Djärv <jan.h.d@swipnet.se>
;; Maintainer: FSF
-;; Keywords: font, system-font
+;; Keywords: font, system-font, tool-bar-style
;; This file is part of GNU Emacs.
(custom-push-theme 'theme-face 'default 'user 'set spec)
(put 'default 'face-modified nil))))))
-(defun font-setting-handle-config-changed-event (event)
- "Handle config-changed-event to change fonts on the display in EVENT.
-If `font-use-system-font' is nil, the font is not changed."
+(defun dynamic-setting-handle-config-changed-event (event)
+ "Handle config-changed-event on the display in EVENT.
+Changes can be
+ The monospace font. If `font-use-system-font' is nil, the font
+ is not changed.
+ Xft parameters, like DPI and hinting.
+ The tool bar style."
(interactive "e")
- (let ((type (nth 1 event)) ;; font-name or font-render
+ (let ((type (nth 1 event))
(display-name (nth 2 event)))
- (if (or (not (eq type 'font-name))
- font-use-system-font)
- (font-setting-change-default-font display-name
- (eq type 'font-name)))))
+ (cond ((and (eq type 'monospace-font-name) font-use-system-font)
+ (font-setting-change-default-font display-name t))
-(if (or (featurep 'system-font-setting) (featurep 'font-render-setting))
- (define-key special-event-map [config-changed-event]
- 'font-setting-handle-config-changed-event))
+ ((eq type 'font-render)
+ (font-setting-change-default-font display-name nil))
-(provide 'font-setting)
+ ((eq type 'tool-bar-style) (force-mode-line-update t)))))
+
+(define-key special-event-map [config-changed-event]
+ 'dynamic-setting-handle-config-changed-event)
;; arch-tag: 3a57e78f-1cd6-48b6-ab75-98f160dcc017
(cons first last))))))
(set-buffer buffer)
(Buffer-menu-mode)
- (bury-buffer buffer)
+ (bury-buffer) ;Get rid of window, if dedicated.
(message "")))
(if select
(progn (set-buffer buffer)
map)
"Keymap defining commands available in `electric-help-mode'.")
+(defvar electric-help-orig-major-mode nil)
+(make-variable-buffer-local 'electric-help-orig-major-mode)
+
(defun electric-help-mode ()
"`with-electric-help' temporarily places its buffer in this mode.
-\(On exit from `with-electric-help', the buffer is put in default `major-mode'.)"
+\(On exit from `with-electric-help', the original `major-mode' is restored.)"
(setq buffer-read-only t)
+ (setq electric-help-orig-major-mode major-mode)
(setq mode-name "Help")
(setq major-mode 'help)
(setq mode-line-buffer-identification '(" Help: %b"))
When the user exits (with `electric-help-exit', or otherwise), the help
buffer's window disappears (i.e., we use `save-window-excursion'), and
-BUFFER is put into default `major-mode' (or `fundamental-mode')."
+BUFFER is put back into its original major mode."
(setq buffer (get-buffer-create (or buffer "*Help*")))
(let ((one (one-window-p t))
(config (current-window-configuration))
(set-buffer buffer)
(setq buffer-read-only nil)
+ ;; Restore the original major mode saved by `electric-help-mode'.
;; We should really get a usable *Help* buffer when retaining
;; the electric one with `r'. The problem is that a simple
- ;; call to help-mode won't cut it; at least RET is bound wrong
- ;; afterwards. It's also not clear that `help-mode' is always
- ;; the right thing, maybe we should add an optional parameter.
+ ;; call to `help-mode' won't cut it; e.g. RET is bound wrong
+ ;; afterwards (`View-scroll-line-forward' instead of `help-follow').
+ ;; That's because Help mode should be set with `with-help-window'
+ ;; instead of the direct call to `help-mode'. But at least
+ ;; RET works correctly on links after using `help-mode'.
+ ;; This is satisfactory enough.
(condition-case ()
- (funcall (or (default-value 'major-mode) 'fundamental-mode))
+ (funcall (or electric-help-orig-major-mode 'fundamental-mode))
(error nil))
(set-window-configuration config)
(err nil)
(prompt-string prompt))
(while t
- (if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
+ (if (functionp prompt)
(setq prompt-string (funcall prompt)))
(if (not (stringp prompt-string))
- (if (eq prompt-string 'noprompt)
- (setq prompt-string nil)
- (setq prompt-string "->")))
+ (setq prompt-string (unless (eq prompt-string 'noprompt) "->")))
(setq cmd (read-key-sequence prompt-string))
(setq last-command-event (aref cmd (1- (length cmd)))
this-command (key-binding cmd t)
'("vc-\\*\\.el$"
"spec.txt$"
".*loaddefs.el$" ; not obsolete, but auto-generated
+ "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting
+ "\\.arch-inventory$"
+ "preferences\\.\\(nib\\|gorm\\)"
"vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$")
"List of regexps matching obsolete files.
Changes to files matching one of the regexps in this list are not
"Imakefile" "icons/sink.ico" "aixcc.lex"
"nxml/char-name/unicode"
"js2-mode.el" ; only installed very briefly, replaced by js.el
+ "cedet/tests/testtemplates.cpp"
+ "cedet/tests/testusing.cpp"
+ "cedet/tests/scopetest.cpp"
+ "cedet/tests/scopetest.java"
+ "cedet/tests/test.cpp"
+ "cedet/tests/test.py"
+ "cedet/tests/teststruct.cpp"
+ "*.el"
;; Autogen:
"cus-load.el" "finder-inf.el" "ldefs-boot.el"
;; Never had any meaningful changes logged, now deleted:
"List of files and directories to ignore.
Changes to files in this list are not listed.")
+;; List via: find . -name '*.el' | sed 's/.*\///g' | sort | uniq -d
+;; FIXME It would be better to discover these dynamically.
+;; Note that traditionally "Makefile.in" etc have not been in this list.
+;; Ditto for "abbrev.texi" etc.
+(defconst authors-ambiguous-files
+ '("chart.el"
+ "compile.el"
+ "complete.el"
+ "cpp.el"
+ "ctxt.el"
+ "debug.el"
+ "dired.el"
+ "el.el"
+ "files.el"
+ "find.el"
+ "format.el"
+ "grep.el"
+ "imenu.el"
+ "java.el"
+ "linux.el"
+ "locate.el"
+ "make.el"
+ "mode.el"
+ "python.el"
+ "semantic.el"
+ "shell.el"
+ "simple.el"
+ "sort.el"
+ "speedbar.el"
+ "srecode.el"
+ "table.el"
+ "texi.el"
+ "util.el"
+ "wisent.el")
+ "List of basenames occurring more than once in the source.")
+
;; FIXME :cowrote entries here can be overwritten by :wrote entries
;; derived from a file's Author: header (eg mh-e). This really means
;; the Author: header is erroneous.
("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
"w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
+ ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]")
;; Not using this version any more.
;;; ("Pace Willisson" :wrote "ispell.el")
;; FIXME overwritten by Author:.
"emacs16_mac.png" "emacs24_mac.png"
"emacs256_mac.png" "emacs32_mac.png"
"emacs48_mac.png" "emacs512_mac.png"
+ "revdiff" ; admin/
+ "mainmake" "sed1.inp" "sed2.inp" "sed3.inp" ; msdos/
+ "mac-fix-env.m"
;; Deleted vms stuff:
"temacs.opt" "descrip.mms" "compile.com" "link.com"
)
- "File names which are valid, but no longer exist (or cannot be
-found) in the repository.")
+ "File names which are valid, but no longer exist (or cannot be found)
+in the repository.")
(defconst authors-renamed-files-alist
'(("nt.c" . "w32.c") ("nt.h" . "w32.h")
;; index and pick merged into search.
("mh-index.el" . "mh-search.el")
("mh-pick.el" . "mh-search.el")
+ ("font-setting.el" . "dynamic-setting.el")
;; INSTALL-CVS -> .CVS -> .BZR
("INSTALL-CVS" . "INSTALL.BZR")
("INSTALL.CVS" . "INSTALL.BZR")
("schema/docbook-dyntbl.rnc" . "schema/docbk-dyntbl.rnc")
("schema/docbook-soextbl.rnc" . "schema/docbk-soextbl.rn" )
("texi/url.txi" . "url.texi")
+ ("edt-user.doc" . "edt.texi")
;; Moved to different directories.
("ctags.1" . "ctags.1")
("etags.1" . "etags.1")
(defvar authors-checked-files-alist)
(defvar authors-invalid-file-names)
+(defun authors-disambiguate-file-name (fullname)
+ "Convert FULLNAME to an unambiguous relative-name."
+ (let ((relname (file-name-nondirectory fullname))
+ parent)
+ (if (member relname authors-ambiguous-files)
+ ;; In case of ambiguity, just prepend the parent directory.
+ ;; FIXME obviously this is not a perfect solution.
+ (if (string-equal "lisp"
+ (setq parent (file-name-nondirectory
+ (directory-file-name
+ (file-name-directory fullname)))))
+ relname
+ (format "%s/%s" parent relname))
+ relname)))
+
(defun authors-canonical-file-name (file log-file pos author)
"Return canonical file name for FILE found in LOG-FILE.
Checks whether FILE is a valid (existing) file name, has been renamed,
-or is on the list of removed files. Returns the non-diretory part of
+or is on the list of removed files. Returns the non-directory part of
the file name. Only uses the LOG-FILE position POS and associated AUTHOR
to print a message if FILE is not found."
;; FILE should be re-checked in every different directory associated
(file-exists-p file)
(file-exists-p relname)
(file-exists-p (concat "etc/" relname)))
- (setq valid relname)
+ (setq valid (authors-disambiguate-file-name fullname))
(setq valid (assoc file authors-renamed-files-alist))
(if valid
(setq valid (cdr valid))
(cons (cons fullname valid) authors-checked-files-alist))
(unless (or valid
(member file authors-ignored-files)
+ (authors-obsolete-file-p file)
(string-match "[*]" file)
(string-match "^[0-9.]+$" file))
(setq authors-invalid-file-names
(enable-local-variables :safe) ; for find-file, hence let*
(enable-local-eval nil)
(buffer (find-file-noselect file)))
- (setq file (file-name-nondirectory file))
+ (setq file (authors-disambiguate-file-name (expand-file-name file)))
(with-current-buffer buffer
(save-restriction
(widen)
;; autoload.el --- maintain autoloads in loaddefs.el
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.org>
;; Keywords: maint
TYPE (default \"autoloads\") is a string stating the type of
information contained in FILE. If FEATURE is non-nil, FILE
will provide a feature. FEATURE may be a string naming the
-feature, otherwise it will be based on FILE's name."
+feature, otherwise it will be based on FILE's name.
+
+At present, a feature is in fact always provided, but this should
+not be relied upon."
(let ((basename (file-name-nondirectory file)))
(concat ";;; " basename
" --- automatically extracted " (or type "autoloads") "\n"
";;\n"
";;; Code:\n\n"
"\f\n"
- ;; This is used outside of autoload.el.
+ ;; This is used outside of autoload.el, eg cus-dep, finder.
"(provide '"
(if (stringp feature)
feature
"File local variable to prevent scanning this file for autoload cookies.")
(defun autoload-file-load-name (file)
- (let ((name (file-name-nondirectory file)))
+ "Compute the name that will be used to load FILE."
+ ;; OUTFILE should be the name of the global loaddefs.el file, which
+ ;; is expected to be at the root directory of the files we're
+ ;; scanning for autoloads and will be in the `load-path'.
+ (let* ((outfile (default-value 'generated-autoload-file))
+ (name (file-relative-name file (file-name-directory outfile)))
+ (names '())
+ (dir (file-name-directory outfile)))
+ ;; If `name' has directory components, only keep the
+ ;; last few that are really needed.
+ (while name
+ (setq name (directory-file-name name))
+ (push (file-name-nondirectory name) names)
+ (setq name (file-name-directory name)))
+ (while (not name)
+ (cond
+ ((null (cdr names)) (setq name (car names)))
+ ((file-exists-p (expand-file-name "subdirs.el" dir))
+ ;; FIXME: here we only check the existence of subdirs.el,
+ ;; without checking its content. This makes it generate wrong load
+ ;; names for cases like lisp/term which is not added to load-path.
+ (setq dir (expand-file-name (pop names) dir)))
+ (t (setq name (mapconcat 'identity names "/")))))
(if (string-match "\\.elc?\\(\\.\\|\\'\\)" name)
(substring name 0 (match-beginning 0))
name)))
(interactive "fGenerate autoloads for file: ")
(autoload-generate-file-autoloads file (current-buffer)))
+(defvar print-readably)
+
;; When called from `generate-file-autoloads' we should ignore
;; `generated-autoload-file' altogether. When called from
;; `update-file-autoloads' we don't know `outbuf'. And when called from
(visited (get-file-buffer file))
(otherbuf nil)
(absfile (expand-file-name file))
- relfile
;; nil until we found a cookie.
- output-start)
+ output-start ostart)
(with-current-buffer (or visited
;; It is faster to avoid visiting the file.
(autoload-find-file file))
(setq load-name
(if (stringp generated-autoload-load-name)
generated-autoload-load-name
- (autoload-file-load-name file)))
+ (autoload-file-load-name absfile)))
+ (when (and outfile
+ (not (equal outfile (autoload-generated-file))))
+ (setq otherbuf t))
(save-excursion
(save-restriction
(widen)
((looking-at (regexp-quote generate-autoload-cookie))
;; If not done yet, figure out where to insert this text.
(unless output-start
- (when (and outfile
- (not (equal outfile (autoload-generated-file))))
- ;; A file-local setting of autoload-generated-file says
- ;; we should ignore OUTBUF.
- (setq outbuf nil)
- (setq otherbuf t))
- (unless outbuf
- (setq outbuf (autoload-find-destination absfile))
- (unless outbuf
- ;; The file has autoload cookies, but they're
- ;; already up-to-date. If OUTFILE is nil, the
- ;; entries are in the expected OUTBUF, otherwise
- ;; they're elsewhere.
- (throw 'done outfile)))
- (with-current-buffer outbuf
- (setq relfile (file-relative-name absfile))
- (setq output-start (point)))
- ;; (message "file=%S, relfile=%S, dest=%S"
- ;; file relfile (autoload-generated-file))
- )
+ (let ((outbuf
+ (or (if otherbuf
+ ;; A file-local setting of
+ ;; autoload-generated-file says we
+ ;; should ignore OUTBUF.
+ nil
+ outbuf)
+ (autoload-find-destination absfile load-name)
+ ;; The file has autoload cookies, but they're
+ ;; already up-to-date. If OUTFILE is nil, the
+ ;; entries are in the expected OUTBUF,
+ ;; otherwise they're elsewhere.
+ (throw 'done otherbuf))))
+ (with-current-buffer outbuf
+ (setq output-start (point-marker)
+ ostart (point)))))
(search-forward generate-autoload-cookie)
(skip-chars-forward " \t")
(if (eolp)
(if autoload
(push (nth 1 form) autoloads-done)
(setq autoload form))
- (let ((autoload-print-form-outbuf outbuf))
+ (let ((autoload-print-form-outbuf
+ (marker-buffer output-start)))
(autoload-print-form autoload)))
(error
(message "Error in %s: %S" file err)))
(forward-char 1))
(point))
(progn (forward-line 1) (point)))
- outbuf)))
+ (marker-buffer output-start))))
((looking-at ";")
;; Don't read the comment.
(forward-line 1))
(let ((secondary-autoloads-file-buf
(if (local-variable-p 'generated-autoload-file)
(current-buffer))))
- (with-current-buffer outbuf
+ (with-current-buffer (marker-buffer output-start)
(save-excursion
;; Insert the section-header line which lists the file name
;; and which functions are in it, etc.
+ (assert (= ostart output-start))
(goto-char output-start)
- (autoload-insert-section-header
- outbuf autoloads-done load-name relfile
- (if secondary-autoloads-file-buf
- ;; MD5 checksums are much better because they do not
- ;; change unless the file changes (so they'll be
- ;; equal on two different systems and will change
- ;; less often than time-stamps, thus leading to fewer
- ;; unneeded changes causing spurious conflicts), but
- ;; using time-stamps is a very useful optimization,
- ;; so we use time-stamps for the main autoloads file
- ;; (loaddefs.el) where we have special ways to
- ;; circumvent the "random change problem", and MD5
- ;; checksum in secondary autoload files where we do
- ;; not need the time-stamp optimization because it is
- ;; already provided by the primary autoloads file.
- (md5 secondary-autoloads-file-buf
- ;; We'd really want to just use
- ;; `emacs-internal' instead.
- nil nil 'emacs-mule-unix)
- (nth 5 (file-attributes relfile))))
- (insert ";;; Generated autoloads from " relfile "\n"))
+ (let ((relfile (file-relative-name absfile)))
+ (autoload-insert-section-header
+ (marker-buffer output-start)
+ autoloads-done load-name relfile
+ (if secondary-autoloads-file-buf
+ ;; MD5 checksums are much better because they do not
+ ;; change unless the file changes (so they'll be
+ ;; equal on two different systems and will change
+ ;; less often than time-stamps, thus leading to fewer
+ ;; unneeded changes causing spurious conflicts), but
+ ;; using time-stamps is a very useful optimization,
+ ;; so we use time-stamps for the main autoloads file
+ ;; (loaddefs.el) where we have special ways to
+ ;; circumvent the "random change problem", and MD5
+ ;; checksum in secondary autoload files where we do
+ ;; not need the time-stamp optimization because it is
+ ;; already provided by the primary autoloads file.
+ (md5 secondary-autoloads-file-buf
+ ;; We'd really want to just use
+ ;; `emacs-internal' instead.
+ nil nil 'emacs-mule-unix)
+ (nth 5 (file-attributes relfile))))
+ (insert ";;; Generated autoloads from " relfile "\n")))
(insert generate-autoload-section-trailer))))
(message "Generating autoloads for %s...done" file))
(or visited
;; We created this buffer, so we should kill it.
(kill-buffer (current-buffer))))
- ;; If the entries were added to some other buffer, then the file
- ;; doesn't add entries to OUTFILE.
- (or (not output-start) otherbuf))))
+ (or (not output-start)
+ ;; If the entries were added to some other buffer, then the file
+ ;; doesn't add entries to OUTFILE.
+ otherbuf))))
\f
(defun autoload-save-buffers ()
(while autoload-modified-buffers
(message "Autoload section for %s is up to date." file)))
(if no-autoloads file)))
-(defun autoload-find-destination (file)
+(defun autoload-find-destination (file load-name)
"Find the destination point of the current buffer's autoloads.
FILE is the file name of the current buffer.
Returns a buffer whose point is placed at the requested location.
Returns nil if the file's autoloads are uptodate, otherwise
removes any prior now out-of-date autoload entries."
(catch 'up-to-date
- (let* ((load-name (autoload-file-load-name file))
- (buf (current-buffer))
+ (let* ((buf (current-buffer))
(existing-buffer (if buffer-file-name buf))
(found nil))
(with-current-buffer
(unless (zerop (coding-system-eol-type buffer-file-coding-system))
(set-buffer-file-coding-system 'unix))
(or (> (buffer-size) 0)
- (error "Autoloads file %s does not exist" buffer-file-name))
+ (error "Autoloads file %s lacks boilerplate" buffer-file-name))
(or (file-writable-p buffer-file-name)
(error "Autoloads file %s is not writable" buffer-file-name))
(widen)
(t
(autoload-remove-section (match-beginning 0))
(if (autoload-generate-file-autoloads
+ ;; Passing `current-buffer' makes it insert at point.
file (current-buffer) buffer-file-name)
(push file no-autoloads))))
(push file done)
(dolist (file files)
(cond
((member (expand-file-name file) autoload-excludes) nil)
+ ;; Passing nil as second argument forces
+ ;; autoload-generate-file-autoloads to look for the right
+ ;; spot where to insert each autoloads section.
((autoload-generate-file-autoloads file nil buffer-file-name)
(push file no-autoloads))))
(setq for-effect nil)))
(defun byte-compile-setq-default (form)
- (let ((bytecomp-args (cdr form))
- setters)
- (while bytecomp-args
- (let ((var (car bytecomp-args)))
- (and (or (not (symbolp var))
- (byte-compile-const-symbol-p var t))
- (byte-compile-warning-enabled-p 'constants)
- (byte-compile-warn
- "variable assignment to %s `%s'"
- (if (symbolp var) "constant" "nonvariable")
- (prin1-to-string var)))
- (push (list 'set-default (list 'quote var) (car (cdr bytecomp-args)))
- setters))
- (setq bytecomp-args (cdr (cdr bytecomp-args))))
- (byte-compile-form (cons 'progn (nreverse setters)))))
+ (setq form (cdr form))
+ (if (> (length form) 2)
+ (let ((setters ()))
+ (while (consp form)
+ (push `(setq-default ,(pop form) ,(pop form)) setters))
+ (byte-compile-form (cons 'progn (nreverse setters))))
+ (let ((var (car form)))
+ (and (or (not (symbolp var))
+ (byte-compile-const-symbol-p var t))
+ (byte-compile-warning-enabled-p 'constants)
+ (byte-compile-warn
+ "variable assignment to %s `%s'"
+ (if (symbolp var) "constant" "nonvariable")
+ (prin1-to-string var)))
+ (byte-compile-normal-call `(set-default ',var ,@(cdr form))))))
+
+(byte-defop-compiler-1 set-default)
+(defun byte-compile-set-default (form)
+ (let ((varexp (car-safe (cdr-safe form))))
+ (if (eq (car-safe varexp) 'quote)
+ ;; If the varexp is constant, compile it as a setq-default
+ ;; so we get more warnings.
+ (byte-compile-setq-default `(setq-default ,(car-safe (cdr varexp))
+ ,@(cddr form)))
+ (byte-compile-normal-call form))))
(defun byte-compile-quote (form)
(byte-compile-constant (car (cdr form))))
;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
;;;;;; do* do loop return-from return block etypecase typecase ecase
;;;;;; case load-time-value eval-when destructuring-bind function*
-;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "273ba25f4a116c61a464dbe55f1f8c63")
+;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "fbeedbf769c72fee9b4e0671957c1077")
;;; Generated autoloads from cl-macs.el
(autoload 'gensym "cl-macs" "\
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
+;; coding: utf-8
;; End:
-
-;; arch-tag: 08cc5aab-e992-47f6-992e-12a7428c1a0e
;;; cl-loaddefs.el ends here
(and (eq (cl-const-expr-p x) t) (if (consp x) (nth 1 x) x)))
(defun cl-expr-access-order (x v)
+ ;; This apparently tries to return nil iff the expression X evaluates
+ ;; the variables V in the same order as they appear in V (so as to
+ ;; be able to replace those vars with the expressions they're bound
+ ;; to).
+ ;; FIXME: This is very naive, it doesn't even check to see if those
+ ;; variables appear more than once.
(if (cl-const-expr-p x) v
(if (consp x)
(progn
(defsetf frame-visible-p cl-set-frame-visible-p)
(defsetf frame-width set-screen-width t)
(defsetf frame-parameter set-frame-parameter t)
+(defsetf terminal-parameter set-terminal-parameter)
(defsetf getenv setenv t)
(defsetf get-register set-register)
(defsetf global-key-binding global-set-key)
(defsetf window-height () (store)
(list 'progn (list 'enlarge-window (list '- store '(window-height))) store))
(defsetf window-hscroll set-window-hscroll)
+(defsetf window-parameter set-window-parameter)
(defsetf window-point set-window-point)
(defsetf window-start set-window-start)
(defsetf window-width () (store)
(defsetf x-get-secondary-selection x-own-secondary-selection t)
(defsetf x-get-selection x-own-selection t)
+;; This is a hack that allows (setf (eq a 7) B) to mean either
+;; (setq a 7) or (setq a nil) depending on whether B is nil or not.
+;; This is useful when you have control over the PLACE but not over
+;; the VALUE, as is the case in define-minor-mode's :variable.
+(define-setf-method eq (place val)
+ (let ((method (get-setf-method place cl-macro-environment))
+ (val-temp (make-symbol "--eq-val--"))
+ (store-temp (make-symbol "--eq-store--")))
+ (list (append (nth 0 method) (list val-temp))
+ (append (nth 1 method) (list val))
+ (list store-temp)
+ `(let ((,(car (nth 2 method))
+ (if ,store-temp ,val-temp (not ,val-temp))))
+ ,(nth 3 method) ,store-temp)
+ `(eq ,(nth 4 method) ,val-temp))))
+
;;; More complex setf-methods.
-;;; These should take &environment arguments, but since full arglists aren't
-;;; available while compiling cl-macs, we fake it by referring to the global
-;;; variable cl-macro-environment directly.
+;; These should take &environment arguments, but since full arglists aren't
+;; available while compiling cl-macs, we fake it by referring to the global
+;; variable cl-macro-environment directly.
(define-setf-method apply (func arg1 &rest rest)
(or (and (memq (car-safe func) '(quote function function*))
(cons '&cl-quote args))
(list* 'cl-defsubst-expand (list 'quote argns)
(list 'quote (list* 'block name body))
- (not (or unsafe (cl-expr-access-order pbody argns)))
+ ;; We used to pass `simple' as
+ ;; (not (or unsafe (cl-expr-access-order pbody argns)))
+ ;; But this is much too simplistic since it
+ ;; does not pay attention to the argvs (and
+ ;; cl-expr-access-order itself is also too naive).
+ nil
(and (memq '&key args) 'cl-whole) unsafe argns)))
(list* 'defun* name args body))))
(defun cl-defsubst-expand (argns body simple whole unsafe &rest argvs)
(if (and whole (not (cl-safe-expr-p (cons 'progn argvs)))) whole
(if (cl-simple-exprs-p argvs) (setq simple t))
- (let ((lets (delq nil
- (mapcar* (function
- (lambda (argn argv)
- (if (or simple (cl-const-expr-p argv))
- (progn (setq body (subst argv argn body))
- (and unsafe (list argn argv)))
- (list argn argv))))
- argns argvs))))
+ (let* ((substs ())
+ (lets (delq nil
+ (mapcar* (function
+ (lambda (argn argv)
+ (if (or simple (cl-const-expr-p argv))
+ (progn (push (cons argn argv) substs)
+ (and unsafe (list argn argv)))
+ (list argn argv))))
+ argns argvs))))
+ ;; FIXME: `sublis/subst' will happily substitute the symbol
+ ;; `argn' in places where it's not used as a reference
+ ;; to a variable.
+ ;; FIXME: `sublis/subst' will happily copy `argv' to a different
+ ;; scope, leading to name capture.
+ (setq body (cond ((null substs) body)
+ ((null (cdr substs))
+ (subst (cdar substs) (caar substs) body))
+ (t (sublis substs body))))
(if lets (list 'let lets body) body))))
; Run the parent.
(delay-mode-hooks
- (,(or parent 'kill-all-local-variables))
+ (,(or parent 'fundamental-mode))
; Identify the child mode.
(setq major-mode (quote ,child))
(setq mode-name ,name)
:lighter SPEC Same as the LIGHTER argument.
:keymap MAP Same as the KEYMAP argument.
:require SYM Same as in `defcustom'.
+:variable PLACE The location (as can be used with `setf') to use instead
+ of the variable MODE to store the state of the mode. 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
+ a new state and sets it.
For example, you could write
(define-minor-mode foo-mode \"If enabled, foo on you!\"
(type nil)
(extra-args nil)
(extra-keywords nil)
+ (variable nil) ;The PLACE where the state is stored.
+ (setter nil) ;The function (if any) to set the mode var.
+ (modefun mode) ;The minor mode function name we're defining.
(require t)
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
(:type (setq type (list :type (pop body))))
(:require (setq require (pop body)))
(:keymap (setq keymap (pop body)))
+ (:variable (setq variable (pop body))
+ (if (not (functionp (cdr-safe variable)))
+ ;; PLACE is not of the form (GET . SET).
+ (setq mode variable)
+ (setq mode (car variable))
+ (setq setter (cdr variable))))
(t (push keyw extra-keywords) (push (pop body) extra-keywords))))
(setq keymap-sym (if (and keymap (symbolp keymap)) keymap
`(progn
;; Define the variable to enable or disable the mode.
- ,(if (not globalp)
- `(progn
- (defvar ,mode ,init-value ,(format "Non-nil if %s is enabled.
+ ,(cond
+ ;; If :variable is specified, then the var will be
+ ;; declared elsewhere.
+ (variable nil)
+ ((not globalp)
+ `(progn
+ (defvar ,mode ,init-value ,(format "Non-nil if %s is enabled.
Use the command `%s' to change this variable." pretty-name mode))
- (make-variable-buffer-local ',mode))
-
+ (make-variable-buffer-local ',mode)))
+ (t
(let ((base-doc-string
(concat "Non-nil if %s is enabled.
See the command `%s' for a description of this minor mode."
,@group
,@type
,@(unless (eq require t) `(:require ,require))
- ,@(nreverse extra-keywords))))
+ ,@(nreverse extra-keywords)))))
;; The actual function.
- (defun ,mode (&optional arg ,@extra-args)
+ (defun ,modefun (&optional arg ,@extra-args)
,(or doc
(format (concat "Toggle %s on or off.
Interactively, with no prefix argument, toggle the mode.
;; repeat-command still does the toggling correctly.
(interactive (list (or current-prefix-arg 'toggle)))
(let ((,last-message (current-message)))
- (setq ,mode
- (cond
- ((eq arg 'toggle) (not ,mode))
- (arg (> (prefix-numeric-value arg) 0))
- (t
- (if (null ,mode) t
- (message
- "Toggling %s off; better pass an explicit argument."
- ',mode)
- nil))))
+ (,@(if setter (list setter)
+ (list (if (symbolp mode) 'setq 'setf) mode))
+ (if (eq arg 'toggle)
+ (not ,mode)
+ ;; A nil argument also means ON now.
+ (> (prefix-numeric-value arg) 0)))
,@body
;; The on/off hooks are here for backward compatibility only.
(run-hooks ',hook (if ,mode ',hook-on ',hook-off))
(if (called-interactively-p 'any)
(progn
- ,(if globalp `(customize-mark-as-set ',mode))
+ ,(if (and globalp (symbolp mode))
+ `(customize-mark-as-set ',mode))
;; Avoid overwriting a message shown by the body,
;; but do overwrite previous messages.
(unless (and (current-message)
(t (error "Invalid keymap %S" ,keymap))))
,(format "Keymap for `%s'." mode-name)))
- (add-minor-mode ',mode ',lighter
- ,(if keymap keymap-sym
- `(if (boundp ',keymap-sym) ,keymap-sym))))))
+ ,(if (not (symbolp mode))
+ (if (or lighter keymap)
+ (error ":lighter and :keymap unsupported with mode expression %s" mode))
+ `(with-no-warnings
+ (add-minor-mode ',mode ',lighter
+ ,(if keymap keymap-sym
+ `(if (boundp ',keymap-sym) ,keymap-sym))
+ nil
+ ,(unless (eq mode modefun) 'modefun)))))))
\f
;;;
;;; make global minor mode
(progn
(add-hook 'after-change-major-mode-hook
',MODE-enable-in-buffers)
+ (add-hook 'fundamental-mode-hook ',MODE-enable-in-buffers)
(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 'fundamental-mode-hook ',MODE-enable-in-buffers)
(remove-hook 'find-file-hook ',MODE-check-buffers)
(remove-hook 'change-major-mode-hook ',MODE-cmhh))
(dolist (buf ,MODE-buffers)
(when (buffer-live-p buf)
(with-current-buffer buf
- (if ,mode
- (unless (eq ,MODE-major-mode major-mode)
- (,mode -1)
- (,turn-on)
- (setq ,MODE-major-mode major-mode))
- (,turn-on)
- (setq ,MODE-major-mode major-mode))))))
+ (unless (eq ,MODE-major-mode major-mode)
+ (if ,mode
+ (progn
+ (,mode -1)
+ (,turn-on)
+ (setq ,MODE-major-mode major-mode))
+ (,turn-on)
+ (setq ,MODE-major-mode major-mode)))))))
(put ',MODE-enable-in-buffers 'definition-name ',global-mode)
(defun ,MODE-check-buffers ()
"Return list of keywords given in file FILE."
(let ((keywords (lm-keywords file)))
(if keywords
- (split-string keywords "[, \t\n]+" t))))
+ (if (string-match-p "," keywords)
+ (split-string keywords ",[ \t\n]*" t)
+ (split-string keywords "[ \t\n]+" t)))))
(defvar finder-known-keywords)
(defun lm-keywords-finder-p (&optional file)
;;(set (make-local-variable 'adaptive-fill-mode) nil)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'lisp-indent-line)
- (make-local-variable 'parse-sexp-ignore-comments)
- (setq parse-sexp-ignore-comments t)
(make-local-variable 'outline-regexp)
(setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
(make-local-variable 'outline-level)
:type 'hook
:group 'lisp)
-(define-derived-mode emacs-lisp-mode nil "Emacs-Lisp"
+(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp"
"Major mode for editing Lisp code to run in Emacs.
Commands:
Delete converts tabs to spaces as it moves back.
"Keymap for ordinary Lisp mode.
All commands in `lisp-mode-shared-map' are inherited by this map.")
-(defun lisp-mode ()
+(define-derived-mode lisp-mode prog-mode "Lisp"
"Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
Commands:
Delete converts tabs to spaces as it moves back.
Entry to this mode calls the value of `lisp-mode-hook'
if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (use-local-map lisp-mode-map)
- (setq major-mode 'lisp-mode)
- (setq mode-name "Lisp")
(lisp-mode-variables nil t)
+ (set (make-local-variable 'find-tag-default-function) 'lisp-find-tag-default)
(make-local-variable 'comment-start-skip)
(setq comment-start-skip
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
- (setq imenu-case-fold-search t)
- (set-syntax-table lisp-mode-syntax-table)
- (run-mode-hooks 'lisp-mode-hook))
-(put 'lisp-mode 'find-tag-default-function 'lisp-find-tag-default)
+ (setq imenu-case-fold-search t))
(defun lisp-find-tag-default ()
(let ((default (find-tag-default)))
(interactive)
(let* ((data (lisp-completion-at-point predicate))
(plist (nthcdr 3 data)))
- (let ((completion-annotate-function (plist-get plist :annotate-function)))
+ (if (null data)
+ (minibuffer-message "Nothing to complete")
+ (let ((completion-annotate-function
+ (plist-get plist :annotate-function)))
(completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)
- (plist-get plist :predicate)))))
+ (plist-get plist :predicate))))))
(defun lisp-completion-at-point (&optional predicate)
"Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
;; FIXME: the `end' could be after point?
- (let* ((end (point))
+ (let* ((pos (point))
(beg (with-syntax-table emacs-lisp-mode-syntax-table
- (save-excursion
- (backward-sexp 1)
- (while (= (char-syntax (following-char)) ?\')
- (forward-char 1))
- (point))))
+ (condition-case nil
+ (save-excursion
+ (backward-sexp 1)
+ (skip-syntax-forward "'")
+ (point))
+ (scan-error pos))))
(predicate
(or predicate
(save-excursion
;; Maybe a `let' varlist or something.
nil
;; Else, we assume that a function name is expected.
- 'fboundp))))))
- (list beg end obarray
- :predicate predicate
- :annotate-function
+ 'fboundp)))))
+ (end
+ (unless (or (eq beg (point-max))
+ (member (char-syntax (char-after beg)) '(?\" ?\( ?\))))
+ (condition-case nil
+ (save-excursion
+ (goto-char beg)
+ (forward-sexp 1)
+ (when (>= (point) pos)
+ (point)))
+ (scan-error pos)))))
+ (when end
+ (list beg end obarray
+ :predicate predicate
+ :annotate-function
(unless (eq predicate 'fboundp)
- (lambda (str) (if (fboundp (intern-soft str)) " <f>"))))))
+ (lambda (str) (if (fboundp (intern-soft str)) " <f>")))))))
;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
;;; lisp.el ends here
--- /dev/null
+;;; smie.el --- Simple Minded Indentation Engine
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords: languages, lisp, internal, parsing, indentation
+
+;; 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; While working on the SML indentation code, the idea grew that maybe
+;; I could write something generic to do the same thing, and at the
+;; end of working on the SML code, I had a pretty good idea of what it
+;; could look like. That idea grew stronger after working on
+;; LaTeX indentation.
+;;
+;; So at some point I decided to try it out, by writing a new
+;; indentation code for Coq while trying to keep most of the code
+;; "table driven", where only the tables are Coq-specific. The result
+;; (which was used for Beluga-mode as well) turned out to be based on
+;; something pretty close to an operator precedence parser.
+
+;; So here is another rewrite, this time following the actual principles of
+;; operator precedence grammars. Why OPG? Even though they're among the
+;; weakest kinds of parsers, these parsers have some very desirable properties
+;; for Emacs:
+;; - most importantly for indentation, they work equally well in either
+;; direction, so you can use them to parse backward from the indentation
+;; point to learn the syntactic context;
+;; - they work locally, so there's no need to keep a cache of
+;; the parser's state;
+;; - because of that locality, indentation also works just fine when earlier
+;; parts of the buffer are syntactically incorrect since the indentation
+;; looks at "as little as possible" of the buffer make an indentation
+;; decision.
+;; - they typically have no error handling and can't even detect a parsing
+;; error, so we don't have to worry about what to do in case of a syntax
+;; error because the parser just automatically does something. Better yet,
+;; we can afford to use a sloppy grammar.
+
+;; The development (especially the parts building the 2D precedence
+;; tables and then computing the precedence levels from it) is largely
+;; inspired from page 187-194 of "Parsing techniques" by Dick Grune
+;; and Ceriel Jacobs (BookBody.pdf available at
+;; http://www.cs.vu.nl/~dick/PTAPG.html).
+;;
+;; OTOH we had to kill many chickens, read many coffee grounds, and practiced
+;; untold numbers of black magic spells.
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+;;; Building precedence level tables from BNF specs.
+
+(defun smie-set-prec2tab (table x y val &optional override)
+ (assert (and x y))
+ (let* ((key (cons x y))
+ (old (gethash key table)))
+ (if (and old (not (eq old val)))
+ (if (gethash key override)
+ ;; FIXME: The override is meant to resolve ambiguities,
+ ;; but it also hides real conflicts. It would be great to
+ ;; be able to distinguish the two cases so that overrides
+ ;; don't hide real conflicts.
+ (puthash key (gethash key override) table)
+ (display-warning 'smie (format "Conflict: %s %s/%s %s" x old val y)))
+ (puthash key val table))))
+
+(defun smie-precs-precedence-table (precs)
+ "Compute a 2D precedence table from a list of precedences.
+PRECS should be a list, sorted by precedence (e.g. \"+\" will
+come before \"*\"), of elements of the form \(left OP ...)
+or (right OP ...) or (nonassoc OP ...) or (assoc OP ...). All operators in
+one of those elements share the same precedence level and associativity."
+ (let ((prec2-table (make-hash-table :test 'equal)))
+ (dolist (prec precs)
+ (dolist (op (cdr prec))
+ (let ((selfrule (cdr (assq (car prec)
+ '((left . >) (right . <) (assoc . =))))))
+ (when selfrule
+ (dolist (other-op (cdr prec))
+ (smie-set-prec2tab prec2-table op other-op selfrule))))
+ (let ((op1 '<) (op2 '>))
+ (dolist (other-prec precs)
+ (if (eq prec other-prec)
+ (setq op1 '> op2 '<)
+ (dolist (other-op (cdr other-prec))
+ (smie-set-prec2tab prec2-table op other-op op2)
+ (smie-set-prec2tab prec2-table other-op op op1)))))))
+ prec2-table))
+
+(defun smie-merge-prec2s (tables)
+ (if (null (cdr tables))
+ (car tables)
+ (let ((prec2 (make-hash-table :test 'equal)))
+ (dolist (table tables)
+ (maphash (lambda (k v)
+ (smie-set-prec2tab prec2 (car k) (cdr k) v))
+ table))
+ prec2)))
+
+(defun smie-bnf-precedence-table (bnf &rest precs)
+ (let ((nts (mapcar 'car bnf)) ;Non-terminals
+ (first-ops-table ())
+ (last-ops-table ())
+ (first-nts-table ())
+ (last-nts-table ())
+ (prec2 (make-hash-table :test 'equal))
+ (override (smie-merge-prec2s
+ (mapcar 'smie-precs-precedence-table precs)))
+ again)
+ (dolist (rules bnf)
+ (let ((nt (car rules))
+ (last-ops ())
+ (first-ops ())
+ (last-nts ())
+ (first-nts ()))
+ (dolist (rhs (cdr rules))
+ (assert (consp rhs))
+ (if (not (member (car rhs) nts))
+ (pushnew (car rhs) first-ops)
+ (pushnew (car rhs) first-nts)
+ (when (consp (cdr rhs))
+ ;; If the first is not an OP we add the second (which
+ ;; should be an OP if BNF is an "operator grammar").
+ ;; Strictly speaking, this should only be done if the
+ ;; first is a non-terminal which can expand to a phrase
+ ;; without any OP in it, but checking doesn't seem worth
+ ;; the trouble, and it lets the writer of the BNF
+ ;; be a bit more sloppy by skipping uninteresting base
+ ;; cases which are terminals but not OPs.
+ (assert (not (member (cadr rhs) nts)))
+ (pushnew (cadr rhs) first-ops)))
+ (let ((shr (reverse rhs)))
+ (if (not (member (car shr) nts))
+ (pushnew (car shr) last-ops)
+ (pushnew (car shr) last-nts)
+ (when (consp (cdr shr))
+ (assert (not (member (cadr shr) nts)))
+ (pushnew (cadr shr) last-ops)))))
+ (push (cons nt first-ops) first-ops-table)
+ (push (cons nt last-ops) last-ops-table)
+ (push (cons nt first-nts) first-nts-table)
+ (push (cons nt last-nts) last-nts-table)))
+ ;; Compute all first-ops by propagating the initial ones we have
+ ;; now, according to first-nts.
+ (setq again t)
+ (while (prog1 again (setq again nil))
+ (dolist (first-nts first-nts-table)
+ (let* ((nt (pop first-nts))
+ (first-ops (assoc nt first-ops-table)))
+ (dolist (first-nt first-nts)
+ (dolist (op (cdr (assoc first-nt first-ops-table)))
+ (unless (member op first-ops)
+ (setq again t)
+ (push op (cdr first-ops))))))))
+ ;; Same thing for last-ops.
+ (setq again t)
+ (while (prog1 again (setq again nil))
+ (dolist (last-nts last-nts-table)
+ (let* ((nt (pop last-nts))
+ (last-ops (assoc nt last-ops-table)))
+ (dolist (last-nt last-nts)
+ (dolist (op (cdr (assoc last-nt last-ops-table)))
+ (unless (member op last-ops)
+ (setq again t)
+ (push op (cdr last-ops))))))))
+ ;; Now generate the 2D precedence table.
+ (dolist (rules bnf)
+ (dolist (rhs (cdr rules))
+ (while (cdr rhs)
+ (cond
+ ((member (car rhs) nts)
+ (dolist (last (cdr (assoc (car rhs) last-ops-table)))
+ (smie-set-prec2tab prec2 last (cadr rhs) '> override)))
+ ((member (cadr rhs) nts)
+ (dolist (first (cdr (assoc (cadr rhs) first-ops-table)))
+ (smie-set-prec2tab prec2 (car rhs) first '< override))
+ (if (and (cddr rhs) (not (member (car (cddr rhs)) nts)))
+ (smie-set-prec2tab prec2 (car rhs) (car (cddr rhs))
+ '= override)))
+ (t (smie-set-prec2tab prec2 (car rhs) (cadr rhs) '= override)))
+ (setq rhs (cdr rhs)))))
+ prec2))
+
+(defun smie-prec2-levels (prec2)
+ "Take a 2D precedence table and turn it into an alist of precedence levels.
+PREC2 is a table as returned by `smie-precs-precedence-table' or
+`smie-bnf-precedence-table'."
+ ;; For each operator, we create two "variables" (corresponding to
+ ;; the left and right precedence level), which are represented by
+ ;; cons cells. Those are the vary cons cells that appear in the
+ ;; final `table'. The value of each "variable" is kept in the `car'.
+ (let ((table ())
+ (csts ())
+ (eqs ())
+ tmp x y)
+ ;; From `prec2' we construct a list of constraints between
+ ;; variables (aka "precedence levels"). These can be either
+ ;; equality constraints (in `eqs') or `<' constraints (in `csts').
+ (maphash (lambda (k v)
+ (if (setq tmp (assoc (car k) table))
+ (setq x (cddr tmp))
+ (setq x (cons nil nil))
+ (push (cons (car k) (cons nil x)) table))
+ (if (setq tmp (assoc (cdr k) table))
+ (setq y (cdr tmp))
+ (setq y (cons nil (cons nil nil)))
+ (push (cons (cdr k) y) table))
+ (ecase v
+ (= (push (cons x y) eqs))
+ (< (push (cons x y) csts))
+ (> (push (cons y x) csts))))
+ prec2)
+ ;; First process the equality constraints.
+ (let ((eqs eqs))
+ (while eqs
+ (let ((from (caar eqs))
+ (to (cdar eqs)))
+ (setq eqs (cdr eqs))
+ (if (eq to from)
+ (debug) ;Can it happen?
+ (dolist (other-eq eqs)
+ (if (eq from (cdr other-eq)) (setcdr other-eq to))
+ (when (eq from (car other-eq))
+ ;; This can happen because of `assoc' settings in precs
+ ;; or because of a rhs like ("op" foo "op").
+ (setcar other-eq to)))
+ (dolist (cst csts)
+ (if (eq from (cdr cst)) (setcdr cst to))
+ (if (eq from (car cst)) (setcar cst to)))))))
+ ;; Then eliminate trivial constraints iteratively.
+ (let ((i 0))
+ (while csts
+ (let ((rhvs (mapcar 'cdr csts))
+ (progress nil))
+ (dolist (cst csts)
+ (unless (memq (car cst) rhvs)
+ (setq progress t)
+ ;; We could give each var in a given iteration the same value,
+ ;; but we can also give them arbitrarily different values.
+ ;; Basically, these are vars between which there is no
+ ;; constraint (neither equality nor inequality), so
+ ;; anything will do.
+ ;; We give them arbitrary values, which means that we
+ ;; replace the "no constraint" case with either > or <
+ ;; but not =. The reason we do that is so as to try and
+ ;; distinguish associative operators (which will have
+ ;; left = right).
+ (unless (caar cst)
+ (setcar (car cst) i)
+ (incf i))
+ (setq csts (delq cst csts))))
+ (unless progress
+ (error "Can't resolve the precedence table to precedence levels")))
+ (incf i 10))
+ ;; Propagate equalities back to their source.
+ (dolist (eq (nreverse eqs))
+ (assert (null (caar eq)))
+ (setcar (car eq) (cadr eq)))
+ ;; Finally, fill in the remaining vars (which only appeared on the
+ ;; right side of the < constraints).
+ ;; Tho leaving them at nil is not a bad choice, since it makes
+ ;; it clear that these don't bind at all.
+ ;; (dolist (x table)
+ ;; (unless (nth 1 x) (setf (nth 1 x) i))
+ ;; (unless (nth 2 x) (setf (nth 2 x) i)))
+ )
+ table))
+
+;;; Parsing using a precedence level table.
+
+(defvar smie-op-levels 'unset
+ "List of token parsing info.
+Each element is of the form (TOKEN LEFT-LEVEL RIGHT-LEVEL).
+Parsing is done using an operator precedence parser.")
+
+(defalias 'smie-op-left 'car)
+(defalias 'smie-op-right 'cadr)
+
+(defun smie-backward-token ()
+ ;; FIXME: This may be an OK default but probably needs a hook.
+ (buffer-substring (point)
+ (progn (if (zerop (skip-syntax-backward "."))
+ (skip-syntax-backward "w_'"))
+ (point))))
+
+(defun smie-forward-token ()
+ ;; FIXME: This may be an OK default but probably needs a hook.
+ (buffer-substring (point)
+ (progn (if (zerop (skip-syntax-forward "."))
+ (skip-syntax-forward "w_'"))
+ (point))))
+
+(defun smie-associative-p (toklevels)
+ ;; in "a + b + c" we want to stop at each +, but in
+ ;; "if a then b else c" we don't want to stop at each keyword.
+ ;; To distinguish the two cases, we made smie-prec2-levels choose
+ ;; different levels for each part of "if a then b else c", so that
+ ;; by checking if the left-level is equal to the right level, we can
+ ;; figure out that it's an associative operator.
+ ;; This is not 100% foolproof, tho, since a grammar like
+ ;; (exp ("A" exp "C") ("A" exp "B" exp "C"))
+ ;; will cause "B" to have equal left and right levels, even though
+ ;; it is not an associative operator.
+ ;; A better check would be the check the actual previous operator
+ ;; against this one to see if it's the same, but we'd have to change
+ ;; `levels' to keep a stack of operators rather than only levels.
+ (eq (smie-op-left toklevels) (smie-op-right toklevels)))
+
+(defun smie-next-sexp (next-token next-sexp op-forw op-back halfsexp)
+ "Skip over one sexp.
+NEXT-TOKEN is a function of no argument that moves forward by one
+token (after skipping comments if needed) and returns it.
+NEXT-SEXP is a lower-level function to skip one sexp.
+OP-FORW is the accessor to the forward level of the level data.
+OP-BACK is the accessor to the backward level of the level data.
+HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
+first token we see is an operator, skip over its left-hand-side argument.
+Possible return values:
+ (FORW-LEVEL POS TOKEN): we couldn't skip TOKEN because its back-level
+ is too high. FORW-LEVEL is the forw-level of TOKEN,
+ POS is its start position in the buffer.
+ (t POS TOKEN): same thing when we bump on the wrong side of a paren.
+ (nil POS TOKEN): we skipped over a paren-like pair.
+ nil: we skipped over an identifier, matched parentheses, ..."
+ (catch 'return
+ (let ((levels ()))
+ (while
+ (let* ((pos (point))
+ (token (funcall next-token))
+ (toklevels (cdr (assoc token smie-op-levels))))
+
+ (cond
+ ((null toklevels)
+ (when (equal token "")
+ (condition-case err
+ (progn (goto-char pos) (funcall next-sexp 1) nil)
+ (scan-error (throw 'return (list t (caddr err)))))
+ (if (eq pos (point))
+ ;; We did not move, so let's abort the loop.
+ (throw 'return (list t (point))))))
+ ((null (funcall op-back toklevels))
+ ;; A token like a paren-close.
+ (assert (funcall op-forw toklevels)) ;Otherwise, why mention it?
+ (push (funcall op-forw toklevels) levels))
+ (t
+ (while (and levels (< (funcall op-back toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (if (and halfsexp (funcall op-forw toklevels))
+ (push (funcall op-forw toklevels) levels)
+ (throw 'return
+ (prog1 (list (or (car toklevels) t) (point) token)
+ (goto-char pos)))))
+ (t
+ (if (and levels (= (funcall op-back toklevels) (car levels)))
+ (setq levels (cdr levels)))
+ (cond
+ ((null levels)
+ (cond
+ ((null (funcall op-forw toklevels))
+ (throw 'return (list nil (point) token)))
+ ((smie-associative-p toklevels)
+ (throw 'return
+ (prog1 (list (or (car toklevels) t) (point) token)
+ (goto-char pos))))
+ ;; We just found a match to the previously pending operator
+ ;; but this new operator is still part of a larger RHS.
+ ;; E.g. we're now looking at the "then" in
+ ;; "if a then b else c". So we have to keep parsing the
+ ;; rest of the construct.
+ (t (push (funcall op-forw toklevels) levels))))
+ (t
+ (if (funcall op-forw toklevels)
+ (push (funcall op-forw toklevels) levels))))))))
+ levels)
+ (setq halfsexp nil)))))
+
+(defun smie-backward-sexp (&optional halfsexp)
+ "Skip over one sexp.
+HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
+first token we see is an operator, skip over its left-hand-side argument.
+Possible return values:
+ (LEFT-LEVEL POS TOKEN): we couldn't skip TOKEN because its right-level
+ is too high. LEFT-LEVEL is the left-level of TOKEN,
+ POS is its start position in the buffer.
+ (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
+ (nil POS TOKEN): we skipped over a paren-like pair.
+ nil: we skipped over an identifier, matched parentheses, ..."
+ (smie-next-sexp
+ (lambda () (forward-comment (- (point-max))) (smie-backward-token))
+ (indirect-function 'backward-sexp)
+ (indirect-function 'smie-op-left)
+ (indirect-function 'smie-op-right)
+ halfsexp))
+
+(defun smie-forward-sexp (&optional halfsexp)
+ "Skip over one sexp.
+HALFSEXP if non-nil, means skip over a partial sexp if needed. I.e. if the
+first token we see is an operator, skip over its left-hand-side argument.
+Possible return values:
+ (RIGHT-LEVEL POS TOKEN): we couldn't skip TOKEN because its left-level
+ is too high. RIGHT-LEVEL is the right-level of TOKEN,
+ POS is its end position in the buffer.
+ (t POS TOKEN): same thing but for an open-paren or the beginning of buffer.
+ (nil POS TOKEN): we skipped over a paren-like pair.
+ nil: we skipped over an identifier, matched parentheses, ..."
+ (smie-next-sexp
+ (lambda () (forward-comment (point-max)) (smie-forward-token))
+ (indirect-function 'forward-sexp)
+ (indirect-function 'smie-op-right)
+ (indirect-function 'smie-op-left)
+ halfsexp))
+
+(defun smie-backward-sexp-command (&optional n)
+ "Move backward through N logical elements."
+ (interactive "p")
+ (if (< n 0)
+ (smie-forward-sexp-command (- n))
+ (let ((forward-sexp-function nil))
+ (while (> n 0)
+ (decf n)
+ (let ((pos (point))
+ (res (smie-backward-sexp 'halfsexp)))
+ (if (and (car res) (= pos (point)) (not (bolp)))
+ (signal 'scan-error
+ (list "Containing expression ends prematurely"
+ (cadr res) (cadr res)))
+ nil))))))
+
+(defun smie-forward-sexp-command (&optional n)
+ "Move forward through N logical elements."
+ (interactive "p")
+ (if (< n 0)
+ (smie-backward-sexp-command (- n))
+ (let ((forward-sexp-function nil))
+ (while (> n 0)
+ (decf n)
+ (let ((pos (point))
+ (res (smie-forward-sexp 'halfsexp)))
+ (if (and (car res) (= pos (point)) (not (bolp)))
+ (signal 'scan-error
+ (list "Containing expression ends prematurely"
+ (cadr res) (cadr res)))
+ nil))))))
+
+;;; The indentation engine.
+
+(defcustom smie-indent-basic 4
+ "Basic amount of indentation."
+ :type 'integer)
+
+(defvar smie-indent-rules 'unset
+ "Rules of the following form.
+\(TOK OFFSET) how to indent right after TOK.
+\(TOK O1 O2) how to indent right after TOK:
+ O1 is the default;
+ O2 is used if TOK is \"hanging\".
+\((T1 . T2) . OFFSET) how to indent token T2 w.r.t T1.
+\((t . TOK) . OFFSET) how to indent TOK with respect to its parent.
+\(list-intro . TOKENS) declare TOKENS as being followed by what may look like
+ a funcall but is just a sequence of expressions.
+\(t . OFFSET) basic indentation step.
+\(args . OFFSET) indentation of arguments.
+A nil offset defaults to `smie-indent-basic'.")
+
+(defun smie-indent-hanging-p ()
+ ;; A Hanging keyword is one that's at the end of a line except it's not at
+ ;; the beginning of a line.
+ (and (save-excursion (smie-forward-token)
+ (skip-chars-forward " \t") (eolp))
+ (save-excursion (skip-chars-backward " \t") (not (bolp)))))
+
+(defun smie-bolp ()
+ (save-excursion (skip-chars-backward " \t") (bolp)))
+
+(defun smie-indent-offset (elem)
+ (or (cdr (assq elem smie-indent-rules))
+ (cdr (assq t smie-indent-rules))
+ smie-indent-basic))
+
+(defun smie-indent-calculate (&optional virtual)
+ "Compute the indentation to use for point.
+If VIRTUAL is non-nil, it means we're not trying to indent point but just
+need to compute the column at which point should be indented
+in order to figure out the indentation of some other (further down) point.
+VIRTUAL can take two different non-nil values:
+- :bolp: means that the current indentation of point can be trusted
+ to be good only if it follows a line break.
+- :hanging: means that the current indentation of point can be
+ trusted to be good except if the following token is hanging."
+ ;; FIXME: This has accumulated a lot of rules, some of which aren't
+ ;; clearly orthogonal any more, so we should probably try and
+ ;; restructure it somewhat.
+ (or
+ ;; Trust pre-existing indentation on other lines.
+ (and virtual
+ (if (eq virtual :hanging) (not (smie-indent-hanging-p)) (smie-bolp))
+ (current-column))
+ ;; Start the file at column 0.
+ (save-excursion
+ (forward-comment (- (point-max)))
+ (if (bobp) 0))
+ ;; Align close paren with opening paren.
+ (save-excursion
+ ;; (forward-comment (point-max))
+ (when (looking-at "\\s)")
+ (while (not (zerop (skip-syntax-forward ")")))
+ (skip-chars-forward " \t"))
+ (condition-case nil
+ (progn
+ (backward-sexp 1)
+ (smie-indent-calculate :hanging))
+ (scan-error nil))))
+ ;; Align closing token with the corresponding opening one.
+ ;; (e.g. "of" with "case", or "in" with "let").
+ (save-excursion
+ (let* ((pos (point))
+ (token (smie-forward-token))
+ (toklevels (cdr (assoc token smie-op-levels))))
+ (when (car toklevels)
+ (let ((res (smie-backward-sexp 'halfsexp)) tmp)
+ ;; If we didn't move at all, that means we didn't really skip
+ ;; what we wanted.
+ (when (< (point) pos)
+ (cond
+ ((eq (car res) (car toklevels))
+ ;; We bumped into a same-level operator. align with it.
+ (goto-char (cadr res))
+ ;; Don't use (smie-indent-calculate :hanging) here, because we
+ ;; want to jump back over a sequence of same-level ops such as
+ ;; a -> b -> c
+ ;; -> d
+ ;; So as to align with the earliest appropriate place.
+ (smie-indent-calculate :bolp))
+ ((equal token (save-excursion
+ (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ ;; in cases such as "fn x => fn y => fn z =>",
+ ;; jump back to the very first fn.
+ ;; FIXME: should we only do that for special tokens like "=>"?
+ (smie-indent-calculate :bolp))
+ ((setq tmp (assoc (cons (caddr res) token)
+ smie-indent-rules))
+ (goto-char (cadr res))
+ (+ (cdr tmp) (smie-indent-calculate :hanging)))
+ (t
+ (+ (or (cdr (assoc (cons t token) smie-indent-rules)) 0)
+ (current-column)))))))))
+ ;; Indentation of a comment.
+ (and (looking-at comment-start-skip)
+ (save-excursion
+ (forward-comment (point-max))
+ (skip-chars-forward " \t\r\n")
+ (smie-indent-calculate nil)))
+ ;; Indentation inside a comment.
+ (and (looking-at "\\*") (nth 4 (syntax-ppss))
+ (let ((ppss (syntax-ppss)))
+ (save-excursion
+ (forward-line -1)
+ (if (<= (point) (nth 8 ppss))
+ (progn (goto-char (1+ (nth 8 ppss))) (current-column))
+ (skip-chars-forward " \t")
+ (if (looking-at "\\*")
+ (current-column))))))
+ ;; Indentation right after a special keyword.
+ (save-excursion
+ (let* ((tok (progn (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ (tokinfo (assoc tok smie-indent-rules))
+ (toklevel (assoc tok smie-op-levels)))
+ (when (or tokinfo (and toklevel (null (cadr toklevel))))
+ (if (or (smie-indent-hanging-p)
+ ;; If calculating the virtual indentation point, prefer
+ ;; looking up the virtual indentation of the alignment
+ ;; point as well. This is used for indentation after
+ ;; "fn x => fn y =>".
+ virtual)
+ (+ (smie-indent-calculate :bolp)
+ (or (caddr tokinfo) (cadr tokinfo) (smie-indent-offset t)))
+ (+ (current-column)
+ (or (cadr tokinfo) (smie-indent-offset t)))))))
+ ;; Main loop (FIXME: whatever that means!?).
+ (save-excursion
+ (let ((positions nil)
+ (begline nil)
+ arg)
+ (while (and (null (car (smie-backward-sexp)))
+ (push (point) positions)
+ (not (setq begline (smie-bolp)))))
+ (save-excursion
+ ;; Figure out if the atom we just skipped is an argument rather
+ ;; than a function.
+ (setq arg (or (null (car (smie-backward-sexp)))
+ (member (progn (forward-comment (- (point-max)))
+ (smie-backward-token))
+ (cdr (assoc 'list-intro smie-indent-rules))))))
+ (cond
+ ((and arg positions)
+ (goto-char (car positions))
+ (current-column))
+ ((and (null begline) (cdr positions))
+ ;; We skipped some args plus the function and bumped into something.
+ ;; Align with the first arg.
+ (goto-char (cadr positions))
+ (current-column))
+ ((and (null begline) positions)
+ ;; We're the first arg.
+ ;; FIXME: it might not be a funcall, in which case we might be the
+ ;; second element.
+ (goto-char (car positions))
+ (+ (smie-indent-offset 'args)
+ ;; We used to use (smie-indent-calculate :bolp), but that
+ ;; doesn't seem right since it might then indent args less than
+ ;; the function itself.
+ (current-column)))
+ ((and (null arg) (null positions))
+ ;; We're the function itself. Not sure what to do here yet.
+ (if virtual (current-column)
+ (save-excursion
+ (let* ((pos (point))
+ (tok (progn (forward-comment (- (point-max)))
+ (smie-backward-token)))
+ (toklevels (cdr (assoc tok smie-op-levels))))
+ (cond
+ ((numberp (car toklevels))
+ ;; We're right after an infix token. Let's skip over the
+ ;; lefthand side.
+ (goto-char pos)
+ (let (res)
+ (while (progn (setq res (smie-backward-sexp 'halfsexp))
+ (and (not (smie-bolp))
+ (equal (car res) (car toklevels)))))
+ ;; We should be right after a token of equal or
+ ;; higher precedence.
+ (cond
+ ((and (consp res) (memq (car res) '(t nil)))
+ ;; The token of higher-precedence is like an open-paren.
+ ;; Sample case for t: foo { bar, \n[TAB] baz }.
+ ;; Sample case for nil: match ... with \n[TAB] | toto ...
+ ;; (goto-char (cadr res))
+ (smie-indent-calculate :hanging))
+ ((and (consp res) (<= (car res) (car toklevels)))
+ ;; We stopped at a token of equal or higher precedence
+ ;; because we found a place with which to align.
+ (current-column))
+ )))
+ ;; For other cases.... hmm... we'll see when we get there.
+ )))))
+ ((null positions)
+ (smie-backward-token)
+ (+ (smie-indent-offset 'args) (smie-indent-calculate :bolp)))
+ ((car (smie-backward-sexp))
+ ;; No arg stands on its own line, but the function does:
+ (if (cdr positions)
+ (progn
+ (goto-char (cadr positions))
+ (current-column))
+ (goto-char (car positions))
+ (+ (current-column) (smie-indent-offset 'args))))
+ (t
+ ;; We've skipped to a previous arg on its own line: align.
+ (goto-char (car positions))
+ (current-column)))))))
+
+(defun smie-indent-line ()
+ "Indent current line using the SMIE indentation engine."
+ (interactive)
+ (let* ((savep (point))
+ (indent (condition-case nil
+ (save-excursion
+ (forward-line 0)
+ (skip-chars-forward " \t")
+ (if (>= (point) savep) (setq savep nil))
+ (or (smie-indent-calculate) 0))
+ (error 0))))
+ (if (not (numberp indent))
+ ;; If something funny is used (e.g. `noindent'), return it.
+ indent
+ (if (< indent 0) (setq indent 0)) ;Just in case.
+ (if savep
+ (save-excursion (indent-line-to indent))
+ (indent-line-to indent)))))
+
+;;;###autoload
+(defun smie-setup (op-levels indent-rules)
+ (set (make-local-variable 'smie-indent-rules) indent-rules)
+ (set (make-local-variable 'smie-op-levels) op-levels)
+ (set (make-local-variable 'indent-line-function) 'smie-indent-line))
+
+
+(provide 'smie)
+;;; smie.el ends here
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)))
+(defun cua--filter-buffer-noprops (start end)
+ (let ((str (filter-buffer-substring start end)))
+ (set-text-properties 0 (length str) nil str)
+ str))
;; The current register prefix
(defvar cua--register nil)
(setq s (car u))
(setq s (car u) e (cdr u)))))))
(cond ((and s e (<= s e) (= s (mark t)))
- (setq cua--repeat-replace-text
- (filter-buffer-substring s e nil t)))
+ (setq cua--repeat-replace-text (cua--filter-buffer-noprops s e)))
((and (null s) (eq u elt)) ;; nothing inserted
(setq cua--repeat-replace-text
""))
;; scrolling
(define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up)
(define-key cua-global-keymap [remap scroll-down] 'cua-scroll-down)
+ (define-key cua-global-keymap [remap scroll-up-command] 'cua-scroll-up)
+ (define-key cua-global-keymap [remap scroll-down-command] 'cua-scroll-down)
(define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region)
(define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill)
move-end-of-line move-beginning-of-line
end-of-buffer beginning-of-buffer
scroll-up scroll-down
+ scroll-up-command scroll-down-command
up-list down-list backward-up-list
end-of-defun beginning-of-defun
forward-sexp backward-sexp
(let ((src-buf (current-buffer)))
(save-excursion
(if (equal (marker-buffer cua--global-mark-marker) src-buf)
- (let ((text (filter-buffer-substring start end nil t)))
+ (let ((text (cua--filter-buffer-noprops start end)))
(goto-char (marker-position cua--global-mark-marker))
(insert text))
(set-buffer (marker-buffer cua--global-mark-marker))
(if (and (< start (marker-position cua--global-mark-marker))
(< (marker-position cua--global-mark-marker) end))
(message "Can't move region into itself")
- (let ((text (filter-buffer-substring start end nil t))
+ (let ((text (cua--filter-buffer-noprops start end))
(p1 (copy-marker start))
(p2 (copy-marker end)))
(goto-char (marker-position cua--global-mark-marker))
(if (not (cua--rectangle-virtual-edges))
(cua--rectangle-operation nil nil nil nil nil ; do not tabify
'(lambda (s e l r)
- (setq rect (cons (filter-buffer-substring s e nil t) rect))))
+ (setq rect (cons (cua--filter-buffer-noprops s e) rect))))
(cua--rectangle-operation nil 1 nil nil nil ; do not tabify
'(lambda (s e l r v)
(let ((copy t) (bs 0) (as 0) row)
(setq as (- r (max (current-column) l))
e (point)))
(setq row (if (and copy (> e s))
- (filter-buffer-substring s e nil t)
+ (cua--filter-buffer-noprops s e)
""))
(when (> bs 0)
(setq row (concat (make-string bs ?\s) row)))
'(lambda (s e l r)
(cond
((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
- (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
+ (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
(n (string-to-number txt 16))
(fmt (format "0x%%0%dx" (length txt))))
(replace-match (format fmt (+ n increment)))))
((re-search-forward "\\( *-?[0-9]+\\)" e t)
- (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
+ (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
(prefix (if (= (aref txt 0) ?0) "0" ""))
(n (string-to-number txt 10))
(fmt (format "%%%s%dd" prefix (length txt))))
(define-key cua--rectangle-keymap [remap beginning-of-buffer] 'cua-resize-rectangle-top)
(define-key cua--rectangle-keymap [remap scroll-down] 'cua-resize-rectangle-page-up)
(define-key cua--rectangle-keymap [remap scroll-up] 'cua-resize-rectangle-page-down)
+ (define-key cua--rectangle-keymap [remap scroll-down-command] 'cua-resize-rectangle-page-up)
+ (define-key cua--rectangle-keymap [remap scroll-up-command] 'cua-resize-rectangle-page-down)
(define-key cua--rectangle-keymap [remap delete-backward-char] 'cua-delete-char-rectangle)
(define-key cua--rectangle-keymap [remap backward-delete-char] 'cua-delete-char-rectangle)
In select mode, selected text is highlighted."
(if arg
(progn
- (make-local-variable 'edt-select-mode)
- (setq edt-select-mode 'edt-select-mode-current)
+ (set (make-local-variable 'edt-select-mode) 'edt-select-mode-current)
(setq rect-start-point (window-point)))
(progn
(kill-local-variable 'edt-select-mode)))
(defgroup pc-select nil
"Emulate pc bindings."
:prefix "pc-select"
- :group 'editing-basics
- :group 'convenience)
+ :group 'emulations)
(defcustom pc-select-override-scroll-error t
"*Non-nil means don't generate error on scrolling past edge of buffer.
errors are suppressed."
:type 'boolean
:group 'pc-select)
+(define-obsolete-variable-alias 'pc-select-override-scroll-error
+ 'scroll-error-top-bottom
+ "24.1")
(defcustom pc-select-selection-keys-only nil
"*Non-nil means only bind the basic selection keys when started.
(+ left-margin
(/ (- fill-column left-margin line-length) 2))))))
-(defun scroll-down-line ()
- "Scroll one line down."
- (interactive)
- (scroll-down 1))
-
-(defun scroll-up-line ()
- "Scroll one line up."
- (interactive)
- (scroll-up 1))
-
;;;;;;;;;;;
;; wordstar special variables:
(defgroup epg ()
"The EasyPG library."
:version "23.1"
- :group 'emacs)
+ :group 'data)
(defcustom epg-gpg-program "gpg"
"The `gpg' executable."
'((?e . encrypt)
(?s . sign)
(?c . certify)
- (?a . authentication)))
+ (?a . authentication)
+ (?D . disabled)))
(defvar epg-new-signature-type-alist
'((?D . detached)
;; Cleanup the tempfile.
(and tempfile
(file-exists-p tempfile)
- (delete-file tempfile))
+ (delete-file tempfile t))
;; Cleanup the tempdir.
(and tempdir
(file-directory-p tempdir)
(epg-read-output context))
(epg-delete-output-file context)
(if (file-exists-p input-file)
- (delete-file input-file))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-verify (context signature &optional signed-text)
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (delete-file input-file))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-encrypt (context plain recipients
(epg-read-output context))
(epg-delete-output-file context)
(if input-file
- (delete-file input-file))
+ (delete-file input-file t))
(epg-reset context))))
(defun epg-start-export-keys (context keys)
* Version 23.2 released.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-02-07 Vivek Dasmohapatra <vivek@etla.org>
* erc-services.el (erc-nickserv-alist): Fix defcustom type (Bug#5520).
(erc-server-reconnect): Use it to reconnect via old
connector (Bug#4958).
- * erc.el (erc-determine-parameters): Save
- erc-server-connect-function to erc-session-connector.
+ * erc.el (erc-determine-parameters):
+ Save erc-server-connect-function to erc-session-connector.
2009-11-03 Stefan Monnier <monnier@iro.umontreal.ca>
to delete-if-not.
* erc.el(erc-update-current-channel-member):
- Use erc-downcase when comparing
+ Use erc-downcase when comparing
nick entries. Cleanup indentation.
2003-11-01 Lawrence Mitchell <wence@gmx.li>
2003-10-24 Mario Lang <mlang@delysid.org>
* erc-dcc.el: From Stephan Stahl <stl@isogmbh.de>:
- * (erc-dcc-send-block): Kill buffer if transfer completed correctly.
+ (erc-dcc-send-block): Kill buffer if transfer completed correctly.
2003-10-22 Mario Lang <mlang@delysid.org>
2004-12-24 Jorgen Schaefer <forcer@users.sourceforge.net>
* erc-goodies.el, erc.el: The Small Extraction of Stuff[tm] commit.
- Moved some functions from erc.el to erc-goodies.el, and
+ Moved some functions from erc.el to erc-goodies.el, and
transformed them to erc modules in the process.
- imenu autoload stuff moved. I don't know why it is here at all.
- Moved: scroll-to-bottom, make-read-only, distinguish-noncommands,
+++ /dev/null
-# Generated files
-precious ^(esh-groups)\.el$
-
-# arch-tag: 8dc7bfaa-6ca6-4be0-915a-1e539c3dabfb
;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
;;
;; Author: Miles Bader <miles@gnu.org>
-;; Keywords: faces face remapping display user commands
+;; Keywords: faces, face remapping, display, user commands
;;
;; This file is part of GNU Emacs.
;;
nil
col)))
-(defun list-colors-display (&optional list buffer-name)
+
+(defun list-colors-display (&optional list buffer-name callback)
"Display names of defined colors, and show what they look like.
If the optional argument LIST is non-nil, it should be a list of
colors to display. Otherwise, this command computes a list of
-colors that the current display can handle. If the optional
-argument BUFFER-NAME is nil, it defaults to *Colors*."
+colors that the current display can handle.
+
+If the optional argument BUFFER-NAME is nil, it defaults to
+*Colors*.
+
+If the optional argument CALLBACK is non-nil, it should be a
+function to call each time the user types RET or clicks on a
+color. The function should accept a single argument, the color
+name."
(interactive)
(when (and (null list) (> (display-color-cells) 0))
(setq list (list-colors-duplicates (defined-colors)))
(let ((lc (nthcdr (1- (display-color-cells)) list)))
(if lc
(setcdr lc nil)))))
- (with-help-window (or buffer-name "*Colors*")
- (with-current-buffer standard-output
+ (let ((buf (get-buffer-create "*Colors*")))
+ (with-current-buffer buf
+ (erase-buffer)
(setq truncate-lines t)
- (if temp-buffer-show-function
- (list-colors-print list)
- ;; Call list-colors-print from temp-buffer-show-hook
- ;; to get the right value of window-width in list-colors-print
- ;; after the buffer is displayed.
- (add-hook 'temp-buffer-show-hook
- (lambda ()
- (set-buffer-modified-p
- (prog1 (buffer-modified-p)
- (list-colors-print list))))
- nil t)))))
-
-(defun list-colors-print (list)
- (dolist (color list)
- (if (consp color)
- (if (cdr color)
- (setq color (sort color (lambda (a b)
- (string< (downcase a)
- (downcase b))))))
- (setq color (list color)))
- (put-text-property
- (prog1 (point)
- (insert (car color))
- (indent-to 22))
- (point)
- 'face (list ':background (car color)))
- (put-text-property
- (prog1 (point)
- (insert " " (if (cdr color)
- (mapconcat 'identity (cdr color) ", ")
- (car color))))
- (point)
- 'face (list ':foreground (car color)))
- (indent-to (max (- (window-width) 8) 44))
- (insert (apply 'format "#%02x%02x%02x"
- (mapcar (lambda (c) (lsh c -8))
- (color-values (car color)))))
-
- (insert "\n"))
- (goto-char (point-min)))
+ (list-colors-print list callback)
+ (set-buffer-modified-p nil))
+ (pop-to-buffer buf))
+ (if callback
+ (message "Click on a color to select it.")))
+
+(defun list-colors-print (list &optional callback)
+ (let ((callback-fn
+ (if callback
+ `(lambda (button)
+ (funcall ,callback (button-get button 'color-name))))))
+ (dolist (color list)
+ (if (consp color)
+ (if (cdr color)
+ (setq color (sort color (lambda (a b)
+ (string< (downcase a)
+ (downcase b))))))
+ (setq color (list color)))
+ (let* ((opoint (point))
+ (color-values (color-values (car color)))
+ (light-p (>= (apply 'max color-values)
+ (* (car (color-values "white")) .5))))
+ (insert (car color))
+ (indent-to 22)
+ (put-text-property opoint (point) 'face `(:background ,(car color)))
+ (put-text-property
+ (prog1 (point)
+ (insert " " (if (cdr color)
+ (mapconcat 'identity (cdr color) ", ")
+ (car color))))
+ (point)
+ 'face (list :foreground (car color)))
+ (indent-to (max (- (window-width) 8) 44))
+ (insert (apply 'format "#%02x%02x%02x"
+ (mapcar (lambda (c) (lsh c -8))
+ color-values)))
+ (when callback
+ (make-text-button
+ opoint (point)
+ 'follow-link t
+ 'mouse-face (list :background (car color)
+ :foreground (if light-p "black" "white"))
+ 'color-name (car color)
+ 'action callback-fn)))
+ (insert "\n"))
+ (goto-char (point-min))))
+
(defun list-colors-duplicates (&optional list)
"Return a list of colors with grouped duplicate colors.
;;; files.el --- file input and output commands for Emacs
;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996,
-;; 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Maintainer: FSF
(inhibit-file-name-operation op))
(apply op args))))
+(declare-function dos-convert-standard-filename "dos-fns.el" (filename))
+(declare-function w32-convert-standard-filename "w32-fns.el" (filename))
+
(defun convert-standard-filename (filename)
"Convert a standard file's name to something suitable for the OS.
This means to guarantee valid names and perhaps to canonicalize
`w32-shell-dos-semantics').
See Info node `(elisp)Standard File Names' for more details."
- (if (eq system-type 'cygwin)
- (let ((name (copy-sequence filename))
- (start 0))
- ;; Replace invalid filename characters with !
- (while (string-match "[?*:<>|\"\000-\037]" name start)
- (aset name (match-beginning 0) ?!)
- (setq start (match-end 0)))
- name)
- filename))
+ (cond
+ ((eq system-type 'cygwin)
+ (let ((name (copy-sequence filename))
+ (start 0))
+ ;; Replace invalid filename characters with !
+ (while (string-match "[?*:<>|\"\000-\037]" name start)
+ (aset name (match-beginning 0) ?!)
+ (setq start (match-end 0)))
+ name))
+ ((eq system-type 'windows-nt)
+ (w32-convert-standard-filename filename))
+ ((eq system-type 'ms-dos)
+ (dos-convert-standard-filename filename))
+ (t filename)))
(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
"Read directory name, prompting with PROMPT and completing in directory DIR.
(if (fboundp 'ucs-set-table-for-input) ; don't lose when building
(ucs-set-table-for-input)))
-(defcustom auto-mode-case-fold nil
+(defcustom auto-mode-case-fold t
"Non-nil means to try second pass through `auto-mode-alist'.
This means that if the first case-sensitive search through the alist fails
to find a matching major mode, a second case-insensitive search is made.
;; The list of archive file extensions should be in sync with
;; `auto-coding-alist' with `no-conversion' coding system.
("\\.\\(\
-arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|\
-ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode)
+arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\
+ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
("\\.\\(sx[dmicw]\\|od[fgpst]\\|oxt\\)\\'" . archive-mode) ;OpenOffice.org
("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode) ; Debian/Opkg packages.
;; Mailer puts message to be edited in
;; /tmp/Re.... or Message
("\\`/tmp/Re" . text-mode)
("/Message[0-9]*\\'" . text-mode)
- ("\\.zone\\'" . zone-mode)
;; some news reader is reported to use this
("\\`/tmp/fol/" . text-mode)
("\\.oak\\'" . scheme-mode)
("#\\*mail\\*" . mail-mode)
("\\.g\\'" . antlr-mode)
("\\.ses\\'" . ses-mode)
- ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
("\\.docbook\\'" . sgml-mode)
("\\.com\\'" . dcl-mode)
("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
("pg" . text-mode)
("make" . makefile-gmake-mode) ; Debian uses this
("guile" . scheme-mode)
- ("clisp" . lisp-mode)))
+ ("clisp" . lisp-mode)
+ ("emacs" . emacs-lisp-mode)))
"Alist mapping interpreter names to major modes.
This is used for files whose first lines match `auto-mode-interpreter-regexp'.
Each element looks like (INTERPRETER . MODE).
(mapc (lambda (pair)
(put (car pair) 'safe-local-variable (cdr pair)))
- '((buffer-read-only . booleanp) ;; C source code
- (default-directory . stringp) ;; C source code
- (fill-column . integerp) ;; C source code
- (indent-tabs-mode . booleanp) ;; C source code
- (left-margin . integerp) ;; C source code
- (no-update-autoloads . booleanp)
- (tab-width . integerp) ;; C source code
- (truncate-lines . booleanp))) ;; C source code
+ '((buffer-read-only . booleanp) ;; C source code
+ (default-directory . stringp) ;; C source code
+ (fill-column . integerp) ;; C source code
+ (indent-tabs-mode . booleanp) ;; C source code
+ (left-margin . integerp) ;; C source code
+ (no-update-autoloads . booleanp)
+ (tab-width . integerp) ;; C source code
+ (truncate-lines . booleanp) ;; C source code
+ (bidi-display-reordering . booleanp))) ;; C source code
(put 'c-set-style 'safe-local-eval-function t)
;; Otherwise, set the variables.
(enable-local-variables
(hack-local-variables-filter result nil)
- (when file-local-variables-alist
- ;; Any 'evals must run in the Right sequence.
- (setq file-local-variables-alist
- (nreverse file-local-variables-alist))
- (run-hooks 'before-hack-local-variables-hook)
- (dolist (elt file-local-variables-alist)
- (hack-one-local-variable (car elt) (cdr elt))))
- (run-hooks 'hack-local-variables-hook)))))
+ (hack-local-variables-apply)))))
+
+(defun hack-local-variables-apply ()
+ (when file-local-variables-alist
+ ;; Any 'evals must run in the Right sequence.
+ (setq file-local-variables-alist
+ (nreverse file-local-variables-alist))
+ (run-hooks 'before-hack-local-variables-hook)
+ (dolist (elt file-local-variables-alist)
+ (hack-one-local-variable (car elt) (cdr elt))))
+ (run-hooks 'hack-local-variables-hook))
(defun safe-local-variable-p (sym val)
"Non-nil if SYM is safe as a file-local variable with value VAL.
Store the directory-local variables in `dir-local-variables-alist'
and `file-local-variables-alist', without applying them."
(when (and enable-local-variables
- (buffer-file-name)
- (not (file-remote-p (buffer-file-name))))
+ (not (file-remote-p (or (buffer-file-name) default-directory))))
;; Find the variables file.
- (let ((variables-file (dir-locals-find-file (buffer-file-name)))
+ (let ((variables-file (dir-locals-find-file (or (buffer-file-name) default-directory)))
(class nil)
(dir-name nil))
(cond
((stringp variables-file)
- (setq dir-name (file-name-directory (buffer-file-name)))
+ (setq dir-name (if (buffer-file-name) (file-name-directory (buffer-file-name)) default-directory))
(setq class (dir-locals-read-from-file variables-file)))
((consp variables-file)
(setq dir-name (nth 0 variables-file))
(push elt dir-local-variables-alist))
(hack-local-variables-filter variables dir-name)))))))
+(defun hack-dir-local-variables-non-file-buffer ()
+ (hack-dir-local-variables)
+ (hack-local-variables-apply))
+
\f
(defcustom change-major-mode-with-file-name t
"Non-nil means \\[write-file] should set the major mode from the file name.
no longer accessible under its old name.
The value is non-nil after a backup was made by renaming.
-It has the form (MODES . BACKUPNAME).
+It has the form (MODES SELINUXCONTEXT BACKUPNAME).
MODES is the result of `file-modes' on the original
file; this means that the caller, after saving the buffer, should change
the modes of the new file to agree with the old modes.
+SELINUXCONTEXT is the result of `file-selinux-context' on the original
+file; this means that the caller, after saving the buffer, should change
+the SELinux context of the new file to agree with the old context.
BACKUPNAME is the backup file name, which is the old file renamed."
(if (and make-backup-files (not backup-inhibited)
(not buffer-backed-up)
(or delete-old-versions
(y-or-n-p (format "Delete excess backup versions of %s? "
real-file-name)))))
- (modes (file-modes buffer-file-name)))
+ (modes (file-modes buffer-file-name))
+ (context (file-selinux-context buffer-file-name)))
;; Actually write the back up file.
(condition-case ()
(if (or file-precious-flag
(<= (nth 2 attr) backup-by-copying-when-privileged-mismatch)))
(or (nth 9 attr)
(not (file-ownership-preserved-p real-file-name)))))))
- (backup-buffer-copy real-file-name backupname modes)
+ (backup-buffer-copy real-file-name backupname modes context)
;; rename-file should delete old backup.
(rename-file real-file-name backupname t)
- (setq setmodes (cons modes backupname)))
+ (setq setmodes (list modes context backupname)))
(file-error
;; If trouble writing the backup, write it in ~.
(setq backupname (expand-file-name
(message "Cannot write backup file; backing up in %s"
backupname)
(sleep-for 1)
- (backup-buffer-copy real-file-name backupname modes)))
+ (backup-buffer-copy real-file-name backupname modes context)))
(setq buffer-backed-up t)
;; Now delete the old versions, if desired.
(if delete-old-versions
setmodes)
(file-error nil))))))
-(defun backup-buffer-copy (from-name to-name modes)
+(defun backup-buffer-copy (from-name to-name modes context)
(let ((umask (default-file-modes)))
(unwind-protect
(progn
;; Reset the umask.
(set-default-file-modes umask)))
(and modes
- (set-file-modes to-name (logand modes #o1777))))
+ (set-file-modes to-name (logand modes #o1777)))
+ (and context
+ (set-file-selinux-context to-name context)))
(defun file-name-sans-versions (name &optional keep-backup-version)
"Return file NAME sans backup versions or strings.
(nthcdr 10 (file-attributes buffer-file-name)))
(if setmodes
(condition-case ()
- (set-file-modes buffer-file-name (car setmodes))
+ (progn
+ (set-file-modes buffer-file-name (car setmodes))
+ (set-file-selinux-context buffer-file-name (nth 1 setmodes)))
(error nil))))
;; If the auto-save file was recent before this command,
;; delete it now.
;; This does the "real job" of writing a buffer into its visited file
;; and making a backup file. This is what is normally done
;; but inhibited if one of write-file-functions returns non-nil.
-;; It returns a value (MODES . BACKUPNAME), like backup-buffer.
+;; It returns a value (MODES SELINUXCONTEXT BACKUPNAME), like backup-buffer.
(defun basic-save-buffer-1 ()
(prog1
(if save-buffer-coding-system
(setq buffer-file-coding-system-explicit
(cons last-coding-system-used nil)))))
-;; This returns a value (MODES . BACKUPNAME), like backup-buffer.
+;; This returns a value (MODES SELINUXCONTEXT BACKUPNAME), like backup-buffer.
(defun basic-save-buffer-2 ()
(let (tempsetmodes setmodes)
(if (not (file-writable-p buffer-file-name))
;; Since we have created an entirely new file,
;; make sure it gets the right permission bits set.
(setq setmodes (or setmodes
- (cons (or (file-modes buffer-file-name)
+ (list (or (file-modes buffer-file-name)
(logand ?\666 umask))
+ (file-selinux-context buffer-file-name)
buffer-file-name)))
;; We succeeded in writing the temp file,
;; so rename it.
;; (setmodes is set) because that says we're superseding.
(cond ((and tempsetmodes (not setmodes))
;; Change the mode back, after writing.
- (setq setmodes (cons (file-modes buffer-file-name) buffer-file-name))
- (set-file-modes buffer-file-name (logior (car setmodes) 128))))
+ (setq setmodes (list (file-modes buffer-file-name)
+ (file-selinux-context buffer-file-name)
+ buffer-file-name))
+ (set-file-modes buffer-file-name (logior (car setmodes) 128))
+ (set-file-selinux-context buffer-file-name (nth 1 setmodes)))))
(let (success)
(unwind-protect
(progn
;; the backup by renaming, undo the backing-up.
(and setmodes (not success)
(progn
- (rename-file (cdr setmodes) buffer-file-name t)
- (setq buffer-backed-up nil)))))))
+ (rename-file (nth 2 setmodes) buffer-file-name t)
+ (setq buffer-backed-up nil))))))
setmodes))
(defun diff-buffer-with-file (&optional buffer)
(kill-buffer-ask buffer)))))
\f
-(defun auto-save-mode (arg)
- "Toggle auto-saving of contents of current buffer.
-With prefix argument ARG, turn auto-saving on if positive, else off."
- (interactive "P")
- (setq buffer-auto-save-file-name
- (and (if (null arg)
- (or (not buffer-auto-save-file-name)
- ;; If auto-save is off because buffer has shrunk,
- ;; then toggling should turn it on.
- (< buffer-saved-size 0))
- (or (eq arg t) (listp arg) (and (integerp arg) (> arg 0))))
- (if (and buffer-file-name auto-save-visited-file-name
- (not buffer-read-only))
- buffer-file-name
- (make-auto-save-file-name))))
- ;; If -1 was stored here, to temporarily turn off saving,
- ;; turn it back on.
- (and (< buffer-saved-size 0)
- (setq buffer-saved-size 0))
- (if (called-interactively-p 'interactive)
- (message "Auto-save %s (in this buffer)"
- (if buffer-auto-save-file-name "on" "off")))
- buffer-auto-save-file-name)
-
(defun rename-auto-save-file ()
"Adjust current buffer's auto save file name for current conditions.
Also rename any existing auto save file, if it was made in this session."
except that the variable `find-ls-option' specifies what to use
as the final argument."
- (interactive (list (read-file-name "Run find in directory: " nil "" t)
+ (interactive (list (read-directory-name "Run find in directory: " nil "" t)
(read-string "Run find (with args): " find-args
'(find-args-history . 1))))
(let ((dired-buffers dired-buffers))
;; This mode uses the Keywords library header to provide code-finding
;; services by keyword.
-;;
-;; Things to do:
-;; 1. Support multiple keywords per search. This could be extremely hairy;
-;; there doesn't seem to be any way to get completing-read to exit on
-;; an EOL with no substring pending, which is what we'd want to end the loop.
-;; 2. Search by string in synopsis line?
-;; 3. Function to check finder-package-info for unknown keywords.
;;; Code:
f)))
(prin1 summary (current-buffer))
(insert "\n ")
- (princ keywords (current-buffer))
+ (prin1 (mapcar 'intern keywords) (current-buffer))
(insert ")\n")))
(directory-files d nil
;; Allow compressed files also. FIXME:
'(mouse-face highlight
help-echo finder-help-echo))))
+(defun finder-unknown-keywords ()
+ "Return an alist of unknown keywords and number of their occurences.
+Unknown are keywords that are present in `finder-package-info'
+but absent in `finder-known-keywords'."
+ (let ((unknown-keywords-hash (make-hash-table)))
+ ;; Prepare a hash where key is a keyword
+ ;; and value is the number of keyword occurences.
+ (mapc (lambda (package)
+ (mapc (lambda (keyword)
+ (unless (assq keyword finder-known-keywords)
+ (puthash keyword
+ (1+ (gethash keyword unknown-keywords-hash 0))
+ unknown-keywords-hash)))
+ (nth 2 package)))
+ finder-package-info)
+ ;; Make an alist from the hash and sort by the keyword name.
+ (sort (let (unknown-keywords-list)
+ (maphash (lambda (key value)
+ (push (cons key value) unknown-keywords-list))
+ unknown-keywords-hash)
+ unknown-keywords-list)
+ (lambda (a b) (string< (car a) (car b))))))
+
;;;###autoload
(defun finder-list-keywords ()
"Display descriptions of the keywords in the Finder buffer."
;;; Code:
(require 'syntax)
+(eval-when-compile (require 'cl))
;; Define core `font-lock' group.
(defgroup font-lock '((jit-lock custom-group))
(declare-function lazy-lock-mode "lazy-lock")
(defun font-lock-turn-on-thing-lock ()
- (let ((thing-mode (font-lock-value-in-major-mode font-lock-support-mode)))
- (cond ((eq thing-mode 'fast-lock-mode)
- (fast-lock-mode t))
- ((eq thing-mode 'lazy-lock-mode)
- (lazy-lock-mode t))
- ((eq thing-mode 'jit-lock-mode)
- ;; Prepare for jit-lock
- (remove-hook 'after-change-functions
- 'font-lock-after-change-function t)
- (set (make-local-variable 'font-lock-fontify-buffer-function)
- 'jit-lock-refontify)
- ;; Don't fontify eagerly (and don't abort if the buffer is large).
- (set (make-local-variable 'font-lock-fontified) t)
- ;; Use jit-lock.
- (jit-lock-register 'font-lock-fontify-region
- (not font-lock-keywords-only))
- ;; Tell jit-lock how we extend the region to refontify.
- (add-hook 'jit-lock-after-change-extend-region-functions
- 'font-lock-extend-jit-lock-region-after-change
- nil t)))))
+ (case (font-lock-value-in-major-mode font-lock-support-mode)
+ (fast-lock-mode (fast-lock-mode t))
+ (lazy-lock-mode (lazy-lock-mode t))
+ (jit-lock-mode
+ ;; Prepare for jit-lock
+ (remove-hook 'after-change-functions
+ 'font-lock-after-change-function t)
+ (set (make-local-variable 'font-lock-fontify-buffer-function)
+ 'jit-lock-refontify)
+ ;; Don't fontify eagerly (and don't abort if the buffer is large).
+ (set (make-local-variable 'font-lock-fontified) t)
+ ;; Use jit-lock.
+ (jit-lock-register 'font-lock-fontify-region
+ (not font-lock-keywords-only))
+ ;; Tell jit-lock how we extend the region to refontify.
+ (add-hook 'jit-lock-after-change-extend-region-functions
+ 'font-lock-extend-jit-lock-region-after-change
+ nil t))))
(defun font-lock-turn-off-thing-lock ()
(cond ((bound-and-true-p fast-lock-mode)
(if forms-forms-scroll
(progn
(local-set-key [remap scroll-up] 'forms-next-record)
- (local-set-key [remap scroll-down] 'forms-prev-record)))
+ (local-set-key [remap scroll-down] 'forms-prev-record)
+ (local-set-key [remap scroll-up-command] 'forms-next-record)
+ (local-set-key [remap scroll-down-command] 'forms-prev-record)))
;;
;; beginning-of-buffer -> forms-first-record
;; end-of-buffer -> forms-end-record
;;; Commentary:
;;; Code:
+(eval-when-compile (require 'cl))
(defvar frame-creation-function-alist
(list (cons nil
(modify-frame-parameters (selected-frame)
(list (cons 'border-color color-name))))
-(defun auto-raise-mode (arg)
+(define-minor-mode auto-raise-mode
"Toggle whether or not the selected frame should auto-raise.
With ARG, turn auto-raise mode on if and only if ARG is positive.
Note that this controls Emacs's own auto-raise feature.
Some window managers allow you to enable auto-raise for certain windows.
You can use that for Emacs windows if you wish, but if you do,
that is beyond the control of Emacs and this command has no effect on it."
- (interactive "P")
- (if (null arg)
- (setq arg
- (if (cdr (assq 'auto-raise (frame-parameters (selected-frame))))
- -1 1)))
- (if (> arg 0)
- (raise-frame (selected-frame)))
- (modify-frame-parameters (selected-frame)
- (list (cons 'auto-raise (> arg 0)))))
+ :variable (frame-parameter nil 'auto-raise)
+ (if (frame-parameter nil 'auto-raise)
+ (raise-frame)))
-(defun auto-lower-mode (arg)
+(define-minor-mode auto-lower-mode
"Toggle whether or not the selected frame should auto-lower.
With ARG, turn auto-lower mode on if and only if ARG is positive.
Note that this controls Emacs's own auto-lower feature.
Some window managers allow you to enable auto-lower for certain windows.
You can use that for Emacs windows if you wish, but if you do,
that is beyond the control of Emacs and this command has no effect on it."
- (interactive "P")
- (if (null arg)
- (setq arg
- (if (cdr (assq 'auto-lower (frame-parameters (selected-frame))))
- -1 1)))
- (modify-frame-parameters (selected-frame)
- (list (cons 'auto-lower (> arg 0)))))
+ :variable (frame-parameter nil 'auto-lower))
+
(defun set-frame-name (name)
"Set the name of the selected frame to NAME.
When called interactively, prompt for the name of the frame.
+2010-05-20 Kevin Ryde <user42@zip.com.au>
+
+ * gnus-start.el (gnus-level-unsubscribed): Doc fix. (Bug#6206)
+
+2010-05-14 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-sum.el (gnus-summary-save-article): Don't bother to re-fetch
+ article unless decoding article to be saved.
+
+2010-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mml1991.el (mml1991-mailcrypt-encrypt, mml1991-gpg-encrypt)
+ * mml2015.el (mml2015-gpg-encrypt): Disable multibyte in buffers
+ generated within the mm-with-unibyte-current-buffer macro.
+
+2010-05-13 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-bind-safe-url-regexp): Bind mm-w3m-safe-url-regexp
+ to nil when we're in a mml-preview buffer and no group is selected.
+
+2010-05-12 Andreas Seltenreich <seltenreich@gmx.de>
+
+ * gnus-sum.el (gnus-summary-read-group-1): Don't jump to next group
+ when catching the `C-g'. Reported by: "Leo"
+
+2010-05-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * message.el (message-forward-make-body-plain)
+ (message-forward-make-body-mml): Use mm-multibyte-string-p instead of
+ multibyte-string-p.
+
+2010-05-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * message.el (message-forward-make-body-mml): Assume original message
+ is multibyte string; error on unibyte.
+ (message-forward-make-body-plain): Ditto; don't add excessive newline
+ in body end.
+
+2010-05-11 Andreas Seltenreich <seltenreich@gmx.de>
+
+ * gnus-sum.el (gnus-summary-kill-thread): Use gnus-summary-mark-article
+ instead of g-s-m-a-as-unread to set the expirable mark. (Bug#5284)
+
+2010-05-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-extern.el (mm-extern-url): Don't use
+ mm-with-unibyte-current-buffer.
+ (mm-extern-cache-contents): Use with-current-buffer instead of
+ save-excursion + set-buffer.
+
+2010-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-util.el (mm-emacs-mule): Remove.
+
+2010-05-10 Andreas Seltenreich <seltenreich@gmx.de>
+
+ * gnus-sum.el (gnus-summary-mode): Don't make minor-mode-alist
+ buffer-local as it's incompatible with Stefan Monnier's 2010-05-03
+ change.
+
+2010-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-util.el (mm-with-unibyte-current-buffer): Redefine it so as not to
+ bind the default value of enable-multibyte-characters to nil.
+
+2010-05-10 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * message.el (message-forward-make-body-plain)
+ (message-forward-make-body-mml):
+ Don't use mm-with-unibyte-current-buffer.
+
+2010-05-07 Christian von Roques <roques@mti.ag> (tiny change)
+
+ * mml2015.el (mml2015-epg-find-usable-key): Skip disabled key
+ (Bug#5592).
+
+2010-05-07 Julien Danjou <julien@danjou.info>
+
+ * gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass
+ it to mm-pipe-part.
+
+ * mm-decode.el (mm-pipe-part): Add optional argument `cmd'; use it if
+ it is given.
+
+2010-05-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * nnweb.el (nnweb-gmane-search)
+ * yenc.el (yenc-decode-region): Don't run set-buffer-multibyte for
+ XEmacs.
+
+ * gnus-art.el (gnus-article-browse-html-parts)
+ * gnus-group.el (gnus-read-ephemeral-gmane-group)
+ (gnus-read-ephemeral-bug-grou): Use mm-make-temp-file instead of
+ make-temp-file.
+
+ * gnus-dired.el (gnus-dired-mode): Bind gnus-dired-mode-hook,
+ gnus-dired-mode-on-hook and gnus-dired-mode-off-hook for XEmacs when
+ compiling.
+
+ * gnus-ml.el (gnus-mailing-list-mode): Bind gnus-mailing-list-mode-hook,
+ gnus-mailing-list-mode-on-hook and gnus-mailing-list-mode-off-hook for
+ XEmacs when compiling.
+
+ * gnus-salt.el (gnus-pick-mode): Bind gnus-pick-mode-on-hook and
+ gnus-pick-mode-off-hook for XEmacs when compiling.
+ (gnus-binary-mode): Bind gnus-binary-mode-on-hook and
+ gnus-binary-mode-off-hook for XEmacs when compiling.
+
+ * gnus-sum.el (gnus-summary-limit-strange-charsets-predicate): Return
+ nil if char-charset is not available.
+
+ * sieve-manage.el (sieve-manage-disable-multibyte): Redefine it as a
+ macro.
+
+ * mm-url.el (mm-url-form-encode-xwfu): Use mm-encode-coding-string
+ instead of encode-coding-string.
+
+ * mm-util.el (mm-enable-multibyte, mm-disable-multibyte): Use (featurep
+ 'xemacs) instead of mm-emacs-mule to switch function definitions.
+ (mm-with-unibyte-current-buffer): Make it a progn macro for XEmacs.
+
+2010-05-06 Tommi Vainikainen <thv@iki.fi> (tiny change)
+
+ * mml-sec.el (mml-secure-message-sign): Fix cut and paste error.
+
+2010-05-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-dired.el, gnus-draft.el, gnus-ml.el, gnus-salt.el, gnus-sum.el,
+ gnus-undo.el, mml.el: Require easy-mmode for XEmacs when compiling.
+
+2010-05-03 Juanma Barranquero <lekktu@gmail.com>
+
+ * mm-util.el (mm-decompress-buffer): Use `delete-file';
+ alias `jka-compr-delete-temp-file' no longer exists.
+
+2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Use define-minor-mode in Gnus where applicable.
+ * mml.el (mml-mode): Use define-minor-mode.
+ * gnus-undo.el (gnus-undo-mode-map): Initialize in declaration.
+ (gnus-undo-mode): Use define-minor-mode.
+ * gnus-sum.el (gnus-dead-summary-mode-map): Initialize in declaration.
+ (gnus-dead-summary-mode): Use define-minor-mode.
+ * gnus-salt.el (gnus-pick-mode-map, gnus-binary-mode-map):
+ Initialize in declaration.
+ (gnus-pick-mode, gnus-binary-mode): Use define-minor-mode.
+ * gnus-ml.el (gnus-mailing-list-mode-map): Initialize in declaration.
+ (gnus-mailing-list-mode): Use define-minor-mode.
+ * gnus-draft.el (gnus-draft-mode-map): Initialize in declaration.
+ (gnus-draft-mode): Use define-minor-mode.
+ * gnus-dired.el (gnus-dired-mode-map): Initialize in declaration.
+ (gnus-dired-mode): Use define-minor-mode.
+
+2010-05-01 Andreas Seltenreich <seltenreich@gmx.de>
+
+ * mml.el (mml-generate-mime-1,mml-compute-boundary-1): Update 'mml
+ handles on recursive mml-to-mime translation and check them for
+ boundary delimiter collisions. Reported by: Greg Troxel.
+
+2010-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-util.el: Don't load tm and apel XEmacs packages when compiling.
+
+2010-04-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * mm-util.el (mm-find-buffer-file-coding-system):
+ * yenc.el (yenc-decode-region): Don't let-bind a read-only variable.
+
2010-04-22 Andreas Seltenreich <seltenreich@gmx.de>
* message.el (message-generate-headers): Record insertion of optional
* nnir.el: Don't mention CVS.
+2010-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * gnus-sum.el (gnus-summary-bookmark-make-record):
+ Add `location' field.
+
+2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * gnus-sum.el: Add bookmark declarations to silence the compiler.
+ (gnus-mark-xrefs-as-read, gnus-summary-limit-to-bodies):
+ Use with-current-buffer to silence the byte-compiler.
+ (gnus-summary-bookmark-make-record): Use derived-mode-p and don't
+ bother to require `gnus'.
+ (gnus-summary-bookmark-jump): Don't forget to autoload. Simplify.
+
+2010-04-12 Thierry Volpiatto <thierry.volpiatto@gmail.com>
+
+ * gnus-sum.el (gnus-summary-bookmark-make-record)
+ (gnus-summary-bookmark-jump): New functions.
+ (gnus-summary-mode): Setup bookmark support.
+
2010-04-01 Andreas Schwab <schwab@linux-m68k.org>
* mm-uu.el (mm-uu-pgp-signed-extract-1): Use buffer-file-coding-system
if set.
-2010-03-29 Katsumi Yamaoka <yamaoka@jpl.org>
+2010-03-31 Katsumi Yamaoka <yamaoka@jpl.org>
- * mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag.
+ * gnus-art.el (gnus-article-browse-html-save-cid-content): Rename from
+ gnus-article-browse-html-save-cid-image; make it work recursively for
+ forwarded messages as well.
+ (gnus-article-browse-html-parts): Work when prefix arg is given.
+ (gnus-article-browse-html-article): Doc fix.
-2010-03-27 Chong Yidong <cyd@stupidchicken.com>
+2010-03-30 Chong Yidong <cyd@stupidchicken.com>
* message.el (message-default-mail-headers):
(message-default-headers): Carry the value mail-default-headers over
into message-default-mail-headers, rather than message-default-headers.
-2010-03-22 Juanma Barranquero <lekktu@gmail.com>
+2010-03-30 Martin Stjernholm <mast@lysator.liu.se>
+
+ * mm-decode.el (mm-add-meta-html-tag): Add option to override the
+ charset.
+
+ * gnus-art.el (gnus-article-browse-html-parts): Force the correct
+ charset into the <meta> tag when the article is encoded to utf-8.
+
+2010-03-30 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-browse-delete-temp-files):
+ Delete directories as well.
+ (gnus-article-browse-html-parts): Work for images that do not specify
+ file names; delete temp directory when quitting; insert header at the
+ right place; use file: scheme for image files.
+
+2010-03-30 Eric Schulte <schulte.eric@gmail.com>
+
+ * gnus-art.el (gnus-article-browse-html-save-cid-image): New function.
+ (gnus-article-browse-html-parts): Use it to make temporary cid image
+ files in addition to html file so that browser may display them.
+
+2010-03-29 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag.
+
+2010-03-29 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-pick): Fix for non-secrets specifier.
+
+2010-03-27 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-sources): Change default to be simpler.
+ Explain about Secret Service API sources. Improve Customize options.
+ (auth-source-pick): Change to accept any number of search parameters.
+ Implement fallbacks iteratively, not recursively. Add scoring on the
+ second pass and sort by score. Call Secret Service API when needed.
+ (auth-source-user-or-password): Use it. Call Secret Service API
+ directly when needed to get the user name and the password.
+
+2010-03-24 Juanma Barranquero <lekktu@gmail.com>
* message.el (message-interactive): Doc fix.
(message-qmail-inject-args): Reflow.
* smiley.el (smiley-buffer): Fix typo in docstring.
+2010-03-24 Glenn Morris <rgm@gnu.org>
+
+ * mail-source.el (gnus-message): Declare.
+ (mail-source-delete-old-incoming): Require gnus-util.
+
+2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (canlock-verify): Autoload it for Emacs 21.
+
+ * message.el (ecomplete-setup): Autoload it for Emacs <23.
+
+ * mml-sec.el (mml-secure-cache-passphrase): Default to t that is
+ password-cache's default if it is not bound.
+ (mml-secure-passphrase-cache-expiry): Default to 16 that is
+ password-cache-expiry's default if it is not bound.
+
+ * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not
+ available in Emacs 21.
+
+2010-03-23 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-sources): Fix up definition so extra parameters
+ are always inline.
+
+2010-03-22 Martin Stjernholm <mast@lysator.liu.se>
+
+ * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity
+ wasn't updated after mismatch. Clear cached mailbox info correctly
+ when uidvalidity changes.
+ (nnimap-group-prefixed-name): New function to avoid some code
+ duplication.
+ (nnimap-verify-uidvalidity, nnimap-group-overview-filename)
+ (nnimap-request-group): Use it.
+ (nnimap-retrieve-groups, nnimap-verify-uidvalidity)
+ (nnimap-update-unseen): Significantly improved speed of Gnus startup
+ with many imap folders. This is done by caching the group status from
+ the imap server persistently in a group parameter `imap-status'. (This
+ was cached before too if `nnimap-retrieve-groups-asynchronous' was set,
+ but not persistently, so every Gnus startup was still very slow.)
+
+2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el: Set up autoloads. Bump to 23.2 because of the
+ secrets.el dependency.
+ (auth-sources): Add optional user name. Add secrets.el configuration
+ choice (unused right now).
+
+2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * gnus-sum.el (gnus-summary-make-menu-bar): Let
+ `gnus-registry-install-shortcuts' fill in the functions.
+
+ * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid
+ warnings.
+ (gnus-registry-misc-menus): Variable to hold registry mark menus.
+ (gnus-registry-install-shortcuts): Populate and use it in a
+ `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks".
+
+2010-03-20 Martin Stjernholm <mast@lysator.liu.se>
+
+ * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name):
+ In-place substitutions for the group name encoding/decoding.
+ (nnimap-find-minmax-uid, nnimap-possibly-change-group)
+ (nnimap-retrieve-headers-progress, nnimap-possibly-change-group)
+ (nnimap-retrieve-headers-progress, nnimap-request-article-part)
+ (nnimap-update-unseen, nnimap-request-list)
+ (nnimap-retrieve-groups, nnimap-request-update-info-internal)
+ (nnimap-request-set-mark, nnimap-split-to-groups)
+ (nnimap-split-articles, nnimap-request-newgroups)
+ (nnimap-request-create-group, nnimap-request-accept-article)
+ (nnimap-request-delete-group, nnimap-request-rename-group)
+ (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with
+ `encoded-mbx' for consistency.
+ (nnimap-close-group): Call `imap-current-mailbox' instead of using the
+ variable `imap-current-mailbox'.
+
+ * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers)
+ (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'.
+
+2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs>
+
+ * pop3.el (pop3-display-message-size-flag): Display message size byte
+ counts during POP3 download.
+ (pop3-movemail): Use it.
+ (pop3-list): Implement listing of available messages.
+
+2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change)
+
+ * nnir.el (nnir-get-article-nov-override-function): New function to
+ override the normal NOV retrieval.
+ (nnir-retrieve-headers): Use it.
+
+2010-03-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * auth-source.el (netrc-machine-user-or-password): Autoload.
+
+2010-03-19 Glenn Morris <rgm@gnu.org>
+
+ Stop message.el from loading about 40 libraries it doesn't always need.
+ The general approach is to autoload rather than require, and to
+ require in the specific functions rather than the file. (Bug#5642)
+
+ * gmm-utils.el: Don't require wid-edit.
+ (widget-create-child-value, widget-convert, widget-default-get):
+ Autoload.
+
+ * gnus-util.el: Don't require time-date, netrc.
+ (message-fetch-field, gnus-group-name-decode): Declare rather than
+ autoloading.
+ (gnus-fetch-field): Require message.
+ (gnus-decode-newsgroups): Require gnus-group.
+
+ * ietf-drums.el: Don't require time-date.
+
+ * message.el: Don't require hashcash, canlock, ecomplete.
+ Do require mail-utils. Require nnheader only when compiling.
+ (smtpmail-default-smtp-server): Remove declaration.
+ (message-send-mail-function): Check smtpmail-default-smtp-server
+ is bound rather than requiring smtpmail.
+ (message-auto-save-directory, message-insert-signature): Use
+ expand-file-name rather than nnheader-concat.
+ (nnheader-insert-file-contents): Autoload.
+ (hashcash-wait-async): Declare.
+ (message-send-mail): Only call gnus-setup-posting-charset if
+ gnus-group-posting-charset-alist is bound. Require hashcash if needed.
+ (message-send-mail-with-sendmail): Require sendmail.
+ (canlock-password, canlock-password-for-verify): Declare.
+ (message-canlock-password): Require canlock.
+ (nnheader-get-report): Autoload.
+ (gnus-setup-posting-charset): Declare.
+ (message-send-news): Require gnus-msg.
+ (message-make-references, message-make-in-reply-to): Use mail-header-id
+ rather than the alias mail-header-message-id.
+ (ecomplete-add-item, ecomplete-save): Declare.
+ (message-put-addresses-in-ecomplete): Require ecomplete.
+ (ecomplete-display-matches): Autoload.
+
+ * mm-decode.el: Don't require mailcap, gnus-util.
+ (gnus-map-function, gnus-replace-in-string, gnus-read-shell-command)
+ (message-fetch-field, mailcap-parse-mailcaps, mailcap-mime-info):
+ Autoload.
+ (mailcap-mime-extensions): Declare.
+
+ * mm-encode.el: Don't require mailcap.
+ (mailcap-extension-to-mime): Autoload.
+
+ * mml-sec.el: Don't require password-cache.
+
+ * mml.el (gnus-setup-posting-charset): Declare rather than autoload.
+ (mailcap-parse-mimetypes, mailcap-mime-types): Declare.
+ (mml-minibuffer-read-type): Require mailcap.
+ (mml-preview): Require gnus-msg.
+
+ * mml1991.el: Require password-cache.
+ (password-cache-expiry): Remove declaration.
+
+ * mml2015.el: Require password-cache.
+ (password-cache-expiry): Remove declaration.
+
+ * nneething.el (mailcap): Require mailcap.
+
+ * nnheader.el: (declare-function): Add compatibility stub.
+ (message-remove-header): Declare rather than autoload.
+ (nnheader-replace-header): Require message.
+
+ * nnimap.el (declare-function): Add compatibility stub.
+ (netrc-parse, netrc-machine-user-or-password): Declare.
+ (nnimap-open-connection): Require netrc.
+
+ * nntp.el (declare-function): Add compatibility stub.
+ (netrc-parse, netrc-machine, netrc-get): Declare.
+ (nntp-send-authinfo): Require netrc.
+
+ * rfc2047.el: Don't require qp.
+ (quoted-printable-encode-region, quoted-printable-decode-string):
+ Autoload.
+
+ * sieve-mode.el: Don't require easymenu.
+ (easy-menu-add-item): Autoload it.
+
+ * spam-stat.el (time-to-number-of-days): Autoload it.
+
+2010-03-17 Kevin Ryde <user42@zip.com.au>
+
+ * mml.el (mml-read-tag): Unquote values with `read' to reverse
+ prin1 in mml-insert-tag (just stripping the quotes gave wrong
+ value if any backslash escapes).
+
+2010-03-15 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-util.el (mm-charset-to-coding-system): Use coding-system-from-name
+ if it is available. (bug#5647)
+
2010-02-26 Glenn Morris <rgm@gnu.org>
* message.el (message-send-mail-function): Change the default, so that
* gnus-start.el (gnus-slave-save-newsrc):
* gnus-uu.el (gnus-uu-tmp-dir, gnus-uu-decode-binhex)
- (gnus-uu-decode-binhex-view, gnus-uu-digest-mail-forward)
- (gnus-uu-initialize):
+ (gnus-uu-decode-binhex-view, gnus-uu-digest-mail-forward)
+ (gnus-uu-initialize):
* nnmail.el (nnmail-make-complex-temp-name, nnmail-get-new-mail):
- Use make-temp-file.
+ Use make-temp-file.
1999-09-07 Eli Zaretskii <eliz@gnu.org>
2003-02-08 Michael Welsh Duggan <md5i@cs.cmu.edu>
* nnmail.el (nnmail-split-it): If a message ends up matching the
- same mailbox more than once, it will cause duplicates to appear
- in the mailbox.
+ same mailbox more than once, it will cause duplicates to appear
+ in the mailbox.
2003-02-08 Simon Josefsson <jas@extundo.com>
2003-01-13 Jhair Tocancipa Triana <jhair_tocancipa@@gmx.net>
* gnus-audio.el (gnus-audio-au-player, gnus-audio-wav-player): Use
- /usr/bin/play as default player.
- (gnus-audio-play): Added ARG-DESCRIPTOR to prompt for a file to play.
+ /usr/bin/play as default player.
+ (gnus-audio-play): Added ARG-DESCRIPTOR to prompt for a file to play.
2003-01-14 Katsumi Yamaoka <yamaoka@jpl.org>
boolean not a string
* gnus-group.el (gnus-group-line-format): Add description of %C
* gnus-group.el (gnus-group-line-format-alist): Add gnus-tmp-comment
- as %C
+ as %C
* gnus-group.el (gnus-group-insert-group-line): Add gnus-tmp-comment.
2002-04-22 Paul Jarc <prj@po.cwru.edu>
2002-01-02 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-picon.el (gnus-picon-transform-newsgroups): Fix for the case
- "Newsgroups: rec.music.beatles.moderated, rec.music.beatles".
+ "Newsgroups: rec.music.beatles.moderated, rec.music.beatles".
2002-01-03 Steve Youngs <youngs@xemacs.org>
(imap-stream-alist): Backslash.
* gnus-sum.el (gnus-summary-limit-to-author): Missing arguments.
- Thanks to david.goldberg6@verizon.net (David S. Goldberg).
+ Thanks to david.goldberg6@verizon.net (David S. Goldberg).
2001-11-27 14:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
2001-10-30 13:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-spec.el (gnus-parse-simple-format): Use
- buffer-substring-no-properties.
+ buffer-substring-no-properties.
2001-10-30 Katsumi Yamaoka <yamaoka@jpl.org>
(require 'gnus-util)
(eval-when-compile (require 'cl))
-(eval-when-compile (require 'netrc))
+(autoload 'netrc-machine-user-or-password "netrc")
+(autoload 'secrets-search-items "secrets")
+(autoload 'secrets-get-alias "secrets")
+(autoload 'secrets-get-attribute "secrets")
+(autoload 'secrets-get-secret "secrets")
(defgroup auth-source nil
"Authentication sources."
"List of authentication protocols and their names"
:group 'auth-source
- :version "23.1" ;; No Gnus
+ :version "23.2" ;; No Gnus
:type '(repeat :tag "Authentication Protocols"
(cons :tag "Protocol Entry"
(symbol :tag "Protocol")
(string :tag "Name")))))
;;; generate all the protocols in a format Customize can use
+;;; TODO: generate on the fly from auth-source-protocols
(defconst auth-source-protocols-customize
(mapcar (lambda (a)
(let ((p (car-safe a)))
(defcustom auth-source-do-cache t
"Whether auth-source should cache information."
:group 'auth-source
- :version "23.1" ;; No Gnus
+ :version "23.2" ;; No Gnus
:type `boolean)
(defcustom auth-source-debug nil
If the value is a function, debug messages are logged by calling
that function using the same arguments as `message'."
:group 'auth-source
- :version "23.1" ;; No Gnus
- :type `(choice
+ :version "23.2" ;; No Gnus
+ :type `(choice
:tag "auth-source debugging mode"
(const :tag "Log using `message' to the *Messages* buffer" t)
(function :tag "Function that takes arguments like `message'")
"Whether auth-source should hide passwords in log messages.
Only relevant if `auth-source-debug' is not nil."
:group 'auth-source
- :version "23.1" ;; No Gnus
+ :version "23.2" ;; No Gnus
:type `boolean)
-(defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t))
+(defcustom auth-sources '((:source "~/.authinfo.gpg"))
"List of authentication sources.
-Each entry is the authentication type with optional properties."
+The default will get login and password information from a .gpg
+file, which you should set up with the EPA/EPG packages to be
+encrypted. See the auth.info manual for details.
+
+Each entry is the authentication type with optional properties.
+
+It's best to customize this with `M-x customize-variable' because the choices
+can get pretty complex."
:group 'auth-source
- :version "23.1" ;; No Gnus
+ :version "23.2" ;; No Gnus
:type `(repeat :tag "Authentication Sources"
(list :tag "Source definition"
(const :format "" :value :source)
- (string :tag "Authentication Source")
- (const :format "" :value :host)
- (choice :tag "Host (machine) choice"
- (const :tag "Any" t)
- (regexp :tag "Host (machine) regular expression (TODO)")
- (const :tag "Fallback" nil))
- (const :format "" :value :protocol)
- (choice :tag "Protocol"
- (const :tag "Any" t)
- (const :tag "Fallback" nil)
- ,@auth-source-protocols-customize))))
+ (choice :tag "Authentication backend choice"
+ (string :tag "Authentication Source (file)")
+ (list :tag "secrets.el (Secret Service API/KWallet/GNOME KeyRing)"
+ (const :format "" :value :secrets)
+ (choice :tag "Collection to use"
+ (string :tag "Collection name")
+ (const :tag "Default" 'default)
+ (const :tag "Login" "login")
+ (const :tag "Temporary" "session"))))
+ (repeat :tag "Extra Parameters" :inline t
+ (choice :tag "Extra parameter"
+ (list :tag "Host (omit to match as a fallback)"
+ (const :format "" :value :host)
+ (choice :tag "Host (machine) choice"
+ (const :tag "Any" t)
+ (regexp :tag "Host (machine) regular expression")))
+ (list :tag "Protocol (omit to match as a fallback)"
+ (const :format "" :value :protocol)
+ (choice :tag "Protocol"
+ (const :tag "Any" t)
+ ,@auth-source-protocols-customize))
+ (list :tag "User (omit to match as a fallback)" :inline t
+ (const :format "" :value :user)
+ (choice :tag "Personality or username"
+ (const :tag "Any" t)
+ (string :tag "Specific user name"))))))))
;; temp for debugging
;; (unintern 'auth-source-protocols)
;; (customize-variable 'auth-source-protocols)
;; (setq auth-source-protocols nil)
;; (format "%S" auth-source-protocols)
-;; (auth-source-pick "a" 'imap)
+;; (auth-source-pick nil :host "a" :port 'imap)
;; (auth-source-user-or-password "login" "imap.myhost.com" 'imap)
;; (auth-source-user-or-password "password" "imap.myhost.com" 'imap)
;; (auth-source-user-or-password-imap "login" "imap.myhost.com")
;; we also check the value
(when auth-source-debug
(let ((logger (if (functionp auth-source-debug)
- auth-source-debug
+ auth-source-debug
'message)))
(apply logger msg))))
-(defun auth-source-pick (host protocol &optional fallback)
- "Parse `auth-sources' for HOST, and PROTOCOL matches.
+;; (auth-source-pick nil :host "any" :protocol 'imap :user "joe")
+;; (auth-source-pick t :host "any" :protocol 'imap :user "joe")
+;; (setq auth-sources '((:source (:secrets default) :host t :protocol t :user "joe")
+;; (:source (:secrets "session") :host t :protocol t :user "joe")
+;; (:source (:secrets "login") :host t :protocol t)
+;; (:source "~/.authinfo.gpg" :host t :protocol t)))
+
+;; (setq auth-sources '((:source (:secrets default) :host t :protocol t :user "joe")
+;; (:source (:secrets "session") :host t :protocol t :user "joe")
+;; (:source (:secrets "login") :host t :protocol t)
+;; ))
+
+;; (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
-Returns fallback choices (where PROTOCOL or HOST are nil) with FALLBACK t."
- (interactive "sHost: \nsProtocol: \n") ;for testing
+(defun auth-source-pick (&rest spec)
+ "Parse `auth-sources' for matches of the SPEC plist.
+
+Common keys are :host, :protocol, and :user. A value of t in
+SPEC means to always succeed in the match. A string value is
+matched as a regex.
+
+The first pass skips fallback choices. If no choices are found
+on the first pass, a second pass is made including the fallback
+choices.
+
+For string (filename) sources, fallback choices are those where
+PROTOCOL or HOST are nil.
+
+For secrets.el collections, the :host and :protocol keys are not
+checked for fallback choices."
(let (choices)
- (dolist (choice auth-sources)
- (let ((h (plist-get choice :host))
- (p (plist-get choice :protocol)))
- (when (and
- (or (equal t h)
- (and (stringp h) (string-match h host))
- (and fallback (equal h nil)))
- (or (equal t p)
- (and (symbolp p) (equal p protocol))
- (and fallback (equal p nil))))
- (push choice choices))))
- (if choices
- choices
- (unless fallback
- (auth-source-pick host protocol t)))))
+ (dolist (fallback '(nil t))
+ (let ((keys (loop for i below (length spec) by 2
+ collect (nth i spec)))
+ (default-session-fallback "login"))
+ (dolist (choice auth-sources)
+ (let* ((s (plist-get choice :source))
+ ;; this is only set for Secret Service API specs (see secrets.el)
+ (coll (and (consp s) (plist-get s :secrets)))
+ (score 0))
+ (cond
+ (coll ; use secrets.el here
+ (when (eq coll 'default)
+ (setq coll (secrets-get-alias "default"))
+ (unless coll
+ (auth-source-do-debug
+ "No 'default' alias. Trying collection '%s'."
+ default-session-fallback)
+ (setq coll default-session-fallback)))
+ (let* ((coll-search (cond
+ ((stringp coll) coll)
+
+ ;; when the collection is nil:
+ ;; in fallback mode, accept it as any
+ ;; otherwise, hope to fail
+ ((null coll) (if fallback
+ nil
+ " *fallback-fail*"))))
+ ;; assemble a search query for secrets-search-items
+ ;; in fallback mode, host and protocol are not checked
+ (other-search (loop for k
+ in (if fallback
+ (remove :host
+ (remove :protocol keys))
+ keys)
+ append (list
+ k
+ ;; convert symbols to a string
+ (let ((v (plist-get spec k)))
+ (if (stringp v)
+ v
+ (prin1-to-string v))))))
+ ;; the score is based on how exact the search was,
+ ;; plus base score = 1 for any match
+ (score (1+ (length other-search)))
+ (results (apply 'secrets-search-items
+ coll-search
+ other-search)))
+ (auth-source-do-debug
+ "auth-source-pick: got items %s in collection '%s' + %s"
+ results coll-search other-search)
+ ;; put the results in the choices variable
+ (dolist (result results)
+ (setq choices (cons (list score
+ `(:source secrets
+ :item ,result
+ :collection ,coll
+ :search ,coll-search
+ ,@other-search))
+ choices)))))
+ ;; this is any non-secrets spec (currently means a string filename)
+ (t
+ (let ((match t))
+ (dolist (k keys)
+ (let* ((v (plist-get spec k))
+ (choicev (plist-get choice k)))
+ (setq match
+ (and match
+ (or (eq t choicev) ; source always matches spec key
+ ;; source key gives regex to match against spec
+ (and (stringp choicev) (string-match choicev v))
+ ;; source key gives symbol to match against spec
+ (and (symbolp choicev) (eq choicev v))
+ ;; in fallback mode, missing source key is OK
+ fallback)))
+ (when match (incf score)))) ; increment the score for each match
+
+ ;; now if the whole iteration resulted in a match:
+ (when match
+ (setq choices (cons (list score choice) choices))))))))
+ ;; when there were matches, skip the second pass
+ (when choices (return choices))))
+
+ ;; return the results sorted by score
+ (mapcar 'cadr (sort choices (lambda (x y) (> (car x) (car y)))))))
(defun auth-source-forget-user-or-password (mode host protocol)
(interactive "slogin/password: \nsHost: \nsProtocol: \n") ;for testing
(interactive)
(setq auth-source-cache (make-hash-table :test 'equal)))
-(defun auth-source-user-or-password (mode host protocol)
+;; (progn
+;; (auth-source-forget-all-cached)
+;; (list
+;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other")
+;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other" "tzz")
+;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other" "joe")))
+
+(defun auth-source-user-or-password (mode host protocol &optional username)
"Find MODE (string or list of strings) matching HOST and PROTOCOL.
+
+USERNAME is optional and will be used as \"login\" in a search
+across the Secret Service API (see secrets.el) if the resulting
+items don't have a username. This means that if you search for
+username \"joe\" and it matches an item but the item doesn't have
+a :user attribute, the username \"joe\" will be returned.
+
MODE can be \"login\" or \"password\" for example."
(auth-source-do-debug
- "auth-source-user-or-password: get %s for %s (%s)"
- mode host protocol)
+ "auth-source-user-or-password: get %s for %s (%s) + user=%s"
+ mode host protocol username)
(let* ((listy (listp mode))
(mode (if listy mode (list mode)))
- (cname (format "%s %s:%s" mode host protocol))
+ (extras (when username `(:user ,username)))
+ (cname (format "%s %s:%s %s" mode host protocol extras))
+ (search (list :host host :protocol protocol))
+ (search (if username (append search (list :user username)) search))
(found (gethash cname auth-source-cache)))
(if found
(progn
(auth-source-do-debug
- "auth-source-user-or-password: cached %s=%s for %s (%s)"
+ "auth-source-user-or-password: cached %s=%s for %s (%s) + %s"
mode
;; don't show the password
- (if (and (member "password" mode) auth-source-hide-passwords) "SECRET" found)
- host protocol)
- found)
- (dolist (choice (auth-source-pick host protocol))
- (setq found (netrc-machine-user-or-password
- mode
- (plist-get choice :source)
- (list host)
- (list (format "%s" protocol))
- (auth-source-protocol-defaults protocol)))
+ (if (and (member "password" mode) auth-source-hide-passwords)
+ "SECRET"
+ found)
+ host protocol extras)
+ found) ; return the found data
+ ;; else, if not found
+ (dolist (choice (apply 'auth-source-pick search))
+ (setq found (cond
+ ;; the secrets.el spec
+ ((eq (plist-get choice :source) 'secrets)
+ (let ((coll (plist-get choice :search))
+ (item (plist-get choice :item)))
+ (mapcar (lambda (m)
+ (if (equal "password" m)
+ (secrets-get-secret coll item)
+ ;; the user name is either
+ (or
+ ;; the secret's attribute :user, or
+ (secrets-get-attribute coll item :user)
+ ;; the originally requested :user
+ username
+ "unknown-user")))
+ mode)))
+ (t ; anything else is netrc
+ (netrc-machine-user-or-password
+ mode
+ (plist-get choice :source)
+ (list host)
+ (list (format "%s" protocol))
+ (auth-source-protocol-defaults protocol)))))
(when found
(auth-source-do-debug
- "auth-source-user-or-password: found %s=%s for %s (%s)"
+ "auth-source-user-or-password: found %s=%s for %s (%s) + %s"
mode
;; don't show the password
(if (and (member "password" mode) auth-source-hide-passwords) "SECRET" found)
- host protocol)
+ host protocol extras)
(setq found (if listy found (car-safe found)))
(when auth-source-do-cache
(puthash cname found auth-source-cache)))
(return found)))))
-
+
(defun auth-source-protocol-defaults (protocol)
"Return a list of default ports and names for PROTOCOL."
(cdr-safe (assoc protocol auth-source-protocols)))
;;; Code:
-(require 'wid-edit)
-
(defgroup gmm nil
"Utility functions for Gnus, Message and MML."
:prefix "gmm-"
"Non-nil if SYMBOL is a widget."
(get symbol 'widget-type))
+(autoload 'widget-create-child-value "wid-edit")
+(autoload 'widget-convert "wid-edit")
+(autoload 'widget-default-get "wid-edit")
+
;; Copy of the `nnmail-lazy' code from `nnmail.el':
(define-widget 'gmm-lazy 'default
"Base widget for recursive datastructures.
(setq selected-sets (nreverse selected-sets))
(gnus-make-directory dir)
- (gnus-message 7 "Fetching articles for %s..." group)
+ (gnus-message 7 "Fetching articles for %s..."
+ (gnus-agent-decoded-group-name group))
(unwind-protect
(while (setq articles (pop selected-sets))
(let (article)
(while (setq article (pop articles))
(gnus-message 10 "Fetching article %s for %s..."
- article group)
+ article
+ (gnus-agent-decoded-group-name group))
(when (or
(gnus-backlog-request-article group article
nntp-server-buffer)
(if articles
(progn
- (gnus-message 7 "Fetching headers for %s..." group)
+ (gnus-message 7 "Fetching headers for %s..."
+ (gnus-agent-decoded-group-name group))
;; Fetch them.
(gnus-make-directory (nnheader-translate-file-chars
(sit-for 1)
t)))))
(when group
- (gnus-message 5 "Regenerating in %s" group)
+ (gnus-message 5 "Regenerating in %s" (gnus-agent-decoded-group-name group))
(let* ((gnus-command-method (or gnus-command-method
(gnus-find-method-for-group group)))
(file (gnus-agent-article-name ".overview" group))
(or (not nov-arts)
(> (car downloaded) (car nov-arts))))
;; This entry is missing from the overview file
- (gnus-message 3 "Regenerating NOV %s %d..." group
+ (gnus-message 3 "Regenerating NOV %s %d..."
+ (gnus-agent-decoded-group-name group)
(car downloaded))
(let ((file (concat dir (number-to-string (car downloaded)))))
(mm-with-unibyte-buffer
;; `how' is neither `nil', `ask' nor `t' (i.e. `file'):
(gnus-y-or-n-p
(format "Delete temporary HTML file `%s'? " file))))
- (delete-file file)))
+ (if (file-directory-p file)
+ (gnus-delete-directory file)
+ (delete-file file))))
;; Also remove file from the list when not deleted or if file doesn't
;; exist anymore.
(setq gnus-article-browse-html-temp-list nil))
gnus-article-browse-html-temp-list)
+(defun gnus-article-browse-html-save-cid-content (cid handles directory)
+ "Find CID content in HANDLES and save it in a file in DIRECTORY.
+Return file name."
+ (save-match-data
+ (let (file type)
+ (catch 'found
+ (dolist (handle handles)
+ (cond
+ ((not (listp handle)))
+ ((equal (mm-handle-media-supertype handle) "multipart")
+ (when (setq file (gnus-article-browse-html-save-cid-content
+ cid handle directory))
+ (throw 'found file)))
+ ((equal (concat "<" cid ">") (mm-handle-id handle))
+ (setq file
+ (expand-file-name
+ (or (mail-content-type-get
+ (mm-handle-disposition handle) 'filename)
+ (mail-content-type-get
+ (setq type (mm-handle-type handle)) 'name)
+ (concat
+ (make-temp-name "cid")
+ (car (rassoc (car type) mailcap-mime-extensions))))
+ directory))
+ (mm-save-part-to-file handle file)
+ (throw 'found file))))))))
+
(defun gnus-article-browse-html-parts (list &optional header)
"View all \"text/html\" parts from LIST.
Recurse into multiparts. The optional HEADER that should be a decoded
message header will be added to the bodies of the \"text/html\" parts."
;; Internal function used by `gnus-article-browse-html-article'.
- (let (type file charset tmp-file showed)
+ (let (type file charset content cid-dir tmp-file showed)
;; Find and show the html-parts.
(dolist (handle list)
;; If HTML, show it:
(setq handle (mm-handle-cache handle)
type (mm-handle-type handle))
(equal (car type) "text/html"))))
- (when (or (setq charset (mail-content-type-get type 'charset))
- header
- (not file))
+ (setq charset (mail-content-type-get type 'charset)
+ content (mm-get-part handle))
+ (with-temp-buffer
+ (if (eq charset 'gnus-decoded)
+ (mm-enable-multibyte)
+ (mm-disable-multibyte))
+ (insert content)
+ ;; resolve cid contents
+ (let ((case-fold-search t)
+ cid-file)
+ (goto-char (point-min))
+ (while (re-search-forward "\
+<img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
+ nil t)
+ (unless cid-dir
+ (setq cid-dir (mm-make-temp-file "cid" t))
+ (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
+ (setq file nil
+ content nil)
+ (when (setq cid-file
+ (gnus-article-browse-html-save-cid-content
+ (match-string 2)
+ (with-current-buffer gnus-article-buffer
+ gnus-article-mime-handles)
+ cid-dir))
+ (replace-match (concat "file://" cid-file)
+ nil nil nil 1))))
+ (unless content (setq content (buffer-string))))
+ (when (or charset header (not file))
(setq tmp-file (mm-make-temp-file
;; Do we need to care for 8.3 filenames?
"mm-" nil ".html")))
;; Add a meta html tag to specify charset and a header.
(cond
(header
- (let (title eheader body hcharset coding)
+ (let (title eheader body hcharset coding force-charset)
(with-temp-buffer
(mm-enable-multibyte)
(setq case-fold-search t)
charset)
title (when title
(mm-encode-coding-string title charset))
- body (mm-encode-coding-string (mm-get-part handle)
- charset))
+ body (mm-encode-coding-string content charset)
+ force-charset t)
(setq hcharset (mm-find-mime-charset-region (point-min)
(point-max)))
(cond ((= (length hcharset) 1)
title (when title
(mm-encode-coding-string
title coding))
- body (mm-get-part handle))
+ body content)
(setq charset 'utf-8
eheader (mm-encode-coding-string
(buffer-string) charset)
title charset))
body (mm-encode-coding-string
(mm-decode-coding-string
- (mm-get-part handle) body)
- charset))))
+ content body)
+ charset)
+ force-charset t)))
(setq charset hcharset
eheader (mm-encode-coding-string
(buffer-string) coding)
title (when title
(mm-encode-coding-string
title coding))
- body (mm-get-part handle)))
+ body content))
(setq eheader (mm-string-as-unibyte (buffer-string))
- body (mm-get-part handle))))
+ body content)))
(erase-buffer)
(mm-disable-multibyte)
(insert body)
(when charset
- (mm-add-meta-html-tag handle charset))
+ (mm-add-meta-html-tag handle charset force-charset))
(when title
(goto-char (point-min))
(unless (search-forward "<title>" nil t)
(charset
(mm-with-unibyte-buffer
(insert (if (eq charset 'gnus-decoded)
- (mm-encode-coding-string
- (mm-get-part handle)
- (setq charset 'utf-8))
- (mm-get-part handle)))
+ (mm-encode-coding-string content
+ (setq charset 'utf-8))
+ content))
(if (or (mm-add-meta-html-tag handle charset)
(not file))
(mm-write-region (point-min) (point-max)
(defun gnus-article-browse-html-article (&optional arg)
"View \"text/html\" parts of the current article with a WWW browser.
+Inline images embedded in a message using the cid scheme, as they are
+generally considered to be safe, will be processed properly.
The message header is added to the beginning of every html part unless
the prefix argument ARG is given.
-Warning: Spammers use links to images in HTML articles to verify
-whether you have read the message. As
+Warning: Spammers use links to images (using the http scheme) in HTML
+articles to verify whether you have read the message. As
`gnus-article-browse-html-article' passes the HTML content to the
browser without eliminating these \"web bugs\" you should only
use it for mails from trusted senders.
If you always want to display HTML parts in the browser, set
-`mm-text-html-renderer' to nil."
+`mm-text-html-renderer' to nil.
+
+This command creates temporary files to pass HTML contents including
+images if any to the browser, and deletes them when exiting the group
+\(if you want)."
;; Cf. `mm-w3m-safe-url-regexp'
(interactive "P")
(if arg
(put-text-property (match-end 0) (point-max)
'face eface)))))))))
+(autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21.
+
(defun article-verify-cancel-lock ()
"Verify Cancel-Lock header."
(interactive)
(with-current-buffer gnus-article-current-summary
gnus-newsgroup-name)
gnus-newsgroup-name)))
- (if (cond ((stringp gnus-safe-html-newsgroups)
+ (if (cond ((not group)
+ ;; Maybe we're in a mml-preview buffer
+ ;; and no group is selected.
+ t)
+ ((stringp gnus-safe-html-newsgroups)
(string-match gnus-safe-html-newsgroups group))
((consp gnus-safe-html-newsgroups)
(member group gnus-safe-html-newsgroups)))
(when data
(mm-save-part data))))
-(defun gnus-mime-pipe-part ()
- "Pipe the MIME part under point to a process."
+(defun gnus-mime-pipe-part (&optional cmd)
+ "Pipe the MIME part under point to a process.
+Use CMD as the process."
(interactive)
(gnus-article-check-buffer)
(let ((data (get-text-property (point) 'gnus-data)))
(when data
- (mm-pipe-part data))))
+ (mm-pipe-part data cmd))))
(defun gnus-mime-view-part ()
"Interactively choose a viewing method for the MIME part under point."
;;; Code:
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(require 'dired)
(autoload 'mml-attach-file "mml")
(autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'?
(autoload 'message-buffers "message")
(autoload 'gnus-print-buffer "gnus-sum")
-(defvar gnus-dired-mode nil
- "Minor mode for intersections of MIME mail composition and dired.")
-
-(defvar gnus-dired-mode-map nil)
-
-(unless gnus-dired-mode-map
- (setq gnus-dired-mode-map (make-sparse-keymap))
-
- (define-key gnus-dired-mode-map "\C-c\C-m\C-a" 'gnus-dired-attach)
- (define-key gnus-dired-mode-map "\C-c\C-m\C-l" 'gnus-dired-find-file-mailcap)
- (define-key gnus-dired-mode-map "\C-c\C-m\C-p" 'gnus-dired-print))
+(defvar gnus-dired-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-m\C-a" 'gnus-dired-attach)
+ (define-key map "\C-c\C-m\C-l" 'gnus-dired-find-file-mailcap)
+ (define-key map "\C-c\C-m\C-p" 'gnus-dired-print)
+ map))
;; FIXME: Make it customizable, change the default to `mail-user-agent' when
;; this file is renamed (e.g. to `dired-mime.el').
gnus-user-agent)
(function :tag "Other")))
-(defun gnus-dired-mode (&optional arg)
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (defvar gnus-dired-mode-hook)
+ (defvar gnus-dired-mode-on-hook)
+ (defvar gnus-dired-mode-off-hook)))
+
+(define-minor-mode gnus-dired-mode
"Minor mode for intersections of gnus and dired.
\\{gnus-dired-mode-map}"
- (interactive "P")
- (when (eq major-mode 'dired-mode)
- (set (make-local-variable 'gnus-dired-mode)
- (if (null arg) (not gnus-dired-mode)
- (> (prefix-numeric-value arg) 0)))
- (when gnus-dired-mode
- (add-minor-mode 'gnus-dired-mode "" gnus-dired-mode-map)
- (save-current-buffer
- (run-hooks 'gnus-dired-mode-hook)))))
+ :keymap gnus-dired-mode-map
+ (unless (derived-mode-p 'dired-mode)
+ (setq gnus-dired-mode nil)))
;;;###autoload
(defun turn-on-gnus-dired-mode ()
(require 'nndraft)
(require 'gnus-agent)
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
;;; Draft minor mode
-(defvar gnus-draft-mode nil
- "Minor mode for providing a draft summary buffers.")
-
-(defvar gnus-draft-mode-map nil)
-
-(unless gnus-draft-mode-map
- (setq gnus-draft-mode-map (make-sparse-keymap))
-
- (gnus-define-keys gnus-draft-mode-map
- "Dt" gnus-draft-toggle-sending
- "e" gnus-draft-edit-message ;; Use `B w' for `gnus-summary-edit-article'
- "De" gnus-draft-edit-message
- "Ds" gnus-draft-send-message
- "DS" gnus-draft-send-all-messages))
+(defvar gnus-draft-mode-map
+ (let ((map (make-sparse-keymap)))
+ (gnus-define-keys map
+ "Dt" gnus-draft-toggle-sending
+ "e" gnus-draft-edit-message ;; Use `B w' for `gnus-summary-edit-article'
+ "De" gnus-draft-edit-message
+ "Ds" gnus-draft-send-message
+ "DS" gnus-draft-send-all-messages)
+ map))
(defun gnus-draft-make-menu-bar ()
(unless (boundp 'gnus-draft-menu)
["Send all messages" gnus-draft-send-all-messages t]
["Delete draft" gnus-summary-delete-article t]))))
-(defun gnus-draft-mode (&optional arg)
+(define-minor-mode gnus-draft-mode
"Minor mode for providing a draft summary buffers.
\\{gnus-draft-mode-map}"
- (interactive "P")
- (when (eq major-mode 'gnus-summary-mode)
- (when (set (make-local-variable 'gnus-draft-mode)
- (if (null arg) (not gnus-draft-mode)
- (> (prefix-numeric-value arg) 0)))
- ;; Set up the menu.
- (when (gnus-visual-p 'draft-menu 'menu)
- (gnus-draft-make-menu-bar))
- (add-minor-mode 'gnus-draft-mode " Draft" gnus-draft-mode-map)
- (gnus-run-hooks 'gnus-draft-mode-hook))))
+ :lighter " Draft" :keymap gnus-draft-mode-map
+ (cond
+ ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-draft-mode nil))
+ (gnus-draft-mode
+ ;; Set up the menu.
+ (when (gnus-visual-p 'draft-menu 'menu)
+ (gnus-draft-make-menu-bar)))))
;;; Commands
(unless range (setq range 500))
(when (< range 1)
(error "Invalid range: %s" range))
- (let ((tmpfile (make-temp-file
+ (let ((tmpfile (mm-make-temp-file
(format "%s.start-%s.range-%s." group start range)))
(gnus-thread-sort-functions '(gnus-thread-sort-by-number)))
(with-temp-file tmpfile
(cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
(when (stringp number)
(setq number (string-to-number number)))
- (let ((tmpfile (make-temp-file "gnus-temp-group-")))
+ (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")))
(with-temp-file tmpfile
(url-insert-file-contents (format mbox-url number))
(write-region (point-min) (point-max) tmpfile)
(require 'gnus)
(require 'gnus-msg)
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
;;; Mailing list minor mode
-(defvar gnus-mailing-list-mode nil
- "Minor mode for providing mailing-list commands.")
-
-(defvar gnus-mailing-list-mode-map nil)
+(defvar gnus-mailing-list-mode-map
+ (let ((map (make-sparse-keymap)))
+ (gnus-define-keys map
+ "\C-c\C-nh" gnus-mailing-list-help
+ "\C-c\C-ns" gnus-mailing-list-subscribe
+ "\C-c\C-nu" gnus-mailing-list-unsubscribe
+ "\C-c\C-np" gnus-mailing-list-post
+ "\C-c\C-no" gnus-mailing-list-owner
+ "\C-c\C-na" gnus-mailing-list-archive)
+ map))
(defvar gnus-mailing-list-menu)
-(unless gnus-mailing-list-mode-map
- (setq gnus-mailing-list-mode-map (make-sparse-keymap))
-
- (gnus-define-keys gnus-mailing-list-mode-map
- "\C-c\C-nh" gnus-mailing-list-help
- "\C-c\C-ns" gnus-mailing-list-subscribe
- "\C-c\C-nu" gnus-mailing-list-unsubscribe
- "\C-c\C-np" gnus-mailing-list-post
- "\C-c\C-no" gnus-mailing-list-owner
- "\C-c\C-na" gnus-mailing-list-archive))
-
(defun gnus-mailing-list-make-menu-bar ()
(unless (boundp 'gnus-mailing-list-menu)
(easy-menu-define
(gnus-mailing-list-mode 1))
(gnus-message 1 "no list-post in this message."))))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (defvar gnus-mailing-list-mode-hook)
+ (defvar gnus-mailing-list-mode-on-hook)
+ (defvar gnus-mailing-list-mode-off-hook)))
+
;;;###autoload
-(defun gnus-mailing-list-mode (&optional arg)
+(define-minor-mode gnus-mailing-list-mode
"Minor mode for providing mailing-list commands.
\\{gnus-mailing-list-mode-map}"
- (interactive "P")
- (when (eq major-mode 'gnus-summary-mode)
- (when (set (make-local-variable 'gnus-mailing-list-mode)
- (if (null arg) (not gnus-mailing-list-mode)
- (> (prefix-numeric-value arg) 0)))
- ;; Set up the menu.
- (when (gnus-visual-p 'mailing-list-menu 'menu)
- (gnus-mailing-list-make-menu-bar))
- (add-minor-mode 'gnus-mailing-list-mode " Mailing-List"
- gnus-mailing-list-mode-map)
- (gnus-run-hooks 'gnus-mailing-list-mode-hook))))
+ :lighter " Mailing-List"
+ :keymap gnus-mailing-list-mode-map
+ (cond
+ ((not (derived-mode-p 'gnus-summary-mode))
+ (setq gnus-mailing-list-mode nil))
+ (gnus-mailing-list-mode
+ ;; Set up the menu.
+ (when (gnus-visual-p 'mailing-list-menu 'menu)
+ (gnus-mailing-list-make-menu-bar)))))
;;; Commands
(require 'gnus-sum)
(require 'gnus-util)
(require 'nnmail)
+(require 'easymenu)
(defvar gnus-adaptive-word-syntax-table)
(const :tag "Always Install" t)
(const :tag "Ask Me" ask)))
+(defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning.
+
+(defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus
+
(defcustom gnus-registry-clean-empty t
"Whether the empty registry entries should be deleted.
Registry entries are considered empty when they have no groups
"Install the keyboard shortcuts and menus for the registry.
Uses `gnus-registry-marks' to find what shortcuts to install."
(let (keys-plist)
- (gnus-registry-do-marks
+ (setq gnus-registry-misc-menus nil)
+ (gnus-registry-do-marks
:char
(lambda (mark data)
(let ((function-format
;; all this just to get the mark, I must be doing it wrong
(intern ,(symbol-name mark))
articles ,remove t)
+ (gnus-message
+ 9
+ "Applying mark %s to %d articles"
+ ,(symbol-name mark) (length articles))
(dolist (article articles)
(gnus-summary-update-article
- article
+ article
(assoc article (gnus-data-list nil)))))))
(push (intern function-name) keys-plist)
- (push shortcut keys-plist)
- (gnus-message
+ (push shortcut keys-plist)
+ (push (vector (format "%s %s"
+ (upcase-initials variant-name)
+ (symbol-name mark))
+ (intern function-name) t)
+ gnus-registry-misc-menus)
+ (gnus-message
9
"Defined mark handling function %s"
function-name))))))
(gnus-define-keys-1
- '(gnus-registry-mark-map "M" gnus-summary-mark-map)
- keys-plist)))
+ '(gnus-registry-mark-map "M" gnus-summary-mark-map)
+ keys-plist)
+ (add-hook 'gnus-summary-menu-hook
+ (lambda ()
+ (easy-menu-add-item
+ gnus-summary-misc-menu
+ nil
+ (cons "Registry Marks" gnus-registry-misc-menus))))))
;;; use like this:
;;; (defalias 'gnus-user-format-function-M
;;; Code:
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(require 'gnus)
(require 'gnus-sum)
;;; gnus-pick-mode
;;;
-(defvar gnus-pick-mode nil
- "Minor mode for providing a pick-and-read interface in Gnus
-summary buffers.")
-
(defcustom gnus-pick-display-summary nil
"*Display summary while reading."
:type 'boolean
;;; Internal variables.
-(defvar gnus-pick-mode-map nil)
-
-(unless gnus-pick-mode-map
- (setq gnus-pick-mode-map (make-sparse-keymap))
-
- (gnus-define-keys gnus-pick-mode-map
- " " gnus-pick-next-page
- "u" gnus-pick-unmark-article-or-thread
- "." gnus-pick-article-or-thread
- gnus-down-mouse-2 gnus-pick-mouse-pick-region
- "\r" gnus-pick-start-reading))
+(defvar gnus-pick-mode-map
+ (let ((map (make-sparse-keymap)))
+ (gnus-define-keys map
+ " " gnus-pick-next-page
+ "u" gnus-pick-unmark-article-or-thread
+ "." gnus-pick-article-or-thread
+ gnus-down-mouse-2 gnus-pick-mouse-pick-region
+ "\r" gnus-pick-start-reading)
+ map))
(defun gnus-pick-make-menu-bar ()
(unless (boundp 'gnus-pick-menu)
["Start reading" gnus-pick-start-reading t]
["Switch pick mode off" gnus-pick-mode gnus-pick-mode]))))
-(defun gnus-pick-mode (&optional arg)
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (defvar gnus-pick-mode-on-hook)
+ (defvar gnus-pick-mode-off-hook)))
+
+(define-minor-mode gnus-pick-mode
"Minor mode for providing a pick-and-read interface in Gnus summary buffers.
\\{gnus-pick-mode-map}"
- (interactive "P")
- (when (eq major-mode 'gnus-summary-mode)
- (if (not (set (make-local-variable 'gnus-pick-mode)
- (if (null arg) (not gnus-pick-mode)
- (> (prefix-numeric-value arg) 0))))
- (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)
- ;; Make sure that we don't select any articles upon group entry.
- (set (make-local-variable 'gnus-auto-select-first) nil)
- ;; Change line format.
- (setq gnus-summary-line-format gnus-summary-pick-line-format)
- (setq gnus-summary-line-format-spec nil)
- (gnus-update-format-specifications nil 'summary)
- (gnus-update-summary-mark-positions)
- (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)
- (set (make-local-variable 'gnus-summary-goto-unread) 'never)
- ;; Set up the menu.
- (when (gnus-visual-p 'pick-menu 'menu)
- (gnus-pick-make-menu-bar))
- (add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map)
- (gnus-run-hooks 'gnus-pick-mode-hook))))
+ :lighter " Pick" :keymap gnus-pick-mode-map
+ (cond
+ ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-pick-mode nil))
+ ((not gnus-pick-mode)
+ ;; FIXME: a buffer-local minor mode removing globally from a hook??
+ (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message))
+ (t
+ ;; Make sure that we don't select any articles upon group entry.
+ (set (make-local-variable 'gnus-auto-select-first) nil)
+ ;; Change line format.
+ (setq gnus-summary-line-format gnus-summary-pick-line-format)
+ (setq gnus-summary-line-format-spec nil)
+ (gnus-update-format-specifications nil 'summary)
+ (gnus-update-summary-mark-positions)
+ ;; FIXME: a buffer-local minor mode adding globally to a hook??
+ (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)
+ (set (make-local-variable 'gnus-summary-goto-unread) 'never)
+ ;; Set up the menu.
+ (when (gnus-visual-p 'pick-menu 'menu)
+ (gnus-pick-make-menu-bar)))))
(defun gnus-pick-setup-message ()
"Make Message do the right thing on exit."
;;; gnus-binary-mode
;;;
-(defvar gnus-binary-mode nil
- "Minor mode for providing a binary group interface in Gnus summary buffers.")
-
(defvar gnus-binary-mode-hook nil
"Hook run in summary binary mode buffers.")
-(defvar gnus-binary-mode-map nil)
-
-(unless gnus-binary-mode-map
- (setq gnus-binary-mode-map (make-sparse-keymap))
-
- (gnus-define-keys
- gnus-binary-mode-map
- "g" gnus-binary-show-article))
+(defvar gnus-binary-mode-map
+ (let ((map (make-sparse-keymap)))
+ (gnus-define-keys map
+ "g" gnus-binary-show-article)
+ map))
(defun gnus-binary-make-menu-bar ()
(unless (boundp 'gnus-binary-menu)
'("Pick"
["Switch binary mode off" gnus-binary-mode t]))))
-(defun gnus-binary-mode (&optional arg)
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (defvar gnus-binary-mode-on-hook)
+ (defvar gnus-binary-mode-off-hook)))
+
+(define-minor-mode gnus-binary-mode
"Minor mode for providing a binary group interface in Gnus summary buffers."
- (interactive "P")
- (when (eq major-mode 'gnus-summary-mode)
- (make-local-variable 'gnus-binary-mode)
- (setq gnus-binary-mode
- (if (null arg) (not gnus-binary-mode)
- (> (prefix-numeric-value arg) 0)))
- (when gnus-binary-mode
- ;; Make sure that we don't select any articles upon group entry.
- (make-local-variable 'gnus-auto-select-first)
- (setq gnus-auto-select-first nil)
- (make-local-variable 'gnus-summary-display-article-function)
- (setq gnus-summary-display-article-function 'gnus-binary-display-article)
- ;; Set up the menu.
- (when (gnus-visual-p 'binary-menu 'menu)
- (gnus-binary-make-menu-bar))
- (add-minor-mode 'gnus-binary-mode " Binary" gnus-binary-mode-map)
- (gnus-run-hooks 'gnus-binary-mode-hook))))
+ :lighter " Binary" :keymap gnus-binary-mode-map
+ (cond
+ ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-binary-mode nil))
+ (gnus-binary-mode
+ ;; Make sure that we don't select any articles upon group entry.
+ (make-local-variable 'gnus-auto-select-first)
+ (setq gnus-auto-select-first nil)
+ (make-local-variable 'gnus-summary-display-article-function)
+ (setq gnus-summary-display-article-function 'gnus-binary-display-article)
+ ;; Set up the menu.
+ (when (gnus-visual-p 'binary-menu 'menu)
+ (gnus-binary-make-menu-bar)))))
(defun gnus-binary-display-article (article &optional all-header)
"Run ARTICLE through the binary decode functions."
should be less than this variable, are subscribed. Groups with
levels from `gnus-level-subscribed' (exclusive) upto this
variable (inclusive) are unsubscribed. See also
-`gnus-level-zombie', `gnus-level-killed' and the Info node `Group
+`gnus-level-zombie', `gnus-level-killed' and the Info node `(gnus)Group
Levels' for details.")
(defconst gnus-level-zombie 8
(defun gnus-slave-mode ()
"Minor mode for slave Gnusae."
+ ;; FIXME: gnus-slave-mode appears to never be set (i.e. it'll always be nil):
+ ;; Remove, or fix and use define-minor-mode.
(add-minor-mode 'gnus-slave-mode " Slave" (make-sparse-keymap))
(gnus-run-hooks 'gnus-slave-mode-hook))
nil)
(t
(save-excursion
+ ;; FIXME: Shouldn't save-restriction be done after set-buffer?
(save-restriction
(set-buffer nntp-server-buffer)
(goto-char (point-min))
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-when-compile
(require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(defvar tool-bar-mode)
(defvar gnus-tmp-header)
["Set expirable mark" gnus-summary-mark-as-expirable t]
["Set bookmark" gnus-summary-set-bookmark t]
["Remove bookmark" gnus-summary-remove-bookmark t])
- ("Registry Mark"
- ["Important" gnus-registry-set-article-Important-mark t]
- ["Not Important" gnus-registry-remove-article-Important-mark t]
- ["Work" gnus-registry-set-article-Work-mark t]
- ["Not Work" gnus-registry-remove-article-Work-mark t]
- ["Later" gnus-registry-set-article-Later-mark t]
- ["Not Later" gnus-registry-remove-article-Later-mark t]
- ["Personal" gnus-registry-set-article-Personal-mark t]
- ["Not Personal" gnus-registry-remove-article-Personal-mark t]
- ["To Do" gnus-registry-set-article-To-Do-mark t]
- ["Not To Do" gnus-registry-remove-article-To-Do-mark t])
("Limit to"
["Marks..." gnus-summary-limit-to-marks t]
["Subject..." gnus-summary-limit-to-subject t]
gnus-newsgroup-process-stack]
["Save" gnus-summary-save-process-mark t]
["Run command on marked..." gnus-summary-universal-argument t]))
+ ("Registry Marks")
("Scroll article"
["Page forward" gnus-summary-next-page
,@(if (featurep 'xemacs) '(t)
(declare-function turn-on-gnus-mailing-list-mode "gnus-ml" ())
-
+(defvar bookmark-make-record-function)
\f
(defun gnus-summary-mode (&optional group)
(gnus-simplify-mode-line)
(setq major-mode 'gnus-summary-mode)
(setq mode-name "Summary")
- (make-local-variable 'minor-mode-alist)
(use-local-map gnus-summary-mode-map)
(buffer-disable-undo)
(setq buffer-read-only t ;Disable modification
(gnus-run-mode-hooks 'gnus-summary-mode-hook)
(turn-on-gnus-mailing-list-mode)
(mm-enable-multibyte)
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'gnus-summary-bookmark-make-record)
(gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
(gnus-update-summary-mark-positions))
(progn
(set-buffer gnus-group-buffer)
(gnus-group-jump-to-group group)
- (gnus-group-next-unread-group 1)
(gnus-configure-windows 'group 'force))
(gnus-handle-ephemeral-exit quit-config))
;; Finally signal the quit.
"Look through all the headers and mark the Xrefs as read."
(let ((virtual (gnus-virtual-group-p from-newsgroup))
name info xref-hashtb idlist method nth4)
- (save-excursion
- (set-buffer gnus-group-buffer)
+ (with-current-buffer gnus-group-buffer
(when (setq xref-hashtb
(gnus-create-xref-hashtb from-newsgroup headers unreads))
(mapatoms
;;; Dead summaries.
-(defvar gnus-dead-summary-mode-map nil)
-
-(unless gnus-dead-summary-mode-map
- (setq gnus-dead-summary-mode-map (make-keymap))
- (suppress-keymap gnus-dead-summary-mode-map)
- (substitute-key-definition
- 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
- (dolist (key '("\C-d" "\r" "\177" [delete]))
- (define-key gnus-dead-summary-mode-map
- key 'gnus-summary-wake-up-the-dead))
- (dolist (key '("q" "Q"))
- (define-key gnus-dead-summary-mode-map key 'bury-buffer)))
-
-(defvar gnus-dead-summary-mode nil
- "Minor mode for Gnus summary buffers.")
-
-(defun gnus-dead-summary-mode (&optional arg)
+(defvar gnus-dead-summary-mode-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map)
+ (substitute-key-definition 'undefined 'gnus-summary-wake-up-the-dead map)
+ (dolist (key '("\C-d" "\r" "\177" [delete]))
+ (define-key map key 'gnus-summary-wake-up-the-dead))
+ (dolist (key '("q" "Q"))
+ (define-key map key 'bury-buffer))
+ map))
+
+(define-minor-mode gnus-dead-summary-mode
"Minor mode for Gnus summary buffers."
- (interactive "P")
- (when (eq major-mode 'gnus-summary-mode)
- (make-local-variable 'gnus-dead-summary-mode)
- (setq gnus-dead-summary-mode
- (if (null arg) (not gnus-dead-summary-mode)
- (> (prefix-numeric-value arg) 0)))
- (when gnus-dead-summary-mode
- (add-minor-mode
- 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map))))
+ :lighter " Dead" :keymap gnus-dead-summary-mode-map
+ (unless (derived-mode-p 'gnus-summary-mode)
+ (setq gnus-dead-summary-mode nil)))
(defun gnus-deaden-summary ()
"Make the current summary buffer into a dead summary buffer."
(gnus-summary-position-point))))
(defun gnus-summary-limit-strange-charsets-predicate (header)
- (let ((string (concat (mail-header-subject header)
- (mail-header-from header)))
- charset found)
- (dotimes (i (1- (length string)))
- (setq charset (format "%s" (char-charset (aref string (1+ i)))))
- (when (string-match "unicode\\|big\\|japanese" charset)
- (setq found t)))
- found))
+ (when (fboundp 'char-charset)
+ (let ((string (concat (mail-header-subject header)
+ (mail-header-from header)))
+ charset found)
+ (dotimes (i (1- (length string)))
+ (setq charset (format "%s" (char-charset (aref string (1+ i)))))
+ (when (string-match "unicode\\|big\\|japanese" charset)
+ (setq found t)))
+ found)))
(defun gnus-summary-limit-to-predicate (predicate)
"Limit to articles where PREDICATE returns non-nil.
(dolist (data gnus-newsgroup-data)
(let (gnus-mark-article-hook)
(gnus-summary-select-article t t nil (gnus-data-number data)))
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(article-goto-body)
(let* ((case-fold-search t)
(found (if headersp
(setq group (format "%s-%d" gnus-newsgroup-name article))
(gnus-summary-remove-process-mark article)
(when (gnus-summary-display-article article)
- (save-excursion
+ (save-excursion ;;What for?
(with-temp-buffer
(insert-buffer-substring gnus-original-article-buffer)
;; Remove some headers that may lead nndoc to make
((> unmark 0)
(gnus-summary-mark-article-as-unread gnus-unread-mark))
((= unmark 0)
- (gnus-summary-mark-article-as-unread gnus-expirable-mark))
+ (gnus-summary-mark-article nil gnus-expirable-mark))
(t
(gnus-summary-mark-article-as-unread gnus-ticked-mark)))
(setq articles (cdr articles))))
(gnus-message 1 "Article %d is unsaveable" article))
;; This is a real article.
(save-window-excursion
- (let ((gnus-display-mime-function (when decode
- gnus-display-mime-function))
- (gnus-article-prepare-hook (when decode
- gnus-article-prepare-hook)))
- (gnus-summary-select-article t t nil article)
- (gnus-summary-goto-subject article)))
+ (gnus-summary-select-article decode decode nil article)
+ (gnus-summary-goto-subject article))
(with-current-buffer save-buffer
(erase-buffer)
(insert-buffer-substring (if decode
(gnus-summary-limit (gnus-sorted-nunion old new))))
(gnus-summary-position-point)))
+;;; Bookmark support for Gnus.
+(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-prop-get "bookmark" (bookmark prop))
+(declare-function bookmark-default-handler "bookmark" (bmk))
+(declare-function bookmark-get-bookmark-record "bookmark" (bmk))
+
+(defun gnus-summary-bookmark-make-record ()
+ "Make a bookmark entry for a Gnus summary buffer."
+ (unless (and (derived-mode-p 'gnus-summary-mode) gnus-article-current)
+ (error "Please retry from the Gnus summary buffer")) ;[1]
+ (let* ((subject (elt (gnus-summary-article-header) 1))
+ (grp (car gnus-article-current))
+ (art (cdr gnus-article-current))
+ (head (gnus-summary-article-header art))
+ (id (mail-header-id head)))
+ `(,subject
+ ,@(bookmark-make-record-default 'point-only)
+ (location . ,(format "Gnus %s:%d:%s" grp art id))
+ (group . ,grp) (article . ,art)
+ (message-id . ,id) (handler . gnus-summary-bookmark-jump))))
+
+;;;###autoload
+(defun gnus-summary-bookmark-jump (bookmark)
+ "Handler function for record returned by `gnus-summary-bookmark-make-record'.
+BOOKMARK is a bookmark name or a bookmark record."
+ (let ((group (bookmark-prop-get bookmark 'group))
+ (article (bookmark-prop-get bookmark 'article))
+ (id (bookmark-prop-get bookmark 'message-id)))
+ (gnus-fetch-group group (list article))
+ (gnus-summary-insert-cached-articles)
+ (gnus-summary-goto-article id nil 'force)
+ (bookmark-default-handler
+ `(""
+ (buffer . ,(current-buffer))
+ . ,(bookmark-get-bookmark-record bookmark)))))
+
(gnus-summary-make-all-marking-commands)
(gnus-ems-redefine)
(defun gnus-topic-mode (&optional arg redisplay)
"Minor mode for topicsifying Gnus group buffers."
+ ;; FIXME: Use define-minor-mode.
(interactive (list current-prefix-arg t))
(when (eq major-mode 'gnus-group-mode)
(make-local-variable 'gnus-topic-mode)
;;; Code:
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(require 'gnus-util)
(require 'gnus)
:group 'gnus-undo)
(defcustom gnus-undo-mode nil
+ ;; FIXME: This is a buffer-local minor mode which requires running
+ ;; code upon activation/deactivation, so defining it as a defcustom
+ ;; doesn't seem very useful: setting it to non-nil via Customize
+ ;; probably won't do the right thing.
"Minor mode for undoing in Gnus buffers."
:type 'boolean
:group 'gnus-undo)
;;; Minor mode definition.
-(defvar gnus-undo-mode-map nil)
-
-(unless gnus-undo-mode-map
- (setq gnus-undo-mode-map (make-sparse-keymap))
-
- (gnus-define-keys gnus-undo-mode-map
- "\M-\C-_" gnus-undo
- "\C-_" gnus-undo
- "\C-xu" gnus-undo
- ;; many people are used to type `C-/' on X terminals and get `C-_'.
- [(control /)] gnus-undo))
+(defvar gnus-undo-mode-map
+ (let ((map (make-sparse-keymap)))
+ (gnus-define-keys map
+ "\M-\C-_" gnus-undo
+ "\C-_" gnus-undo
+ "\C-xu" gnus-undo
+ ;; many people are used to type `C-/' on X terminals and get `C-_'.
+ [(control /)] gnus-undo)
+ map))
(defun gnus-undo-make-menu-bar ()
;; This is disabled for the time being.
(cons "Undo" 'gnus-undo-actions)
[menu-bar file whatever])))
-(defun gnus-undo-mode (&optional arg)
+(define-minor-mode gnus-undo-mode
"Minor mode for providing `undo' in Gnus buffers.
\\{gnus-undo-mode-map}"
- (interactive "P")
- (set (make-local-variable 'gnus-undo-mode)
- (if (null arg) (not gnus-undo-mode)
- (> (prefix-numeric-value arg) 0)))
+ :keymap gnus-undo-mode-map
(set (make-local-variable 'gnus-undo-actions) nil)
(set (make-local-variable 'gnus-undo-boundary) t)
(when gnus-undo-mode
;; Set up the menu.
(when (gnus-visual-p 'undo-menu 'menu)
(gnus-undo-make-menu-bar))
- (add-minor-mode 'gnus-undo-mode "" gnus-undo-mode-map)
(gnus-make-local-hook 'post-command-hook)
- (add-hook 'post-command-hook 'gnus-undo-boundary nil t)
- (gnus-run-hooks 'gnus-undo-mode-hook)))
+ (add-hook 'post-command-hook 'gnus-undo-boundary nil t)))
;;; Interface functions.
(defvar gnus-original-article-buffer)
(defvar gnus-user-agent)
-(require 'time-date)
-(require 'netrc)
-
-(autoload 'message-fetch-field "message")
(autoload 'gnus-get-buffer-window "gnus-win")
(autoload 'nnheader-narrow-to-headers "nnheader")
(autoload 'nnheader-replace-chars-in-string "nnheader")
Uses `gnus-extract-address-components'."
(nth 1 (gnus-extract-address-components from)))
+(declare-function message-fetch-field "message" (header &optional not-all))
+
(defun gnus-fetch-field (field)
"Return the value of the header FIELD of current article."
+ (require 'message)
(save-excursion
(save-restriction
(let ((inhibit-point-motion-hooks t))
(point)))))
(declare-function gnus-find-method-for-group "gnus" (group &optional info))
-(autoload 'gnus-group-name-decode "gnus-group")
+(declare-function gnus-group-name-decode "gnus-group" (string charset))
(declare-function gnus-group-name-charset "gnus-group" (method group))
;; gnus-group requires gnus-int which requires message.
(declare-function message-tokenize-header "message"
(header &optional separator))
(defun gnus-decode-newsgroups (newsgroups group &optional method)
+ (require 'gnus-group)
(let ((method (or method (gnus-find-method-for-group group))))
(mapconcat (lambda (group)
(gnus-group-name-decode group (gnus-group-name-charset
;;; Functions for saving to babyl/mail files.
(eval-when-compile
- (condition-case nil
- (progn
- (require 'rmail)
- (autoload 'rmail-update-summary "rmailsum"))
- (error
- (define-compiler-macro rmail-select-summary (&rest body)
- ;; Rmail of the XEmacs version is supplied by the package, and
- ;; requires tm and apel packages. However, there may be those
- ;; who haven't installed those packages. This macro helps such
- ;; people even if they install those packages later.
- `(eval '(rmail-select-summary ,@body)))
- ;; If there's rmail but there's no tm (or there's apel of the
- ;; mainstream, not the XEmacs version), loading rmail of the XEmacs
- ;; version fails halfway, however it provides the rmail-select-summary
- ;; macro which uses the following functions:
- (autoload 'rmail-summary-displayed "rmail")
- (autoload 'rmail-maybe-display-summary "rmail"))))
+ (if (featurep 'xemacs)
+ ;; Don't load tm and apel XEmacs packages that provide some
+ ;; Emacs emulating functions and variables.
+ (let ((features features))
+ (provide 'tm-view)
+ (unless (fboundp 'set-alist) (defalias 'set-alist 'ignore))
+ (require 'rmail)) ;; It requires tm-view that loads apel.
+ (require 'rmail))
+ (autoload 'rmail-update-summary "rmailsum"))
(defvar mm-text-coding-system)
;;; Code:
(eval-when-compile (require 'cl))
-(require 'time-date)
(require 'mm-util)
(defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177"
;;; mail-source.el --- functions for fetching mail
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;; 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news, mail
(error "Cannot get new mail"))
0)))))))))
+(declare-function gnus-message "gnus-util" (level &rest args))
+
(defun mail-source-delete-old-incoming (&optional age confirm)
"Remove incoming files older than AGE days.
If CONFIRM is non-nil, ask for confirmation before removing a file."
(interactive "P")
+ (require 'gnus-util)
(let* ((high2days (/ 65536.0 60 60 24));; convert high bits to days
(low2days (/ 1.0 65536.0)) ;; convert low bits to days
(diff (if (natnump age) age 30));; fallback, if no valid AGE given
(eval-when-compile
(require 'cl))
-(require 'hashcash)
-(require 'canlock)
(require 'mailheader)
(require 'gmm-utils)
-(require 'nnheader)
+(require 'mail-utils)
+;; Only for the trivial macros mail-header-from, mail-header-date
+;; mail-header-references, mail-header-subject, mail-header-id
+(eval-when-compile (require 'nnheader))
;; This is apparently necessary even though things are autoloaded.
;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
;; require mailabbrev here.
(require 'mail-parse)
(require 'mml)
(require 'rfc822)
-(require 'ecomplete)
(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
:link '(custom-manual "(message)Canceling News")
:type 'string)
-(defvar smtpmail-default-smtp-server)
-
(defun message-send-mail-function ()
"Return suitable value for the variable `message-send-mail-function'."
(cond ((and (require 'sendmail)
(executable-find sendmail-program))
'message-send-mail-with-sendmail)
((and (locate-library "smtpmail")
- (require 'smtpmail)
+ (boundp 'smtpmail-default-smtp-server)
smtpmail-default-smtp-server)
'message-smtpmail-send-it)
((locate-library "mailclient")
'message-send-mail-with-mailclient)
(t
- (lambda ()
- (error "Don't know how to send mail. Please customize `message-send-mail-function'")))))
+ (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
;; Useful to set in site-init.el
(defcustom message-send-mail-function
:type '(repeat function))
(defcustom message-auto-save-directory
- (file-name-as-directory (nnheader-concat message-directory "drafts"))
+ (file-name-as-directory (expand-file-name "drafts" message-directory))
"*Directory where Message auto-saves buffers if Gnus isn't running.
If nil, Message won't auto-save."
:group 'message-buffers
(setq paren nil))))
(nreverse elems)))))
+(autoload 'nnheader-insert-file-contents "nnheader")
+
(defun message-mail-file-mbox-p (file)
"Say whether FILE looks like a Unix mbox file."
(when (and (file-exists-p file)
(inhibit-read-only t))
(remove-text-properties begin end message-forbidden-properties))))
+(autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23.
+
;;;###autoload
(define-derived-mode message-mode text-mode "Message"
"Major mode for editing mail and news to be sent.
;; if message-signature-file contains a path.
(not (file-name-directory
message-signature-file)))
- (nnheader-concat message-signature-directory
- message-signature-file)
+ (expand-file-name message-signature-file
+ message-signature-directory)
message-signature-file))
(file-exists-p signature-file))))
(when signature
(erase-buffer)))
(kill-buffer tembuf))))
+(declare-function hashcash-wait-async "hashcash" (&optional buffer))
+
(defun message-send-mail (&optional arg)
(require 'mail-utils)
(let* ((tembuf (message-generate-new-buffer-clone-locals " message temp"))
(news (message-news-p))
(mailbuf (current-buffer))
(message-this-is-mail t)
+ ;; gnus-setup-posting-charset is autoloaded in mml.el (FIXME
+ ;; maybe it should not be), which this file requires. Hence
+ ;; the fboundp test is always true. Loading it from gnus-msg
+ ;; loads many Gnus files (Bug#5642). If
+ ;; gnus-group-posting-charset-alist hasn't been customized,
+ ;; this is just going to return nil anyway. FIXME it would
+ ;; be good to improve this further, because even if g-g-p-c-a
+ ;; has been customized, that is likely to just be for news.
+ ;; Eg either move the definition from gnus-msg, or separate out
+ ;; the mail and news parts.
(message-posting-charset
- (if (fboundp 'gnus-setup-posting-charset)
+ (if (and (fboundp 'gnus-setup-posting-charset)
+ (boundp 'gnus-group-posting-charset-alist))
(gnus-setup-posting-charset nil)
message-posting-charset))
(headers message-required-mail-headers))
(when (and message-generate-hashcash
(not (eq message-generate-hashcash 'opportunistic)))
(message "Generating hashcash...")
+ (require 'hashcash)
;; Wait for calculations already started to finish...
(hashcash-wait-async)
;; ...and do calculations not already done. mail-add-payment
(defun message-send-mail-with-sendmail ()
"Send off the prepared buffer with sendmail."
+ (require 'sendmail)
(let ((errbuf (if message-interactive
(message-generate-new-buffer-clone-locals
" sendmail errors")
(prin1-to-string (recent-keys))
(prin1-to-string (garbage-collect))))))
+(defvar canlock-password)
+(defvar canlock-password-for-verify)
+
(defun message-canlock-password ()
"The password used by message for cancel locks.
This is the value of `canlock-password', if that option is non-nil.
Otherwise, generate and save a value for `canlock-password' first."
+ (require 'canlock)
(unless canlock-password
(customize-save-variable 'canlock-password (message-canlock-generate))
(setq canlock-password-for-verify canlock-password))
(message-canlock-password)
(canlock-insert-header)))
+(autoload 'nnheader-get-report "nnheader")
+
+(declare-function gnus-setup-posting-charset "gnus-msg" (group))
+
(defun message-send-news (&optional arg)
+ (require 'gnus-msg)
(let* ((tembuf (message-generate-new-buffer-clone-locals " *message temp*"))
(case-fold-search nil)
(method (if (functionp message-post-method)
(defun message-make-references ()
"Return the References header for this message."
(when message-reply-headers
- (let ((message-id (mail-header-message-id message-reply-headers))
+ (let ((message-id (mail-header-id message-reply-headers))
(references (mail-header-references message-reply-headers)))
(if (or references message-id)
(concat (or references "") (and references " ")
(when message-reply-headers
(let ((from (mail-header-from message-reply-headers))
(date (mail-header-date message-reply-headers))
- (msg-id (mail-header-message-id message-reply-headers)))
+ (msg-id (mail-header-id message-reply-headers)))
(when from
(let ((name (mail-extract-address-components from)))
(concat
(defun message-forward-make-body-plain (forward-buffer)
(insert
"\n-------------------- Start of forwarded message --------------------\n")
- (let ((b (point)) e)
- (insert
- (with-temp-buffer
- (mm-disable-multibyte)
- (insert
- (with-current-buffer forward-buffer
- (mm-with-unibyte-current-buffer (buffer-string))))
- (mm-enable-multibyte)
- (mime-to-mml)
- (goto-char (point-min))
- (when (looking-at "From ")
- (replace-match "X-From-Line: "))
- (buffer-string)))
+ (let ((b (point))
+ (contents (with-current-buffer forward-buffer (buffer-string)))
+ e)
+ (unless (featurep 'xemacs)
+ (unless (mm-multibyte-string-p contents)
+ (error "Attempt to insert unibyte string from the buffer \"%s\"\
+ to the multibyte buffer \"%s\""
+ (if (bufferp forward-buffer)
+ (buffer-name forward-buffer)
+ forward-buffer)
+ (buffer-name))))
+ (insert (mm-with-multibyte-buffer
+ (insert contents)
+ (mime-to-mml)
+ (goto-char (point-min))
+ (when (looking-at "From ")
+ (replace-match "X-From-Line: "))
+ (buffer-string)))
+ (unless (bolp) (insert "\n"))
(setq e (point))
(insert
- "\n-------------------- End of forwarded message --------------------\n")
+ "-------------------- End of forwarded message --------------------\n")
(message-remove-ignored-headers b e)))
(defun message-remove-ignored-headers (b e)
(insert "\n\n<#mml type=message/rfc822 disposition=inline>\n")
(let ((b (point)) e)
(if (not message-forward-decoded-p)
- (insert
- (with-temp-buffer
- (mm-disable-multibyte)
- (insert
- (with-current-buffer forward-buffer
- (mm-with-unibyte-current-buffer (buffer-string))))
- (mm-enable-multibyte)
- (mime-to-mml)
- (goto-char (point-min))
- (when (looking-at "From ")
- (replace-match "X-From-Line: "))
- (buffer-string)))
+ (let ((contents (with-current-buffer forward-buffer (buffer-string))))
+ (unless (featurep 'xemacs)
+ (unless (mm-multibyte-string-p contents)
+ (error "Attempt to insert unibyte string from the buffer \"%s\"\
+ to the multibyte buffer \"%s\""
+ (if (bufferp forward-buffer)
+ (buffer-name forward-buffer)
+ forward-buffer)
+ (buffer-name))))
+ (insert (mm-with-multibyte-buffer
+ (insert contents)
+ (mime-to-mml)
+ (goto-char (point-min))
+ (when (looking-at "From ")
+ (replace-match "X-From-Line: "))
+ (buffer-string))))
(save-restriction
(narrow-to-region (point) (point))
(mml-insert-buffer forward-buffer)
(not result)
result)))
+(declare-function ecomplete-add-item "ecomplete" (type key text))
+(declare-function ecomplete-save "ecomplete" ())
+
(defun message-put-addresses-in-ecomplete ()
+ (require 'ecomplete)
(dolist (header '("to" "cc" "from" "reply-to"))
(let ((value (message-field-value header)))
(dolist (string (mail-header-parse-addresses value 'raw))
string))))
(ecomplete-save))
+(autoload 'ecomplete-display-matches "ecomplete")
+
(defun message-display-abbrev (&optional choose)
"Display the next possible abbrev for the text before point."
(interactive (list t))
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(require 'mail-parse)
-(require 'mailcap)
(require 'mm-bodies)
-(require 'gnus-util)
(eval-when-compile (require 'cl)
(require 'term))
+(autoload 'gnus-map-function "gnus-util")
+(autoload 'gnus-replace-in-string "gnus-util")
+(autoload 'gnus-read-shell-command "gnus-util")
+
(autoload 'mm-inline-partial "mm-partial")
(autoload 'mm-inline-external-body "mm-extern")
(autoload 'mm-extern-cache-contents "mm-extern")
(message "Destroying external MIME viewers")
(mm-destroy-parts mm-postponed-undisplay-list)))
+(autoload 'message-fetch-field "message")
+
(defun mm-dissect-buffer (&optional no-strict-mime loose-mime from)
"Dissect the current buffer and return a list of MIME handles."
(save-excursion
(goto-char (point-max)))
(mapcar 'mm-display-parts handle))))
+(autoload 'mailcap-parse-mailcaps "mailcap")
+(autoload 'mailcap-mime-info "mailcap")
+
(defun mm-display-part (handle &optional no-default)
"Display the MIME part represented by HANDLE.
Returns nil if the part is removed; inline if displayed inline;
handle 'mailcap-save-binary-file)))))))))
(declare-function gnus-configure-windows "gnus-win" (setting &optional force))
+(defvar mailcap-mime-extensions) ; mailcap-mime-info autoloads
(defun mm-display-external (handle method)
"Display HANDLE using METHOD."
(mm-save-part-to-file handle file)
file))))
-(defun mm-add-meta-html-tag (handle &optional charset)
+(defun mm-add-meta-html-tag (handle &optional charset force-charset)
"Add meta html tag to specify CHARSET of HANDLE in the current buffer.
CHARSET defaults to the one HANDLE specifies. Existing meta tag that
-specifies charset will not be modified. Return t if meta tag is added
-or replaced."
+specifies charset will not be modified unless FORCE-CHARSET is non-nil.
+Return t if meta tag is added or replaced."
(when (equal (mm-handle-media-type handle) "text/html")
(when (or charset
(setq charset (mail-content-type-get (mm-handle-type handle)
(if (re-search-forward "\
<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']\
text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t)
- (if (and (match-beginning 2)
+ (if (and (not force-charset)
+ (match-beginning 2)
(string-match "\\`html\\'" (match-string 1)))
;; Don't modify existing meta tag.
nil
(mm-write-region (point-min) (point-max) file nil nil nil 'binary t)
(set-default-file-modes current-file-modes)))))
-(defun mm-pipe-part (handle)
- "Pipe HANDLE to a process."
- (let* ((name (mail-content-type-get (mm-handle-type handle) 'name))
- (command
- (gnus-read-shell-command
- "Shell command on MIME part: " mm-last-shell-command)))
+(defun mm-pipe-part (handle &optional cmd)
+ "Pipe HANDLE to a process.
+Use CMD as the process."
+ (let ((name (mail-content-type-get (mm-handle-type handle) 'name))
+ (command (or cmd
+ (gnus-read-shell-command
+ "Shell command on MIME part: " mm-last-shell-command))))
(mm-with-unibyte-buffer
(mm-insert-part handle)
(mm-add-meta-html-tag handle)
(eval-when-compile (require 'cl))
(require 'mail-parse)
-(require 'mailcap)
+(autoload 'mailcap-extension-to-mime "mailcap")
(autoload 'mm-body-7-or-8 "mm-bodies")
(autoload 'mm-long-lines-p "mm-bodies")
(coding-system-for-read mm-binary-coding-system))
(unless url
(error "URL is not specified"))
- (mm-with-unibyte-current-buffer
- (mm-url-insert-file-contents url))
(mm-disable-multibyte)
+ (mm-url-insert-file-contents url)
(setq buffer-file-name name)))
(defun mm-extern-anon-ftp (handle)
(or access-type
(error "Couldn't find access type"))))
mm-extern-function-alist)))
- buf handles)
+ handles)
(unless func
(error "Access type (%s) is not supported" access-type))
(mm-with-part handle
(unless (bufferp (car handles))
(mm-destroy-parts handles)
(error "Multipart external body is not supported"))
- (save-excursion
- (set-buffer (setq buf (mm-handle-buffer handles)))
+ (with-current-buffer (mm-handle-buffer handles)
(let (good)
(unwind-protect
(progn
((= char ? ) "+")
((memq char mm-url-unreserved-chars) (char-to-string char))
(t (upcase (format "%%%02x" char)))))
- ;; Fixme: Should this actually be accepting multibyte? Is there a
- ;; better way in XEmacs?
- (if (featurep 'mule)
- (encode-coding-string chunk
- (if (fboundp 'find-coding-systems-string)
- (car (find-coding-systems-string chunk))
- buffer-file-coding-system))
- chunk)
+ (mm-encode-coding-string chunk
+ (if (fboundp 'find-coding-systems-string)
+ (car (find-coding-systems-string chunk))
+ buffer-file-coding-system))
""))
(defun mm-url-encode-www-form-urlencoded (pairs)
;;; (eq charset (coding-system-get charset 'mime-charset))
)
charset)
+ ;; Use coding system Emacs knows.
+ ((and (fboundp 'coding-system-from-name)
+ (coding-system-from-name charset)))
;; Eval expressions from `mm-charset-eval-alist'
((let* ((el (assq charset mm-charset-eval-alist))
(cs (car el))
out)))
(eval-and-compile
- (defvar mm-emacs-mule (and (not (featurep 'xemacs))
- (boundp 'enable-multibyte-characters)
- (default-value 'enable-multibyte-characters)
- (fboundp 'set-buffer-multibyte))
- "True in Emacs with Mule.")
-
- (if mm-emacs-mule
- (defun mm-enable-multibyte ()
- "Set the multibyte flag of the current buffer.
+ (if (featurep 'xemacs)
+ (defalias 'mm-enable-multibyte 'ignore)
+ (defun mm-enable-multibyte ()
+ "Set the multibyte flag of the current buffer.
Only do this if the default value of `enable-multibyte-characters' is
non-nil. This is a no-op in XEmacs."
- (set-buffer-multibyte 'to))
- (defalias 'mm-enable-multibyte 'ignore))
+ (set-buffer-multibyte t)))
- (if mm-emacs-mule
- (defun mm-disable-multibyte ()
- "Unset the multibyte flag of in the current buffer.
+ (if (featurep 'xemacs)
+ (defalias 'mm-disable-multibyte 'ignore)
+ (defun mm-disable-multibyte ()
+ "Unset the multibyte flag of in the current buffer.
This is a no-op in XEmacs."
- (set-buffer-multibyte nil))
- (defalias 'mm-disable-multibyte 'ignore)))
+ (set-buffer-multibyte nil))))
(defun mm-preferred-coding-system (charset)
;; A typo in some Emacs versions.
(defmacro mm-with-unibyte-current-buffer (&rest forms)
"Evaluate FORMS with current buffer temporarily made unibyte.
-Also bind the default-value of `enable-multibyte-characters' to nil.
-Equivalent to `progn' in XEmacs
-
-NOTE: Use this macro with caution in multibyte buffers (it is not
-worth using this macro in unibyte buffers of course). Use of
-`(set-buffer-multibyte t)', which is run finally, is generally
-harmful since it is likely to modify existing data in the buffer.
-For instance, it converts \"\\300\\255\" into \"\\255\" in
-Emacs 23 (unicode)."
- (let ((multibyte (make-symbol "multibyte"))
- (buffer (make-symbol "buffer")))
- `(if mm-emacs-mule
- (let ((,multibyte enable-multibyte-characters)
- (,buffer (current-buffer)))
- (unwind-protect
- (letf (((default-value 'enable-multibyte-characters) nil))
- (set-buffer-multibyte nil)
- ,@forms)
- (set-buffer ,buffer)
- (set-buffer-multibyte ,multibyte)))
- (letf (((default-value 'enable-multibyte-characters) nil))
- ,@forms))))
+Equivalent to `progn' in XEmacs.
+
+Note: We recommend not using this macro any more; there should be
+better ways to do a similar thing. The previous version of this macro
+bound the default value of `enable-multibyte-characters' to nil while
+evaluating FORMS but it is no longer done. So, some programs assuming
+it if any may malfunction."
+ (if (featurep 'xemacs)
+ `(progn ,@forms)
+ (let ((multibyte (make-symbol "multibyte")))
+ `(let ((,multibyte enable-multibyte-characters))
+ (when ,multibyte
+ (set-buffer-multibyte nil))
+ (prog1
+ (progn ,@forms)
+ (when ,multibyte
+ (set-buffer-multibyte t)))))))
(put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0)
(put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body))
(error
(setq err-msg (error-message-string err)))))
(when (file-exists-p err-file)
- (ignore-errors (jka-compr-delete-temp-file err-file)))
+ (ignore-errors (delete-file err-file)))
(when inplace
(unless err-msg
(delete-region (point-min) (point-max))
filename))
(mm-decompress-buffer filename nil t))))
(when decomp
- (set-buffer (letf (((default-value 'enable-multibyte-characters) nil))
- (generate-new-buffer " *temp*")))
+ (set-buffer (generate-new-buffer " *temp*"))
+ (mm-disable-multibyte)
(insert decomp)
(setq filename (file-name-sans-extension filename)))
(goto-char (point-min))
(eval-when-compile (require 'cl))
-(if (locate-library "password-cache")
- (require 'password-cache)
- (require 'password))
-
(autoload 'mml2015-sign "mml2015")
(autoload 'mml2015-encrypt "mml2015")
(autoload 'mml1991-sign "mml1991")
:group 'message
:type 'boolean)
-(defcustom mml-secure-cache-passphrase password-cache
+(defcustom mml-secure-cache-passphrase
+ (if (boundp 'password-cache)
+ password-cache
+ t)
"If t, cache passphrase."
:group 'message
:type 'boolean)
-(defcustom mml-secure-passphrase-cache-expiry password-cache-expiry
+(defcustom mml-secure-passphrase-cache-expiry
+ (if (boundp 'password-cache-expiry)
+ password-cache-expiry
+ 16)
"How many seconds the passphrase is cached.
Whether the passphrase is cached at all is controlled by
`mml-secure-cache-passphrase'."
(defun mml-secure-message-sign (&optional method)
- "Add MML tags to sign this MML part.
+ "Add MML tags to sign the entire message.
Use METHOD if given. Else use `mml-secure-method' or
`mml-default-sign-method'."
(interactive)
- (mml-secure-part
+ (mml-secure-message
(or method mml-secure-method mml-default-sign-method)
'sign))
(require 'mm-decode)
(require 'mml-sec)
(eval-when-compile (require 'cl))
+(eval-when-compile
+ (when (featurep 'xemacs)
+ (require 'easy-mmode))) ; for `define-minor-mode'
(autoload 'message-make-message-id "message")
-(autoload 'gnus-setup-posting-charset "gnus-msg")
+(declare-function gnus-setup-posting-charset "gnus-msg" (group))
(autoload 'gnus-make-local-hook "gnus-util")
(autoload 'message-fetch-field "message")
(autoload 'message-mark-active-p "message")
(skip-chars-forward "= \t\n")
(setq val (buffer-substring-no-properties
(point) (progn (forward-sexp 1) (point))))
- (when (string-match "^\"\\(.*\\)\"$" val)
- (setq val (match-string 1 val)))
+ (when (string-match "\\`\"" val)
+ (setq val (read val))) ;; inverse of prin1 in mml-insert-tag
(push (cons (intern elem) val) contents)
(skip-chars-forward " \t\n"))
(goto-char (match-end 0))
;; `m-g-d-t' will be bound to "message/rfc822"
;; when encoding an article to be forwarded.
(mml-generate-default-type "text/plain"))
- (mml-to-mime))
+ (mml-to-mime)
+ ;; Update handle so mml-compute-boundary can
+ ;; detect collisions with the nested parts.
+ (setcdr (assoc 'contents cont) (buffer-string)))
(let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
;; ignore 0x1b, it is part of iso-2022-jp
(setq encoding (mm-body-7-or-8))))
(defun mml-compute-boundary-1 (cont)
(let (filename)
(cond
- ((eq (car cont) 'part)
+ ((member (car cont) '(part mml))
(with-temp-buffer
(cond
((cdr (assq 'buffer cont))
;; Determine type and stuff.
(unless (stringp (car handle))
(unless (setq textp (equal (mm-handle-media-supertype handle) "text"))
- (save-excursion
- (set-buffer (setq buffer (mml-generate-new-buffer " *mml*")))
+ (with-current-buffer (setq buffer (mml-generate-new-buffer " *mml*"))
(if (eq (mail-content-type-get (mm-handle-type handle) 'charset)
'gnus-decoded)
;; A part that mm-uu dissected from a non-MIME message
,@(if (featurep 'xemacs) '(t)
'(:help "Display the EasyPG manual"))]))
-(defvar mml-mode nil
- "Minor mode for editing MML.")
-
-(defun mml-mode (&optional arg)
+(define-minor-mode mml-mode
"Minor mode for editing MML.
MML is the MIME Meta Language, a minor mode for composing MIME articles.
See Info node `(emacs-mime)Composing'.
\\{mml-mode-map}"
- (interactive "P")
- (when (set (make-local-variable 'mml-mode)
- (if (null arg) (not mml-mode)
- (> (prefix-numeric-value arg) 0)))
- (add-minor-mode 'mml-mode " MML" mml-mode-map)
+ :lighter " MML" :keymap mml-mode-map
+ (when mml-mode
(easy-menu-add mml-menu mml-mode-map)
(when (boundp 'dnd-protocol-alist)
(set (make-local-variable 'dnd-protocol-alist)
- (append mml-dnd-protocol-alist dnd-protocol-alist)))
- (run-hooks 'mml-mode-hook)))
+ (append mml-dnd-protocol-alist dnd-protocol-alist)))))
;;;
;;; Helper functions for reading MIME stuff from the minibuffer and
(error "Permission denied: %s" file))
file))
+(declare-function mailcap-parse-mimetypes "mailcap" (&optional path force))
+(declare-function mailcap-mime-types "mailcap" ())
+
(defun mml-minibuffer-read-type (name &optional default)
+ (require 'mailcap)
(mailcap-parse-mimetypes)
(let* ((default (or default
(mm-default-file-encoding name)
(setq mml-preview-buffer (generate-new-buffer
(concat (if raw "*Raw MIME preview of "
"*MIME preview of ") (buffer-name))))
+ (require 'gnus-msg) ; for gnus-setup-posting-charset
(save-excursion
(let* ((buf (current-buffer))
(message-options message-options)
;; For Emacs < 22.2.
(eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
+
+ (if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password)))
(eval-when-compile
(require 'cl)
(delete-region (point-min) (point)))
(mm-with-unibyte-current-buffer
(with-temp-buffer
+ (inline (mm-disable-multibyte))
(setq cipher (current-buffer))
(insert-buffer-substring text)
(unless (mc-encrypt-generic
(delete-region (point-min) (point)))
(mm-with-unibyte-current-buffer
(with-temp-buffer
+ (inline (mm-disable-multibyte))
(flet ((gpg-encrypt-func
(sign plaintext ciphertext result recipients &optional
passphrase sign-with-key armor textmode)
;; epg wrapper
(defvar epg-user-id-alist)
-(defvar password-cache-expiry)
(autoload 'epg-make-context "epg")
(autoload 'epg-passphrase-callback-function "epg")
;; For Emacs < 22.2.
(eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
+
+ (if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password)))
(eval-when-compile (require 'cl))
(require 'mm-decode)
cipher)
(mm-with-unibyte-current-buffer
(with-temp-buffer
+ (mm-disable-multibyte)
;; set up a function to call the correct gpg encrypt routine
;; with the right arguments. (FIXME: this should be done
;; differently.)
(autoload 'epg-expand-group "epg-config")
(autoload 'epa-select-keys "epa")
-(defvar password-cache-expiry)
-
(defvar mml2015-epg-secret-key-id-list nil)
(defun mml2015-epg-passphrase-callback (context key-id ignore)
(let ((pointer (epg-key-sub-key-list (car keys))))
(while pointer
(if (and (memq usage (epg-sub-key-capability (car pointer)))
+ (not (memq 'disabled (epg-sub-key-capability (car pointer))))
(not (memq (epg-sub-key-validity (car pointer))
'(revoked expired))))
(throw 'found (car keys)))
(eval-when-compile (require 'cl))
+(require 'mailcap)
(require 'nnheader)
(require 'nnmail)
(require 'nnoo)
;;; Code:
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-when-compile (require 'cl))
(defvar nnmail-extra-headers)
(autoload 'nnmail-message-id "nnmail")
(autoload 'mail-position-on-field "sendmail")
-(autoload 'message-remove-header "message")
(autoload 'gnus-buffer-live-p "gnus-util")
;;; Header access macros.
;; without inserting extra newline.
(fill-region-as-paragraph begin (1+ (point))))))
+(declare-function message-remove-header "message"
+ (header &optional is-regexp first reverse))
+
(defun nnheader-replace-header (header new-value)
"Remove HEADER and insert the NEW-VALUE."
+ (require 'message)
(save-excursion
(save-restriction
(nnheader-narrow-to-headers)
;;; Code:
+;; For Emacs < 22.2.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
(require 'imap)
(require 'nnoo)
(require 'nnmail)
;; Utility functions:
+(defsubst nnimap-decode-group-name (group)
+ (and group
+ (gnus-group-decoded-name group)))
+
+(defsubst nnimap-encode-group-name (group)
+ (and group
+ (mm-encode-coding-string group (gnus-group-name-charset nil group))))
+
+(defun nnimap-group-prefixed-name (group &optional server)
+ (gnus-group-prefixed-name group
+ (gnus-server-to-method
+ (format "nnimap:%s"
+ (or server nnimap-current-server)))))
+
(defsubst nnimap-get-server-buffer (server)
"Return buffer for SERVER, if nil use current server."
(cadr (assoc (or server nnimap-current-server) nnimap-server-buffer-alist)))
(defun nnimap-verify-uidvalidity (group server)
"Verify stored uidvalidity match current one in GROUP on SERVER."
- (let* ((gnusgroup (gnus-group-prefixed-name
- group (gnus-server-to-method
- (format "nnimap:%s" server))))
+ (let* ((gnusgroup (nnimap-group-prefixed-name group server))
(new-uidvalidity (imap-mailbox-get 'uidvalidity))
(old-uidvalidity (gnus-group-get-parameter gnusgroup 'uidvalidity))
(dir (file-name-as-directory (expand-file-name nnimap-directory)))
(if old-uidvalidity
(if (not (equal old-uidvalidity new-uidvalidity))
;; uidvalidity clash
- (gnus-delete-file file)
- (gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity)
+ (progn
+ (gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity)
+ (gnus-group-remove-parameter gnusgroup 'imap-status)
+ (gnus-sethash (gnus-group-prefixed-name group server)
+ nil nnimap-mailbox-info)
+ (gnus-delete-file file))
t)
(gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity))
+ (gnus-group-remove-parameter gnusgroup 'imap-status)
+ (gnus-sethash ; Maybe not necessary here.
+ (gnus-group-prefixed-name group server)
+ nil nnimap-mailbox-info)
t)))
(defun nnimap-before-find-minmax-bugworkaround ()
"Find lowest and highest active article number in GROUP.
If EXAMINE is non-nil the group is selected read-only."
(with-current-buffer nnimap-server-buffer
- (when (or (string= group (imap-current-mailbox))
- (imap-mailbox-select group examine))
- (let (minuid maxuid)
- (when (> (imap-mailbox-get 'exists) 0)
- (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch)
- (imap-message-map (lambda (uid Uid)
- (setq minuid (if minuid (min minuid uid) uid)
- maxuid (if maxuid (max maxuid uid) uid)))
- 'UID))
- (list (imap-mailbox-get 'exists) minuid maxuid)))))
+ (let ((decoded-group (nnimap-decode-group-name group)))
+ (when (or (string= decoded-group (imap-current-mailbox))
+ (imap-mailbox-select decoded-group examine))
+ (let (minuid maxuid)
+ (when (> (imap-mailbox-get 'exists) 0)
+ (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch)
+ (imap-message-map (lambda (uid Uid)
+ (setq minuid (if minuid (min minuid uid) uid)
+ maxuid (if maxuid (max maxuid uid) uid)))
+ 'UID))
+ (list (imap-mailbox-get 'exists) minuid maxuid))))))
(defun nnimap-possibly-change-group (group &optional server)
"Make GROUP the current group, and SERVER the current server."
(when (nnimap-possibly-change-server server)
- (with-current-buffer nnimap-server-buffer
- (if (or (null group) (imap-current-mailbox-p group))
- imap-current-mailbox
- (if (imap-mailbox-select group)
- (if (or (nnimap-verify-uidvalidity
- group (or server nnimap-current-server))
- (zerop (imap-mailbox-get 'exists group))
- t ;; for OGnus to see if ignoring uidvalidity
- ;; changes has any bad effects.
- (yes-or-no-p
- (format
- "nnimap: Group %s is not uidvalid. Continue? " group)))
- imap-current-mailbox
- (imap-mailbox-unselect)
- (error "nnimap: Group %s is not uid-valid" group))
- (nnheader-report 'nnimap (imap-error-text)))))))
+ (let ((decoded-group (nnimap-decode-group-name group)))
+ (with-current-buffer nnimap-server-buffer
+ (if (or (null group) (imap-current-mailbox-p decoded-group))
+ imap-current-mailbox ; Note: utf-7 encoded.
+ (if (imap-mailbox-select decoded-group)
+ (if (or (nnimap-verify-uidvalidity
+ group (or server nnimap-current-server))
+ (zerop (imap-mailbox-get 'exists decoded-group))
+ t ;; for OGnus to see if ignoring uidvalidity
+ ;; changes has any bad effects.
+ (yes-or-no-p
+ (format
+ "nnimap: Group %s is not uidvalid. Continue? "
+ decoded-group)))
+ imap-current-mailbox ; Note: utf-7 encoded.
+ (imap-mailbox-unselect)
+ (error "nnimap: Group %s is not uid-valid" decoded-group))
+ (nnheader-report 'nnimap (imap-error-text))))))))
(defun nnimap-replace-whitespace (string)
"Return STRING with all whitespace replaced with space."
(let (headers lines chars uid mbx)
(with-current-buffer nnimap-server-buffer
(setq uid imap-current-message
- mbx imap-current-mailbox
+ mbx (nnimap-encode-group-name (imap-current-mailbox))
headers (if (imap-capability 'IMAP4rev1)
;; xxx don't just use car? alist doesn't contain
;; anything else now, but it might...
"Make file name for GROUP on SERVER."
(let* ((dir (file-name-as-directory (expand-file-name nnimap-directory)))
(uidvalidity (gnus-group-get-parameter
- (gnus-group-prefixed-name
- group (gnus-server-to-method
- (format "nnimap:%s" server)))
+ (nnimap-group-prefixed-name group server)
'uidvalidity))
(name (nnheader-translate-file-chars
(concat nnimap-nov-file-name
(nnheader-nov-delete-outside-range low high))))
'nov)))
+(declare-function netrc-parse "netrc" (file))
+(declare-function netrc-machine-user-or-password "netrc"
+ (mode authinfo-file-or-list machines ports defaults))
+
(defun nnimap-open-connection (server)
;; Note: `nnimap-open-server' that calls this function binds
;; `imap-logout-timeout' to `nnimap-logout-timeout'.
(if (not (imap-open nnimap-address nnimap-server-port nnimap-stream
nnimap-authenticator nnimap-server-buffer))
(nnheader-report 'nnimap "Can't open connection to server %s" server)
+ (require 'netrc)
(unless (or (imap-capability 'IMAP4 nnimap-server-buffer)
(imap-capability 'IMAP4rev1 nnimap-server-buffer))
(imap-close nnimap-server-buffer)
(port (if nnimap-server-port
(int-to-string nnimap-server-port)
"imap"))
- (auth-info
+ (auth-info
(auth-source-user-or-password '("login" "password") server port))
(auth-user (nth 0 auth-info))
(auth-passwd (nth 1 auth-info))
article)))
(when article
(gnus-message 10 "nnimap: Fetching (part of) article %d from %s..."
- article (or group imap-current-mailbox
- gnus-newsgroup-name))
+ article (or (nnimap-decode-group-name group)
+ (imap-current-mailbox)
+ (nnimap-decode-group-name
+ gnus-newsgroup-name)))
(if (not nnheader-callback-function)
(with-current-buffer (or to-buffer nntp-server-buffer)
(erase-buffer)
(nnheader-ms-strip-cr)
(gnus-message
10 "nnimap: Fetching (part of) article %d from %s...done"
- article (or group imap-current-mailbox gnus-newsgroup-name))
+ article (or (nnimap-decode-group-name group)
+ (imap-current-mailbox)
+ (nnimap-decode-group-name gnus-newsgroup-name)))
(if (bobp)
(nnheader-report 'nnimap "No such article %d in %s: %s"
- article (or group imap-current-mailbox
- gnus-newsgroup-name)
+ article (or (nnimap-decode-group-name group)
+ (imap-current-mailbox)
+ (nnimap-decode-group-name
+ gnus-newsgroup-name))
(imap-error-text nnimap-server-buffer))
(cons group article)))
(add-hook 'imap-fetch-data-hook
(deffoo nnimap-request-group (group &optional server fast)
(nnimap-request-update-info-internal
group
- (gnus-get-info (gnus-group-prefixed-name
- group (gnus-server-to-method (format "nnimap:%s" server))))
+ (gnus-get-info (nnimap-group-prefixed-name group server))
server)
(when (nnimap-possibly-change-group group server)
(nnimap-before-find-minmax-bugworkaround)
(let ((old (gnus-gethash-safe (gnus-group-prefixed-name group server)
nnimap-mailbox-info)))
(list (nth 0 old) (nth 1 old)
- (imap-mailbox-status group 'unseen nnimap-server-buffer)
- (nth 3 old)))
+ (imap-mailbox-status (nnimap-decode-group-name group)
+ 'unseen nnimap-server-buffer)))
nnimap-mailbox-info))
(defun nnimap-close-group (group &optional server)
(imap-mailbox-close nnimap-close-asynchronous))))
(ask (if (and (imap-search "DELETED")
(gnus-y-or-n-p (format "Expunge articles in group `%s'? "
- imap-current-mailbox)))
+ (imap-current-mailbox))))
(progn
(imap-mailbox-expunge nnimap-close-asynchronous)
(unless nnimap-dont-close
(dolist (mbx (funcall nnimap-request-list-method
(cdr pattern) (car pattern)))
(or (member "\\NoSelect" (imap-mailbox-get 'list-flags mbx))
- (let ((info (nnimap-find-minmax-uid mbx 'examine)))
+ (let* ((encoded-mbx (nnimap-encode-group-name mbx))
+ (info (nnimap-find-minmax-uid encoded-mbx 'examine)))
(when info
(with-current-buffer nntp-server-buffer
(insert (format "\"%s\" %d %d y\n"
- mbx (or (nth 2 info) 0)
+ encoded-mbx (or (nth 2 info) 0)
(max 1 (or (nth 1 info) 1)))))))))))
(gnus-message 5 "nnimap: Generating active list%s...done"
(if (> (length server) 0) (concat " for " server) ""))
(with-current-buffer nntp-server-buffer
(erase-buffer)
(nnimap-before-find-minmax-bugworkaround)
- (let (asyncgroups slowgroups)
+ (let (asyncgroups slowgroups decoded-group)
(if (null nnimap-retrieve-groups-asynchronous)
(setq slowgroups groups)
(dolist (group groups)
- (gnus-message 9 "nnimap: Quickly checking mailbox %s" group)
- (add-to-list (if (gnus-gethash-safe
- (gnus-group-prefixed-name group server)
- nnimap-mailbox-info)
+ (setq decoded-group (nnimap-decode-group-name group))
+ (gnus-message 9 "nnimap: Quickly checking mailbox %s"
+ decoded-group)
+ (add-to-list (if (gnus-group-get-parameter
+ (nnimap-group-prefixed-name group)
+ 'imap-status)
'asyncgroups
'slowgroups)
(list group (imap-mailbox-status-asynch
- group '(uidvalidity uidnext unseen)
+ decoded-group
+ '(uidvalidity uidnext unseen)
nnimap-server-buffer))))
(dolist (asyncgroup asyncgroups)
- (let ((group (nth 0 asyncgroup))
- (tag (nth 1 asyncgroup))
- new old)
+ (let* ((group (nth 0 asyncgroup))
+ (tag (nth 1 asyncgroup))
+ (gnusgroup (nnimap-group-prefixed-name group))
+ (saved-uidvalidity (gnus-group-get-parameter gnusgroup
+ 'uidvalidity))
+ (saved-imap-status (gnus-group-get-parameter gnusgroup
+ 'imap-status))
+ (saved-info (and saved-imap-status
+ (split-string saved-imap-status " "))))
+ (setq decoded-group (nnimap-decode-group-name group))
(when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer))
- (if (or (not (string=
- (nth 0 (gnus-gethash (gnus-group-prefixed-name
- group server)
- nnimap-mailbox-info))
- (imap-mailbox-get 'uidvalidity group
+ (if (or (not (equal
+ saved-uidvalidity
+ (imap-mailbox-get 'uidvalidity decoded-group
nnimap-server-buffer)))
- (not (string=
- (nth 1 (gnus-gethash (gnus-group-prefixed-name
- group server)
- nnimap-mailbox-info))
- (imap-mailbox-get 'uidnext group
+ (not (equal
+ (nth 0 saved-info)
+ (imap-mailbox-get 'uidnext decoded-group
nnimap-server-buffer))))
(push (list group) slowgroups)
- (insert (nth 3 (gnus-gethash (gnus-group-prefixed-name
- group server)
- nnimap-mailbox-info))))))))
+ (gnus-sethash
+ (gnus-group-prefixed-name group server)
+ (list (imap-mailbox-get 'uidvalidity
+ decoded-group nnimap-server-buffer)
+ (imap-mailbox-get 'uidnext
+ decoded-group nnimap-server-buffer)
+ (imap-mailbox-get 'unseen
+ decoded-group nnimap-server-buffer))
+ nnimap-mailbox-info)
+ (insert (format "\"%s\" %s %s y\n" group
+ (nth 2 saved-info)
+ (nth 1 saved-info))))))))
(dolist (group slowgroups)
(if nnimap-retrieve-groups-asynchronous
(setq group (car group)))
- (gnus-message 7 "nnimap: Mailbox %s modified" group)
- (imap-mailbox-put 'uidnext nil group nnimap-server-buffer)
- (or (member "\\NoSelect" (imap-mailbox-get 'list-flags group
+ (setq decoded-group (nnimap-decode-group-name group))
+ (gnus-message 7 "nnimap: Mailbox %s modified" decoded-group)
+ (or (member "\\NoSelect" (imap-mailbox-get 'list-flags decoded-group
nnimap-server-buffer))
- (let* ((info (nnimap-find-minmax-uid group 'examine))
- (str (format "\"%s\" %d %d y\n" group
- (or (nth 2 info) 0)
- (max 1 (or (nth 1 info) 1)))))
- (when (> (or (imap-mailbox-get 'recent group
+ (let* ((gnusgroup (nnimap-group-prefixed-name group))
+ (status (imap-mailbox-status
+ decoded-group '(uidvalidity uidnext unseen)
+ nnimap-server-buffer))
+ (info (nnimap-find-minmax-uid group 'examine))
+ (min-uid (max 1 (or (nth 1 info) 1)))
+ (max-uid (or (nth 2 info) 0)))
+ (when (> (or (imap-mailbox-get 'recent decoded-group
nnimap-server-buffer) 0)
0)
- (push (list (cons group 0)) nnmail-split-history))
- (insert str)
- (when nnimap-retrieve-groups-asynchronous
- (gnus-sethash
- (gnus-group-prefixed-name group server)
- (list (or (imap-mailbox-get
- 'uidvalidity group nnimap-server-buffer)
- (imap-mailbox-status
- group 'uidvalidity nnimap-server-buffer))
- (or (imap-mailbox-get
- 'uidnext group nnimap-server-buffer)
- (imap-mailbox-status
- group 'uidnext nnimap-server-buffer))
- (or (imap-mailbox-get
- 'unseen group nnimap-server-buffer)
- (imap-mailbox-status
- group 'unseen nnimap-server-buffer))
- str)
- nnimap-mailbox-info)))))))
+ (push (list (cons decoded-group 0)) nnmail-split-history))
+ (insert (format "\"%s\" %d %d y\n" group max-uid min-uid))
+ (gnus-sethash
+ (gnus-group-prefixed-name group server)
+ status
+ nnimap-mailbox-info)
+ (if (not (equal (nth 0 status)
+ (gnus-group-get-parameter gnusgroup
+ 'uidvalidity)))
+ (nnimap-verify-uidvalidity group nnimap-current-server))
+ ;; The imap-status parameter is a string on the form
+ ;; "<uidnext> <min-uid> <max-uid>".
+ (gnus-group-add-parameter
+ gnusgroup
+ (cons 'imap-status
+ (format "%s %s %s" (nth 1 status) min-uid max-uid))))))))
(gnus-message 5 "nnimap: Checking mailboxes...done")
'active))
(when info ;; xxx what does this mean? should we create a info?
(with-current-buffer nnimap-server-buffer
(gnus-message 5 "nnimap: Updating info for %s..."
- (gnus-info-group info))
+ (nnimap-decode-group-name (gnus-info-group info)))
(when (nnimap-mark-permanent-p 'read)
(let (seen unseen)
t))
(gnus-message 5 "nnimap: Updating info for %s...done"
- (gnus-info-group info))
+ (nnimap-decode-group-name (gnus-info-group info)))
info))))
(when (nnimap-possibly-change-group group server)
(with-current-buffer nnimap-server-buffer
(let (action)
- (gnus-message 7 "nnimap: Setting marks in %s..." group)
+ (gnus-message 7 "nnimap: Setting marks in %s..."
+ (nnimap-decode-group-name group))
(while (setq action (pop actions))
(let ((range (nth 0 action))
(what (nth 1 action))
(imap-message-flags-set
(imap-range-to-message-set range)
(nnimap-mark-to-flag marks nil t)))))))
- (gnus-message 7 "nnimap: Setting marks in %s...done" group))))
+ (gnus-message 7 "nnimap: Setting marks in %s...done"
+ (nnimap-decode-group-name group)))))
nil)
(defun nnimap-split-fancy ()
(defun nnimap-split-to-groups (rules)
;; tries to match all rules in nnimap-split-rule against content of
;; nntp-server-buffer, returns a list of groups that matched.
+ ;; Note: This function takes and returns decoded group names.
(with-current-buffer nntp-server-buffer
;; Fold continuation lines.
(goto-char (point-min))
(list nnimap-split-inbox)))
(defun nnimap-split-articles (&optional group server)
+ ;; Note: Assumes decoded group names in nnimap-split-inbox,
+ ;; nnimap-split-rule, nnimap-split-fancy, and nnmail-split-history.
(when (nnimap-possibly-change-server server)
(with-current-buffer nnimap-server-buffer
- (let (rule inbox removeorig (inboxes (nnimap-split-find-inbox server)))
+ (let (rule inbox removeorig
+ (inboxes (nnimap-split-find-inbox server)))
;; iterate over inboxes
(while (and (setq inbox (pop inboxes))
- (nnimap-possibly-change-group inbox)) ;; SELECT
+ (nnimap-possibly-change-group
+ (nnimap-encode-group-name inbox))) ;; SELECT
;; find split rule for this server / inbox
(when (setq rule (nnimap-split-find-rule server inbox))
;; iterate over articles
(and (setq msgid
(nnmail-fetch-field "message-id"))
(nnmail-cache-insert msgid
- to-group
+ (nnimap-encode-group-name to-group)
(nnmail-fetch-field "subject"))))))
;; Add the group-art list to the history list.
(push (list (cons to-group 0)) nnmail-split-history))
(if (string= (downcase mailbox) "\\noselect")
(throw 'found t)))
nil)
- (let ((info (nnimap-find-minmax-uid mbx 'examine)))
+ (let* ((encoded-mbx (nnimap-encode-group-name mbx))
+ (info (nnimap-find-minmax-uid encoded-mbx 'examine)))
(when info
(insert (format "\"%s\" %d %d y\n"
- mbx (or (nth 2 info) 0)
+ encoded-mbx (or (nth 2 info) 0)
(max 1 (or (nth 1 info) 1)))))))))
(gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done"
(if (> (length server) 0) " on " "") server))
(deffoo nnimap-request-create-group (group &optional server args)
(when (nnimap-possibly-change-server server)
- (or (imap-mailbox-status group 'uidvalidity nnimap-server-buffer)
- (imap-mailbox-create group nnimap-server-buffer)
- (nnheader-report 'nnimap "%S"
- (imap-error-text nnimap-server-buffer)))))
+ (let ((decoded-group (nnimap-decode-group-name group)))
+ (or (imap-mailbox-status decoded-group 'uidvalidity nnimap-server-buffer)
+ (imap-mailbox-create decoded-group nnimap-server-buffer)
+ (nnheader-report 'nnimap "%S"
+ (imap-error-text nnimap-server-buffer))))))
(defun nnimap-time-substract (time1 time2)
"Return TIME for TIME1 - TIME2."
nnimap-current-move-group)
(imap-message-copy (number-to-string
nnimap-current-move-article)
- group 'dontcreate nil
+ (nnimap-decode-group-name group)
+ 'dontcreate nil
nnimap-server-buffer))
(with-current-buffer (current-buffer)
(goto-char (point-min))
;; this 'or' is for Cyrus server bug
(or (null (imap-current-mailbox nnimap-server-buffer))
(imap-mailbox-unselect nnimap-server-buffer))
- (imap-message-append group (current-buffer) nil nil
+ (imap-message-append (nnimap-decode-group-name group)
+ (current-buffer) nil nil
nnimap-server-buffer)))
(cons group (nth 1 uid))
(nnheader-report 'nnimap (imap-error-text nnimap-server-buffer))))))
(deffoo nnimap-request-delete-group (group force &optional server)
(when (nnimap-possibly-change-server server)
+ (setq group (nnimap-decode-group-name group))
(when (string= group (imap-current-mailbox nnimap-server-buffer))
(imap-mailbox-unselect nnimap-server-buffer))
(with-current-buffer nnimap-server-buffer
(deffoo nnimap-request-rename-group (group new-name &optional server)
(when (nnimap-possibly-change-server server)
- (imap-mailbox-rename group new-name nnimap-server-buffer)))
+ (imap-mailbox-rename (nnimap-decode-group-name group)
+ (nnimap-decode-group-name new-name)
+ nnimap-server-buffer)))
(defun nnimap-expunge (mailbox server)
(when (nnimap-possibly-change-group mailbox server)
(defun nnimap-acl-get (mailbox server)
(when (nnimap-possibly-change-server server)
(and (imap-capability 'ACL nnimap-server-buffer)
- (imap-mailbox-acl-get mailbox nnimap-server-buffer))))
+ (imap-mailbox-acl-get (nnimap-decode-group-name mailbox)
+ nnimap-server-buffer))))
(defun nnimap-acl-edit (mailbox method old-acls new-acls)
(when (nnimap-possibly-change-server (cadr method))
;; delete all removed identifiers
(mapc (lambda (old-acl)
(unless (assoc (car old-acl) new-acls)
- (or (imap-mailbox-acl-delete (car old-acl) mailbox)
+ (or (imap-mailbox-acl-delete (car old-acl)
+ (nnimap-decode-group-name mailbox))
(error "Can't delete ACL for %s" (car old-acl)))))
old-acls)
;; set all changed acl's
(old-rights (cdr (assoc (car new-acl) old-acls))))
(unless (and old-rights new-rights
(string= old-rights new-rights))
- (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
+ (or (imap-mailbox-acl-set (car new-acl) new-rights
+ (nnimap-decode-group-name mailbox))
(error "Can't set ACL for %s to %s" (car new-acl)
new-rights)))))
new-acls)
(defvar nnir-imap-search-argument-history ()
"The history for querying search options in nnir")
+(defvar nnir-get-article-nov-override-function nil
+ "If non-nil, a function that will be passed each search result. This
+should return a message's headers in NOV format.
+
+If this variable is nil, or if the provided function returns nil for a search
+result, `gnus-retrieve-headers' will be called instead.")
+
+
;;; Developer Extension Variable:
(defvar nnir-engines
(nnir-possibly-change-server server)
(let ((gnus-override-method
(gnus-server-to-method server)))
- (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
- (nov
- (goto-char (point-min))
- (setq novitem (nnheader-parse-nov))
- (unless novitem
- (pop-to-buffer nntp-server-buffer)
- (error
- "nnheader-parse-nov returned nil for article %s in group %s"
- artno artfullgroup)))
- (headers
- (goto-char (point-min))
- (setq novitem (nnheader-parse-head))
- (unless novitem
- (pop-to-buffer nntp-server-buffer)
- (error
- "nnheader-parse-head returned nil for article %s in group %s"
- artno artfullgroup)))
- (t (error "Unknown header type %s while requesting article %s of group %s"
- foo artno artfullgroup))))
+ ;; if nnir-get-article-nov-override-function is set, use it
+ (if nnir-get-article-nov-override-function
+ (setq novitem (funcall nnir-get-article-nov-override-function
+ artitem))
+ ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head
+ (case (setq foo (gnus-retrieve-headers (list artno)
+ artfullgroup nil))
+ (nov
+ (goto-char (point-min))
+ (setq novitem (nnheader-parse-nov))
+ (unless novitem
+ (pop-to-buffer nntp-server-buffer)
+ (error
+ "nnheader-parse-nov returned nil for article %s in group %s"
+ artno artfullgroup)))
+ (headers
+ (goto-char (point-min))
+ (setq novitem (nnheader-parse-head))
+ (unless novitem
+ (pop-to-buffer nntp-server-buffer)
+ (error
+ "nnheader-parse-head returned nil for article %s in group %s"
+ artno artfullgroup)))
+ (t (error "Unknown header type %s while requesting article %s of group %s"
+ foo artno artfullgroup)))))
;; replace article number in original group with article number
;; in nnir group
(mail-header-set-number novitem art)
;;; Code:
+;; For Emacs < 22.2.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
(require 'nnheader)
(require 'nnoo)
(require 'gnus-util)
reading."
(nntp-send-command "^.*\n" "MODE READER"))
+(declare-function netrc-parse "netrc" (file))
+(declare-function netrc-machine "netrc"
+ (list machine &optional port defaultport))
+(declare-function netrc-get "netrc" (alist type))
+
(defun nntp-send-authinfo (&optional send-if-force)
"Send the AUTHINFO to the nntp server.
It will look in the \"~/.authinfo\" file for matching entries. If
If SEND-IF-FORCE, only send authinfo to the server if the
.authinfo file has the FORCE token."
+ (require 'netrc)
(let* ((list (netrc-parse nntp-authinfo-file))
(alist (netrc-machine list nntp-address "nntp"))
(force (or (netrc-get alist "force") nntp-authinfo-force))
- (auth-info
+ (auth-info
(auth-source-user-or-password '("login" "password") nntp-address "nntp"))
(auth-user (nth 0 auth-info))
(auth-passwd (nth 1 auth-info))
;;("TOPDOC" . "1000")
))))
(setq buffer-file-name nil)
- (set-buffer-multibyte t)
+ (unless (featurep 'xemacs) (set-buffer-multibyte t))
(mm-decode-coding-region (point-min) (point-max) 'utf-8)
t)
:type 'boolean
:group 'pop3)
+(defcustom pop3-display-message-size-flag t
+ "*If non-nil, display the size of the message that is being fetched."
+ :version "22.1" ;; Oort Gnus
+ :type 'boolean
+ :group 'pop3)
+
(defvar pop3-timestamp nil
"Timestamp returned when initially connected to the POP server.
Used for APOP authentication.")
(crashbuf (get-buffer-create " *pop3-retr*"))
(n 1)
message-count
+ message-sizes
(pop3-password pop3-password))
;; for debugging only
(if pop3-debug (switch-to-buffer (process-buffer process)))
(pop3-pass process))
(t (error "Invalid POP3 authentication scheme")))
(setq message-count (car (pop3-stat process)))
+ (when (and pop3-display-message-size-flag
+ (> message-count 0))
+ (setq message-sizes (pop3-list process)))
(unwind-protect
(while (<= n message-count)
- (message "Retrieving message %d of %d from %s..."
- n message-count pop3-mailhost)
+ (if pop3-display-message-size-flag
+ (message "Retrieving message %d of %d from %s... (%.1fk)"
+ n message-count pop3-mailhost
+ (/ (cdr (assoc n message-sizes))
+ 1024.0))
+ (message "Retrieving message %d of %d from %s..."
+ n message-count pop3-mailhost))
(pop3-retr process n crashbuf)
(save-excursion
(set-buffer crashbuf)
))
(defun pop3-list (process &optional msg)
- "Scan listing of available messages.
-This function currently does nothing.")
+ "If MSG is nil, return an alist of (MESSAGE-ID . SIZE) pairs.
+Otherwise, return the size of the message-id MSG"
+ (pop3-send-command process (if msg
+ (format "LIST %d" msg)
+ "LIST"))
+ (let ((response (pop3-read-response process t)))
+ (if msg
+ (string-to-number (nth 2 (split-string response " ")))
+ (let ((start pop3-read-point) end)
+ (save-excursion
+ (set-buffer (process-buffer process))
+ (while (not (re-search-forward "^\\.\r\n" nil t))
+ (pop3-accept-process-output process)
+ (goto-char start))
+ (setq pop3-read-point (point-marker))
+ (goto-char (match-beginning 0))
+ (setq end (point-marker))
+ (mapcar #'(lambda (s) (let ((split (split-string s " ")))
+ (cons (string-to-number (nth 0 split))
+ (string-to-number (nth 1 split)))))
+ (delete "" (split-string (buffer-substring start end)
+ "\r\n"))))))))
(defun pop3-retr (process msg crashbuf)
"Retrieve message-id MSG to buffer CRASHBUF."
(require 'cl))
(defvar message-posting-charset)
-(require 'qp)
(require 'mm-util)
(require 'ietf-drums)
;; Fixme: Avoid this (used for mail-parse-charset) mm dependence on gnus.
"Base64-encode the header contained in STRING."
(base64-encode-string string t))
+(autoload 'quoted-printable-encode-region "qp")
+
(defun rfc2047-q-encode-string (string)
"Quoted-printable-encode the header in STRING."
(mm-with-unibyte-buffer
'raw-text
cs)))
+(autoload 'quoted-printable-decode-string "qp")
+
(defun rfc2047-decode-encoded-words (words)
"Decode successive encoded-words in WORDS and return a decoded string.
Each element of WORDS looks like (CHARSET ENCODING ENCODED-TEXT
;; Internal utility functions
-(defsubst sieve-manage-disable-multibyte ()
+(defmacro sieve-manage-disable-multibyte ()
"Enable multibyte in the current buffer."
- (when (fboundp 'set-buffer-multibyte)
- (set-buffer-multibyte nil)))
+ (unless (featurep 'xemacs)
+ '(set-buffer-multibyte nil)))
(declare-function password-read "password-cache" (prompt &optional key))
(declare-function password-cache-add "password-cache" (key password))
;;; sieve-mode.el --- Sieve code editing commands for Emacs
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
(autoload 'sieve-manage "sieve")
(autoload 'sieve-upload "sieve")
-(require 'easymenu)
(eval-when-compile
(require 'font-lock))
"Menubar used in sieve mode.")
;; Code for Sieve editing mode.
+(autoload 'easy-menu-add-item "easymenu")
;;;###autoload
(define-derived-mode sieve-mode c-mode "Sieve"
;;; spam-stat.el --- detecting spam based on statistics
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
;; Keywords: network
(when (re-search-forward "^Xref:.*\n" nil t)
(delete-region (match-beginning 0) (match-end 0)))))
+(autoload 'time-to-number-of-days "time-date")
+
(defun spam-stat-process-directory (dir func)
"Process all the regular files in directory DIR using function FUNC."
(let* ((files (directory-files dir t "^[^.]"))
(when (re-search-forward "^=yend.*$" end t)
(setq last (match-beginning 0))
(setq footer-alist (yenc-parse-line (match-string 0)))
- (letf (((default-value 'enable-multibyte-characters) nil))
- (setq work-buffer (generate-new-buffer " *yenc-work*")))
+ (setq work-buffer (generate-new-buffer " *yenc-work*"))
+ (unless (featurep 'xemacs)
+ (with-current-buffer work-buffer (set-buffer-multibyte nil)))
(while (< first last)
(setq char (char-after first))
(cond ((or (eq char ?\r)
(let ((data (match-string 2)))
(save-match-data
(unless (string-match "^([^)]+)" data)
- (setq data (concat "(emacs)" data))))
+ (setq data (concat "(emacs)" data)))
+ (setq data ;; possible newlines if para filled
+ (replace-regexp-in-string "[ \t\n]+" " " data t t)))
(help-xref-button 2 'help-info data))))
;; URLs
(save-excursion
(insert (format-mode-line mode nil nil buffer))
(add-text-properties start (point) '(face bold)))))
(princ " mode:\n")
- (princ (documentation major-mode))))))
+ (princ (documentation major-mode)))))
+ ;; For the sake of IELM and maybe others
+ nil)
(defun describe-minor-mode (minor-mode)
(defconst hfy-rgb-regex
"^\\s-*\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\(.+\\)\\s-*$")
+;;;###autoload
(defun htmlfontify-load-rgb-file (&optional file)
"Load an X11 style rgb.txt FILE.
Search `hfy-rgb-load-path' if FILE is not specified.
(kill-buffer rgb-buffer)))))
(defun htmlfontify-unload-rgb-file ()
+ "Unload the current color name -> rgb translation map."
(interactive)
(setq hfy-rgb-txt-colour-map nil))
+;;;###autoload
(defun hfy-fallback-colour-values (colour-string)
+ "Use a fallback method for obtaining the rgb values for a color."
(cdr (assoc-string colour-string (or hfy-rgb-txt-colour-map
hfy-fallback-colour-map))) )
(provide 'hfy-cmap)
-;;; hfy-cmap.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "htmlfontify.el"
+;; End:
;; arch-tag: dff7feea-add4-48ba-937c-e79ac40cec9b
+;;; hfy-cmap.el ends here
(defgroup hl-line nil
"Highlight the current line."
:version "21.1"
- :group 'editing)
+ :group 'convenience)
(defface hl-line
'((t :inherit highlight))
;; (`font-lock-fontify-region')
(require 'cus-edit)
-(eval-and-compile
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; I want these - can't be bothered requiring all of cl though.
- (if (not (fboundp 'caddr))
- (defun caddr (list)
- "Return the `car' of the `cddr' of LIST."
- (car (cddr list))))
-
- (if (not (fboundp 'cadddr))
- (defun cadddr (list)
- "Return the `cadr' of the `cddr' of LIST."
- (cadr (cddr list))))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (autoload
- 'htmlfontify-load-rgb-file
- "hfy-cmap"
- "Load an rgb.txt file for color name -> rgb translation purposes."
- 'interactive)
-
- (autoload
- 'htmlfontify-unload-rgb-file
- "hfy-cmap"
- "Unload the current color name -> rgb translation map."
- 'interactive)
-
- (autoload
- 'hfy-fallback-colour-values
- "hfy-cmap"
- "Use a fallback method for obtaining the rgb values for a color."
- 'interactive)
- )
-
(defconst htmlfontify-version 0.21)
(defconst hfy-meta-tags
(let ((file (hfy-initfile)))
(load file 'NOERROR nil nil) ))
+\f
+;;;### (autoloads (hfy-fallback-colour-values htmlfontify-load-rgb-file)
+;;;;;; "hfy-cmap" "hfy-cmap.el" "3de2db2d213813bb3afe170ffd66cdde")
+;;; Generated autoloads from hfy-cmap.el
+
+(autoload 'htmlfontify-load-rgb-file "hfy-cmap" "\
+Load an X11 style rgb.txt FILE.
+Search `hfy-rgb-load-path' if FILE is not specified.
+Loads the variable `hfy-rgb-txt-colour-map', which is used by
+`hfy-fallback-colour-values'.
+
+\(fn &optional FILE)" t nil)
+
+(autoload 'hfy-fallback-colour-values "hfy-cmap" "\
+Use a fallback method for obtaining the rgb values for a color.
+
+\(fn COLOUR-STRING)" nil nil)
+
+;;;***
+\f
+
(provide 'htmlfontify)
-;;; htmlfontify.el ends here
;; arch-tag: 944e5e63-c81d-4baa-a82a-0275f9c30e61
+;;; htmlfontify.el ends here
(defvar ibuffer-tmp-show-regexps nil
"A list of regexps which should match buffer names to always show.")
-(defvar ibuffer-auto-mode nil
- "If non-nil, Ibuffer auto-mode should be enabled for this buffer.
-Do not set this variable directly! Use the function
-`ibuffer-auto-mode' instead.")
-
(defvar ibuffer-auto-buffers-changed nil)
(defcustom ibuffer-saved-filters '(("gnus"
(ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers)
(ibuffer-buf-matches-predicates buf ibuffer-always-show-predicates)))))
+;;;###autoload
+(define-minor-mode ibuffer-auto-mode
+ "Toggle use of Ibuffer's auto-update facility.
+With numeric ARG, enable auto-update if and only if ARG is positive."
+ nil nil nil
+ (unless (derived-mode-p 'ibuffer-mode)
+ (error "This buffer is not in Ibuffer mode"))
+ (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
+ (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
+
(defun ibuffer-auto-update-changed ()
(when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed)
(dolist (buf (buffer-list))
(derived-mode-p 'ibuffer-mode))
(ibuffer-update nil t)))))))
-;;;###autoload
-(defun ibuffer-auto-mode (&optional arg)
- "Toggle use of Ibuffer's auto-update facility.
-With numeric ARG, enable auto-update if and only if ARG is positive."
- (interactive)
- (unless (derived-mode-p 'ibuffer-mode)
- (error "This buffer is not in Ibuffer mode"))
- (set (make-local-variable 'ibuffer-auto-mode)
- (if arg
- (plusp arg)
- (not ibuffer-auto-mode)))
- (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
- (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
-
;;;###autoload
(defun ibuffer-mouse-filter-by-mode (event)
"Enable or disable filtering by the major mode chosen via mouse."
;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
-;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "4fb4f1a32cf4ecf4669a133a866f4a14")
+;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "e1272bfdc7c3b6e926b2a68155217303")
;;; Generated autoloads from ibuf-ext.el
(autoload 'ibuffer-auto-mode "ibuf-ext" "\
matches exist. \(Keybindings for uniquely matched commands
are exhibited within the square braces.)"
- (let* ((comps (completion-all-sorted-completions))
+ (let* ((non-essential t)
+ (comps (completion-all-sorted-completions))
(last (if (consp comps) (last comps)))
(base-size (cdr last))
(open-bracket (if require-match "(" "["))
;;; Code:
-(defvar cua-inhibit-cua-keys)
+(defvar recentf-list)
;;; User Variables
;;
:type '(repeat string)
:group 'ido)
+(defcustom ido-use-virtual-buffers nil
+ "If non-nil, refer to past buffers as well as existing ones.
+Essentially it works as follows: Say you are visiting a file and
+the buffer gets cleaned up by mignight.el. Later, you want to
+switch to that buffer, but find it's no longer open. With
+virtual buffers enabled, the buffer name stays in the buffer
+list (using the ido-virtual face, and always at the end), and if
+you select it, it opens the file back up again. This allows you
+to think less about whether recently opened files are still open
+or not. Most of the time you can quit Emacs, restart, and then
+switch to a file buffer that was previously open as if it still
+were.
+ This feature relies upon the `recentf' package, which will be
+enabled if this variable is configured to a non-nil value."
+ :version "24.1"
+ :type 'boolean
+ :group 'ido)
+
(defcustom ido-use-faces t
"Non-nil means use ido faces to highlighting first match, only match and
subdirs in the alternatives."
"Face used by ido for highlighting subdirs in the alternatives."
:group 'ido)
+(defface ido-virtual '((t (:inherit font-lock-builtin-face)))
+ "Face used by ido for matching virtual buffer names."
+ :version "24.1"
+ :group 'ido)
+
(defface ido-indicator '((((min-colors 88) (class color))
(:foreground "yellow1"
:background "red1"
"Non-nil means to explicitly cursor on entry to minibuffer.
Value is an integer which is number of chars to right of prompt.")
+(defvar ido-virtual-buffers nil
+ "List of virtual buffers, that is, past visited files.
+This is a copy of `recentf-list', pared down and with faces applied.
+Only used if `ido-use-virtual-buffers' is non-nil.")
+
;;; Variables with dynamic bindings.
;;; Declared here to keep the byte compiler quiet.
(define-key map "\C-o" 'ido-copy-current-word)
(define-key map "\C-w" 'ido-copy-current-file-name)
(define-key map [(meta ?l)] 'ido-toggle-literal)
- (define-key map "\C-v" 'ido-toggle-vc)
(set-keymap-parent map ido-file-dir-completion-map)
(setq ido-file-completion-map map))
(define-key map "\C-x\C-f" 'ido-enter-find-file)
(define-key map "\C-x\C-b" 'ido-fallback-command)
(define-key map "\C-k" 'ido-kill-buffer-at-head)
+ (define-key map "\C-o" 'ido-toggle-virtual-buffers)
(set-keymap-parent map ido-common-completion-map)
(setq ido-buffer-completion-map map)))
(ido-current-directory nil)
(ido-directory-nonreadable nil)
(ido-directory-too-big nil)
+ (ido-use-virtual-buffers (if (eq method 'kill)
+ nil ;; Don't consider virtual buffers for killing
+ ido-use-virtual-buffers))
(require-match (confirm-nonexistent-file-or-buffer))
(buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
- require-match initial)))
+ require-match initial))
+ filename)
;; Choose the buffer name: either the text typed in, or the head
;; of the list of matches
(point))))
(ido-visit-buffer buf method t)))
+ ;; check for a virtual buffer reference
+ ((and ido-use-virtual-buffers ido-virtual-buffers
+ (setq filename (assoc buf ido-virtual-buffers)))
+ (ido-visit-buffer (find-file-noselect (cdr filename)) method t))
+
+ ((and (eq ido-create-new-buffer 'prompt)
+ (null require-match)
+ (not (y-or-n-p (format "No buffer matching `%s', create one? " buf))))
+ nil)
+
;; buffer doesn't exist
((and (eq ido-create-new-buffer 'never)
(null require-match))
(setq ido-exit 'keep)
(exit-minibuffer))))
+(defun ido-toggle-virtual-buffers ()
+ "Toggle the use of virtual buffers.
+See `ido-use-virtual-buffers' for explanation of virtual buffer."
+ (interactive)
+ (when (and ido-mode (eq ido-cur-item 'buffer))
+ (setq ido-use-virtual-buffers (not ido-use-virtual-buffers))
+ (setq ido-text-init ido-text)
+ (setq ido-exit 'refresh)
+ (exit-minibuffer)))
+
(defun ido-reread-directory ()
"Read current directory again.
May be useful if cached version is no longer valid, but directory
(if ido-temp-list
(nconc ido-temp-list ido-current-buffers)
(setq ido-temp-list ido-current-buffers))
- (if (and default (buffer-live-p (get-buffer default)))
- (progn
- (setq ido-temp-list
- (delete default ido-temp-list))
- (setq ido-temp-list
- (cons default ido-temp-list))))
+ (when (and default (buffer-live-p (get-buffer default)))
+ (setq ido-temp-list
+ (cons default (delete default ido-temp-list))))
+ (if ido-use-virtual-buffers
+ (ido-add-virtual-buffers-to-list))
(run-hooks 'ido-make-buffer-list-hook)
ido-temp-list))
+(defun ido-add-virtual-buffers-to-list ()
+ "Add recently visited files, and bookmark files, to the buffer list.
+This is to make them appear as if they were \"virtual buffers\"."
+ ;; If no buffers matched, and virtual buffers are being used, then
+ ;; consult the list of past visited files, to see if we can find
+ ;; the file which the user might thought was still open.
+ (unless recentf-mode (recentf-mode 1))
+ (setq ido-virtual-buffers nil)
+ (let (name)
+ (dolist (head recentf-list)
+ (and (setq name (file-name-nondirectory head))
+ (null (get-file-buffer head))
+ (not (assoc name ido-virtual-buffers))
+ (not (member name ido-temp-list))
+ (not (ido-ignore-item-p name ido-ignore-buffers))
+ ;;(file-exists-p head)
+ (push (cons name head) ido-virtual-buffers))))
+ (when ido-virtual-buffers
+ (if ido-use-faces
+ (dolist (comp ido-virtual-buffers)
+ (put-text-property 0 (length (car comp))
+ 'face 'ido-virtual
+ (car comp))))
+ (setq ido-temp-list
+ (nconc ido-temp-list
+ (nreverse (mapcar #'car ido-virtual-buffers))))))
+
(defun ido-make-choice-list (default)
;; Return the current list of choices.
;; If DEFAULT is non-nil, and corresponds to an element of choices,
;; Strip method:user@host: part of tramp completions.
;; Tramp completions do not include leading slash.
(let* ((len (1- (length dir)))
- (tramp-completion-mode t)
+ (non-essential t)
(compl
(or (file-name-all-completions "" dir)
;; work around bug in ange-ftp.
(when (ido-active)
(add-hook 'pre-command-hook 'ido-tidy nil t)
(add-hook 'post-command-hook 'ido-exhibit nil t)
- (setq cua-inhibit-cua-keys t)
(when (featurep 'xemacs)
(ido-exhibit)
(goto-char (point-min)))
:group 'image)
(defconst iimage-version "1.1")
-(defvar iimage-mode nil)
-(defvar iimage-mode-map nil)
-;; Set up key map.
-(unless iimage-mode-map
- (setq iimage-mode-map (make-sparse-keymap))
- (define-key iimage-mode-map "\C-l" 'iimage-recenter))
+(defvar iimage-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-l" 'iimage-recenter)
+ map))
(defun iimage-recenter (&optional arg)
-"Re-draw images and recenter."
+ "Re-draw images and recenter."
(interactive "P")
- (iimage-mode-buffer 0)
- (iimage-mode-buffer 1)
+ (iimage-mode-buffer nil)
+ (iimage-mode-buffer t)
(recenter arg))
(defvar iimage-mode-image-filename-regex
`((,(concat "\\(`?file://\\|\\[\\[\\|<\\|`\\)?"
"\\(" iimage-mode-image-filename-regex "\\)"
"\\(\\]\\]\\|>\\|'\\)?") . 2))
-"*Alist of filename REGEXP vs NUM.
+ "*Alist of filename REGEXP vs NUM.
Each element looks like (REGEXP . NUM).
NUM specifies which parenthesized expression in the regexp.
`file://foo.png'
\\[\\[foo.gif]]
<foo.png>
- foo.JPG
-")
+ foo.JPG")
(defvar iimage-mode-image-search-path nil
-"*List of directories to search for image files for iimage-mode.")
+ "*List of directories to search for image files for `iimage-mode'.")
;;;###autoload
-(defun turn-on-iimage-mode ()
-"Unconditionally turn on iimage mode."
- (interactive)
- (iimage-mode 1))
+(define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
(defun turn-off-iimage-mode ()
-"Unconditionally turn off iimage mode."
+ "Unconditionally turn off iimage mode."
(interactive)
(iimage-mode 0))
-(defalias 'iimage-locate-file 'locate-file)
-
(defun iimage-mode-buffer (arg)
-"Display/undisplay images.
-With numeric ARG, display the images if and only if ARG is positive."
- (interactive)
- (let ((ing (if (numberp arg)
- (> arg 0)
- iimage-mode))
- (modp (buffer-modified-p (current-buffer)))
- file buffer-read-only)
- (save-excursion
- (goto-char (point-min))
- (dolist (pair iimage-mode-image-regex-alist)
- (while (re-search-forward (car pair) nil t)
- (if (and (setq file (match-string (cdr pair)))
- (setq file (iimage-locate-file file
- (cons default-directory
- iimage-mode-image-search-path))))
- (if ing
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'display (create-image file)))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(display)))))))
- (set-buffer-modified-p modp)))
+ "Display images if ARG is non-nil, undisplay them otherwise."
+ (let ((image-path (cons default-directory iimage-mode-image-search-path))
+ file)
+ (with-silent-modifications
+ (save-excursion
+ (goto-char (point-min))
+ (dolist (pair iimage-mode-image-regex-alist)
+ (while (re-search-forward (car pair) nil t)
+ (if (and (setq file (match-string (cdr pair)))
+ (setq file (locate-file file image-path)))
+ ;; FIXME: we don't mark our images, so we can't reliably
+ ;; remove them either (we may leave some of ours, and we
+ ;; may remove other packages's display properties).
+ (if arg
+ (add-text-properties (match-beginning 0) (match-end 0)
+ (list 'display (create-image file)))
+ (remove-text-properties (match-beginning 0) (match-end 0)
+ '(display))))))))))
;;;###autoload
(define-minor-mode iimage-mode
"Toggle inline image minor mode."
:group 'iimage :lighter " iImg" :keymap iimage-mode-map
- (run-hooks 'iimage-mode-hook)
(iimage-mode-buffer iimage-mode))
(provide 'iimage)
(define-key map [remap next-line] 'image-next-line)
(define-key map [remap scroll-up] 'image-scroll-up)
(define-key map [remap scroll-down] 'image-scroll-down)
+ (define-key map [remap scroll-up-command] 'image-scroll-up)
+ (define-key map [remap scroll-down-command] 'image-scroll-down)
(define-key map [remap move-beginning-of-line] 'image-bol)
(define-key map [remap move-end-of-line] 'image-eol)
(define-key map [remap beginning-of-buffer] 'image-bob)
(defvar archive-superior-buffer)
(defvar tar-superior-buffer)
-(declare-function image-refresh "image.c" (spec &optional frame))
+(declare-function image-flush "image.c" (spec &optional frame))
(defun image-toggle-display-image ()
"Show the image of the image file.
(buffer-substring-no-properties (point-min) (point-max)))
filename))
(type (image-type file-or-data nil data-p))
- (image (create-image file-or-data type data-p))
+ (image (create-animated-image file-or-data type data-p))
(props
`(display ,image
intangible ,image
(inhibit-read-only t)
(buffer-undo-list t)
(modified (buffer-modified-p)))
- (image-refresh image)
+ (image-flush image)
(let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file
(add-text-properties (point-min) (point-max) props)
(restore-buffer-modified-p modified))
;;; image.el --- image API
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: multimedia
"Image support."
:group 'multimedia)
+(defalias 'image-refresh 'image-flush)
(defconst image-type-header-regexps
`(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
(declare (doc-string 3))
`(defvar ,symbol (find-image ',specs) ,doc))
+\f
+;;; Animated image API
+(defcustom image-animate-max-time 30
+ "Time in seconds to animate images."
+ :type 'integer
+ :version "24.1"
+ :group 'image)
+
+(defconst image-animated-types '(gif)
+ "List of supported animated image types.")
+
+;;;###autoload
+(defun create-animated-image (file-or-data &optional type data-p &rest props)
+ "Create an animated image.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type. If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data. If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
+Optional PROPS are additional image attributes to assign to the image,
+like, e.g. `:mask MASK'.
+Value is the image created, or nil if images of type TYPE are not supported.
+
+Images should not be larger than specified by `max-image-size'."
+ (setq type (image-type file-or-data type data-p))
+ (when (image-type-available-p type)
+ (let* ((animate (memq type image-animated-types))
+ (image
+ (append (list 'image :type type (if data-p :data :file) file-or-data)
+ (if animate '(:index 0 :mask heuristic))
+ props)))
+ (if animate
+ (image-animate-start image))
+ image)))
+
+(defun image-animate-timer (image)
+ "Return the animation timer for image IMAGE."
+ ;; See cancel-function-timers
+ (let ((tail timer-list) timer)
+ (while tail
+ (setq timer (car tail)
+ tail (cdr tail))
+ (if (and (eq (aref timer 5) #'image-animate-timeout)
+ (consp (aref timer 6))
+ (eq (car (aref timer 6)) image))
+ (setq tail nil)
+ (setq timer nil)))
+ timer))
+
+(defun image-animate-start (image &optional max-time)
+ "Start animation of image IMAGE.
+Optional second arg MAX-TIME is number of seconds to animate image,
+or t to animate infinitely."
+ (let ((anim (image-animated-p image))
+ timer tmo)
+ (when anim
+ (if (setq timer (image-animate-timer image))
+ (setcar (nthcdr 3 (aref timer 6)) max-time)
+ (setq tmo (* (cdr anim) 0.01))
+ (setq max-time (or max-time image-animate-max-time))
+ (run-with-timer tmo nil #'image-animate-timeout
+ image 1 (car anim)
+ (if (numberp max-time)
+ (- max-time tmo)
+ max-time))))))
+
+(defun image-animate-stop (image)
+ "Stop animation of image."
+ (let ((timer (image-animate-timer image)))
+ (when timer
+ (cancel-timer timer))))
+
+(defun image-animate-timeout (image ino count time-left)
+ (if (>= ino count)
+ (setq ino 0))
+ (plist-put (cdr image) :index ino)
+ (force-window-update)
+ (let ((anim (image-animated-p image)) tmo)
+ (when anim
+ (setq tmo (* (cdr anim) 0.01))
+ (unless (and (= ino 0) (numberp time-left) (< time-left tmo))
+ (run-with-timer tmo nil #'image-animate-timeout
+ image (1+ ino) count
+ (if (numberp time-left)
+ (- time-left tmo)
+ time-left))))))
+
+(defun image-animated-p (image)
+ "Return non-nil if image is animated.
+Actually, return value is a cons (IMAGES . DELAY) where IMAGES
+is the number of sub-images in the animated image, and DELAY
+is the delay in 100ths of a second until the next sub-image
+shall be displayed."
+ (cond
+ ((eq (plist-get (cdr image) :type) 'gif)
+ (let* ((metadata (image-metadata image))
+ (images (plist-get metadata 'count))
+ (extdata (plist-get metadata 'extension-data))
+ (anim (plist-get extdata #xF9)))
+ (and (integerp images) (> images 1)
+ (stringp anim) (>= (length anim) 4)
+ (cons images (+ (aref anim 1) (* (aref anim 2) 256))))))))
+
+\f
(provide 'image)
;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3
(or (eolp)
(indent-to column 0))
(forward-line 1))
- (move-marker end nil))))
+ (move-marker end nil)))
+ ;; In most cases, reindenting modifies the buffer, but it may also
+ ;; leave it unmodified, in which case we have to deactivate the mark
+ ;; by hand.
+ (deactivate-mark))
(defun indent-relative-maybe ()
"Indent a new line like previous nonblank line.
:group 'info)
(defvar Info-isearch-initial-node nil)
+(defvar Info-isearch-initial-history nil)
+(defvar Info-isearch-initial-history-list nil)
(defcustom Info-mode-hook
;; Try to obey obsolete Info-fontify settings.
(setq Info-isearch-initial-node
;; Don't stop at initial node for nonincremental search.
;; Otherwise this variable is set after first search failure.
- (and isearch-nonincremental Info-current-node)))
+ (and isearch-nonincremental Info-current-node))
+ (setq Info-isearch-initial-history Info-history
+ Info-isearch-initial-history-list Info-history-list)
+ (add-hook 'isearch-mode-end-hook 'Info-isearch-end nil t))
+
+(defun Info-isearch-end ()
+ ;; Remove intermediate nodes (visited while searching)
+ ;; from the history. Add only the last node (where Isearch ended).
+ (if (> (length Info-history)
+ (length Info-isearch-initial-history))
+ (setq Info-history
+ (nthcdr (- (length Info-history)
+ (length Info-isearch-initial-history)
+ 1)
+ Info-history)))
+ (if (> (length Info-history-list)
+ (length Info-isearch-initial-history-list))
+ (setq Info-history-list
+ (cons (car Info-history-list)
+ Info-isearch-initial-history-list)))
+ (remove-hook 'isearch-mode-end-hook 'Info-isearch-end t))
(defun Info-isearch-filter (beg-found found)
"Test whether the current search hit is a visible useful text.
(add-to-list 'Info-virtual-nodes
'("\\`\\*Index.*\\*\\'"
(find-node . Info-virtual-index-find-node)
+ (slow . t)
))
(defvar Info-virtual-index-nodes nil
(toc-nodes . Info-apropos-toc-nodes)
(find-file . Info-apropos-find-file)
(find-node . Info-apropos-find-node)
+ (slow . t)
))
(defvar Info-apropos-file "*Apropos*"
(defvar finder-known-keywords)
(defvar finder-package-info)
(declare-function find-library-name "find-func" (library))
+(declare-function finder-unknown-keywords "finder" ())
(declare-function lm-commentary "lisp-mnt" (&optional file))
(defun Info-finder-find-node (filename nodename &optional no-going-back)
"Finder-specific implementation of Info-find-node-2."
+ (require 'finder)
(cond
((equal nodename "Top")
;; Display Top menu with descriptions of the keywords
(insert (format "* %-14s %s.\n"
(concat (symbol-name keyword) "::")
(cdr assoc)))))
- finder-known-keywords))
+ (append '((all . "All package info")
+ (unknown . "unknown keywords"))
+ finder-known-keywords)))
+ ((equal nodename "unknown")
+ ;; Display unknown keywords
+ (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
+ Info-finder-file nodename))
+ (insert "Finder Unknown Keywords\n")
+ (insert "***********************\n\n")
+ (insert "* Menu:\n\n")
+ (mapc
+ (lambda (assoc)
+ (insert (format "* %-14s %s.\n"
+ (concat (symbol-name (car assoc)) "::")
+ (cdr assoc))))
+ (finder-unknown-keywords)))
+ ((equal nodename "all")
+ ;; Display all package info.
+ (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
+ Info-finder-file nodename))
+ (insert "Finder Package Info\n")
+ (insert "*******************\n\n")
+ (mapc (lambda (package)
+ (insert (format "%s - %s\n"
+ (format "*Note %s::" (nth 0 package))
+ (nth 1 package)))
+ (insert "Keywords: "
+ (mapconcat (lambda (keyword)
+ (format "*Note %s::" (symbol-name keyword)))
+ (nth 2 package) ", ")
+ "\n\n"))
+ finder-package-info))
((string-match-p "\\.el\\'" nodename)
;; Display commentary section
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
(buffer-string))))))
(t
;; Display packages that match the keyword
+ ;; or the list of keywords separated by comma.
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
Info-finder-file nodename))
(insert "Finder Packages\n")
(insert
"The following packages match the keyword `" nodename "':\n\n")
(insert "* Menu:\n\n")
- (let ((id (intern nodename)))
+ (let ((keywords
+ (mapcar 'intern (if (string-match-p "," nodename)
+ (split-string nodename ",[ \t\n]*" t)
+ (list nodename)))))
(mapc
- (lambda (x)
- (when (memq id (cadr (cdr x)))
+ (lambda (package)
+ (unless (memq nil (mapcar (lambda (k) (memq k (nth 2 package)))
+ keywords))
(insert (format "* %-16s %s.\n"
- (concat (car x) "::")
- (cadr x)))))
+ (concat (nth 0 package) "::")
+ (nth 1 package)))))
finder-package-info)))))
;;;###autoload
-(defun info-finder ()
- "Display descriptions of the keywords in the Finder virtual manual."
- (interactive)
+(defun info-finder (&optional keywords)
+ "Display descriptions of the keywords in the Finder virtual manual.
+In interactive use, a prefix argument directs this command to read
+a list of keywords separated by comma. After that, it displays a node
+with a list packages that contain all specified keywords."
+ (interactive
+ (when current-prefix-arg
+ (require 'finder)
+ (list
+ (completing-read-multiple
+ "Keywords (separated by comma): "
+ (mapcar 'symbol-name (mapcar 'car (append finder-known-keywords
+ (finder-unknown-keywords))))
+ nil t))))
(require 'finder)
- (Info-find-node Info-finder-file "Top"))
+ (if keywords
+ (Info-find-node Info-finder-file (mapconcat 'identity keywords ", "))
+ (Info-find-node Info-finder-file "Top")))
+
\f
(defun Info-undefined ()
"Make command be undefined in Info."
(defvar info-tool-bar-map
(let ((map (make-sparse-keymap)))
(tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map
- :rtl "right-arrow")
+ :rtl "right-arrow"
+ :label "Back")
(tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map
- :rtl "left-arrow")
+ :rtl "left-arrow"
+ :label "Forward")
(tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map
:rtl "next-node")
(tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map
(tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
- (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
+ (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map
+ :label "Index Search")
(tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map)
map))
;; Autoload cookie needed by desktop.el
;;;###autoload
-(defun Info-mode ()
+(define-derived-mode Info-mode nil "Info"
"Info mode provides commands for browsing through the Info documentation tree.
Documentation in Info is divided into \"nodes\", each of which discusses
one topic and contains references to other nodes which discuss related
\\[clone-buffer] Select a new cloned Info buffer in another window.
\\[universal-argument] \\[info] Move to new Info file with completion.
\\[universal-argument] N \\[info] Select Info buffer with prefix number in the name *info*<N>."
- (kill-all-local-variables)
- (setq major-mode 'Info-mode)
- (setq mode-name "Info")
+ :syntax-table text-mode-syntax-table
+ :abbrev-table text-mode-abbrev-table
(setq tab-width 8)
- (use-local-map Info-mode-map)
(add-hook 'activate-menubar-hook 'Info-menu-update nil t)
- (set-syntax-table text-mode-syntax-table)
- (setq local-abbrev-table text-mode-abbrev-table)
(setq case-fold-search t)
(setq buffer-read-only t)
(make-local-variable 'Info-current-file)
(make-local-variable 'Info-current-subfile)
(make-local-variable 'Info-current-node)
- (make-local-variable 'Info-tag-table-marker)
- (setq Info-tag-table-marker (make-marker))
- (make-local-variable 'Info-tag-table-buffer)
- (setq Info-tag-table-buffer nil)
+ (set (make-local-variable 'Info-tag-table-marker) (make-marker))
+ (set (make-local-variable 'Info-tag-table-buffer) nil)
(make-local-variable 'Info-history)
(make-local-variable 'Info-history-forward)
(make-local-variable 'Info-index-alternatives)
'(:eval (get-text-property (point-min) 'header-line))))
(set (make-local-variable 'tool-bar-map) info-tool-bar-map)
;; This is for the sake of the invisible text we use handling titles.
- (make-local-variable 'line-move-ignore-invisible)
- (setq line-move-ignore-invisible t)
- (make-local-variable 'desktop-save-buffer)
- (make-local-variable 'widen-automatically)
- (setq widen-automatically nil)
- (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
+ (set (make-local-variable 'line-move-ignore-invisible) t)
+ (set (make-local-variable 'desktop-save-buffer)
+ 'Info-desktop-buffer-misc-data)
+ (set (make-local-variable 'widen-automatically) nil)
(add-hook 'kill-buffer-hook 'Info-kill-buffer nil t)
(add-hook 'clone-buffer-hook 'Info-clone-buffer nil t)
(add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
'Info-revert-buffer-function)
(Info-set-mode-line)
(set (make-local-variable 'bookmark-make-record-function)
- 'Info-bookmark-make-record)
- (run-mode-hooks 'Info-mode-hook))
+ 'Info-bookmark-make-record))
;; When an Info buffer is killed, make sure the associated tags buffer
;; is killed too.
(defun Info-desktop-buffer-misc-data (desktop-dirname)
"Auxiliary information to be saved in desktop file."
- (unless (Info-virtual-file-p Info-current-file)
- (list Info-current-file Info-current-node)))
+ (list Info-current-file
+ Info-current-node
+ ;; Additional data as an association list.
+ (delq nil (list
+ (and Info-history
+ (cons 'history Info-history))
+ (and (Info-virtual-fun
+ 'slow Info-current-file Info-current-node)
+ (cons 'slow t))))))
(defun Info-restore-desktop-buffer (desktop-buffer-file-name
desktop-buffer-name
desktop-buffer-misc)
"Restore an Info buffer specified in a desktop file."
- (let ((first (nth 0 desktop-buffer-misc))
- (second (nth 1 desktop-buffer-misc)))
- (when (and first second)
- (when desktop-buffer-name
- (set-buffer (get-buffer-create desktop-buffer-name))
- (Info-mode))
- (Info-find-node first second)
- (current-buffer))))
+ (let* ((file (nth 0 desktop-buffer-misc))
+ (node (nth 1 desktop-buffer-misc))
+ (data (nth 2 desktop-buffer-misc))
+ (hist (assq 'history data))
+ (slow (assq 'slow data)))
+ ;; Don't restore nodes slow to regenerate.
+ (unless slow
+ (when (and file node)
+ (when desktop-buffer-name
+ (set-buffer (get-buffer-create desktop-buffer-name))
+ (Info-mode))
+ (Info-find-node file node)
+ (when hist
+ (setq Info-history (cdr hist)))
+ (current-buffer)))))
(add-to-list 'desktop-buffer-mode-handlers
'(Info-mode . Info-restore-desktop-buffer))
;;; Code:
(require 'disp-table)
+(eval-when-compile (require 'cl))
(defgroup iso-ascii nil
"Set up char tables for ISO 8859/1 on ASCII terminals."
(iso-ascii-display 254 "th") ; small thorn, Icelandic
(iso-ascii-display 255 "\"y") ; small y with diaeresis or umlaut mark
-(defun iso-ascii-mode (arg)
+(define-minor-mode iso-ascii-mode
"Toggle ISO-ASCII mode."
- (interactive "P")
- (unless arg
- (setq arg (eq standard-display-table iso-ascii-standard-display-table)))
- (setq standard-display-table
- (if arg
- iso-ascii-display-table
- iso-ascii-standard-display-table)))
+ :variable (eq standard-display-table iso-ascii-display-table)
+ (unless standard-display-table
+ (setq standard-display-table iso-ascii-standard-display-table)))
(provide 'iso-ascii)
(define-key-after map [describe-language-environment]
`(menu-item ,(purecopy "Describe Language Environment")
- describe-language-environment-map
+ ,describe-language-environment-map
:help ,(purecopy "Show multilingual settings for a specific language")))
(define-key-after map [describe-input-method]
`(menu-item ,(purecopy "Describe Input Method...") describe-input-method
"Display the HELLO file, which lists many languages and characters."
(interactive)
;; We have to decode the file in any environment.
- (letf (((default-value 'enable-multibyte-characters) t)
- (coding-system-for-read 'iso-2022-7bit))
+ (letf ((coding-system-for-read 'iso-2022-7bit))
(view-file (expand-file-name "HELLO" data-directory))))
(defun universal-coding-system-argument (coding-system)
(make-variable-buffer-local 'buffer-file-coding-system-explicit)
(put 'buffer-file-coding-system-explicit 'permanent-local t)
+(defun read-buffer-file-coding-system ()
+ (let* ((bcss (find-coding-systems-region (point-min) (point-max)))
+ (css-table
+ (unless (equal bcss '(undecided))
+ (append '("dos" "unix" "mac")
+ (delq nil (mapcar (lambda (cs)
+ (if (memq (coding-system-base cs) bcss)
+ (symbol-name cs)))
+ coding-system-list)))))
+ (combined-table
+ (if css-table
+ (completion-table-in-turn css-table coding-system-alist)
+ coding-system-alist))
+ (auto-cs
+ (unless find-file-literally
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (funcall set-auto-coding-function
+ (or buffer-file-name "") (buffer-size))))))
+ (preferred
+ (let ((bfcs (default-value 'buffer-file-coding-system)))
+ (cons (and (or (equal bcss '(undecided))
+ (memq (coding-system-base bfcs) bcss))
+ bfcs)
+ (mapcar (lambda (cs)
+ (and (coding-system-p cs)
+ (coding-system-get cs :mime-charset)
+ (or (equal bcss '(undecided))
+ (memq (coding-system-base cs) bcss))
+ cs))
+ (coding-system-priority-list)))))
+ (default
+ (let ((current (coding-system-base buffer-file-coding-system)))
+ ;; Generally use as a default the first preferred coding-system
+ ;; different from the current coding-system, except for
+ ;; the case of auto-cs since choosing anything else is asking
+ ;; for trouble (would lead to using a different coding
+ ;; system than specified in the coding tag).
+ (or auto-cs
+ (car (delq nil
+ (mapcar (lambda (cs)
+ (if (eq current (coding-system-base cs))
+ nil
+ cs))
+ preferred))))))
+ (completion-ignore-case t)
+ (completion-pcm--delim-wild-regex ; Let "u8" complete to "utf-8".
+ (concat completion-pcm--delim-wild-regex
+ "\\|\\([[:alpha:]]\\)[[:digit:]]"))
+ (cs (completing-read
+ (format "Coding system for saving file (default %s): " default)
+ combined-table
+ nil t nil 'coding-system-history
+ (if default (symbol-name default)))))
+ (unless (zerop (length cs)) (intern cs))))
+
(defun set-buffer-file-coding-system (coding-system &optional force nomodify)
"Set the file coding-system of the current buffer to CODING-SYSTEM.
This means that when you save the buffer, it will be converted
don't want to mark the buffer modified, specify t for NOMODIFY.
If you know exactly what coding system you want to use,
just set the variable `buffer-file-coding-system' directly."
- (interactive "zCoding system for saving file (default nil): \nP")
+ (interactive
+ (list (read-buffer-file-coding-system)
+ current-prefix-arg))
(check-coding-system coding-system)
(if (and coding-system buffer-file-coding-system (null force))
(setq coding-system
(merge-coding-systems coding-system buffer-file-coding-system)))
+ (when (called-interactively-p 'interactive)
+ ;; Check whether save would succeed, and jump to the offending char(s)
+ ;; if not.
+ (let ((css (find-coding-systems-region (point-min) (point-max))))
+ (unless (or (eq (car css) 'undecided)
+ (memq (coding-system-base coding-system) css))
+ (setq coding-system (select-safe-coding-system-interactively
+ (point-min) (point-max) css
+ (list coding-system))))))
(setq buffer-file-coding-system coding-system)
(if buffer-file-coding-system-explicit
(setcdr buffer-file-coding-system-explicit coding-system)
(setq buffer-file-coding-system-explicit (cons nil coding-system)))
- ;; This is in case of an explicit call. Normally, `normal-mode' and
- ;; `set-buffer-major-mode-hook' take care of setting the table.
- (if (fboundp 'ucs-set-table-for-input) ; don't lose when building
- (ucs-set-table-for-input))
(unless nomodify
(set-buffer-modified-p t))
(force-mode-line-update))
;; self-extracting exe archives.
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\.\\(\
-arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|\
-ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'"
+arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\
+ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'"
. no-conversion-multibyte)
("\\.\\(exe\\|EXE\\)\\'" . no-conversion)
("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion)
(defvar isearch-mode-hook nil
"Function(s) to call after starting up an incremental search.")
+(defvar isearch-update-post-hook nil
+ "Function(s) to call after isearch has found matches in the buffer.")
+
(defvar isearch-mode-end-hook nil
"Function(s) to call after terminating an incremental search.
When these functions are called, `isearch-mode-end-hook-quit'
(define-key map "\M-\C-y" 'isearch-yank-char)
(define-key map "\C-y" 'isearch-yank-line)
- (define-key map "\C-h" isearch-help-map)
+ (define-key map (char-to-string help-char) isearch-help-map)
+ (define-key map [help] isearch-help-map)
+ (define-key map [f1] isearch-help-map)
(define-key map "\M-n" 'isearch-ring-advance)
(define-key map "\M-p" 'isearch-ring-retreat)
(isearch-lazy-highlight-new-loop))
;; We must prevent the point moving to the end of composition when a
;; part of the composition has just been searched.
- (setq disable-point-adjustment t))
+ (setq disable-point-adjustment t)
+ (run-hooks 'isearch-update-post-hook))
(defun isearch-done (&optional nopush edit)
"Exit Isearch mode.
(eq 'not-yanks search-upper-case))
(setq string (downcase string)))
(if isearch-regexp (setq string (regexp-quote string)))
- (setq isearch-string (concat isearch-string string)
- isearch-message
- (concat isearch-message
- (mapconcat 'isearch-text-char-description
- string ""))
- ;; Don't move cursor in reverse search.
- isearch-yank-flag t)
- (isearch-search-and-update))
+ ;; Don't move cursor in reverse search.
+ (setq isearch-yank-flag t)
+ (isearch-process-search-string
+ string (mapconcat 'isearch-text-char-description string "")))
(defun isearch-yank-kill ()
"Pull string from kill ring into search string."
(interactive "p")
(isearch-yank-internal (lambda () (forward-char arg) (point))))
+(declare-function subword-forward "subword" (&optional arg))
(defun isearch-yank-word-or-char ()
- "Pull next character or word from buffer into search string."
+ "Pull next character, subword or word from buffer into search string.
+Subword is used when `subword-mode' is activated. "
(interactive)
(isearch-yank-internal
(lambda ()
(if (or (= (char-syntax (or (char-after) 0)) ?w)
(= (char-syntax (or (char-after (1+ (point))) 0)) ?w))
- (forward-word 1)
+ (if (and (boundp 'subword-mode) subword-mode)
+ (subword-forward 1)
+ (forward-word 1))
(forward-char 1)) (point))))
(defun isearch-yank-word ()
;; attempts this, we scroll the text back again.
;;
;; We implement this feature with a property called `isearch-scroll'.
-;; If a command's symbol has the value t for this property it is a
-;; scrolling command. The feature needs to be enabled by setting the
-;; customizable variable `isearch-allow-scroll' to a non-nil value.
+;; If a command's symbol has the value t for this property or for the
+;; `scroll-command' property, it is a scrolling command. The feature
+;; needs to be enabled by setting the customizable variable
+;; `isearch-allow-scroll' to a non-nil value.
;;
;; The universal argument commands (e.g. C-u) in simple.el are marked
;; as scrolling commands, and isearch.el has been amended to allow
(if (fboundp 'w32-handle-scroll-bar-event)
(put 'w32-handle-scroll-bar-event 'isearch-scroll t))
-;; Commands which scroll the window:
+;; Commands which scroll the window (some scroll commands
+;; already have the `scroll-command' property on them):
(put 'recenter 'isearch-scroll t)
(put 'recenter-top-bottom 'isearch-scroll t)
(put 'reposition-window 'isearch-scroll t)
-(put 'scroll-up 'isearch-scroll t)
-(put 'scroll-down 'isearch-scroll t)
;; Commands which act on the other window
(put 'list-buffers 'isearch-scroll t)
"Whether scrolling is allowed during incremental search.
If non-nil, scrolling commands can be used in Isearch mode.
However, the current match will never scroll offscreen.
-If nil, scolling commands will first cancel Isearch mode."
+If nil, scrolling commands will first cancel Isearch mode."
:type 'boolean
:group 'isearch)
(let* ((overriding-terminal-local-map nil)
(binding (key-binding key-seq)))
(and binding (symbolp binding) (commandp binding)
- (eq (get binding 'isearch-scroll) t)
+ (or (eq (get binding 'isearch-scroll) t)
+ (eq (get binding 'scroll-command) t))
binding)))
(defalias 'isearch-other-control-char 'isearch-other-meta-char)
null-device))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (jka-compr-delete-temp-file err-file)))
+ (delete-file err-file t)))
+
;; Run the uncompression program directly.
;; We get the whole file and must delete what we don't want.
(jka-compr-call-process prog message infile t nil args))
"")))
jka-compr-acceptable-retval-list)
(jka-compr-error prog args infile message err-file))
- (jka-compr-delete-temp-file err-file)))
+ (delete-file err-file t)))
(or (eq 0
(apply 'call-process
prog infile (if (stringp output) temp output)
"This routine will return the name of a new file."
(make-temp-file jka-compr-temp-name-template))
-(defalias 'jka-compr-delete-temp-file 'delete-file)
-
-
(defun jka-compr-write-region (start end file &optional append visit)
(let* ((filename (expand-file-name file))
(visit-file (if (stringp visit) (expand-file-name visit) filename))
(and append can-append) 'dont))
(erase-buffer)) )
- (jka-compr-delete-temp-file temp-file)
+ (delete-file temp-file t)
(and
compress-message
(setq file (file-name-sans-extension file)))
(setcar l file)))
- (jka-compr-delete-temp-file local-copy))
+ (delete-file local-copy))
t))
(input-method . "hebrew")
(unibyte-display . hebrew-iso-8bit)
(sample-text . "Hebrew \e,Hylem\e(B")
- (documentation . "Right-to-left writing is not yet supported.")))
+ (documentation . "Bidirectional editing is supported.")))
(set-language-info-alist
"Windows-1255" '((coding-priority windows-1255)
(coding-system windows-1255)
(documentation . "\
Support for Windows-1255 encoding, e.g. for Yiddish.
-Right-to-left writing is not yet supported.")))
+Bidirectional editing is supported.")))
(define-coding-system 'windows-1255
"windows-1255 (Hebrew) encoding (MIME: WINDOWS-1255)"
\f
;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
;;;;;; 5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
-;;;;;; "play/5x5.el" (19383 49278))
+;;;;;; "play/5x5.el" (19279 5151))
;;; Generated autoloads from play/5x5.el
(autoload '5x5 "5x5" "\
;;;***
\f
;;;### (autoloads (list-one-abbrev-table) "abbrevlist" "abbrevlist.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from abbrevlist.el
(autoload 'list-one-abbrev-table "abbrevlist" "\
;;;***
\f
;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;; (19383 49276))
+;;;;;; (19313 15414))
;;; Generated autoloads from progmodes/ada-mode.el
(autoload 'ada-add-extensions "ada-mode" "\
;;;***
\f
;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 38446))
;;; Generated autoloads from progmodes/ada-stmt.el
(autoload 'ada-header "ada-stmt" "\
;;;***
\f
;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 38446))
;;; Generated autoloads from progmodes/ada-xref.el
(autoload 'ada-find-file "ada-xref" "\
;;;### (autoloads (change-log-merge add-log-current-defun change-log-mode
;;;;;; add-change-log-entry-other-window add-change-log-entry find-change-log
;;;;;; prompt-for-change-log-name add-log-mailing-address add-log-full-name
-;;;;;; add-log-current-defun-function) "add-log" "add-log.el" (19383
-;;;;;; 49278))
+;;;;;; add-log-current-defun-function) "add-log" "add-log.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from add-log.el
(put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
\f
;;;### (autoloads (defadvice ad-activate ad-add-advice ad-disable-advice
;;;;;; ad-enable-advice ad-default-compilation-action ad-redefinition-action)
-;;;;;; "advice" "emacs-lisp/advice.el" (19383 49276))
+;;;;;; "advice" "emacs-lisp/advice.el" (19323 49698))
;;; Generated autoloads from emacs-lisp/advice.el
(defvar ad-redefinition-action 'warn "\
\f
;;;### (autoloads (align-newline-and-indent align-unhighlight-rule
;;;;;; align-highlight-rule align-current align-entire align-regexp
-;;;;;; align) "align" "align.el" (19383 49278))
+;;;;;; align) "align" "align.el" (19279 5148))
;;; Generated autoloads from align.el
(autoload 'align "align" "\
;;;***
\f
;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from allout.el
(put 'allout-use-hanging-indents 'safe-local-variable (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
;;;***
\f
;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;; "net/ange-ftp.el" (19383 49276))
+;;;;;; "net/ange-ftp.el" (19356 10801))
;;; Generated autoloads from net/ange-ftp.el
(defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
;;;***
\f
;;;### (autoloads (animate-birthday-present animate-sequence animate-string)
-;;;;;; "animate" "play/animate.el" (19383 49278))
+;;;;;; "animate" "play/animate.el" (19279 5151))
;;; Generated autoloads from play/animate.el
(autoload 'animate-string "animate" "\
;;;***
\f
;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on)
-;;;;;; "ansi-color" "ansi-color.el" (19383 49278))
+;;;;;; "ansi-color" "ansi-color.el" (19279 5148))
;;; Generated autoloads from ansi-color.el
(autoload 'ansi-color-for-comint-mode-on "ansi-color" "\
;;;***
\f
;;;### (autoloads (antlr-set-tabs antlr-mode antlr-show-makefile-rules)
-;;;;;; "antlr-mode" "progmodes/antlr-mode.el" (19383 49278))
+;;;;;; "antlr-mode" "progmodes/antlr-mode.el" (19279 5151))
;;; Generated autoloads from progmodes/antlr-mode.el
(autoload 'antlr-show-makefile-rules "antlr-mode" "\
;;;***
\f
;;;### (autoloads (appt-activate appt-make-list appt-delete appt-add)
-;;;;;; "appt" "calendar/appt.el" (19383 49278))
+;;;;;; "appt" "calendar/appt.el" (19279 5149))
;;; Generated autoloads from calendar/appt.el
(autoload 'appt-add "appt" "\
\f
;;;### (autoloads (apropos-documentation apropos-value apropos-library
;;;;;; apropos apropos-documentation-property apropos-command apropos-variable
-;;;;;; apropos-read-pattern) "apropos" "apropos.el" (19383 49278))
+;;;;;; apropos-read-pattern) "apropos" "apropos.el" (19279 5148))
;;; Generated autoloads from apropos.el
(autoload 'apropos-read-pattern "apropos" "\
;;;***
\f
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19383
-;;;;;; 49276))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19321
+;;;;;; 4517))
;;; Generated autoloads from arc-mode.el
(autoload 'archive-mode "arc-mode" "\
;;;***
\f
-;;;### (autoloads (array-mode) "array" "array.el" (19383 49278))
+;;;### (autoloads (array-mode) "array" "array.el" (19279 5148))
;;; Generated autoloads from array.el
(autoload 'array-mode "array" "\
;;;***
\f
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (19383
-;;;;;; 49276))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (19321
+;;;;;; 4517))
;;; Generated autoloads from textmodes/artist.el
(autoload 'artist-mode "artist" "\
;;;***
\f
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/asm-mode.el
(autoload 'asm-mode "asm-mode" "\
;;;***
\f
;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from autoarg.el
(defvar autoarg-mode nil "\
;;;***
\f
;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/autoconf.el
(autoload 'autoconf-mode "autoconf" "\
;;;***
\f
;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;; "autoinsert" "autoinsert.el" (19383 49278))
+;;;;;; "autoinsert" "autoinsert.el" (19279 5148))
;;; Generated autoloads from autoinsert.el
(autoload 'auto-insert "autoinsert" "\
\f
;;;### (autoloads (batch-update-autoloads update-directory-autoloads
;;;;;; update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;; (19383 49278))
+;;;;;; (19365 25156))
;;; Generated autoloads from emacs-lisp/autoload.el
(put 'generated-autoload-file 'safe-local-variable 'stringp)
\f
;;;### (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" (19383 49278))
+;;;;;; "autorevert" "autorevert.el" (19279 5148))
;;; Generated autoloads from autorevert.el
(autoload 'auto-revert-mode "autorevert" "\
;;;***
\f
;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;; "avoid.el" (19383 49278))
+;;;;;; "avoid.el" (19279 5148))
;;; Generated autoloads from avoid.el
(defvar mouse-avoidance-mode nil "\
;;;***
\f
;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from battery.el
(put 'battery-mode-line-string 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
-;;;;;; "benchmark" "emacs-lisp/benchmark.el" (19383 49278))
+;;;;;; "benchmark" "emacs-lisp/benchmark.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/benchmark.el
(autoload 'benchmark-run "benchmark" "\
;;;***
\f
;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
-;;;;;; "bibtex" "textmodes/bibtex.el" (19383 49278))
+;;;;;; "bibtex" "textmodes/bibtex.el" (19279 38446))
;;; Generated autoloads from textmodes/bibtex.el
(autoload 'bibtex-initialize "bibtex" "\
;;;***
\f
;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/bibtex-style.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.bst\\'") 'bibtex-style-mode))
\f
;;;### (autoloads (binhex-decode-region binhex-decode-region-external
;;;;;; binhex-decode-region-internal) "binhex" "mail/binhex.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/binhex.el
(defconst binhex-begin-line "^:...............................................................$")
;;;***
\f
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from play/blackbox.el
(autoload 'blackbox "blackbox" "\
;;;;;; bookmark-save bookmark-write bookmark-delete bookmark-insert
;;;;;; bookmark-rename bookmark-insert-location bookmark-relocate
;;;;;; bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark"
-;;;;;; "bookmark.el" (19383 49276))
+;;;;;; "bookmark.el" (19326 6129))
;;; Generated autoloads from bookmark.el
(define-key ctl-x-r-map "b" 'bookmark-jump)
(define-key ctl-x-r-map "m" 'bookmark-set)
;;;;;; browse-url-of-dired-file browse-url-of-buffer browse-url-of-file
;;;;;; browse-url-url-at-point browse-url-galeon-program browse-url-firefox-program
;;;;;; browse-url-browser-function) "browse-url" "net/browse-url.el"
-;;;;;; (19383 49278))
+;;;;;; (19356 10801))
;;; Generated autoloads from net/browse-url.el
(defvar browse-url-browser-function (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)) "\
;;;***
\f
-;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from play/bruce.el
(autoload 'bruce "bruce" "\
;;;***
\f
;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;; "bs" "bs.el" (19383 49278))
+;;;;;; "bs" "bs.el" (19279 5148))
;;; Generated autoloads from bs.el
(autoload 'bs-cycle-next "bs" "\
;;;***
\f
-;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19383 49278))
+;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19279 5151))
;;; Generated autoloads from play/bubbles.el
(autoload 'bubbles "bubbles" "\
;;;***
\f
;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference"
-;;;;;; "progmodes/bug-reference.el" (19383 49278))
+;;;;;; "progmodes/bug-reference.el" (19279 5151))
;;; Generated autoloads from progmodes/bug-reference.el
(put 'bug-reference-url-format 'safe-local-variable 'stringp)
;;;;;; compile-defun byte-compile-file byte-recompile-directory
;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning
;;;;;; byte-compile-warnings-safe-p) "bytecomp" "emacs-lisp/bytecomp.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5149))
;;; 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)
;;;***
\f
-;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19383
-;;;;;; 49278))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from calendar/cal-china.el
(put 'calendar-chinese-time-zone 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19383 49278))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19279 5149))
;;; Generated autoloads from calendar/cal-dst.el
(put 'calendar-daylight-savings-starts 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (calendar-hebrew-list-yahrzeits) "cal-hebrew" "calendar/cal-hebrew.el"
-;;;;;; (19383 49284))
+;;;;;; (19345 41626))
;;; Generated autoloads from calendar/cal-hebrew.el
(autoload 'calendar-hebrew-list-yahrzeits "cal-hebrew" "\
\f
;;;### (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" (19383
-;;;;;; 49278))
+;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (19282
+;;;;;; 55646))
;;; Generated autoloads from calc/calc.el
(define-key ctl-x-map "*" 'calc-dispatch)
;;;***
\f
-;;;### (autoloads (calculator) "calculator" "calculator.el" (19383
-;;;;;; 49277))
+;;;### (autoloads (calculator) "calculator" "calculator.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from calculator.el
(autoload 'calculator "calculator" "\
;;;***
\f
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from calendar/calendar.el
(autoload 'calendar "calendar" "\
;;;***
\f
;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;; "gnus/canlock.el" (19383 49278))
+;;;;;; "gnus/canlock.el" (19279 5150))
;;; Generated autoloads from gnus/canlock.el
(autoload 'canlock-insert-header "canlock" "\
;;;***
\f
;;;### (autoloads (capitalized-words-mode) "cap-words" "progmodes/cap-words.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/cap-words.el
(autoload 'capitalized-words-mode "cap-words" "\
;;;***
\f
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19383
-;;;;;; 49278))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/cc-compat.el
(put 'c-indent-level 'safe-local-variable 'integerp)
;;;***
\f
;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;; (19396 34127))
+;;;;;; (19370 36541))
;;; Generated autoloads from progmodes/cc-engine.el
(autoload 'c-guess-basic-syntax "cc-engine" "\
\f
;;;### (autoloads (pike-mode idl-mode java-mode objc-mode c++-mode
;;;;;; c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
-;;;;;; (19396 34127))
+;;;;;; (19338 9841))
;;; Generated autoloads from progmodes/cc-mode.el
(autoload 'c-initialize-cc-mode "cc-mode" "\
;;;***
\f
;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
-;;;;;; "progmodes/cc-styles.el" (19383 49278))
+;;;;;; "progmodes/cc-styles.el" (19279 5151))
;;; Generated autoloads from progmodes/cc-styles.el
(autoload 'c-set-style "cc-styles" "\
;;;***
\f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19383 49278))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19279 5151))
;;; Generated autoloads from progmodes/cc-vars.el
(put 'c-basic-offset 'safe-local-variable 'integerp)
(put 'c-backslash-column 'safe-local-variable 'integerp)
\f
;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5150))
;;; Generated autoloads from international/ccl.el
(autoload 'ccl-compile "ccl" "\
;;;***
\f
;;;### (autoloads (cfengine-mode) "cfengine" "progmodes/cfengine.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/cfengine.el
(autoload 'cfengine-mode "cfengine" "\
;;;***
\f
;;;### (autoloads (check-declare-directory check-declare-file) "check-declare"
-;;;;;; "emacs-lisp/check-declare.el" (19383 49278))
+;;;;;; "emacs-lisp/check-declare.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/check-declare.el
(autoload 'check-declare-file "check-declare" "\
;;;;;; checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
;;;;;; checkdoc-eval-current-buffer checkdoc-message-interactive
;;;;;; checkdoc-interactive checkdoc checkdoc-list-of-strings-p)
-;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (19383 49278))
+;;;;;; "checkdoc" "emacs-lisp/checkdoc.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/checkdoc.el
(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
(put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
\f
;;;### (autoloads (pre-write-encode-hz post-read-decode-hz encode-hz-buffer
;;;;;; encode-hz-region decode-hz-buffer decode-hz-region) "china-util"
-;;;;;; "language/china-util.el" (19383 49278))
+;;;;;; "language/china-util.el" (19279 5150))
;;; Generated autoloads from language/china-util.el
(autoload 'decode-hz-region "china-util" "\
;;;***
\f
;;;### (autoloads (command-history list-command-history repeat-matching-complex-command)
-;;;;;; "chistory" "chistory.el" (19383 49278))
+;;;;;; "chistory" "chistory.el" (19279 5148))
;;; Generated autoloads from chistory.el
(autoload 'repeat-matching-complex-command "chistory" "\
;;;***
\f
-;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19383 49278))
+;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/cl.el
(defvar custom-print-functions nil "\
;;;***
\f
;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/cl-indent.el
(autoload 'common-lisp-indent-function "cl-indent" "\
;;;***
\f
;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/cmacexp.el
(autoload 'c-macro-expand "cmacexp" "\
;;;***
\f
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from cmuscheme.el
(autoload 'run-scheme "cmuscheme" "\
;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command
;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from comint.el
(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
;;;***
\f
-;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (19383
-;;;;;; 49278))
+;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from compare-w.el
(autoload 'compare-windows "compare-w" "\
;;;;;; 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" (19405
-;;;;;; 51439))
+;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (19375
+;;;;;; 49830))
;;; Generated autoloads from progmodes/compile.el
(defvar compilation-mode-hook nil "\
;;;***
\f
;;;### (autoloads (partial-completion-mode) "complete" "complete.el"
-;;;;;; (19383 49278))
+;;;;;; (19358 54001))
;;; Generated autoloads from complete.el
(defvar partial-completion-mode nil "\
;;;***
\f
;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5148))
;;; Generated autoloads from completion.el
(defvar dynamic-completion-mode nil "\
;;;### (autoloads (conf-xdefaults-mode conf-ppd-mode conf-colon-mode
;;;;;; conf-space-keywords conf-space-mode conf-javaprop-mode conf-windows-mode
;;;;;; conf-unix-mode conf-mode) "conf-mode" "textmodes/conf-mode.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/conf-mode.el
(autoload 'conf-mode "conf-mode" "\
;;;***
\f
;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie)
-;;;;;; "cookie1" "play/cookie1.el" (19383 49278))
+;;;;;; "cookie1" "play/cookie1.el" (19279 5151))
;;; Generated autoloads from play/cookie1.el
(autoload 'cookie "cookie1" "\
;;;***
\f
;;;### (autoloads (copyright-update-directory copyright copyright-fix-years
-;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (19383
-;;;;;; 49278))
+;;;;;; copyright-update) "copyright" "emacs-lisp/copyright.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/copyright.el
(autoload 'copyright-update "copyright" "\
;;;***
\f
;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (19383 49278))
+;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (19279 5151))
;;; Generated autoloads from progmodes/cperl-mode.el
(put 'cperl-indent-level 'safe-local-variable 'integerp)
(put 'cperl-brace-offset 'safe-local-variable 'integerp)
;;;***
\f
;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/cpp.el
(autoload 'cpp-highlight-buffer "cpp" "\
;;;***
\f
;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/crisp.el
(defvar crisp-mode nil "\
;;;***
\f
;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;; (19383 49278))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/crm.el
(autoload 'completing-read-multiple "crm" "\
;;;***
\f
-;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19392
-;;;;;; 42395))
+;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19279
+;;;;;; 5152))
;;; Generated autoloads from textmodes/css-mode.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.css\\'") 'css-mode))
;;;***
\f
;;;### (autoloads (cua-selection-mode cua-mode) "cua-base" "emulation/cua-base.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/cua-base.el
(defvar cua-mode nil "\
;;;;;; customize-mode customize 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"
-;;;;;; (19383 49276))
+;;;;;; (19356 10801))
;;; Generated autoloads from cus-edit.el
(defvar custom-browse-sort-alphabetically nil "\
(custom-autoload 'custom-browse-sort-alphabetically "cus-edit" t)
-(defvar custom-buffer-sort-alphabetically nil "\
-If non-nil, sort each customization group alphabetically in Custom buffer.")
+(defvar custom-buffer-sort-alphabetically t "\
+Whether to sort customization groups alphabetically in Custom buffer.")
(custom-autoload 'custom-buffer-sort-alphabetically "cus-edit" t)
\(fn)" t nil)
(autoload 'customize-apropos "cus-edit" "\
-Customize all loaded options, faces and groups matching REGEXP.
-If ALL is `options', include only options.
-If ALL is `faces', include only faces.
-If ALL is `groups', include only groups.
-If ALL is t (interactively, with prefix arg), include variables
+Customize all loaded options, faces and groups matching PATTERN.
+PATTERN can be a word, a list of words (separated by spaces),
+or a regexp (using some regexp special characters). If it is a word,
+search for matches for that word as a substring. If it is a list of words,
+search for matches for any two (or more) of those words.
+
+If TYPE is `options', include only options.
+If TYPE is `faces', include only faces.
+If TYPE is `groups', include only groups.
+If TYPE is t (interactively, with prefix arg), include variables
that are not customizable options, as well as faces and groups
\(but we recommend using `apropos-variable' instead).
-\(fn REGEXP &optional ALL)" t nil)
+\(fn PATTERN &optional TYPE)" t nil)
(autoload 'customize-apropos-options "cus-edit" "\
Customize all loaded customizable options matching REGEXP.
;;;***
\f
;;;### (autoloads (customize-create-theme) "cus-theme" "cus-theme.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from cus-theme.el
(autoload 'customize-create-theme "cus-theme" "\
;;;***
\f
;;;### (autoloads (cvs-status-mode) "cvs-status" "cvs-status.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from cvs-status.el
(autoload 'cvs-status-mode "cvs-status" "\
;;;***
\f
;;;### (autoloads (global-cwarn-mode turn-on-cwarn-mode cwarn-mode)
-;;;;;; "cwarn" "progmodes/cwarn.el" (19383 49279))
+;;;;;; "cwarn" "progmodes/cwarn.el" (19279 5151))
;;; Generated autoloads from progmodes/cwarn.el
(autoload 'cwarn-mode "cwarn" "\
\f
;;;### (autoloads (standard-display-cyrillic-translit cyrillic-encode-alternativnyj-char
;;;;;; cyrillic-encode-koi8-r-char) "cyril-util" "language/cyril-util.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from language/cyril-util.el
(autoload 'cyrillic-encode-koi8-r-char "cyril-util" "\
;;;***
\f
;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "dabbrev.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from dabbrev.el
(put 'dabbrev-case-fold-search 'risky-local-variable t)
(put 'dabbrev-case-replace 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (data-debug-new-buffer) "data-debug" "cedet/data-debug.el"
-;;;;;; (19383 49276))
+;;;;;; (19323 49698))
;;; Generated autoloads from cedet/data-debug.el
(autoload 'data-debug-new-buffer "data-debug" "\
;;;***
\f
-;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19383
-;;;;;; 49284))
+;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19345
+;;;;;; 41626))
;;; Generated autoloads from net/dbus.el
(autoload 'dbus-handle-event "dbus" "\
;;;***
\f
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/dcl-mode.el
(autoload 'dcl-mode "dcl-mode" "\
;;;***
\f
;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
-;;;;;; "emacs-lisp/debug.el" (19383 49279))
+;;;;;; "emacs-lisp/debug.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/debug.el
(setq debugger 'debug)
;;;***
\f
;;;### (autoloads (decipher-mode decipher) "decipher" "play/decipher.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from play/decipher.el
(autoload 'decipher "decipher" "\
;;;***
\f
;;;### (autoloads (delimit-columns-rectangle delimit-columns-region
-;;;;;; delimit-columns-customize) "delim-col" "delim-col.el" (19383
-;;;;;; 49276))
+;;;;;; delimit-columns-customize) "delim-col" "delim-col.el" (19323
+;;;;;; 49698))
;;; Generated autoloads from delim-col.el
(autoload 'delimit-columns-customize "delim-col" "\
;;;***
\f
-;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19279
+;;;;;; 38446))
;;; Generated autoloads from progmodes/delphi.el
(autoload 'delphi-mode "delphi" "\
;;;***
\f
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from delsel.el
(defalias 'pending-delete-mode 'delete-selection-mode)
;;;***
\f
;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
-;;;;;; "derived" "emacs-lisp/derived.el" (19383 49279))
+;;;;;; "derived" "emacs-lisp/derived.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/derived.el
(autoload 'define-derived-mode "derived" "\
;;;***
\f
;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;; "descr-text.el" (19383 49279))
+;;;;;; "descr-text.el" (19279 5148))
;;; Generated autoloads from descr-text.el
(autoload 'describe-text-properties "descr-text" "\
;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
;;;;;; desktop-load-default desktop-read desktop-remove desktop-save
;;;;;; desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
-;;;;;; "desktop.el" (19383 49279))
+;;;;;; "desktop.el" (19372 27330))
;;; Generated autoloads from desktop.el
(defvar desktop-save-mode nil "\
\f
;;;### (autoloads (gnus-article-outlook-deuglify-article gnus-outlook-deuglify-article
;;;;;; gnus-article-outlook-repair-attribution gnus-article-outlook-unwrap-lines)
-;;;;;; "deuglify" "gnus/deuglify.el" (19383 49279))
+;;;;;; "deuglify" "gnus/deuglify.el" (19279 5150))
;;; Generated autoloads from gnus/deuglify.el
(autoload 'gnus-article-outlook-unwrap-lines "deuglify" "\
;;;***
\f
;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;; "calendar/diary-lib.el" (19383 49276))
+;;;;;; "calendar/diary-lib.el" (19299 25154))
;;; Generated autoloads from calendar/diary-lib.el
(autoload 'diary "diary-lib" "\
;;;***
\f
;;;### (autoloads (diff-backup diff diff-command diff-switches) "diff"
-;;;;;; "diff.el" (19419 35832))
+;;;;;; "diff.el" (19279 5148))
;;; Generated autoloads from diff.el
(defvar diff-switches (purecopy "-c") "\
;;;***
\f
;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
-;;;;;; (19383 49279))
+;;;;;; (19356 10801))
;;; Generated autoloads from diff-mode.el
(autoload 'diff-mode "diff-mode" "\
;;;***
\f
-;;;### (autoloads (dig) "dig" "net/dig.el" (19383 49279))
+;;;### (autoloads (dig) "dig" "net/dig.el" (19279 5151))
;;; Generated autoloads from net/dig.el
(autoload 'dig "dig" "\
\f
;;;### (autoloads (dired-mode dired-auto-revert-buffer dired-noselect
;;;;;; dired-other-frame dired-other-window dired dired-trivial-filenames
-;;;;;; dired-listing-switches) "dired" "dired.el" (19383 49276))
+;;;;;; dired-listing-switches) "dired" "dired.el" (19313 15414))
;;; Generated autoloads from dired.el
(defvar dired-listing-switches (purecopy "-al") "\
;;;***
\f
;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
-;;;;;; (19383 49276))
+;;;;;; (19299 25154))
;;; Generated autoloads from dirtrack.el
(autoload 'dirtrack-mode "dirtrack" "\
;;;***
\f
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/disass.el
(autoload 'disassemble "disass" "\
;;;;;; standard-display-g1 standard-display-ascii standard-display-default
;;;;;; standard-display-8bit describe-current-display-table describe-display-table
;;;;;; set-display-table-slot display-table-slot make-display-table)
-;;;;;; "disp-table" "disp-table.el" (19383 49279))
+;;;;;; "disp-table" "disp-table.el" (19279 5148))
;;; Generated autoloads from disp-table.el
(autoload 'make-display-table "disp-table" "\
;;;***
\f
;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from play/dissociate.el
(autoload 'dissociated-press "dissociate" "\
;;;***
\f
-;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (19383 49279))
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (19279 5148))
;;; Generated autoloads from dnd.el
(defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://") . dnd-open-file) (,(purecopy "^file:") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|file\\|nfs\\)://") . dnd-open-file)) "\
;;;***
\f
;;;### (autoloads (dns-mode-soa-increment-serial dns-mode) "dns-mode"
-;;;;;; "textmodes/dns-mode.el" (19383 49279))
+;;;;;; "textmodes/dns-mode.el" (19279 5152))
;;; Generated autoloads from textmodes/dns-mode.el
(autoload 'dns-mode "dns-mode" "\
;;;***
\f
;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode
-;;;;;; doc-view-mode-p) "doc-view" "doc-view.el" (19383 49276))
+;;;;;; doc-view-mode-p) "doc-view" "doc-view.el" (19323 49698))
;;; Generated autoloads from doc-view.el
(autoload 'doc-view-mode-p "doc-view" "\
;;;***
\f
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19383 49279))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19279 5151))
;;; Generated autoloads from play/doctor.el
(autoload 'doctor "doctor" "\
;;;***
\f
-;;;### (autoloads (double-mode) "double" "double.el" (19383 49279))
+;;;### (autoloads (double-mode) "double" "double.el" (19279 5148))
;;; Generated autoloads from double.el
(autoload 'double-mode "double" "\
;;;***
\f
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19383 49279))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19279 5151))
;;; Generated autoloads from play/dunnet.el
(autoload 'dunnet "dunnet" "\
;;;***
\f
;;;### (autoloads (gnus-earcon-display) "earcon" "gnus/earcon.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/earcon.el
(autoload 'gnus-earcon-display "earcon" "\
\f
;;;### (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" (19383 49279))
+;;;;;; "emacs-lisp/easy-mmode.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/easy-mmode.el
(defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
;;;***
\f
;;;### (autoloads (easy-menu-change easy-menu-create-menu easy-menu-do-define
-;;;;;; easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (19383
-;;;;;; 49279))
+;;;;;; easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/easymenu.el
(put 'easy-menu-define 'lisp-indent-function 'defun)
;;;;;; ebnf-eps-file ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer
;;;;;; ebnf-spool-file ebnf-spool-directory ebnf-print-region ebnf-print-buffer
;;;;;; ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;; "progmodes/ebnf2ps.el" (19383 49279))
+;;;;;; "progmodes/ebnf2ps.el" (19279 5151))
;;; Generated autoloads from progmodes/ebnf2ps.el
(autoload 'ebnf-customize "ebnf2ps" "\
;;;;;; ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
;;;;;; ebrowse-tags-view-definition ebrowse-tags-find-declaration
;;;;;; ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
-;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19383
-;;;;;; 49279))
+;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/ebrowse.el
(autoload 'ebrowse-tree-mode "ebrowse" "\
;;;***
\f
;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from ebuff-menu.el
(autoload 'electric-buffer-list "ebuff-menu" "\
;;;***
\f
;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;; "echistory.el" (19383 49279))
+;;;;;; "echistory.el" (19279 5148))
;;; Generated autoloads from echistory.el
(autoload 'Electric-command-history-redo-expression "echistory" "\
;;;***
\f
;;;### (autoloads (ecomplete-setup) "ecomplete" "gnus/ecomplete.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/ecomplete.el
(autoload 'ecomplete-setup "ecomplete" "\
;;;***
\f
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19383 49276))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19323 49698))
;;; Generated autoloads from cedet/ede.el
(defvar global-ede-mode nil "\
\f
;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form
;;;;;; edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug"
-;;;;;; "emacs-lisp/edebug.el" (19383 49279))
+;;;;;; "emacs-lisp/edebug.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/edebug.el
(defvar edebug-all-defs nil "\
;;;;;; ediff-merge-directories-with-ancestor ediff-merge-directories
;;;;;; ediff-directories3 ediff-directory-revisions ediff-directories
;;;;;; ediff-buffers3 ediff-buffers ediff-backup ediff-current-file
-;;;;;; ediff-files3 ediff-files) "ediff" "ediff.el" (19383 49279))
+;;;;;; ediff-files3 ediff-files) "ediff" "ediff.el" (19279 5148))
;;; Generated autoloads from ediff.el
(autoload 'ediff-files "ediff" "\
;;;***
\f
;;;### (autoloads (ediff-customize) "ediff-help" "ediff-help.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from ediff-help.el
(autoload 'ediff-customize "ediff-help" "\
;;;***
\f
;;;### (autoloads (ediff-show-registry) "ediff-mult" "ediff-mult.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from ediff-mult.el
(autoload 'ediff-show-registry "ediff-mult" "\
;;;***
\f
;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;; "ediff-util" "ediff-util.el" (19383 49276))
+;;;;;; "ediff-util" "ediff-util.el" (19313 15414))
;;; Generated autoloads from ediff-util.el
(autoload 'ediff-toggle-multiframe "ediff-util" "\
\f
;;;### (autoloads (format-kbd-macro read-kbd-macro edit-named-kbd-macro
;;;;;; edit-last-kbd-macro edit-kbd-macro) "edmacro" "edmacro.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from edmacro.el
(defvar edmacro-eight-bits nil "\
;;;***
\f
;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;; "emulation/edt.el" (19383 49279))
+;;;;;; "emulation/edt.el" (19281 39617))
;;; Generated autoloads from emulation/edt.el
(autoload 'edt-set-scroll-margins "edt" "\
;;;***
\f
;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from ehelp.el
(autoload 'with-electric-help "ehelp" "\
;;;***
\f
;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;; "eldoc" "emacs-lisp/eldoc.el" (19383 49279))
+;;;;;; "eldoc" "emacs-lisp/eldoc.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/eldoc.el
(defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
;;;***
\f
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from elide-head.el
(autoload 'elide-head "elide-head" "\
\f
;;;### (autoloads (elint-initialize elint-defun elint-current-buffer
;;;;;; elint-directory elint-file) "elint" "emacs-lisp/elint.el"
-;;;;;; (19383 49284))
+;;;;;; (19338 9840))
;;; Generated autoloads from emacs-lisp/elint.el
(autoload 'elint-file "elint" "\
;;;***
\f
;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
-;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (19383
-;;;;;; 49279))
+;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/elp.el
(autoload 'elp-instrument-function "elp" "\
;;;***
\f
;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;; (19383 49279))
+;;;;;; (19365 25156))
;;; Generated autoloads from mail/emacsbug.el
(autoload 'report-emacs-bug "emacsbug" "\
;;;;;; emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
;;;;;; emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
;;;;;; emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;; "emerge.el" (19383 49279))
+;;;;;; "emerge.el" (19256 49601))
;;; Generated autoloads from emerge.el
(autoload 'emerge-files "emerge" "\
;;;***
\f
;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;; "enriched" "textmodes/enriched.el" (19383 49279))
+;;;;;; "enriched" "textmodes/enriched.el" (19279 5152))
;;; Generated autoloads from textmodes/enriched.el
(autoload 'enriched-mode "enriched" "\
;;;;;; 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" (19383
-;;;;;; 49279))
+;;;;;; epa-list-secret-keys epa-list-keys) "epa" "epa.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from epa.el
(autoload 'epa-list-keys "epa" "\
;;;***
\f
;;;### (autoloads (epa-dired-do-encrypt epa-dired-do-sign epa-dired-do-verify
-;;;;;; epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19383 49279))
+;;;;;; epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19279 5148))
;;; Generated autoloads from epa-dired.el
(autoload 'epa-dired-do-decrypt "epa-dired" "\
;;;***
\f
;;;### (autoloads (epa-file-disable epa-file-enable epa-file-handler)
-;;;;;; "epa-file" "epa-file.el" (19383 49279))
+;;;;;; "epa-file" "epa-file.el" (19279 5148))
;;; Generated autoloads from epa-file.el
(autoload 'epa-file-handler "epa-file" "\
\f
;;;### (autoloads (epa-global-mail-mode epa-mail-import-keys epa-mail-encrypt
;;;;;; epa-mail-sign epa-mail-verify epa-mail-decrypt epa-mail-mode)
-;;;;;; "epa-mail" "epa-mail.el" (19383 49279))
+;;;;;; "epa-mail" "epa-mail.el" (19279 5148))
;;; Generated autoloads from epa-mail.el
(autoload 'epa-mail-mode "epa-mail" "\
;;;***
\f
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (19383 49279))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (19279 5148))
;;; Generated autoloads from epg.el
(autoload 'epg-make-context "epg" "\
;;;***
\f
;;;### (autoloads (epg-expand-group epg-check-configuration epg-configuration)
-;;;;;; "epg-config" "epg-config.el" (19383 49279))
+;;;;;; "epg-config" "epg-config.el" (19356 10801))
;;; Generated autoloads from epg-config.el
(autoload 'epg-configuration "epg-config" "\
;;;***
\f
;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
-;;;;;; "erc/erc.el" (19383 49276))
+;;;;;; "erc/erc.el" (19299 25154))
;;; Generated autoloads from erc/erc.el
(autoload 'erc-select-read-args "erc" "\
;;;***
\f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19383
-;;;;;; 49279))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from erc/erc-autoaway.el
(autoload 'erc-autoaway-mode "erc-autoaway")
;;;***
\f
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19383 49279))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19279 5150))
;;; Generated autoloads from erc/erc-button.el
(autoload 'erc-button-mode "erc-button" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19383 49279))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19279 5150))
;;; Generated autoloads from erc/erc-capab.el
(autoload 'erc-capab-identify-mode "erc-capab" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19383 49279))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19279 5150))
;;; Generated autoloads from erc/erc-compat.el
(autoload 'erc-define-minor-mode "erc-compat")
;;;***
\f
;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;; "erc-dcc" "erc/erc-dcc.el" (19383 49279))
+;;;;;; "erc-dcc" "erc/erc-dcc.el" (19279 5150))
;;; Generated autoloads from erc/erc-dcc.el
(autoload 'erc-dcc-mode "erc-dcc")
;;;;;; erc-ezb-add-session erc-ezb-end-of-session-list erc-ezb-init-session-list
;;;;;; erc-ezb-identify erc-ezb-notice-autodetect erc-ezb-lookup-action
;;;;;; erc-ezb-get-login erc-cmd-ezb) "erc-ezbounce" "erc/erc-ezbounce.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-ezbounce.el
(autoload 'erc-cmd-ezb "erc-ezbounce" "\
;;;***
\f
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from erc/erc-fill.el
(autoload 'erc-fill-mode "erc-fill" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19383
-;;;;;; 49279))
+;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from erc/erc-hecomplete.el
(autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
;;;***
\f
;;;### (autoloads (erc-identd-stop erc-identd-start) "erc-identd"
-;;;;;; "erc/erc-identd.el" (19383 49279))
+;;;;;; "erc/erc-identd.el" (19279 5150))
;;; Generated autoloads from erc/erc-identd.el
(autoload 'erc-identd-mode "erc-identd")
;;;***
\f
;;;### (autoloads (erc-create-imenu-index) "erc-imenu" "erc/erc-imenu.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-imenu.el
(autoload 'erc-create-imenu-index "erc-imenu" "\
;;;***
\f
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19383 49279))
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19279 5150))
;;; Generated autoloads from erc/erc-join.el
(autoload 'erc-autojoin-mode "erc-join" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19383 49279))
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19279 5150))
;;; Generated autoloads from erc/erc-list.el
(autoload 'erc-list-mode "erc-list")
;;;***
\f
;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;; "erc/erc-log.el" (19383 49279))
+;;;;;; "erc/erc-log.el" (19279 5150))
;;; Generated autoloads from erc/erc-log.el
(autoload 'erc-log-mode "erc-log" nil t)
;;;### (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"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-match.el
(autoload 'erc-match-mode "erc-match")
;;;***
\f
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19383 49279))
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19279 5150))
;;; Generated autoloads from erc/erc-menu.el
(autoload 'erc-menu-mode "erc-menu" nil t)
;;;***
\f
;;;### (autoloads (erc-cmd-WHOLEFT) "erc-netsplit" "erc/erc-netsplit.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-netsplit.el
(autoload 'erc-netsplit-mode "erc-netsplit")
;;;***
\f
;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;; "erc/erc-networks.el" (19383 49279))
+;;;;;; "erc/erc-networks.el" (19279 5150))
;;; Generated autoloads from erc/erc-networks.el
(autoload 'erc-determine-network "erc-networks" "\
;;;***
\f
;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
-;;;;;; "erc/erc-notify.el" (19383 49279))
+;;;;;; "erc/erc-notify.el" (19279 5150))
;;; Generated autoloads from erc/erc-notify.el
(autoload 'erc-notify-mode "erc-notify" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19383 49279))
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19279 5150))
;;; Generated autoloads from erc/erc-page.el
(autoload 'erc-page-mode "erc-page")
;;;***
\f
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19383
-;;;;;; 49279))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from erc/erc-pcomplete.el
(autoload 'erc-completion-mode "erc-pcomplete" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19383 49279))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19279 5150))
;;; Generated autoloads from erc/erc-replace.el
(autoload 'erc-replace-mode "erc-replace")
;;;***
\f
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19383 49279))
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19279 5150))
;;; Generated autoloads from erc/erc-ring.el
(autoload 'erc-ring-mode "erc-ring" nil t)
;;;***
\f
;;;### (autoloads (erc-nickserv-identify erc-nickserv-identify-mode)
-;;;;;; "erc-services" "erc/erc-services.el" (19383 49276))
+;;;;;; "erc-services" "erc/erc-services.el" (19313 15414))
;;; Generated autoloads from erc/erc-services.el
(autoload 'erc-services-mode "erc-services" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19383 49279))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19279 5150))
;;; Generated autoloads from erc/erc-sound.el
(autoload 'erc-sound-mode "erc-sound")
;;;***
\f
;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-speedbar.el
(autoload 'erc-speedbar-browser "erc-speedbar" "\
;;;***
\f
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19383
-;;;;;; 49279))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from erc/erc-spelling.el
(autoload 'erc-spelling-mode "erc-spelling" nil t)
;;;***
\f
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19383 49279))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19279 5150))
;;; Generated autoloads from erc/erc-stamp.el
(autoload 'erc-timestamp-mode "erc-stamp" nil t)
;;;***
\f
;;;### (autoloads (erc-track-minor-mode) "erc-track" "erc/erc-track.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-track.el
(defvar erc-track-minor-mode nil "\
;;;***
\f
;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;; "erc-truncate" "erc/erc-truncate.el" (19383 49279))
+;;;;;; "erc-truncate" "erc/erc-truncate.el" (19279 5150))
;;; Generated autoloads from erc/erc-truncate.el
(autoload 'erc-truncate-mode "erc-truncate" nil t)
;;;***
\f
;;;### (autoloads (erc-xdcc-add-file) "erc-xdcc" "erc/erc-xdcc.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from erc/erc-xdcc.el
(autoload 'erc-xdcc-mode "erc-xdcc")
;;;***
\f
-;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from eshell/esh-mode.el
(autoload 'eshell-mode "esh-mode" "\
;;;***
\f
-;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from eshell/esh-test.el
(autoload 'eshell-test "esh-test" "\
;;;***
\f
;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell"
-;;;;;; "eshell/eshell.el" (19383 49284))
+;;;;;; "eshell/eshell.el" (19330 37505))
;;; Generated autoloads from eshell/eshell.el
(autoload 'eshell "eshell" "\
;;;;;; visit-tags-table tags-table-mode find-tag-default-function
;;;;;; find-tag-hook tags-add-tables tags-compression-info-list
;;;;;; tags-table-list tags-case-fold-search) "etags" "progmodes/etags.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/etags.el
(defvar tags-file-name nil "\
;;;;;; ethio-fidel-to-sera-marker ethio-fidel-to-sera-region ethio-fidel-to-sera-buffer
;;;;;; ethio-sera-to-fidel-marker ethio-sera-to-fidel-region ethio-sera-to-fidel-buffer
;;;;;; setup-ethiopic-environment-internal) "ethio-util" "language/ethio-util.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from language/ethio-util.el
(autoload 'setup-ethiopic-environment-internal "ethio-util" "\
\f
;;;### (autoloads (eudc-load-eudc eudc-query-form eudc-expand-inline
;;;;;; eudc-get-phone eudc-get-email eudc-set-server) "eudc" "net/eudc.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/eudc.el
(autoload 'eudc-set-server "eudc" "\
\f
;;;### (autoloads (eudc-display-jpeg-as-button eudc-display-jpeg-inline
;;;;;; eudc-display-sound eudc-display-mail eudc-display-url eudc-display-generic-binary)
-;;;;;; "eudc-bob" "net/eudc-bob.el" (19383 49279))
+;;;;;; "eudc-bob" "net/eudc-bob.el" (19279 5151))
;;; Generated autoloads from net/eudc-bob.el
(autoload 'eudc-display-generic-binary "eudc-bob" "\
;;;***
\f
;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
-;;;;;; "eudc-export" "net/eudc-export.el" (19383 49279))
+;;;;;; "eudc-export" "net/eudc-export.el" (19279 5151))
;;; Generated autoloads from net/eudc-export.el
(autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
;;;***
\f
;;;### (autoloads (eudc-edit-hotlist) "eudc-hotlist" "net/eudc-hotlist.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/eudc-hotlist.el
(autoload 'eudc-edit-hotlist "eudc-hotlist" "\
;;;***
\f
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/ewoc.el
(autoload 'ewoc-create "ewoc" "\
;;;### (autoloads (executable-make-buffer-file-executable-if-script-p
;;;;;; executable-self-display executable-set-magic executable-interpret
;;;;;; executable-command-find-posix-p) "executable" "progmodes/executable.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/executable.el
(autoload 'executable-command-find-posix-p "executable" "\
\f
;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
;;;;;; expand-abbrev-hook expand-add-abbrevs) "expand" "expand.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from expand.el
(autoload 'expand-add-abbrevs "expand" "\
;;;***
\f
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19383 49276))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19326 6129))
;;; Generated autoloads from progmodes/f90.el
(autoload 'f90-mode "f90" "\
;;;### (autoloads (variable-pitch-mode buffer-face-toggle buffer-face-set
;;;;;; buffer-face-mode text-scale-adjust text-scale-decrease text-scale-increase
;;;;;; text-scale-set face-remap-set-base face-remap-reset-base
-;;;;;; face-remap-add-relative) "face-remap" "face-remap.el" (19383
-;;;;;; 49279))
+;;;;;; face-remap-add-relative) "face-remap" "face-remap.el" (19358
+;;;;;; 54001))
;;; Generated autoloads from face-remap.el
(autoload 'face-remap-add-relative "face-remap" "\
\f
;;;### (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" (19383 49279))
+;;;;;; feedmail-send-it) "feedmail" "mail/feedmail.el" (19256 49601))
;;; Generated autoloads from mail/feedmail.el
(autoload 'feedmail-send-it "feedmail" "\
;;;***
\f
;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
-;;;;;; find-file-at-point ffap-next) "ffap" "ffap.el" (19383 49276))
+;;;;;; find-file-at-point ffap-next) "ffap" "ffap.el" (19321 4517))
;;; Generated autoloads from ffap.el
(autoload 'ffap-next "ffap" "\
;;;### (autoloads (file-cache-minibuffer-complete file-cache-add-directory-recursively
;;;;;; file-cache-add-directory-using-locate file-cache-add-directory-using-find
;;;;;; file-cache-add-file file-cache-add-directory-list file-cache-add-directory)
-;;;;;; "filecache" "filecache.el" (19409 46567))
+;;;;;; "filecache" "filecache.el" (19279 5148))
;;; Generated autoloads from filecache.el
(autoload 'file-cache-add-directory "filecache" "\
(autoload 'file-cache-add-directory-list "filecache" "\
Add DIRECTORY-LIST (a list of directory names) to the file cache.
If the optional REGEXP argument is non-nil, only files which match it
-will be added to the cache. Note that the REGEXP is applied to the
-files in each directory, not to the directory list itself.
+will be added to the cache. Note that the REGEXP is applied to the files
+in each directory, not to the directory list itself.
\(fn DIRECTORY-LIST &optional REGEXP)" t nil)
(autoload 'file-cache-add-directory-recursively "filecache" "\
Adds DIR and any subdirectories to the file-cache.
-This function does not use any external programs.
+This function does not use any external programs
If the optional REGEXP argument is non-nil, only files which match it
-will be added to the cache. Note that the REGEXP is applied to the
-files in each directory, not to the directory list itself.
+will be added to the cache. Note that the REGEXP is applied to the files
+in each directory, not to the directory list itself.
\(fn DIR &optional REGEXP)" t nil)
;;;;;; copy-file-locals-to-dir-locals delete-dir-local-variable
;;;;;; add-dir-local-variable delete-file-local-variable-prop-line
;;;;;; add-file-local-variable-prop-line delete-file-local-variable
-;;;;;; add-file-local-variable) "files-x" "files-x.el" (19383 49279))
+;;;;;; add-file-local-variable) "files-x" "files-x.el" (19279 5148))
;;; Generated autoloads from files-x.el
(autoload 'add-file-local-variable "files-x" "\
;;;***
\f
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from filesets.el
(autoload 'filesets-init "filesets" "\
;;;***
\f
-;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19383 49279))
+;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19279 38446))
;;; Generated autoloads from find-cmd.el
(autoload 'find-cmd "find-cmd" "\
\f
;;;### (autoloads (find-grep-dired find-name-dired find-dired find-grep-options
;;;;;; find-ls-subdir-switches find-ls-option) "find-dired" "find-dired.el"
-;;;;;; (19422 11991))
+;;;;;; (19375 49830))
;;; Generated autoloads from find-dired.el
(defvar find-ls-option (if (eq system-type 'berkeley-unix) (purecopy '("-ls" . "-gilsb")) (purecopy '("-exec ls -ld {} \\;" . "-ld"))) "\
\f
;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
;;;;;; ff-find-other-file ff-get-other-file) "find-file" "find-file.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from find-file.el
(defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\
;;;;;; find-variable find-variable-noselect find-function-other-frame
;;;;;; find-function-other-window find-function find-function-noselect
;;;;;; find-function-search-for-symbol find-library) "find-func"
-;;;;;; "emacs-lisp/find-func.el" (19383 49279))
+;;;;;; "emacs-lisp/find-func.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/find-func.el
(autoload 'find-library "find-func" "\
;;;***
\f
;;;### (autoloads (find-lisp-find-dired-filter find-lisp-find-dired-subdirectories
-;;;;;; find-lisp-find-dired) "find-lisp" "find-lisp.el" (19383 49279))
+;;;;;; find-lisp-find-dired) "find-lisp" "find-lisp.el" (19279 5148))
;;; Generated autoloads from find-lisp.el
(autoload 'find-lisp-find-dired "find-lisp" "\
;;;***
\f
;;;### (autoloads (finder-by-keyword finder-commentary finder-list-keywords)
-;;;;;; "finder" "finder.el" (19383 49279))
+;;;;;; "finder" "finder.el" (19368 35187))
;;; Generated autoloads from finder.el
(autoload 'finder-list-keywords "finder" "\
;;;***
\f
;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl"
-;;;;;; "flow-ctrl.el" (19383 49279))
+;;;;;; "flow-ctrl.el" (19279 5148))
;;; Generated autoloads from flow-ctrl.el
(autoload 'enable-flow-control "flow-ctrl" "\
;;;***
\f
;;;### (autoloads (fill-flowed fill-flowed-encode) "flow-fill" "gnus/flow-fill.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/flow-fill.el
(autoload 'fill-flowed-encode "flow-fill" "\
;;;***
\f
;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
-;;;;;; "flymake" "progmodes/flymake.el" (19383 49276))
+;;;;;; "flymake" "progmodes/flymake.el" (19299 25155))
;;; Generated autoloads from progmodes/flymake.el
(autoload 'flymake-mode "flymake" "\
\f
;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
;;;;;; turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;; "flyspell" "textmodes/flyspell.el" (19383 49284))
+;;;;;; "flyspell" "textmodes/flyspell.el" (19370 36541))
;;; Generated autoloads from textmodes/flyspell.el
(autoload 'flyspell-prog-mode "flyspell" "\
\f
;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
;;;;;; turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from follow.el
(autoload 'turn-on-follow-mode "follow" "\
;;;***
\f
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from mail/footnote.el
(autoload 'footnote-mode "footnote" "\
;;;***
\f
;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode)
-;;;;;; "forms" "forms.el" (19383 49279))
+;;;;;; "forms" "forms.el" (19279 5148))
;;; Generated autoloads from forms.el
(autoload 'forms-mode "forms" "\
;;;***
\f
;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
-;;;;;; (19392 38041))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/fortran.el
(autoload 'fortran-mode "fortran" "\
;;;***
\f
;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (19383 49279))
+;;;;;; fortune-add-fortune) "fortune" "play/fortune.el" (19279 5151))
;;; Generated autoloads from play/fortune.el
(autoload 'fortune-add-fortune "fortune" "\
;;;***
\f
-;;;### (autoloads (gdb-enable-debug gdb) "gdb-ui" "progmodes/gdb-ui.el"
-;;;;;; (19383 49284))
-;;; Generated autoloads from progmodes/gdb-ui.el
+;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
+;;;;;; (19375 49830))
+;;; Generated autoloads from progmodes/gdb-mi.el
+
+(defvar gdb-enable-debug nil "\
+Non-nil means record the process input and output in `gdb-debug-log'.")
-(autoload 'gdb "gdb-ui" "\
+(custom-autoload 'gdb-enable-debug "gdb-mi" t)
+
+(autoload 'gdb "gdb-mi" "\
Run gdb on program FILE in buffer *gud-FILE*.
-The directory containing FILE becomes the initial working
-directory and source-file directory for your debugger.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger.
If `gdb-many-windows' is nil (the default value) then gdb just
pops up the GUD buffer unless `gdb-show-main' is t. In this case
other with the source file with the main routine of the inferior.
If `gdb-many-windows' is t, regardless of the value of
-`gdb-show-main', the layout below will appear unless
-`gdb-use-separate-io-buffer' is nil when the source buffer
-occupies the full width of the frame. Keybindings are shown in
-some of the buffers.
+`gdb-show-main', the layout below will appear. Keybindings are
+shown in some of the buffers.
Watch expressions appear in the speedbar/slowbar.
See Info node `(emacs)GDB Graphical Interface' for a more
detailed description of this mode.
+
+----------------------------------------------------------------------+
| GDB Toolbar |
+-----------------------------------+----------------------------------+
-| GUD buffer (I/O of GDB) | Locals buffer |
-|-----------------------------------+----------------------------------+
+| GUD buffer (I/O of GDB) | Locals buffer |
+| | |
| | |
-| Source buffer | I/O buffer for debugged program |
| | |
-|-----------------------------------+----------------------------------+
-| Stack buffer | Breakpoints/threads buffer |
+-----------------------------------+----------------------------------+
-
-The option \"--annotate=3\" must be included in this value. To
-run GDB in text command mode, use `gud-gdb'. You need to use
-text command mode to debug multiple programs within one Emacs
-session.
+| Source buffer | I/O buffer (of debugged program) |
+| | (comint-mode) |
+| | |
+| | |
+| | |
+| | |
+| | |
+| | |
++-----------------------------------+----------------------------------+
+| Stack buffer | Breakpoints buffer |
+| RET gdb-select-frame | SPC gdb-toggle-breakpoint |
+| | RET gdb-goto-breakpoint |
+| | D gdb-delete-breakpoint |
++-----------------------------------+----------------------------------+
\(fn COMMAND-LINE)" t nil)
-(defalias 'gdba 'gdb)
-
-(defvar gdb-enable-debug nil "\
-Non-nil means record the process input and output in `gdb-debug-log'.")
-
-(custom-autoload 'gdb-enable-debug "gdb-ui" t)
-
;;;***
\f
;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (19383
-;;;;;; 49279))
+;;;;;; define-generic-mode) "generic" "emacs-lisp/generic.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/generic.el
(defvar generic-mode-list nil "\
;;;***
\f
;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/glasses.el
(autoload 'glasses-mode "glasses" "\
\f
;;;### (autoloads (gmm-tool-bar-from-list gmm-widget-p gmm-error
;;;;;; gmm-message gmm-regexp-concat) "gmm-utils" "gnus/gmm-utils.el"
-;;;;;; (19383 49279))
+;;;;;; (19365 25156))
;;; Generated autoloads from gnus/gmm-utils.el
(autoload 'gmm-regexp-concat "gmm-utils" "\
;;;***
\f
;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (19383 49279))
+;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (19279 5150))
;;; Generated autoloads from gnus/gnus.el
(when (fboundp 'custom-autoload)
(custom-autoload 'gnus-select-method "gnus"))
;;;;;; gnus-agent-get-undownloaded-list gnus-agent-delete-group
;;;;;; gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
;;;;;; gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;; "gnus/gnus-agent.el" (19383 49279))
+;;;;;; "gnus/gnus-agent.el" (19368 35187))
;;; Generated autoloads from gnus/gnus-agent.el
(autoload 'gnus-unplugged "gnus-agent" "\
;;;***
\f
;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;; (19383 49284))
+;;;;;; (19368 35187))
;;; Generated autoloads from gnus/gnus-art.el
(autoload 'gnus-article-prepare-display "gnus-art" "\
;;;***
\f
;;;### (autoloads (gnus-audio-play) "gnus-audio" "gnus/gnus-audio.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-audio.el
(autoload 'gnus-audio-play "gnus-audio" "\
;;;***
\f
;;;### (autoloads (gnus-bookmark-bmenu-list gnus-bookmark-jump gnus-bookmark-set)
-;;;;;; "gnus-bookmark" "gnus/gnus-bookmark.el" (19383 49279))
+;;;;;; "gnus-bookmark" "gnus/gnus-bookmark.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-bookmark.el
(autoload 'gnus-bookmark-set "gnus-bookmark" "\
\f
;;;### (autoloads (gnus-cache-delete-group gnus-cache-rename-group
;;;;;; gnus-cache-generate-nov-databases gnus-cache-generate-active
-;;;;;; gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19383
-;;;;;; 49279))
+;;;;;; gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/gnus-cache.el
(autoload 'gnus-jog-cache "gnus-cache" "\
;;;***
\f
;;;### (autoloads (gnus-delay-initialize gnus-delay-send-queue gnus-delay-article)
-;;;;;; "gnus-delay" "gnus/gnus-delay.el" (19383 49279))
+;;;;;; "gnus-delay" "gnus/gnus-delay.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-delay.el
(autoload 'gnus-delay-article "gnus-delay" "\
;;;***
\f
;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;; "gnus-diary" "gnus/gnus-diary.el" (19383 49279))
+;;;;;; "gnus-diary" "gnus/gnus-diary.el" (19279 38446))
;;; Generated autoloads from gnus/gnus-diary.el
(autoload 'gnus-user-format-function-d "gnus-diary" "\
;;;***
\f
;;;### (autoloads (turn-on-gnus-dired-mode) "gnus-dired" "gnus/gnus-dired.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-dired.el
(autoload 'turn-on-gnus-dired-mode "gnus-dired" "\
;;;***
\f
;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-draft.el
(autoload 'gnus-draft-reminder "gnus-draft" "\
\f
;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
;;;;;; gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
-;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19383
-;;;;;; 49279))
+;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/gnus-fun.el
(autoload 'gnus-random-x-face "gnus-fun" "\
;;;***
\f
;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;; "gnus-group" "gnus/gnus-group.el" (19383 49279))
+;;;;;; "gnus-group" "gnus/gnus-group.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-group.el
(autoload 'gnus-fetch-group "gnus-group" "\
;;;***
\f
;;;### (autoloads (gnus-batch-score) "gnus-kill" "gnus/gnus-kill.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-kill.el
(defalias 'gnus-batch-kill 'gnus-batch-score)
\f
;;;### (autoloads (gnus-mailing-list-mode gnus-mailing-list-insinuate
;;;;;; turn-on-gnus-mailing-list-mode) "gnus-ml" "gnus/gnus-ml.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-ml.el
(autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" "\
\f
;;;### (autoloads (gnus-group-split-fancy gnus-group-split gnus-group-split-update
;;;;;; gnus-group-split-setup) "gnus-mlspl" "gnus/gnus-mlspl.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-mlspl.el
(autoload 'gnus-group-split-setup "gnus-mlspl" "\
;;;***
\f
;;;### (autoloads (gnus-change-server) "gnus-move" "gnus/gnus-move.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-move.el
(autoload 'gnus-change-server "gnus-move" "\
;;;***
\f
;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
-;;;;;; "gnus-msg" "gnus/gnus-msg.el" (19383 49279))
+;;;;;; "gnus-msg" "gnus/gnus-msg.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-msg.el
(autoload 'gnus-msg-mail "gnus-msg" "\
;;;***
\f
;;;### (autoloads (gnus-nocem-load-cache gnus-nocem-scan-groups)
-;;;;;; "gnus-nocem" "gnus/gnus-nocem.el" (19383 49279))
+;;;;;; "gnus-nocem" "gnus/gnus-nocem.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-nocem.el
(autoload 'gnus-nocem-scan-groups "gnus-nocem" "\
\f
;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
;;;;;; gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-picon.el
(autoload 'gnus-treat-from-picon "gnus-picon" "\
;;;;;; gnus-sorted-nintersection gnus-sorted-range-intersection
;;;;;; gnus-sorted-intersection gnus-intersection gnus-sorted-complement
;;;;;; gnus-sorted-ndifference gnus-sorted-difference) "gnus-range"
-;;;;;; "gnus/gnus-range.el" (19383 49279))
+;;;;;; "gnus/gnus-range.el" (19279 5150))
;;; Generated autoloads from gnus/gnus-range.el
(autoload 'gnus-sorted-difference "gnus-range" "\
;;;***
\f
;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;; "gnus-registry" "gnus/gnus-registry.el" (19383 49279))
+;;;;;; "gnus-registry" "gnus/gnus-registry.el" (19368 35187))
;;; Generated autoloads from gnus/gnus-registry.el
(autoload 'gnus-registry-initialize "gnus-registry" "\
;;;***
\f
;;;### (autoloads (gnus-sieve-article-add-rule gnus-sieve-generate
-;;;;;; gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19383
-;;;;;; 49279))
+;;;;;; gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/gnus-sieve.el
(autoload 'gnus-sieve-update "gnus-sieve" "\
;;;***
\f
;;;### (autoloads (gnus-batch-brew-soup) "gnus-soup" "gnus/gnus-soup.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-soup.el
(autoload 'gnus-batch-brew-soup "gnus-soup" "\
;;;***
\f
;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-spec.el
(autoload 'gnus-update-format "gnus-spec" "\
;;;***
\f
;;;### (autoloads (gnus-fixup-nnimap-unread-after-getting-new-news
-;;;;;; gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (19383
-;;;;;; 49279))
+;;;;;; gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/gnus-start.el
(autoload 'gnus-declare-backend "gnus-start" "\
;;;***
\f
;;;### (autoloads (gnus-add-configuration) "gnus-win" "gnus/gnus-win.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/gnus-win.el
(autoload 'gnus-add-configuration "gnus-win" "\
;;;***
\f
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19383 49279))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19279 5151))
;;; Generated autoloads from play/gomoku.el
(autoload 'gomoku "gomoku" "\
;;;***
\f
;;;### (autoloads (goto-address-prog-mode goto-address-mode goto-address
-;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (19383
-;;;;;; 49279))
+;;;;;; goto-address-at-point) "goto-addr" "net/goto-addr.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from net/goto-addr.el
(define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
\f
;;;### (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" (19397 57330))
+;;;;;; grep-window-height) "grep" "progmodes/grep.el" (19304 5068))
;;; Generated autoloads from progmodes/grep.el
(defvar grep-window-height nil "\
;;;***
\f
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (19383 49279))
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (19279 5148))
;;; Generated autoloads from gs.el
(autoload 'gs-load-image "gs" "\
;;;***
\f
;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb
-;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19383 49279))
+;;;;;; xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19374 384))
;;; Generated autoloads from progmodes/gud.el
(autoload 'gud-gdb "gud" "\
;;;***
\f
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from play/handwrite.el
(autoload 'handwrite "handwrite" "\
;;;***
\f
;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;; (19383 49279))
+;;;;;; (19256 49601))
;;; Generated autoloads from play/hanoi.el
(autoload 'hanoi "hanoi" "\
\f
;;;### (autoloads (mail-check-payment mail-add-payment-async mail-add-payment
;;;;;; hashcash-verify-payment hashcash-insert-payment-async hashcash-insert-payment)
-;;;;;; "hashcash" "mail/hashcash.el" (19383 49279))
+;;;;;; "hashcash" "mail/hashcash.el" (19365 25156))
;;; Generated autoloads from mail/hashcash.el
(autoload 'hashcash-insert-payment "hashcash" "\
;;;### (autoloads (scan-buf-previous-region scan-buf-next-region
;;;;;; scan-buf-move-to-region help-at-pt-display-when-idle help-at-pt-set-timer
;;;;;; help-at-pt-cancel-timer display-local-help help-at-pt-kbd-string
-;;;;;; help-at-pt-string) "help-at-pt" "help-at-pt.el" (19383 49279))
+;;;;;; help-at-pt-string) "help-at-pt" "help-at-pt.el" (19279 5148))
;;; Generated autoloads from help-at-pt.el
(autoload 'help-at-pt-string "help-at-pt" "\
;;;### (autoloads (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"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from help-fns.el
(autoload 'describe-function "help-fns" "\
;;;***
\f
;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from help-macro.el
(defvar three-step-help nil "\
\f
;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button
;;;;;; help-make-xrefs help-buffer help-setup-xref help-mode-finish
-;;;;;; help-mode-setup help-mode) "help-mode" "help-mode.el" (19383
-;;;;;; 49279))
+;;;;;; help-mode-setup help-mode) "help-mode" "help-mode.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from help-mode.el
(autoload 'help-mode "help-mode" "\
;;;***
\f
;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;; "emacs-lisp/helper.el" (19383 49279))
+;;;;;; "emacs-lisp/helper.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/helper.el
(autoload 'Helper-describe-bindings "helper" "\
;;;***
\f
;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;; "hexl.el" (19383 49279))
+;;;;;; "hexl.el" (19279 38446))
;;; Generated autoloads from hexl.el
(autoload 'hexl-mode "hexl" "\
;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer
;;;;;; hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer
;;;;;; global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from hi-lock.el
(autoload 'hi-lock-mode "hi-lock" "\
;;;***
\f
;;;### (autoloads (hide-ifdef-mode) "hideif" "progmodes/hideif.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/hideif.el
(autoload 'hide-ifdef-mode "hideif" "\
;;;***
\f
;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/hideshow.el
(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\
;;;;;; highlight-compare-buffers highlight-changes-rotate-faces
;;;;;; highlight-changes-previous-change highlight-changes-next-change
;;;;;; highlight-changes-remove-highlight highlight-changes-visible-mode
-;;;;;; highlight-changes-mode) "hilit-chg" "hilit-chg.el" (19383
-;;;;;; 49279))
+;;;;;; highlight-changes-mode) "hilit-chg" "hilit-chg.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from hilit-chg.el
(autoload 'highlight-changes-mode "hilit-chg" "\
;;;;;; hippie-expand-ignore-buffers hippie-expand-max-buffers hippie-expand-no-restriction
;;;;;; hippie-expand-dabbrev-as-symbol hippie-expand-dabbrev-skip-space
;;;;;; hippie-expand-verbose hippie-expand-try-functions-list) "hippie-exp"
-;;;;;; "hippie-exp.el" (19383 49279))
+;;;;;; "hippie-exp.el" (19279 5148))
;;; Generated autoloads from hippie-exp.el
(defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\
;;;***
\f
;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
-;;;;;; (19383 49279))
+;;;;;; (19356 10801))
;;; Generated autoloads from hl-line.el
(autoload 'hl-line-mode "hl-line" "\
;;;;;; holiday-bahai-holidays holiday-islamic-holidays holiday-christian-holidays
;;;;;; holiday-hebrew-holidays holiday-other-holidays holiday-local-holidays
;;;;;; holiday-oriental-holidays holiday-general-holidays) "holidays"
-;;;;;; "calendar/holidays.el" (19383 49279))
+;;;;;; "calendar/holidays.el" (19279 5149))
;;; Generated autoloads from calendar/holidays.el
(defvar holiday-general-holidays (mapcar 'purecopy '((holiday-fixed 1 1 "New Year's Day") (holiday-float 1 1 3 "Martin Luther King Day") (holiday-fixed 2 2 "Groundhog Day") (holiday-fixed 2 14 "Valentine's Day") (holiday-float 2 1 3 "President's Day") (holiday-fixed 3 17 "St. Patrick's Day") (holiday-fixed 4 1 "April Fools' Day") (holiday-float 5 0 2 "Mother's Day") (holiday-float 5 1 -1 "Memorial Day") (holiday-fixed 6 14 "Flag Day") (holiday-float 6 0 3 "Father's Day") (holiday-fixed 7 4 "Independence Day") (holiday-float 9 1 1 "Labor Day") (holiday-float 10 1 2 "Columbus Day") (holiday-fixed 10 31 "Halloween") (holiday-fixed 11 11 "Veteran's Day") (holiday-float 11 4 4 "Thanksgiving"))) "\
;;;***
\f
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/html2text.el
(autoload 'html2text "html2text" "\
;;;***
\f
-;;;### (autoloads (htmlfontify-copy-and-link-dir htmlfontify-buffer)
-;;;;;; "htmlfontify" "htmlfontify.el" (19401 55581))
-;;; Generated autoloads from htmlfontify.el
-
-(autoload 'htmlfontify-buffer "htmlfontify" "\
-Create a new buffer, named for the current buffer + a .html extension,
-containing an inline CSS-stylesheet and formatted CSS-markup HTML
-that reproduces the look of the current Emacs buffer as closely
-as possible.
-
-Dangerous characters in the existing buffer are turned into HTML
-entities, so you should even be able to do HTML-within-HTML
-fontified display.
-
-You should, however, note that random control or eight-bit
-characters such as ^L (\f) or ¤ (\244) won't get mapped yet.
-
-If the SRCDIR and FILE arguments are set, lookup etags derived
-entries in the `hfy-tags-cache' and add HTML anchors and
-hyperlinks as appropriate.
-
-\(fn &optional SRCDIR FILE)" t nil)
-
-(autoload 'htmlfontify-copy-and-link-dir "htmlfontify" "\
-Trawl SRCDIR and write fontified-and-hyperlinked output in DSTDIR.
-F-EXT and L-EXT specify values for `hfy-extn' and `hfy-link-extn'.
-
-You may also want to set `hfy-page-header' and `hfy-page-footer'.
-
-\(fn SRCDIR DSTDIR &optional F-EXT L-EXT)" t nil)
-
-;;;***
-\f
;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
-;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19383
-;;;;;; 49279))
+;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from ibuf-macs.el
(autoload 'define-ibuffer-column "ibuf-macs" "\
;;;***
\f
;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
-;;;;;; "ibuffer" "ibuffer.el" (19383 49279))
+;;;;;; "ibuffer" "ibuffer.el" (19279 5148))
;;; Generated autoloads from ibuffer.el
(autoload 'ibuffer-list-buffers "ibuffer" "\
\f
;;;### (autoloads (icalendar-import-buffer icalendar-import-file
;;;;;; icalendar-export-region icalendar-export-file) "icalendar"
-;;;;;; "calendar/icalendar.el" (19383 49284))
+;;;;;; "calendar/icalendar.el" (19338 9840))
;;; Generated autoloads from calendar/icalendar.el
(autoload 'icalendar-export-file "icalendar" "\
;;;***
\f
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from icomplete.el
(defvar icomplete-mode nil "\
;;;***
\f
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19383 49279))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19279 5151))
;;; Generated autoloads from progmodes/icon.el
(autoload 'icon-mode "icon" "\
;;;***
\f
;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/idlw-shell.el
(autoload 'idlwave-shell "idlw-shell" "\
;;;***
\f
;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 38446))
;;; Generated autoloads from progmodes/idlwave.el
(autoload 'idlwave-mode "idlwave" "\
;;;;;; 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" (19397
-;;;;;; 64530))
+;;;;;; ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19292
+;;;;;; 15231))
;;; Generated autoloads from ido.el
(defvar ido-mode nil "\
;;;***
\f
-;;;### (autoloads (ielm) "ielm" "ielm.el" (19383 49279))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (19279 5148))
;;; Generated autoloads from ielm.el
(add-hook 'same-window-buffer-names (purecopy "*ielm*"))
;;;***
\f
;;;### (autoloads (iimage-mode turn-on-iimage-mode) "iimage" "iimage.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from iimage.el
(autoload 'turn-on-iimage-mode "iimage" "\
;;;***
\f
-;;;### (autoloads (defimage find-image remove-images insert-sliced-image
-;;;;;; insert-image put-image create-image image-type-auto-detected-p
+;;;### (autoloads (create-animated-image defimage find-image remove-images
+;;;;;; insert-sliced-image insert-image put-image 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" (19383 49279))
+;;;;;; "image" "image.el" (19356 10801))
;;; Generated autoloads from image.el
(autoload 'image-type-from-data "image" "\
\(fn SYMBOL SPECS &optional DOC)" nil (quote macro))
+(autoload 'create-animated-image "image" "\
+Create an animated image.
+FILE-OR-DATA is an image file name or image data.
+Optional TYPE is a symbol describing the image type. If TYPE is omitted
+or nil, try to determine the image type from its first few bytes
+of image data. If that doesn't work, and FILE-OR-DATA is a file name,
+use its file extension as image type.
+Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
+Optional PROPS are additional image attributes to assign to the image,
+like, e.g. `:mask MASK'.
+Value is the image created, or nil if images of type TYPE are not supported.
+
+Images should not be larger than specified by `max-image-size'.
+
+\(fn FILE-OR-DATA &optional TYPE DATA-P &rest PROPS)" nil nil)
+
;;;***
\f
;;;### (autoloads (image-dired-dired-edit-comment-and-tags image-dired-mark-tagged-files
;;;;;; 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-insert-marked-thumbs)
-;;;;;; "image-dired" "image-dired.el" (19383 49285))
+;;;;;; "image-dired" "image-dired.el" (19370 36540))
;;; Generated autoloads from image-dired.el
(autoload 'image-dired-dired-insert-marked-thumbs "image-dired" "\
\f
;;;### (autoloads (auto-image-file-mode insert-image-file image-file-name-regexp
;;;;;; image-file-name-regexps image-file-name-extensions) "image-file"
-;;;;;; "image-file.el" (19422 11991))
+;;;;;; "image-file.el" (19279 5148))
;;; Generated autoloads from image-file.el
(defvar image-file-name-extensions (purecopy '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg")) "\
;;;***
\f
;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
-;;;;;; image-mode) "image-mode" "image-mode.el" (19412 35030))
+;;;;;; image-mode) "image-mode" "image-mode.el" (19356 10801))
;;; Generated autoloads from image-mode.el
(push (cons (purecopy "\\.jpe?g\\'") 'image-mode) auto-mode-alist)
(push (cons (purecopy "\\.png\\'") 'image-mode) auto-mode-alist)
to display an image file as the actual image.
You can use `image-mode-as-text' in `auto-mode-alist' when you want
-to display an image file as text initially.
+to display an image file as text inititally.
See commands `image-mode' and `image-minor-mode' for more information
on these modes.
;;;***
\f
;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;; imenu-sort-function) "imenu" "imenu.el" (19383 49279))
+;;;;;; imenu-sort-function) "imenu" "imenu.el" (19279 5148))
;;; Generated autoloads from imenu.el
(defvar imenu-sort-function nil "\
\f
;;;### (autoloads (indian-2-column-to-ucs-region in-is13194-pre-write-conversion
;;;;;; in-is13194-post-read-conversion indian-compose-string indian-compose-region)
-;;;;;; "ind-util" "language/ind-util.el" (19383 49279))
+;;;;;; "ind-util" "language/ind-util.el" (19279 5150))
;;; Generated autoloads from language/ind-util.el
(autoload 'indian-compose-region "ind-util" "\
\f
;;;### (autoloads (inferior-lisp inferior-lisp-prompt inferior-lisp-load-command
;;;;;; inferior-lisp-program inferior-lisp-filter-regexp) "inf-lisp"
-;;;;;; "progmodes/inf-lisp.el" (19383 49279))
+;;;;;; "progmodes/inf-lisp.el" (19279 5151))
;;; Generated autoloads from progmodes/inf-lisp.el
(defvar inferior-lisp-filter-regexp (purecopy "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'") "\
;;;;;; Info-goto-emacs-command-node Info-mode info-finder info-apropos
;;;;;; Info-index Info-directory Info-on-current-buffer info-standalone
;;;;;; info-emacs-manual info info-other-window) "info" "info.el"
-;;;;;; (19412 35030))
+;;;;;; (19368 35187))
;;; Generated autoloads from info.el
(autoload 'info-other-window "info" "\
(autoload 'info-finder "info" "\
Display descriptions of the keywords in the Finder virtual manual.
+In interactive use, a prefix argument directs this command to read
+a list of keywords separated by comma. After that, it displays a node
+with a list packages that contain all specified keywords.
-\(fn)" t nil)
+\(fn &optional KEYWORDS)" t nil)
(autoload 'Info-mode "info" "\
Info mode provides commands for browsing through the Info documentation tree.
\f
;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
;;;;;; info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from info-look.el
(autoload 'info-lookup-reset "info-look" "\
;;;***
\f
;;;### (autoloads (info-xref-check-all-custom info-xref-check-all
-;;;;;; info-xref-check) "info-xref" "info-xref.el" (19383 49279))
+;;;;;; info-xref-check) "info-xref" "info-xref.el" (19279 5148))
;;; Generated autoloads from info-xref.el
(autoload 'info-xref-check "info-xref" "\
;;;***
\f
;;;### (autoloads (batch-info-validate Info-validate Info-split Info-split-threshold
-;;;;;; Info-tagify) "informat" "informat.el" (19383 49279))
+;;;;;; Info-tagify) "informat" "informat.el" (19279 5148))
;;; Generated autoloads from informat.el
(autoload 'Info-tagify "informat" "\
\f
;;;### (autoloads (isearch-process-search-multibyte-characters isearch-toggle-input-method
;;;;;; isearch-toggle-specified-input-method) "isearch-x" "international/isearch-x.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from international/isearch-x.el
(autoload 'isearch-toggle-specified-input-method "isearch-x" "\
;;;***
\f
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from isearchb.el
(autoload 'isearchb-activate "isearchb" "\
;;;### (autoloads (iso-cvt-define-menu iso-cvt-write-only iso-cvt-read-only
;;;;;; iso-sgml2iso iso-iso2sgml iso-iso2duden iso-iso2gtex iso-gtex2iso
;;;;;; iso-tex2iso iso-iso2tex iso-german iso-spanish) "iso-cvt"
-;;;;;; "international/iso-cvt.el" (19383 49279))
+;;;;;; "international/iso-cvt.el" (19279 5150))
;;; Generated autoloads from international/iso-cvt.el
(autoload 'iso-spanish "iso-cvt" "\
;;;***
\f
;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from international/iso-transl.el
(or key-translation-map (setq key-translation-map (make-sparse-keymap)))
(define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
;;;;;; ispell-complete-word ispell-continue 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" (19383 49276))
+;;;;;; "ispell" "textmodes/ispell.el" (19313 15415))
;;; Generated autoloads from textmodes/ispell.el
(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
;;;***
\f
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19383
-;;;;;; 49276))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19321
+;;;;;; 4517))
;;; Generated autoloads from iswitchb.el
(defvar iswitchb-mode nil "\
;;;### (autoloads (read-hiragana-string japanese-zenkaku-region japanese-hankaku-region
;;;;;; japanese-hiragana-region japanese-katakana-region japanese-zenkaku
;;;;;; japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal)
-;;;;;; "japan-util" "language/japan-util.el" (19383 49279))
+;;;;;; "japan-util" "language/japan-util.el" (19279 5150))
;;; Generated autoloads from language/japan-util.el
(autoload 'setup-japanese-environment-internal "japan-util" "\
;;;***
\f
;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;; "jka-compr.el" (19383 49279))
+;;;;;; "jka-compr.el" (19292 15231))
;;; Generated autoloads from jka-compr.el
(defvar jka-compr-inhibit nil "\
;;;***
\f
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19421 38445))
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19279 5151))
;;; Generated autoloads from progmodes/js.el
(autoload 'js-mode "js" "\
\f
;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
;;;;;; keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/keypad.el
(defvar keypad-setup nil "\
;;;***
\f
;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5150))
;;; Generated autoloads from international/kinsoku.el
(autoload 'kinsoku "kinsoku" "\
;;;***
\f
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from international/kkc.el
(defvar kkc-after-update-conversion-functions nil "\
;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
;;;;;; kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
;;;;;; kmacro-call-macro kmacro-end-macro kmacro-start-macro kmacro-exec-ring-item)
-;;;;;; "kmacro" "kmacro.el" (19383 49279))
+;;;;;; "kmacro" "kmacro.el" (19279 5148))
;;; Generated autoloads from kmacro.el
(global-set-key "\C-x(" 'kmacro-start-macro)
(global-set-key "\C-x)" 'kmacro-end-macro)
;;;***
\f
;;;### (autoloads (setup-korean-environment-internal) "korea-util"
-;;;;;; "language/korea-util.el" (19383 49279))
+;;;;;; "language/korea-util.el" (19279 5150))
;;; Generated autoloads from language/korea-util.el
(defvar default-korean-keyboard (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "\
;;;***
\f
;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from play/landmark.el
(defalias 'landmark-repeat 'lm-test-run)
\f
;;;### (autoloads (lao-compose-region lao-composition-function lao-transcribe-roman-to-lao-string
;;;;;; lao-transcribe-single-roman-syllable-to-lao lao-compose-string)
-;;;;;; "lao-util" "language/lao-util.el" (19383 49279))
+;;;;;; "lao-util" "language/lao-util.el" (19279 5150))
;;; Generated autoloads from language/lao-util.el
(autoload 'lao-compose-string "lao-util" "\
\f
;;;### (autoloads (latexenc-find-file-coding-system latexenc-coding-system-to-inputenc
;;;;;; latexenc-inputenc-to-coding-system latex-inputenc-coding-alist)
-;;;;;; "latexenc" "international/latexenc.el" (19383 49279))
+;;;;;; "latexenc" "international/latexenc.el" (19279 5150))
;;; Generated autoloads from international/latexenc.el
(defvar latex-inputenc-coding-alist (purecopy '(("ansinew" . windows-1252) ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . windows-1250) ("cp1252" . windows-1252) ("cp1257" . cp1257) ("cp437de" . cp437) ("cp437" . cp437) ("cp850" . cp850) ("cp852" . cp852) ("cp858" . cp858) ("cp865" . cp865) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ("next" . next) ("utf8" . utf-8) ("utf8x" . utf-8))) "\
;;;***
\f
;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;; "latin1-disp" "international/latin1-disp.el" (19383 49279))
+;;;;;; "latin1-disp" "international/latin1-disp.el" (19279 5150))
;;; Generated autoloads from international/latin1-disp.el
(defvar latin1-display nil "\
;;;***
\f
;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/ld-script.el
(add-to-list 'auto-mode-alist (purecopy '("\\.ld[si]?\\>" . ld-script-mode)))
;;;***
\f
;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
-;;;;;; (19383 49279))
+;;;;;; (19279 5148))
;;; Generated autoloads from ledit.el
(defconst ledit-save-files t "\
;;;***
\f
-;;;### (autoloads (life) "life" "play/life.el" (19383 49279))
+;;;### (autoloads (life) "life" "play/life.el" (19279 5151))
;;; Generated autoloads from play/life.el
(autoload 'life "life" "\
;;;***
\f
;;;### (autoloads (global-linum-mode linum-mode linum-format) "linum"
-;;;;;; "linum.el" (19383 49279))
+;;;;;; "linum.el" (19279 5148))
;;; Generated autoloads from linum.el
(defvar linum-format 'dynamic "\
;;;***
\f
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from loadhist.el
(autoload 'unload-feature "loadhist" "\
;;;***
\f
;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;; "locate" "locate.el" (19383 49279))
+;;;;;; "locate" "locate.el" (19279 5148))
;;; Generated autoloads from locate.el
(defvar locate-ls-subdir-switches (purecopy "-al") "\
;;;***
\f
-;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19383 49276))
+;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19370 36540))
;;; Generated autoloads from log-edit.el
(autoload 'log-edit "log-edit" "\
Setup a buffer to enter a log message.
-\\<log-edit-mode-map>The buffer will be put in `log-edit-mode'.
+\\<log-edit-mode-map>The buffer will be put in mode MODE or `log-edit-mode'
+if MODE is nil.
If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run.
Mark and point will be set around the entire contents of the buffer so
that it is easy to kill the contents of the buffer with \\[kill-region].
log message and go back to the current buffer when done. Otherwise, it
uses the current buffer.
-\(fn CALLBACK &optional SETUP PARAMS BUFFER &rest IGNORE)" nil nil)
+\(fn CALLBACK &optional SETUP PARAMS BUFFER MODE &rest IGNORE)" nil nil)
;;;***
\f
-;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (19358
+;;;;;; 54001))
;;; Generated autoloads from log-view.el
(autoload 'log-view-mode "log-view" "\
;;;***
\f
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from longlines.el
(autoload 'longlines-mode "longlines" "\
;;;***
\f
;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
-;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19383
-;;;;;; 49279))
+;;;;;; lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from lpr.el
(defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)))
;;;***
\f
;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
-;;;;;; (19383 49276))
+;;;;;; (19321 4517))
;;; Generated autoloads from ls-lisp.el
(defvar ls-lisp-support-shell-wildcards t "\
;;;***
\f
-;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19383
-;;;;;; 49279))
+;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from calendar/lunar.el
(autoload 'lunar-phases "lunar" "\
;;;***
\f
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19383
-;;;;;; 49280))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/m4-mode.el
(autoload 'm4-mode "m4-mode" "\
;;;***
\f
;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/macroexp.el
(autoload 'macroexpand-all "macroexp" "\
;;;***
\f
;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;; name-last-kbd-macro) "macros" "macros.el" (19383 49277))
+;;;;;; name-last-kbd-macro) "macros" "macros.el" (19345 41626))
;;; Generated autoloads from macros.el
(autoload 'name-last-kbd-macro "macros" "\
;;;***
\f
;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;; "mail/mail-extr.el" (19383 49280))
+;;;;;; "mail/mail-extr.el" (19279 5150))
;;; Generated autoloads from mail/mail-extr.el
(autoload 'mail-extract-address-components "mail-extr" "\
\f
;;;### (autoloads (mail-hist-put-headers-into-history mail-hist-keep-history
;;;;;; mail-hist-enable mail-hist-define-keys) "mail-hist" "mail/mail-hist.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/mail-hist.el
(autoload 'mail-hist-define-keys "mail-hist" "\
;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
;;;;;; mail-unquote-printable mail-quote-printable-region mail-quote-printable
;;;;;; mail-file-babyl-p mail-use-rfc822) "mail-utils" "mail/mail-utils.el"
-;;;;;; (19383 49276))
+;;;;;; (19313 15414))
;;; Generated autoloads from mail/mail-utils.el
(defvar mail-use-rfc822 nil "\
;;;***
\f
;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup
-;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19383
-;;;;;; 49280))
+;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from mail/mailabbrev.el
(defvar mail-abbrevs-mode nil "\
;;;***
\f
;;;### (autoloads (mail-complete define-mail-alias expand-mail-aliases
-;;;;;; mail-complete-style) "mailalias" "mail/mailalias.el" (19383
-;;;;;; 49280))
+;;;;;; mail-complete-style) "mailalias" "mail/mailalias.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from mail/mailalias.el
(defvar mail-complete-style 'angles "\
;;;***
\f
;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/mailclient.el
(autoload 'mailclient-send-it "mailclient" "\
\f
;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;; "make-mode" "progmodes/make-mode.el" (19383 49284))
+;;;;;; "make-mode" "progmodes/make-mode.el" (19372 27330))
;;; Generated autoloads from progmodes/make-mode.el
(autoload 'makefile-mode "make-mode" "\
;;;***
\f
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19383
-;;;;;; 49280))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from makesum.el
(autoload 'make-command-summary "makesum" "\
;;;***
\f
-;;;### (autoloads (man-follow man) "man" "man.el" (19383 49278))
+;;;### (autoloads (man-follow man) "man" "man.el" (19345 41626))
;;; Generated autoloads from man.el
(defalias 'manual-entry 'man)
;;;***
\f
-;;;### (autoloads (master-mode) "master" "master.el" (19383 49280))
+;;;### (autoloads (master-mode) "master" "master.el" (19279 5148))
;;; Generated autoloads from master.el
(autoload 'master-mode "master" "\
;;;***
\f
;;;### (autoloads (minibuffer-depth-indicate-mode) "mb-depth" "mb-depth.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5148))
;;; Generated autoloads from mb-depth.el
(defvar minibuffer-depth-indicate-mode nil "\
;;;;;; message-forward-make-body message-forward message-recover
;;;;;; message-supersede message-cancel-news message-followup message-wide-reply
;;;;;; message-reply message-news message-mail message-mode) "message"
-;;;;;; "gnus/message.el" (19409 46567))
+;;;;;; "gnus/message.el" (19370 36541))
;;; Generated autoloads from gnus/message.el
(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
;;;***
\f
;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/meta-mode.el
(autoload 'metafont-mode "meta-mode" "\
\f
;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
;;;;;; metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;; (19383 49280))
+;;;;;; (19356 10801))
;;; Generated autoloads from mail/metamail.el
(autoload 'metamail-interpret-header "metamail" "\
\f
;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
;;;;;; mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
-;;;;;; "mh-e/mh-comp.el" (19383 49280))
+;;;;;; "mh-e/mh-comp.el" (19279 5150))
;;; Generated autoloads from mh-e/mh-comp.el
(autoload 'mh-smail "mh-comp" "\
;;;***
\f
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19383 49280))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19279 5150))
;;; Generated autoloads from mh-e/mh-e.el
(put 'mh-progs 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (mh-folder-mode mh-nmail mh-rmail) "mh-folder"
-;;;;;; "mh-e/mh-folder.el" (19383 49280))
+;;;;;; "mh-e/mh-folder.el" (19279 5150))
;;; Generated autoloads from mh-e/mh-folder.el
(autoload 'mh-rmail "mh-folder" "\
;;;***
\f
;;;### (autoloads (midnight-delay-set clean-buffer-list) "midnight"
-;;;;;; "midnight.el" (19383 49280))
+;;;;;; "midnight.el" (19369 15960))
;;; Generated autoloads from midnight.el
(autoload 'clean-buffer-list "midnight" "\
;;;***
\f
;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;; "minibuf-eldef.el" (19383 49280))
+;;;;;; "minibuf-eldef.el" (19279 5148))
;;; Generated autoloads from minibuf-eldef.el
(defvar minibuffer-electric-default-mode nil "\
;;;***
\f
-;;;### (autoloads (butterfly) "misc" "misc.el" (19383 49280))
+;;;### (autoloads (butterfly) "misc" "misc.el" (19279 5148))
;;; Generated autoloads from misc.el
(autoload 'butterfly "misc" "\
\f
;;;### (autoloads (multi-isearch-files-regexp multi-isearch-files
;;;;;; multi-isearch-buffers-regexp multi-isearch-buffers multi-isearch-setup)
-;;;;;; "misearch" "misearch.el" (19383 49280))
+;;;;;; "misearch" "misearch.el" (19279 5148))
;;; Generated autoloads from misearch.el
(add-hook 'isearch-mode-hook 'multi-isearch-setup)
;;;***
\f
;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;; (19383 49280))
+;;;;;; (19358 54001))
;;; Generated autoloads from progmodes/mixal-mode.el
(autoload 'mixal-mode "mixal-mode" "\
;;;***
\f
;;;### (autoloads (mm-inline-external-body mm-extern-cache-contents)
-;;;;;; "mm-extern" "gnus/mm-extern.el" (19383 49280))
+;;;;;; "mm-extern" "gnus/mm-extern.el" (19279 5150))
;;; Generated autoloads from gnus/mm-extern.el
(autoload 'mm-extern-cache-contents "mm-extern" "\
;;;***
\f
;;;### (autoloads (mm-inline-partial) "mm-partial" "gnus/mm-partial.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/mm-partial.el
(autoload 'mm-inline-partial "mm-partial" "\
;;;***
\f
;;;### (autoloads (mm-url-insert-file-contents-external mm-url-insert-file-contents)
-;;;;;; "mm-url" "gnus/mm-url.el" (19383 49280))
+;;;;;; "mm-url" "gnus/mm-url.el" (19279 5150))
;;; Generated autoloads from gnus/mm-url.el
(autoload 'mm-url-insert-file-contents "mm-url" "\
;;;***
\f
;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;; "gnus/mm-uu.el" (19383 49283))
+;;;;;; "gnus/mm-uu.el" (19279 5150))
;;; Generated autoloads from gnus/mm-uu.el
(autoload 'mm-uu-dissect "mm-uu" "\
;;;***
\f
;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;; (19383 49280))
+;;;;;; (19365 25156))
;;; Generated autoloads from gnus/mml1991.el
(autoload 'mml1991-encrypt "mml1991" "\
\f
;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;; "mml2015" "gnus/mml2015.el" (19383 49280))
+;;;;;; "mml2015" "gnus/mml2015.el" (19365 25156))
;;; Generated autoloads from gnus/mml2015.el
(autoload 'mml2015-decrypt "mml2015" "\
;;;***
\f
;;;### (autoloads (modula-2-mode) "modula2" "progmodes/modula2.el"
-;;;;;; (19352 21355))
+;;;;;; (19256 49603))
;;; Generated autoloads from progmodes/modula2.el
(autoload 'modula-2-mode "modula2" "\
;;;***
\f
;;;### (autoloads (unmorse-region morse-region) "morse" "play/morse.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from play/morse.el
(autoload 'morse-region "morse" "\
;;;***
\f
;;;### (autoloads (mouse-drag-drag mouse-drag-throw) "mouse-drag"
-;;;;;; "mouse-drag.el" (19383 49280))
+;;;;;; "mouse-drag.el" (19279 5148))
;;; Generated autoloads from mouse-drag.el
(autoload 'mouse-drag-throw "mouse-drag" "\
;;;***
\f
-;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19383
-;;;;;; 49280))
+;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from mouse-sel.el
(defvar mouse-sel-mode nil "\
;;;***
\f
-;;;### (autoloads (mpc) "mpc" "mpc.el" (19383 49280))
+;;;### (autoloads (mpc) "mpc" "mpc.el" (19372 27330))
;;; Generated autoloads from mpc.el
(autoload 'mpc "mpc" "\
;;;***
\f
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19383 49280))
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19279 5151))
;;; Generated autoloads from play/mpuz.el
(autoload 'mpuz "mpuz" "\
;;;***
\f
-;;;### (autoloads (msb-mode) "msb" "msb.el" (19383 49280))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (19279 5148))
;;; Generated autoloads from msb.el
(defvar msb-mode nil "\
;;;;;; describe-current-coding-system describe-current-coding-system-briefly
;;;;;; describe-coding-system describe-character-set list-charset-chars
;;;;;; read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from international/mule-diag.el
(autoload 'list-character-sets "mule-diag" "\
;;;;;; coding-system-translation-table-for-decode coding-system-pre-write-conversion
;;;;;; coding-system-post-read-conversion lookup-nested-alist set-nested-alist
;;;;;; truncate-string-to-width store-substring string-to-sequence)
-;;;;;; "mule-util" "international/mule-util.el" (19383 49276))
+;;;;;; "mule-util" "international/mule-util.el" (19313 15414))
;;; Generated autoloads from international/mule-util.el
(autoload 'string-to-sequence "mule-util" "\
;;;### (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" (19383
-;;;;;; 49280))
+;;;;;; iwconfig ifconfig) "net-utils" "net/net-utils.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from net/net-utils.el
(autoload 'ifconfig "net-utils" "\
;;;;;; uncomment-region comment-kill comment-set-column comment-indent
;;;;;; comment-indent-default comment-normalize-vars comment-multi-line
;;;;;; comment-padding comment-style comment-column) "newcomment"
-;;;;;; "newcomment.el" (19383 49280))
+;;;;;; "newcomment.el" (19279 5148))
;;; Generated autoloads from newcomment.el
(defalias 'indent-for-comment 'comment-indent)
;;;***
\f
;;;### (autoloads (newsticker-start newsticker-running-p) "newst-backend"
-;;;;;; "net/newst-backend.el" (19383 49280))
+;;;;;; "net/newst-backend.el" (19279 5151))
;;; Generated autoloads from net/newst-backend.el
(autoload 'newsticker-running-p "newst-backend" "\
;;;***
\f
;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/newst-plainview.el
(autoload 'newsticker-plainview "newst-plainview" "\
;;;***
\f
;;;### (autoloads (newsticker-show-news) "newst-reader" "net/newst-reader.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/newst-reader.el
(autoload 'newsticker-show-news "newst-reader" "\
;;;***
\f
;;;### (autoloads (newsticker-start-ticker newsticker-ticker-running-p)
-;;;;;; "newst-ticker" "net/newst-ticker.el" (19383 49280))
+;;;;;; "newst-ticker" "net/newst-ticker.el" (19279 5151))
;;; Generated autoloads from net/newst-ticker.el
(autoload 'newsticker-ticker-running-p "newst-ticker" "\
;;;***
\f
;;;### (autoloads (newsticker-treeview) "newst-treeview" "net/newst-treeview.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/newst-treeview.el
(autoload 'newsticker-treeview "newst-treeview" "\
;;;***
\f
;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 38446))
;;; Generated autoloads from gnus/nndiary.el
(autoload 'nndiary-generate-nov-databases "nndiary" "\
;;;***
\f
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19383
-;;;;;; 49280))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/nndoc.el
(autoload 'nndoc-add-type "nndoc" "\
;;;***
\f
;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/nnfolder.el
(autoload 'nnfolder-generate-active-file "nnfolder" "\
;;;***
\f
;;;### (autoloads (nnkiboze-generate-groups) "nnkiboze" "gnus/nnkiboze.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/nnkiboze.el
(autoload 'nnkiboze-generate-groups "nnkiboze" "\
;;;***
\f
;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 38446))
;;; Generated autoloads from gnus/nnml.el
(autoload 'nnml-generate-nov-databases "nnml" "\
;;;***
\f
;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies)
-;;;;;; "nnsoup" "gnus/nnsoup.el" (19383 49280))
+;;;;;; "nnsoup" "gnus/nnsoup.el" (19279 5150))
;;; Generated autoloads from gnus/nnsoup.el
(autoload 'nnsoup-pack-replies "nnsoup" "\
;;;***
\f
;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;; "novice" "novice.el" (19383 49280))
+;;;;;; "novice" "novice.el" (19279 5148))
;;; Generated autoloads from novice.el
(defvar disabled-command-function 'disabled-command-function "\
;;;***
\f
;;;### (autoloads (nroff-mode) "nroff-mode" "textmodes/nroff-mode.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/nroff-mode.el
(autoload 'nroff-mode "nroff-mode" "\
;;;***
\f
;;;### (autoloads (nxml-glyph-display-string) "nxml-glyph" "nxml/nxml-glyph.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from nxml/nxml-glyph.el
(autoload 'nxml-glyph-display-string "nxml-glyph" "\
;;;***
\f
-;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19383
-;;;;;; 49276))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from nxml/nxml-mode.el
(autoload 'nxml-mode "nxml-mode" "\
;;;***
\f
;;;### (autoloads (nxml-enable-unicode-char-name-sets) "nxml-uchnm"
-;;;;;; "nxml/nxml-uchnm.el" (19383 49280))
+;;;;;; "nxml/nxml-uchnm.el" (19279 5151))
;;; Generated autoloads from nxml/nxml-uchnm.el
(autoload 'nxml-enable-unicode-char-name-sets "nxml-uchnm" "\
;;;***
\f
;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/octave-inf.el
(autoload 'inferior-octave "octave-inf" "\
;;;***
\f
;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/octave-mod.el
(autoload 'octave-mode "octave-mod" "\
;;;;;; org-map-entries org-open-link-from-string org-open-at-point-global
;;;;;; org-insert-link-global org-store-link org-run-like-in-org-mode
;;;;;; turn-on-orgstruct++ turn-on-orgstruct orgstruct-mode org-global-cycle
-;;;;;; org-mode) "org" "org/org.el" (19383 49280))
+;;;;;; org-mode) "org" "org/org.el" (19356 10801))
;;; Generated autoloads from org/org.el
(autoload 'org-mode "org" "\
;;;;;; org-diary org-agenda-list-stuck-projects org-tags-view org-todo-list
;;;;;; 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-agenda" "org/org-agenda.el" (19383 49280))
+;;;;;; org-agenda) "org-agenda" "org/org-agenda.el" (19279 5151))
;;; Generated autoloads from org/org-agenda.el
(autoload 'org-agenda "org-agenda" "\
\f
;;;### (autoloads (org-archive-subtree-default-with-confirmation
;;;;;; org-archive-subtree-default) "org-archive" "org/org-archive.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-archive.el
(autoload 'org-archive-subtree-default "org-archive" "\
\f
;;;### (autoloads (org-export-as-ascii org-export-region-as-ascii
;;;;;; org-replace-region-by-ascii org-export-as-ascii-to-buffer)
-;;;;;; "org-ascii" "org/org-ascii.el" (19383 49280))
+;;;;;; "org-ascii" "org/org-ascii.el" (19279 5151))
;;; Generated autoloads from org/org-ascii.el
(autoload 'org-export-as-ascii-to-buffer "org-ascii" "\
;;;***
\f
-;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19383
-;;;;;; 49280))
+;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from org/org-attach.el
(autoload 'org-attach "org-attach" "\
;;;***
\f
;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "org/org-bbdb.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-bbdb.el
(autoload 'org-bbdb-anniversaries "org-bbdb" "\
;;;***
\f
;;;### (autoloads (org-clock-persistence-insinuate org-get-clocktable)
-;;;;;; "org-clock" "org/org-clock.el" (19383 49280))
+;;;;;; "org-clock" "org/org-clock.el" (19279 5151))
;;; Generated autoloads from org/org-clock.el
(autoload 'org-get-clocktable "org-clock" "\
;;;### (autoloads (org-export-as-docbook org-export-as-docbook-pdf-and-open
;;;;;; org-export-as-docbook-pdf org-export-region-as-docbook org-replace-region-by-docbook
;;;;;; org-export-as-docbook-to-buffer org-export-as-docbook-batch)
-;;;;;; "org-docbook" "org/org-docbook.el" (19383 49280))
+;;;;;; "org-docbook" "org/org-docbook.el" (19279 5151))
;;; Generated autoloads from org/org-docbook.el
(autoload 'org-export-as-docbook-batch "org-docbook" "\
\f
;;;### (autoloads (org-insert-export-options-template org-export-as-org
;;;;;; org-export-visible org-export) "org-exp" "org/org-exp.el"
-;;;;;; (19383 49280))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-exp.el
(autoload 'org-export "org-exp" "\
;;;***
\f
;;;### (autoloads (org-feed-show-raw-feed org-feed-goto-inbox org-feed-update
-;;;;;; org-feed-update-all) "org-feed" "org/org-feed.el" (19383
-;;;;;; 49280))
+;;;;;; org-feed-update-all) "org-feed" "org/org-feed.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from org/org-feed.el
(autoload 'org-feed-update-all "org-feed" "\
;;;***
\f
;;;### (autoloads (org-footnote-normalize org-footnote-action) "org-footnote"
-;;;;;; "org/org-footnote.el" (19383 49281))
+;;;;;; "org/org-footnote.el" (19279 5151))
;;; Generated autoloads from org/org-footnote.el
(autoload 'org-footnote-action "org-footnote" "\
;;;### (autoloads (org-freemind-to-org-mode org-freemind-from-org-sparse-tree
;;;;;; org-freemind-from-org-mode org-freemind-from-org-mode-node
;;;;;; org-freemind-show org-export-as-freemind) "org-freemind"
-;;;;;; "org/org-freemind.el" (19383 49276))
+;;;;;; "org/org-freemind.el" (19323 49698))
;;; Generated autoloads from org/org-freemind.el
(autoload 'org-export-as-freemind "org-freemind" "\
;;;### (autoloads (org-export-htmlize-generate-css org-export-as-html
;;;;;; org-export-region-as-html org-replace-region-by-html org-export-as-html-to-buffer
;;;;;; org-export-as-html-batch org-export-as-html-and-open) "org-html"
-;;;;;; "org/org-html.el" (19383 49281))
+;;;;;; "org/org-html.el" (19279 5151))
;;; Generated autoloads from org/org-html.el
(put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
\f
;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
;;;;;; org-export-icalendar-this-file) "org-icalendar" "org/org-icalendar.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-icalendar.el
(autoload 'org-export-icalendar-this-file "org-icalendar" "\
\f
;;;### (autoloads (org-id-find-id-file org-id-find org-id-goto org-id-get-with-outline-drilling
;;;;;; org-id-get-with-outline-path-completion org-id-get org-id-copy
-;;;;;; org-id-get-create) "org-id" "org/org-id.el" (19383 49281))
+;;;;;; org-id-get-create) "org-id" "org/org-id.el" (19279 5151))
;;; Generated autoloads from org/org-id.el
(autoload 'org-id-get-create "org-id" "\
;;;***
\f
;;;### (autoloads (org-indent-mode) "org-indent" "org/org-indent.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-indent.el
(autoload 'org-indent-mode "org-indent" "\
;;;***
\f
;;;### (autoloads (org-irc-store-link) "org-irc" "org/org-irc.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-irc.el
(autoload 'org-irc-store-link "org-irc" "\
;;;### (autoloads (org-export-as-pdf-and-open org-export-as-pdf org-export-as-latex
;;;;;; org-export-region-as-latex org-replace-region-by-latex org-export-as-latex-to-buffer
;;;;;; org-export-as-latex-batch) "org-latex" "org/org-latex.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-latex.el
(autoload 'org-export-as-latex-batch "org-latex" "\
;;;***
\f
;;;### (autoloads (org-mobile-create-sumo-agenda org-mobile-pull
-;;;;;; org-mobile-push) "org-mobile" "org/org-mobile.el" (19383
-;;;;;; 49281))
+;;;;;; org-mobile-push) "org-mobile" "org/org-mobile.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from org/org-mobile.el
(autoload 'org-mobile-push "org-mobile" "\
;;;***
\f
;;;### (autoloads (org-plot/gnuplot) "org-plot" "org/org-plot.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-plot.el
(autoload 'org-plot/gnuplot "org-plot" "\
\f
;;;### (autoloads (org-publish-current-project org-publish-current-file
;;;;;; org-publish-all org-publish) "org-publish" "org/org-publish.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-publish.el
(defalias 'org-publish-project 'org-publish)
\f
;;;### (autoloads (org-remember-handler org-remember org-remember-apply-template
;;;;;; org-remember-annotation org-remember-insinuate) "org-remember"
-;;;;;; "org/org-remember.el" (19383 49281))
+;;;;;; "org/org-remember.el" (19279 5151))
;;; Generated autoloads from org/org-remember.el
(autoload 'org-remember-insinuate "org-remember" "\
;;;***
\f
;;;### (autoloads (org-table-to-lisp orgtbl-mode turn-on-orgtbl)
-;;;;;; "org-table" "org/org-table.el" (19383 49281))
+;;;;;; "org-table" "org/org-table.el" (19279 5151))
;;; Generated autoloads from org/org-table.el
(autoload 'turn-on-orgtbl "org-table" "\
\f
;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region
;;;;;; org-timer org-timer-start) "org-timer" "org/org-timer.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-timer.el
(autoload 'org-timer-start "org-timer" "\
;;;***
\f
;;;### (autoloads (org-export-as-xoxo) "org-xoxo" "org/org-xoxo.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from org/org-xoxo.el
(autoload 'org-export-as-xoxo "org-xoxo" "\
;;;***
\f
;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;; (19383 49276))
+;;;;;; (19365 25156))
;;; Generated autoloads from outline.el
(put 'outline-regexp 'safe-local-variable 'string-or-null-p)
;;;***
\f
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19383 49281))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19279 5148))
;;; Generated autoloads from paren.el
(defvar show-paren-mode nil "\
;;;***
\f
;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5149))
;;; Generated autoloads from calendar/parse-time.el
(put 'parse-time-rules 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/pascal.el
(autoload 'pascal-mode "pascal" "\
;;;***
\f
+;;;### (autoloads (password-cache-expiry password-cache) "password-cache"
+;;;;;; "password-cache.el" (19365 25156))
+;;; Generated autoloads from password-cache.el
+
+(defvar password-cache t "\
+Whether to cache passwords.")
+
+(custom-autoload 'password-cache "password-cache" t)
+
+(defvar password-cache-expiry 16 "\
+How many seconds passwords are cached, or nil to disable expiring.
+Whether passwords are cached at all is controlled by `password-cache'.")
+
+(custom-autoload 'password-cache-expiry "password-cache" t)
+
+;;;***
+\f
;;;### (autoloads (pc-bindings-mode) "pc-mode" "emulation/pc-mode.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/pc-mode.el
(autoload 'pc-bindings-mode "pc-mode" "\
;;;***
\f
;;;### (autoloads (pc-selection-mode) "pc-select" "emulation/pc-select.el"
-;;;;;; (19383 49281))
+;;;;;; (19356 10801))
;;; Generated autoloads from emulation/pc-select.el
(defvar pc-selection-mode nil "\
;;;***
\f
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from pcmpl-cvs.el
(autoload 'pcomplete/cvs "pcmpl-cvs" "\
;;;***
\f
;;;### (autoloads (pcomplete/tar pcomplete/make pcomplete/bzip2 pcomplete/gzip)
-;;;;;; "pcmpl-gnu" "pcmpl-gnu.el" (19383 49281))
+;;;;;; "pcmpl-gnu" "pcmpl-gnu.el" (19279 5148))
;;; Generated autoloads from pcmpl-gnu.el
(autoload 'pcomplete/gzip "pcmpl-gnu" "\
;;;***
\f
;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
-;;;;;; "pcmpl-linux" "pcmpl-linux.el" (19383 49281))
+;;;;;; "pcmpl-linux" "pcmpl-linux.el" (19279 5148))
;;; Generated autoloads from pcmpl-linux.el
(autoload 'pcomplete/kill "pcmpl-linux" "\
;;;***
\f
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from pcmpl-rpm.el
(autoload 'pcomplete/rpm "pcmpl-rpm" "\
\f
;;;### (autoloads (pcomplete/scp pcomplete/ssh pcomplete/chgrp pcomplete/chown
;;;;;; pcomplete/which pcomplete/xargs pcomplete/rm pcomplete/rmdir
-;;;;;; pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19383 49281))
+;;;;;; pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19282 55646))
;;; Generated autoloads from pcmpl-unix.el
(autoload 'pcomplete/cd "pcmpl-unix" "\
\f
;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
;;;;;; pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
-;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19383
-;;;;;; 49281))
+;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from pcomplete.el
(autoload 'pcomplete "pcomplete" "\
\f
;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
;;;;;; cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;; "pcvs.el" (19383 49281))
+;;;;;; "pcvs.el" (19279 5148))
;;; Generated autoloads from pcvs.el
(autoload 'cvs-checkout "pcvs" "\
;;;***
\f
-;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (19383 49281))
+;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (19279 5148))
;;; Generated autoloads from pcvs-defs.el
(defvar cvs-global-menu (let ((m (make-sparse-keymap "PCL-CVS"))) (define-key m [status] `(menu-item ,(purecopy "Directory Status") cvs-status :help ,(purecopy "A more verbose status of a workarea"))) (define-key m [checkout] `(menu-item ,(purecopy "Checkout Module") cvs-checkout :help ,(purecopy "Check out a module from the repository"))) (define-key m [update] `(menu-item ,(purecopy "Update Directory") cvs-update :help ,(purecopy "Fetch updates from the repository"))) (define-key m [examine] `(menu-item ,(purecopy "Examine Directory") cvs-examine :help ,(purecopy "Examine the current state of a workarea"))) (fset 'cvs-global-menu m)))
;;;***
\f
;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/perl-mode.el
(put 'perl-indent-level 'safe-local-variable 'integerp)
(put 'perl-continued-statement-offset 'safe-local-variable 'integerp)
;;;### (autoloads (pgg-snarf-keys pgg-snarf-keys-region pgg-insert-key
;;;;;; pgg-verify pgg-verify-region pgg-sign pgg-sign-region pgg-decrypt
;;;;;; pgg-decrypt-region pgg-encrypt pgg-encrypt-symmetric pgg-encrypt-symmetric-region
-;;;;;; pgg-encrypt-region) "pgg" "pgg.el" (19383 49281))
+;;;;;; pgg-encrypt-region) "pgg" "pgg.el" (19279 5148))
;;; Generated autoloads from pgg.el
(autoload 'pgg-encrypt-region "pgg" "\
;;;***
\f
;;;### (autoloads (pgg-gpg-symmetric-key-p) "pgg-gpg" "pgg-gpg.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5148))
;;; Generated autoloads from pgg-gpg.el
(autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" "\
;;;***
\f
;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;; (19383 49281))
+;;;;;; (19356 10801))
;;; Generated autoloads from textmodes/picture.el
(autoload 'picture-mode "picture" "\
;;;***
\f
;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/po.el
(autoload 'po-find-file-coding-system "po" "\
;;;***
\f
-;;;### (autoloads (pong) "pong" "play/pong.el" (19383 49281))
+;;;### (autoloads (pong) "pong" "play/pong.el" (19279 5151))
;;; Generated autoloads from play/pong.el
(autoload 'pong "pong" "\
\f
;;;### (autoloads (pp-macroexpand-last-sexp pp-eval-last-sexp pp-macroexpand-expression
;;;;;; pp-eval-expression pp pp-buffer pp-to-string) "pp" "emacs-lisp/pp.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/pp.el
(autoload 'pp-to-string "pp" "\
;;;;;; pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
;;;;;; pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
;;;;;; pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5148))
;;; Generated autoloads from printing.el
(autoload 'pr-interface "printing" "\
;;;***
\f
-;;;### (autoloads (proced) "proced" "proced.el" (19383 49281))
+;;;### (autoloads (proced) "proced" "proced.el" (19279 5148))
;;; Generated autoloads from proced.el
(autoload 'proced "proced" "\
;;;***
\f
;;;### (autoloads (switch-to-prolog prolog-mode) "prolog" "progmodes/prolog.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/prolog.el
(autoload 'prolog-mode "prolog" "\
;;;***
\f
-;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from ps-bdf.el
(defvar bdf-directory-list (if (memq system-type '(ms-dos windows-nt)) (list (expand-file-name "fonts/bdf" installation-directory)) '("/usr/local/share/emacs/fonts/bdf")) "\
;;;***
\f
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/ps-mode.el
(autoload 'ps-mode "ps-mode" "\
;;;;;; ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
;;;;;; ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
;;;;;; ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (19383
-;;;;;; 49281))
+;;;;;; ps-page-dimensions-database) "ps-print" "ps-print.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from ps-print.el
(defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\
;;;***
\f
;;;### (autoloads (python-shell jython-mode python-mode run-python)
-;;;;;; "python" "progmodes/python.el" (19383 49284))
+;;;;;; "python" "progmodes/python.el" (19338 9841))
;;; Generated autoloads from progmodes/python.el
(add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
;;;***
\f
;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/qp.el
(autoload 'quoted-printable-decode-region "qp" "\
;;;;;; quail-defrule quail-install-decode-map quail-install-map
;;;;;; quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
;;;;;; quail-define-package quail-use-package quail-title) "quail"
-;;;;;; "international/quail.el" (19383 49281))
+;;;;;; "international/quail.el" (19279 5150))
;;; Generated autoloads from international/quail.el
(autoload 'quail-title "quail" "\
\f
;;;### (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" (19383
-;;;;;; 49281))
+;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (19279
+;;;;;; 5151))
;;; 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" "\
;;;***
\f
;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;; "net/rcirc.el" (19383 49281))
+;;;;;; "net/rcirc.el" (19279 5151))
;;; Generated autoloads from net/rcirc.el
(autoload 'rcirc "rcirc" "\
;;;***
\f
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from net/rcompile.el
(autoload 'remote-compile "rcompile" "\
;;;***
\f
;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/re-builder.el
(defalias 'regexp-builder 're-builder)
;;;***
\f
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19383 49281))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19279 5148))
;;; Generated autoloads from recentf.el
(defvar recentf-mode nil "\
;;;### (autoloads (clear-rectangle string-insert-rectangle string-rectangle
;;;;;; delete-whitespace-rectangle open-rectangle insert-rectangle
;;;;;; yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle
-;;;;;; delete-rectangle move-to-column-force) "rect" "rect.el" (19383
-;;;;;; 49281))
+;;;;;; delete-rectangle move-to-column-force) "rect" "rect.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from rect.el
(define-key ctl-x-r-map "c" 'clear-rectangle)
(define-key ctl-x-r-map "k" 'kill-rectangle)
;;;***
\f
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19279
+;;;;;; 5152))
;;; Generated autoloads from textmodes/refill.el
(autoload 'refill-mode "refill" "\
;;;***
\f
;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (19383 49281))
+;;;;;; turn-on-reftex) "reftex" "textmodes/reftex.el" (19279 5152))
;;; Generated autoloads from textmodes/reftex.el
(autoload 'turn-on-reftex "reftex" "\
;;;***
\f
;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/reftex-cite.el
(autoload 'reftex-citation "reftex-cite" "\
;;;***
\f
;;;### (autoloads (reftex-isearch-minor-mode) "reftex-global" "textmodes/reftex-global.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/reftex-global.el
(autoload 'reftex-isearch-minor-mode "reftex-global" "\
;;;***
\f
;;;### (autoloads (reftex-index-phrases-mode) "reftex-index" "textmodes/reftex-index.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/reftex-index.el
(autoload 'reftex-index-phrases-mode "reftex-index" "\
;;;***
\f
;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/reftex-parse.el
(autoload 'reftex-all-document-files "reftex-parse" "\
;;;***
\f
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19383
-;;;;;; 49285))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19370
+;;;;;; 36541))
;;; Generated autoloads from textmodes/reftex-vars.el
(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
;;;***
\f
;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/regexp-opt.el
(autoload 'regexp-opt "regexp-opt" "\
\f
;;;### (autoloads (remember-diary-extract-entries remember-clipboard
;;;;;; remember-other-frame remember) "remember" "textmodes/remember.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/remember.el
(autoload 'remember "remember" "\
;;;***
\f
-;;;### (autoloads (repeat) "repeat" "repeat.el" (19383 49281))
+;;;### (autoloads (repeat) "repeat" "repeat.el" (19279 5148))
;;; Generated autoloads from repeat.el
(autoload 'repeat "repeat" "\
;;;***
\f
;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/reporter.el
(autoload 'reporter-submit-bug-report "reporter" "\
;;;***
\f
;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5148))
;;; Generated autoloads from reposition.el
(autoload 'reposition-window "reposition" "\
;;;***
\f
;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;; (19383 49281))
+;;;;;; (19356 10801))
;;; Generated autoloads from reveal.el
(autoload 'reveal-mode "reveal" "\
;;;***
\f
;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/ring.el
(autoload 'ring-p "ring" "\
;;;***
\f
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19383 49281))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19279 5151))
;;; Generated autoloads from net/rlogin.el
(add-hook 'same-window-regexps (purecopy "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)"))
;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
;;;;;; rmail-dont-reply-to-names rmail-user-mail-address-regexp
-;;;;;; rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19383
-;;;;;; 49285))
+;;;;;; rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19370
+;;;;;; 36541))
;;; Generated autoloads from mail/rmail.el
(autoload 'rmail-movemail-variant-p "rmail" "\
;;;***
\f
;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen
-;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (19383 49281))
+;;;;;; rmail-output) "rmailout" "mail/rmailout.el" (19279 5150))
;;; Generated autoloads from mail/rmailout.el
(put 'rmail-output-file-alist 'risky-local-variable t)
;;;***
\f
;;;### (autoloads (rng-c-load-schema) "rng-cmpct" "nxml/rng-cmpct.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from nxml/rng-cmpct.el
(autoload 'rng-c-load-schema "rng-cmpct" "\
;;;***
\f
;;;### (autoloads (rng-nxml-mode-init) "rng-nxml" "nxml/rng-nxml.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from nxml/rng-nxml.el
(autoload 'rng-nxml-mode-init "rng-nxml" "\
;;;***
\f
;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from nxml/rng-valid.el
(autoload 'rng-validate-mode "rng-valid" "\
;;;***
\f
-;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from nxml/rng-xsd.el
(put 'http://www\.w3\.org/2001/XMLSchema-datatypes 'rng-dt-compile 'rng-xsd-compile)
;;;***
\f
;;;### (autoloads (robin-use-package robin-modify-package robin-define-package)
-;;;;;; "robin" "international/robin.el" (19383 49281))
+;;;;;; "robin" "international/robin.el" (19279 5150))
;;; Generated autoloads from international/robin.el
(autoload 'robin-define-package "robin" "\
;;;***
\f
;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;; rot13-string rot13) "rot13" "rot13.el" (19383 49281))
+;;;;;; rot13-string rot13) "rot13" "rot13.el" (19279 5148))
;;; Generated autoloads from rot13.el
(autoload 'rot13 "rot13" "\
;;;***
\f
;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
-;;;;;; (19383 49281))
+;;;;;; (19365 25156))
;;; Generated autoloads from textmodes/rst.el
(add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
;;;***
\f
;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
-;;;;;; (19383 49281))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/ruby-mode.el
(autoload 'ruby-mode "ruby-mode" "\
;;;***
\f
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from ruler-mode.el
(autoload 'ruler-mode "ruler-mode" "\
;;;***
\f
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19383
-;;;;;; 49281))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from emacs-lisp/rx.el
(autoload 'rx-to-string "rx" "\
;;;***
\f
;;;### (autoloads (savehist-mode savehist-mode) "savehist" "savehist.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from savehist.el
(defvar savehist-mode nil "\
;;;***
\f
;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/scheme.el
(autoload 'scheme-mode "scheme" "\
;;;***
\f
;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5150))
;;; Generated autoloads from gnus/score-mode.el
(autoload 'gnus-score-mode "score-mode" "\
;;;***
\f
;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from scroll-all.el
(defvar scroll-all-mode nil "\
;;;***
\f
;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from scroll-lock.el
(autoload 'scroll-lock-mode "scroll-lock" "\
;;;***
\f
;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;; "cedet/semantic.el" (19383 49276))
+;;;;;; "cedet/semantic.el" (19323 49698))
;;; Generated autoloads from cedet/semantic.el
(defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
;;;;;; mail-alias-file mail-default-reply-to mail-archive-file-name
;;;;;; mail-header-separator send-mail-function mail-interactive
;;;;;; mail-self-blind mail-specify-envelope-from mail-from-style)
-;;;;;; "sendmail" "mail/sendmail.el" (19383 49284))
+;;;;;; "sendmail" "mail/sendmail.el" (19338 9841))
;;; Generated autoloads from mail/sendmail.el
(defvar mail-from-style 'default "\
;;;***
\f
;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;; server-force-delete server-start) "server" "server.el" (19392
-;;;;;; 53767))
+;;;;;; server-force-delete server-start) "server" "server.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from server.el
(autoload 'server-start "server" "\
;;;***
\f
-;;;### (autoloads (ses-mode) "ses" "ses.el" (19383 49282))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (19279 5148))
;;; Generated autoloads from ses.el
(autoload 'ses-mode "ses" "\
;;;***
\f
;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;; (19383 49282))
+;;;;;; (19292 15232))
;;; Generated autoloads from textmodes/sgml-mode.el
(autoload 'sgml-mode "sgml-mode" "\
;;;***
\f
;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;; (19383 49284))
+;;;;;; (19345 41626))
;;; Generated autoloads from progmodes/sh-script.el
(put 'sh-shell 'safe-local-variable 'symbolp)
;;;***
\f
-;;;### (autoloads (sha1) "sha1" "sha1.el" (19383 49282))
+;;;### (autoloads (sha1) "sha1" "sha1.el" (19279 5148))
;;; Generated autoloads from sha1.el
(autoload 'sha1 "sha1" "\
;;;***
\f
;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/shadow.el
(autoload 'list-load-path-shadows "shadow" "\
;;;***
\f
;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;; shadow-define-cluster) "shadowfile" "shadowfile.el" (19383
-;;;;;; 49282))
+;;;;;; shadow-define-cluster) "shadowfile" "shadowfile.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from shadowfile.el
(autoload 'shadow-define-cluster "shadowfile" "\
;;;***
\f
;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from shell.el
(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
;;;***
\f
;;;### (autoloads (sieve-upload-and-bury sieve-upload sieve-manage)
-;;;;;; "sieve" "gnus/sieve.el" (19383 49282))
+;;;;;; "sieve" "gnus/sieve.el" (19279 5150))
;;; Generated autoloads from gnus/sieve.el
(autoload 'sieve-manage "sieve" "\
;;;***
\f
;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;; (19383 49282))
+;;;;;; (19365 25156))
;;; Generated autoloads from gnus/sieve-mode.el
(autoload 'sieve-mode "sieve-mode" "\
;;;***
\f
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/simula.el
(autoload 'simula-mode "simula" "\
;;;***
\f
;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new
-;;;;;; define-skeleton) "skeleton" "skeleton.el" (19383 49282))
+;;;;;; define-skeleton) "skeleton" "skeleton.el" (19279 5148))
;;; Generated autoloads from skeleton.el
(defvar skeleton-filter-function 'identity "\
;;;***
\f
;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
-;;;;;; "smerge-mode" "smerge-mode.el" (19383 49282))
+;;;;;; "smerge-mode" "smerge-mode.el" (19279 5148))
;;; Generated autoloads from smerge-mode.el
(autoload 'smerge-ediff "smerge-mode" "\
;;;***
\f
;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;; (19383 49285))
+;;;;;; (19370 36541))
;;; Generated autoloads from gnus/smiley.el
(autoload 'smiley-region "smiley" "\
;;;***
\f
;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;; "mail/smtpmail.el" (19383 49282))
+;;;;;; "mail/smtpmail.el" (19279 5150))
;;; Generated autoloads from mail/smtpmail.el
(autoload 'smtpmail-send-it "smtpmail" "\
;;;***
\f
-;;;### (autoloads (snake) "snake" "play/snake.el" (19383 49282))
+;;;### (autoloads (snake) "snake" "play/snake.el" (19279 5151))
;;; Generated autoloads from play/snake.el
(autoload 'snake "snake" "\
;;;***
\f
;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/snmp-mode.el
(autoload 'snmp-mode "snmp-mode" "\
;;;***
\f
-;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from calendar/solar.el
(autoload 'sunrise-sunset "solar" "\
;;;***
\f
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from play/solitaire.el
(autoload 'solitaire "solitaire" "\
\f
;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
;;;;;; sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;; sort-lines sort-subr) "sort" "sort.el" (19383 49282))
+;;;;;; sort-lines sort-subr) "sort" "sort.el" (19279 5148))
;;; Generated autoloads from sort.el
(put 'sort-fold-case 'safe-local-variable 'booleanp)
;;;***
\f
-;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from gnus/spam.el
(autoload 'spam-initialize "spam" "\
\f
;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
;;;;;; spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
-;;;;;; "gnus/spam-report.el" (19383 49282))
+;;;;;; "gnus/spam-report.el" (19279 5150))
;;; Generated autoloads from gnus/spam-report.el
(autoload 'spam-report-process-queue "spam-report" "\
;;;***
\f
;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;; "speedbar.el" (19383 49282))
+;;;;;; "speedbar.el" (19279 5148))
;;; Generated autoloads from speedbar.el
(defalias 'speedbar 'speedbar-frame-mode)
;;;***
\f
;;;### (autoloads (spell-string spell-region spell-word spell-buffer)
-;;;;;; "spell" "textmodes/spell.el" (19383 49282))
+;;;;;; "spell" "textmodes/spell.el" (19279 5152))
;;; Generated autoloads from textmodes/spell.el
(put 'spell-filter 'risky-local-variable t)
;;;***
\f
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from play/spook.el
(autoload 'spook "spook" "\
;;;### (autoloads (sql-linter sql-db2 sql-interbase sql-postgres
;;;;;; sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
;;;;;; sql-sybase sql-oracle sql-product-interactive sql-mode sql-help
-;;;;;; sql-add-product-keywords) "sql" "progmodes/sql.el" (19412
-;;;;;; 35030))
+;;;;;; sql-add-product-keywords) "sql" "progmodes/sql.el" (19279
+;;;;;; 5151))
;;; Generated autoloads from progmodes/sql.el
(autoload 'sql-add-product-keywords "sql" "\
defaults, if set. Additional command line parameters can be stored in
the list `sql-oracle-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
`sql-database' as defaults, if set. Additional command line parameters
can be stored in the list `sql-sybase-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
Interpreter used comes from variable `sql-informix-program'. Login uses
the variable `sql-database' as default, if set.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
`sql-server' as defaults, if set. Additional command line parameters
can be stored in the list `sql-sqlite-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
`sql-server' as defaults, if set. Additional command line parameters
can be stored in the list `sql-mysql-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
the variables `sql-user', `sql-password', and `sql-server' as
defaults, if set.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
Interpreter used comes from variable `sql-ingres-program'. Login uses
the variable `sql-database' as default, if set.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
as defaults, if set. Additional command line parameters can be stored
in the list `sql-ms-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
Additional command line parameters can be stored in the list
`sql-postgres-options'.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
uses the variables `sql-user', `sql-password', and `sql-database' as
defaults, if set.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
To specify a coding system for converting non-ASCII characters
Interpreter used comes from variable `sql-db2-program'. There is not
automatic login.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
If you use \\[sql-accumulate-and-indent] to send multiline commands to
for this to work). If `sql-password' is an empty string, inl will use
an empty password.
-The buffer is put in SQL interactive mode, giving commands for sending
+The buffer is put in sql-interactive-mode, giving commands for sending
input. See `sql-interactive-mode'.
\(Type \\[describe-mode] in the SQL buffer for a list of commands.)
;;;***
\f
;;;### (autoloads (srecode-template-mode) "srecode/srt-mode" "cedet/srecode/srt-mode.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5149))
;;; Generated autoloads from cedet/srecode/srt-mode.el
(autoload 'srecode-template-mode "srecode/srt-mode" "\
;;;;;; strokes-mode strokes-list-strokes strokes-load-user-strokes
;;;;;; strokes-help strokes-describe-stroke strokes-do-complex-stroke
;;;;;; strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke
-;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (19383
-;;;;;; 49282))
+;;;;;; strokes-global-set-stroke) "strokes" "strokes.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from strokes.el
(autoload 'strokes-global-set-stroke "strokes" "\
;;;***
\f
;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;; "studly" "play/studly.el" (19383 49282))
+;;;;;; "studly" "play/studly.el" (19256 49605))
;;; Generated autoloads from play/studly.el
(autoload 'studlify-region "studly" "\
;;;***
\f
;;;### (autoloads (global-subword-mode subword-mode) "subword" "progmodes/subword.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/subword.el
(autoload 'subword-mode "subword" "\
;;;***
\f
;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;; (19383 49282))
+;;;;;; (19365 25156))
;;; Generated autoloads from mail/supercite.el
(autoload 'sc-cite-original "supercite" "\
;;;***
\f
-;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from t-mouse.el
(define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
;;;***
\f
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19383 49282))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19279 5148))
;;; Generated autoloads from tabify.el
(autoload 'untabify "tabify" "\
;;;;;; table-recognize table-insert-row-column table-insert-column
;;;;;; table-insert-row table-insert table-point-left-cell-hook
;;;;;; table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;; "table" "textmodes/table.el" (19383 49282))
+;;;;;; "table" "textmodes/table.el" (19356 10801))
;;; Generated autoloads from textmodes/table.el
(defvar table-cell-map-hook nil "\
;;;***
\f
-;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19383 49282))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19279 5148))
;;; Generated autoloads from talk.el
(autoload 'talk-connect "talk" "\
;;;***
\f
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19383 49282))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19279 5148))
;;; Generated autoloads from tar-mode.el
(autoload 'tar-mode "tar-mode" "\
;;;***
\f
;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;; "progmodes/tcl.el" (19383 49282))
+;;;;;; "progmodes/tcl.el" (19279 5151))
;;; Generated autoloads from progmodes/tcl.el
(autoload 'tcl-mode "tcl" "\
;;;***
\f
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19383 49282))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19279 5151))
;;; Generated autoloads from net/telnet.el
(add-hook 'same-window-regexps (purecopy "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)"))
;;;***
\f
;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
-;;;;;; (19383 49282))
+;;;;;; (19292 15231))
;;; Generated autoloads from term.el
(autoload 'make-term "term" "\
;;;***
\f
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from terminal.el
(autoload 'terminal-emulator "terminal" "\
;;;***
\f
;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5149))
;;; Generated autoloads from emacs-lisp/testcover.el
(autoload 'testcover-this-defun "testcover" "\
;;;***
\f
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19383 49282))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19279 5151))
;;; Generated autoloads from play/tetris.el
(autoload 'tetris "tetris" "\
;;;;;; 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"
-;;;;;; (19387 22082))
+;;;;;; (19323 49698))
;;; Generated autoloads from textmodes/tex-mode.el
(defvar tex-shell-file-name nil "\
;;;***
\f
;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;; "texinfmt" "textmodes/texinfmt.el" (19383 49282))
+;;;;;; "texinfmt" "textmodes/texinfmt.el" (19279 5152))
;;; Generated autoloads from textmodes/texinfmt.el
(autoload 'texinfo-format-buffer "texinfmt" "\
;;;***
\f
;;;### (autoloads (texinfo-mode texinfo-close-quote texinfo-open-quote)
-;;;;;; "texinfo" "textmodes/texinfo.el" (19383 49282))
+;;;;;; "texinfo" "textmodes/texinfo.el" (19279 5152))
;;; Generated autoloads from textmodes/texinfo.el
(defvar texinfo-open-quote (purecopy "``") "\
\f
;;;### (autoloads (thai-composition-function thai-compose-buffer
;;;;;; thai-compose-string thai-compose-region) "thai-util" "language/thai-util.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5150))
;;; Generated autoloads from language/thai-util.el
(autoload 'thai-compose-region "thai-util" "\
\f
;;;### (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" (19383 49282))
+;;;;;; "thingatpt" "thingatpt.el" (19279 5148))
;;; Generated autoloads from thingatpt.el
(autoload 'forward-thing "thingatpt" "\
\f
;;;### (autoloads (thumbs-dired-setroot thumbs-dired-show thumbs-dired-show-marked
;;;;;; thumbs-show-from-dir thumbs-find-thumb) "thumbs" "thumbs.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from thumbs.el
(autoload 'thumbs-find-thumb "thumbs" "\
;;;;;; tibetan-post-read-conversion tibetan-compose-buffer tibetan-decompose-buffer
;;;;;; tibetan-decompose-string tibetan-decompose-region tibetan-compose-region
;;;;;; tibetan-compose-string tibetan-transcription-to-tibetan tibetan-tibetan-to-transcription
-;;;;;; tibetan-char-p) "tibet-util" "language/tibet-util.el" (19383
-;;;;;; 49282))
+;;;;;; tibetan-char-p) "tibet-util" "language/tibet-util.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from language/tibet-util.el
(autoload 'tibetan-char-p "tibet-util" "\
;;;***
\f
;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5152))
;;; Generated autoloads from textmodes/tildify.el
(autoload 'tildify-region "tildify" "\
\f
;;;### (autoloads (emacs-init-time emacs-uptime display-time-world
;;;;;; display-time-mode display-time display-time-day-and-date)
-;;;;;; "time" "time.el" (19383 49282))
+;;;;;; "time" "time.el" (19279 5148))
;;; Generated autoloads from time.el
(defvar display-time-day-and-date nil "\
;;;;;; time-to-day-in-year date-leap-year-p days-between date-to-day
;;;;;; time-add time-subtract time-since days-to-time time-less-p
;;;;;; seconds-to-time date-to-time) "time-date" "calendar/time-date.el"
-;;;;;; (19383 49282))
+;;;;;; (19292 15231))
;;; Generated autoloads from calendar/time-date.el
(autoload 'date-to-time "time-date" "\
;;;***
\f
;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;; "time-stamp.el" (19383 49282))
+;;;;;; "time-stamp.el" (19279 5148))
;;; Generated autoloads from time-stamp.el
(put 'time-stamp-format 'safe-local-variable 'stringp)
(put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p)
;;;;;; timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
;;;;;; timeclock-change timeclock-status-string timeclock-out timeclock-in
;;;;;; timeclock-modeline-display) "timeclock" "calendar/timeclock.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5149))
;;; Generated autoloads from calendar/timeclock.el
(autoload 'timeclock-modeline-display "timeclock" "\
;;;***
\f
;;;### (autoloads (batch-titdic-convert titdic-convert) "titdic-cnv"
-;;;;;; "international/titdic-cnv.el" (19383 49282))
+;;;;;; "international/titdic-cnv.el" (19279 5150))
;;; Generated autoloads from international/titdic-cnv.el
(autoload 'titdic-convert "titdic-cnv" "\
;;;***
\f
;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;; "tmm.el" (19383 49284))
+;;;;;; "tmm.el" (19279 5148))
;;; Generated autoloads from tmm.el
(define-key global-map "\M-`" 'tmm-menubar)
(define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
\f
;;;### (autoloads (todo-show todo-cp todo-mode todo-print todo-top-priorities
;;;;;; todo-insert-item todo-add-item-non-interactively todo-add-category)
-;;;;;; "todo-mode" "calendar/todo-mode.el" (19383 49282))
+;;;;;; "todo-mode" "calendar/todo-mode.el" (19279 5149))
;;; Generated autoloads from calendar/todo-mode.el
(autoload 'todo-add-category "todo-mode" "\
\f
;;;### (autoloads (tool-bar-local-item-from-menu tool-bar-add-item-from-menu
;;;;;; tool-bar-local-item tool-bar-add-item toggle-tool-bar-mode-from-frame)
-;;;;;; "tool-bar" "tool-bar.el" (19383 49282))
+;;;;;; "tool-bar" "tool-bar.el" (19279 5148))
;;; Generated autoloads from tool-bar.el
(autoload 'toggle-tool-bar-mode-from-frame "tool-bar" "\
;;;***
\f
;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/tpu-edt.el
(defvar tpu-edt-mode nil "\
;;;***
\f
;;;### (autoloads (tpu-mapper) "tpu-mapper" "emulation/tpu-mapper.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/tpu-mapper.el
(autoload 'tpu-mapper "tpu-mapper" "\
;;;***
\f
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19383 49282))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19279 5149))
;;; Generated autoloads from emacs-lisp/tq.el
(autoload 'tq-create "tq" "\
;;;***
\f
;;;### (autoloads (trace-function-background trace-function trace-buffer)
-;;;;;; "trace" "emacs-lisp/trace.el" (19383 49285))
+;;;;;; "trace" "emacs-lisp/trace.el" (19370 36541))
;;; Generated autoloads from emacs-lisp/trace.el
(defvar trace-buffer (purecopy "*trace-output*") "\
;;;### (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" (19383 49278))
+;;;;;; "net/tramp.el" (19370 36541))
;;; Generated autoloads from net/tramp.el
(defvar tramp-mode t "\
;;;***
\f
;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5151))
;;; Generated autoloads from net/tramp-ftp.el
(autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
;;;***
\f
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19383
-;;;;;; 49282))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19279
+;;;;;; 5148))
;;; Generated autoloads from tutorial.el
(autoload 'help-with-tutorial "tutorial" "\
;;;***
\f
;;;### (autoloads (tai-viet-composition-function) "tv-util" "language/tv-util.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5150))
;;; Generated autoloads from language/tv-util.el
(autoload 'tai-viet-composition-function "tv-util" "\
;;;***
\f
;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;; "textmodes/two-column.el" (19383 49282))
+;;;;;; "textmodes/two-column.el" (19279 5152))
;;; Generated autoloads from textmodes/two-column.el
(autoload '2C-command "two-column" () t 'keymap)
(global-set-key "\C-x6" '2C-command)
;;;;;; type-break type-break-mode type-break-keystroke-threshold
;;;;;; type-break-good-break-interval type-break-good-rest-interval
;;;;;; type-break-interval type-break-mode) "type-break" "type-break.el"
-;;;;;; (19383 49282))
+;;;;;; (19279 5148))
;;; Generated autoloads from type-break.el
(defvar type-break-mode nil "\
;;;***
\f
-;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19383 49282))
+;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19279 5150))
;;; Generated autoloads from mail/uce.el
(autoload 'uce-reply-to-uce "uce" "\
;;;;;; ucs-normalize-NFKC-string ucs-normalize-NFKC-region ucs-normalize-NFKD-string
;;;;;; ucs-normalize-NFKD-region ucs-normalize-NFC-string ucs-normalize-NFC-region
;;;;;; ucs-normalize-NFD-string ucs-normalize-NFD-region) "ucs-normalize"
-;;;;;; "international/ucs-normalize.el" (19383 49282))
+;;;;;; "international/ucs-normalize.el" (19279 5150))
;;; Generated autoloads from international/ucs-normalize.el
(autoload 'ucs-normalize-NFD-region "ucs-normalize" "\
;;;***
\f
;;;### (autoloads (ununderline-region underline-region) "underline"
-;;;;;; "textmodes/underline.el" (19383 49282))
+;;;;;; "textmodes/underline.el" (19279 5152))
;;; Generated autoloads from textmodes/underline.el
(autoload 'underline-region "underline" "\
;;;***
\f
;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/unrmail.el
(autoload 'batch-unrmail "unrmail" "\
;;;***
\f
-;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from emacs-lisp/unsafep.el
(autoload 'unsafep "unsafep" "\
;;;***
\f
;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;; "url/url.el" (19383 49283))
+;;;;;; "url/url.el" (19365 25156))
;;; Generated autoloads from url/url.el
(autoload 'url-retrieve "url" "\
;;;***
\f
;;;### (autoloads (url-register-auth-scheme url-get-authentication)
-;;;;;; "url-auth" "url/url-auth.el" (19383 49283))
+;;;;;; "url-auth" "url/url-auth.el" (19279 5152))
;;; Generated autoloads from url/url-auth.el
(autoload 'url-get-authentication "url-auth" "\
;;;***
\f
;;;### (autoloads (url-cache-expired url-cache-extract url-is-cached
-;;;;;; url-store-in-cache) "url-cache" "url/url-cache.el" (19383
-;;;;;; 49283))
+;;;;;; url-store-in-cache) "url-cache" "url/url-cache.el" (19279
+;;;;;; 5152))
;;; Generated autoloads from url/url-cache.el
(autoload 'url-store-in-cache "url-cache" "\
;;;***
\f
-;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19383 49283))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19279 5152))
;;; Generated autoloads from url/url-cid.el
(autoload 'url-cid "url-cid" "\
;;;***
\f
;;;### (autoloads (url-dav-vc-registered url-dav-supported-p) "url-dav"
-;;;;;; "url/url-dav.el" (19383 49283))
+;;;;;; "url/url-dav.el" (19279 5152))
;;; Generated autoloads from url/url-dav.el
(autoload 'url-dav-supported-p "url-dav" "\
;;;***
\f
-;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19279
+;;;;;; 5152))
;;; Generated autoloads from url/url-file.el
(autoload 'url-file "url-file" "\
;;;***
\f
;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;; "url/url-gw.el" (19383 49283))
+;;;;;; "url/url-gw.el" (19279 5152))
;;; Generated autoloads from url/url-gw.el
(autoload 'url-gateway-nslookup-host "url-gw" "\
\f
;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
;;;;;; url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5152))
;;; Generated autoloads from url/url-handlers.el
(defvar url-handler-mode nil "\
;;;***
\f
;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
-;;;;;; url-http) "url-http" "url/url-http.el" (19383 49283))
+;;;;;; url-http) "url-http" "url/url-http.el" (19372 27330))
;;; Generated autoloads from url/url-http.el
(autoload 'url-http "url-http" "\
;;;***
\f
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19383 49283))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19279 5152))
;;; Generated autoloads from url/url-irc.el
(autoload 'url-irc "url-irc" "\
;;;***
\f
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19279
+;;;;;; 5152))
;;; Generated autoloads from url/url-ldap.el
(autoload 'url-ldap "url-ldap" "\
;;;***
\f
;;;### (autoloads (url-mailto url-mail) "url-mailto" "url/url-mailto.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5152))
;;; Generated autoloads from url/url-mailto.el
(autoload 'url-mail "url-mailto" "\
;;;***
\f
;;;### (autoloads (url-data url-generic-emulator-loader url-info
-;;;;;; url-man) "url-misc" "url/url-misc.el" (19383 49283))
+;;;;;; url-man) "url-misc" "url/url-misc.el" (19279 5152))
;;; Generated autoloads from url/url-misc.el
(autoload 'url-man "url-misc" "\
;;;***
\f
;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5152))
;;; Generated autoloads from url/url-news.el
(autoload 'url-news "url-news" "\
\f
;;;### (autoloads (url-ns-user-pref url-ns-prefs isInNet isResolvable
;;;;;; dnsResolve dnsDomainIs isPlainHostName) "url-ns" "url/url-ns.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5152))
;;; Generated autoloads from url/url-ns.el
(autoload 'isPlainHostName "url-ns" "\
;;;***
\f
;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;; "url/url-parse.el" (19383 49283))
+;;;;;; "url/url-parse.el" (19279 5152))
;;; Generated autoloads from url/url-parse.el
(autoload 'url-recreate-url "url-parse" "\
;;;***
\f
;;;### (autoloads (url-setup-privacy-info) "url-privacy" "url/url-privacy.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5152))
;;; Generated autoloads from url/url-privacy.el
(autoload 'url-setup-privacy-info "url-privacy" "\
;;;;;; url-pretty-length url-strip-leading-spaces url-eat-trailing-space
;;;;;; url-get-normalized-date url-lazy-message url-normalize-url
;;;;;; url-insert-entities-in-string url-parse-args url-debug url-debug)
-;;;;;; "url-util" "url/url-util.el" (19383 49283))
+;;;;;; "url-util" "url/url-util.el" (19292 15232))
;;; Generated autoloads from url/url-util.el
(defvar url-debug nil "\
;;;***
\f
;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;; "userlock" "userlock.el" (19383 49283))
+;;;;;; "userlock" "userlock.el" (19279 5148))
;;; Generated autoloads from userlock.el
(autoload 'ask-user-about-lock "userlock" "\
\f
;;;### (autoloads (utf-7-imap-pre-write-conversion utf-7-pre-write-conversion
;;;;;; utf-7-imap-post-read-conversion utf-7-post-read-conversion)
-;;;;;; "utf-7" "international/utf-7.el" (19383 49283))
+;;;;;; "utf-7" "international/utf-7.el" (19279 5150))
;;; Generated autoloads from international/utf-7.el
(autoload 'utf-7-post-read-conversion "utf-7" "\
\f
;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
;;;;;; uudecode-decode-region-external) "uudecode" "mail/uudecode.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5150))
;;; Generated autoloads from mail/uudecode.el
(autoload 'uudecode-decode-region-external "uudecode" "\
;;;;;; vc-create-tag vc-merge vc-insert-headers vc-revision-other-window
;;;;;; vc-root-diff vc-diff vc-version-diff vc-register vc-next-action
;;;;;; vc-before-checkin-hook vc-checkin-hook vc-checkout-hook)
-;;;;;; "vc" "vc.el" (19383 49284))
+;;;;;; "vc" "vc.el" (19370 36540))
;;; Generated autoloads from vc.el
(defvar vc-checkout-hook nil "\
;;;***
\f
-;;;### (autoloads (vc-annotate) "vc-annotate" "vc-annotate.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (vc-annotate) "vc-annotate" "vc-annotate.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from vc-annotate.el
(autoload 'vc-annotate "vc-annotate" "\
;;;***
\f
-;;;### (autoloads nil "vc-arch" "vc-arch.el" (19383 49283))
+;;;### (autoloads nil "vc-arch" "vc-arch.el" (19365 25156))
;;; Generated autoloads from vc-arch.el
(defun vc-arch-registered (file)
(if (vc-find-root file "{arch}/=tagging-method")
;;;***
\f
-;;;### (autoloads nil "vc-bzr" "vc-bzr.el" (19383 49276))
+;;;### (autoloads nil "vc-bzr" "vc-bzr.el" (19370 36540))
;;; Generated autoloads from vc-bzr.el
(defconst vc-bzr-admin-dirname ".bzr" "\
;;;***
\f
-;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (19383 49276))
+;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (19365 25156))
;;; Generated autoloads from vc-cvs.el
(defun vc-cvs-registered (f)
(when (file-readable-p (expand-file-name
;;;***
\f
-;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19383 49283))
+;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19370 36540))
;;; Generated autoloads from vc-dir.el
(autoload 'vc-dir "vc-dir" "\
;;;***
\f
;;;### (autoloads (vc-do-command) "vc-dispatcher" "vc-dispatcher.el"
-;;;;;; (19383 49283))
+;;;;;; (19374 2442))
;;; Generated autoloads from vc-dispatcher.el
(autoload 'vc-do-command "vc-dispatcher" "\
;;;***
\f
-;;;### (autoloads nil "vc-git" "vc-git.el" (19400 65477))
+;;;### (autoloads nil "vc-git" "vc-git.el" (19365 25156))
;;; Generated autoloads from vc-git.el
(defun vc-git-registered (file)
"Return non-nil if FILE is registered with git."
;;;***
\f
-;;;### (autoloads nil "vc-hg" "vc-hg.el" (19405 52797))
+;;;### (autoloads nil "vc-hg" "vc-hg.el" (19370 36540))
;;; Generated autoloads from vc-hg.el
(defun vc-hg-registered (file)
"Return non-nil if FILE is registered with hg."
;;;***
\f
-;;;### (autoloads nil "vc-mtn" "vc-mtn.el" (19383 49283))
+;;;### (autoloads nil "vc-mtn" "vc-mtn.el" (19365 25156))
;;; Generated autoloads from vc-mtn.el
(defconst vc-mtn-admin-dir "_MTN")
;;;***
\f
;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc-rcs.el"
-;;;;;; (19383 49283))
+;;;;;; (19365 25156))
;;; Generated autoloads from vc-rcs.el
(defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
;;;***
\f
;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc-sccs.el"
-;;;;;; (19383 49283))
+;;;;;; (19365 25156))
;;; Generated autoloads from vc-sccs.el
(defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
;;;***
\f
-;;;### (autoloads nil "vc-svn" "vc-svn.el" (19383 49276))
+;;;### (autoloads nil "vc-svn" "vc-svn.el" (19365 25156))
;;; Generated autoloads from vc-svn.el
(defun vc-svn-registered (f)
(let ((admin-dir (cond ((and (eq system-type 'windows-nt)
;;;***
\f
;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/vera-mode.el
(add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode))
;;;***
\f
;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/verilog-mode.el
(autoload 'verilog-mode "verilog-mode" "\
;;;***
\f
;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/vhdl-mode.el
(autoload 'vhdl-mode "vhdl-mode" "\
;;;***
\f
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19383 49283))
+;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19256 49605))
;;; Generated autoloads from emulation/vi.el
(autoload 'vi-mode "vi" "\
;;;### (autoloads (viqr-pre-write-conversion viqr-post-read-conversion
;;;;;; viet-encode-viqr-buffer viet-encode-viqr-region viet-decode-viqr-buffer
;;;;;; viet-decode-viqr-region viet-encode-viscii-char) "viet-util"
-;;;;;; "language/viet-util.el" (19383 49283))
+;;;;;; "language/viet-util.el" (19279 5150))
;;; Generated autoloads from language/viet-util.el
(autoload 'viet-encode-viscii-char "viet-util" "\
;;;;;; 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" (19383 49283))
+;;;;;; "view" "view.el" (19356 10801))
;;; Generated autoloads from view.el
(defvar view-remove-frame-by-deleting t "\
;;;***
\f
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19279
+;;;;;; 5150))
;;; Generated autoloads from emulation/vip.el
(autoload 'vip-setup "vip" "\
;;;***
\f
;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/viper.el
(autoload 'toggle-viper-mode "viper" "\
;;;***
\f
;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5150))
;;; Generated autoloads from emacs-lisp/warnings.el
(defvar warning-prefix-function nil "\
;;;***
\f
;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5149))
;;; Generated autoloads from wdired.el
(autoload 'wdired-change-to-wdired-mode "wdired" "\
;;;***
\f
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19383 49283))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19279 5151))
;;; Generated autoloads from net/webjump.el
(autoload 'webjump "webjump" "\
;;;***
\f
;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5151))
;;; Generated autoloads from progmodes/which-func.el
(put 'which-func-format 'risky-local-variable t)
(put 'which-func-current 'risky-local-variable t)
;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region
;;;;;; whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options
;;;;;; global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode
-;;;;;; whitespace-mode) "whitespace" "whitespace.el" (19383 49283))
+;;;;;; whitespace-mode) "whitespace" "whitespace.el" (19356 10801))
;;; Generated autoloads from whitespace.el
(autoload 'whitespace-mode "whitespace" "\
;;;***
\f
;;;### (autoloads (widget-minor-mode widget-browse-other-window widget-browse
-;;;;;; widget-browse-at) "wid-browse" "wid-browse.el" (19383 49283))
+;;;;;; widget-browse-at) "wid-browse" "wid-browse.el" (19279 5149))
;;; Generated autoloads from wid-browse.el
(autoload 'widget-browse-at "wid-browse" "\
;;;***
\f
;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19383
-;;;;;; 49283))
+;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19356
+;;;;;; 10801))
;;; Generated autoloads from wid-edit.el
(autoload 'widgetp "wid-edit" "\
;;;***
\f
;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right
-;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (19383
-;;;;;; 49283))
+;;;;;; windmove-up windmove-left) "windmove" "windmove.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from windmove.el
(autoload 'windmove-left "windmove" "\
;;;***
\f
;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5149))
;;; Generated autoloads from winner.el
(defvar winner-mode nil "\
;;;***
\f
;;;### (autoloads (woman-find-file woman-dired-find-file woman woman-locale)
-;;;;;; "woman" "woman.el" (19383 49285))
+;;;;;; "woman" "woman.el" (19370 36540))
;;; Generated autoloads from woman.el
(defvar woman-locale nil "\
;;;***
\f
;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5150))
;;; Generated autoloads from emulation/ws-mode.el
(autoload 'wordstar-mode "ws-mode" "\
;;;***
\f
-;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19383 49283))
+;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19356 10801))
;;; Generated autoloads from net/xesam.el
(autoload 'xesam-search "xesam" "\
;;;***
\f
;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;; (19383 49283))
+;;;;;; (19279 5149))
;;; Generated autoloads from xml.el
(autoload 'xml-parse-file "xml" "\
;;;***
\f
;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
-;;;;;; "nxml/xmltok.el" (19383 49283))
+;;;;;; "nxml/xmltok.el" (19279 5151))
;;; Generated autoloads from nxml/xmltok.el
(autoload 'xmltok-get-declared-encoding-position "xmltok" "\
;;;***
\f
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19383
-;;;;;; 49283))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19279
+;;;;;; 5149))
;;; Generated autoloads from xt-mouse.el
(defvar xterm-mouse-mode nil "\
;;;***
\f
;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;; "gnus/yenc.el" (19383 49283))
+;;;;;; "gnus/yenc.el" (19279 5150))
;;; Generated autoloads from gnus/yenc.el
(autoload 'yenc-decode-region "yenc" "\
;;;***
\f
;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;; yow) "yow" "play/yow.el" (19383 49283))
+;;;;;; yow) "yow" "play/yow.el" (19279 5151))
;;; Generated autoloads from play/yow.el
(autoload 'yow "yow" "\
;;;***
\f
-;;;### (autoloads (zone) "zone" "play/zone.el" (19383 49283))
+;;;### (autoloads (zone) "zone" "play/zone.el" (19279 5151))
;;; Generated autoloads from play/zone.el
(autoload 'zone "zone" "\
;;;;;; "calc/calc-fin.el" "calc/calc-forms.el" "calc/calc-frac.el"
;;;;;; "calc/calc-funcs.el" "calc/calc-graph.el" "calc/calc-help.el"
;;;;;; "calc/calc-incom.el" "calc/calc-keypd.el" "calc/calc-lang.el"
-;;;;;; "calc/calc-macs.el" "calc/calc-map.el" "calc/calc-math.el"
-;;;;;; "calc/calc-menu.el" "calc/calc-misc.el" "calc/calc-mode.el"
-;;;;;; "calc/calc-mtx.el" "calc/calc-nlfit.el" "calc/calc-poly.el"
-;;;;;; "calc/calc-prog.el" "calc/calc-rewr.el" "calc/calc-rules.el"
-;;;;;; "calc/calc-sel.el" "calc/calc-stat.el" "calc/calc-store.el"
-;;;;;; "calc/calc-stuff.el" "calc/calc-trail.el" "calc/calc-undo.el"
-;;;;;; "calc/calc-units.el" "calc/calc-vec.el" "calc/calc-yank.el"
-;;;;;; "calc/calcalg2.el" "calc/calcalg3.el" "calc/calccomp.el"
-;;;;;; "calc/calcsel2.el" "calendar/cal-bahai.el" "calendar/cal-coptic.el"
-;;;;;; "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
-;;;;;; "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-loaddefs.el"
-;;;;;; "calendar/cal-mayan.el" "calendar/cal-menu.el" "calendar/cal-move.el"
-;;;;;; "calendar/cal-persia.el" "calendar/cal-tex.el" "calendar/cal-x.el"
-;;;;;; "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "cdl.el"
-;;;;;; "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
+;;;;;; "calc/calc-loaddefs.el" "calc/calc-macs.el" "calc/calc-map.el"
+;;;;;; "calc/calc-math.el" "calc/calc-menu.el" "calc/calc-misc.el"
+;;;;;; "calc/calc-mode.el" "calc/calc-mtx.el" "calc/calc-nlfit.el"
+;;;;;; "calc/calc-poly.el" "calc/calc-prog.el" "calc/calc-rewr.el"
+;;;;;; "calc/calc-rules.el" "calc/calc-sel.el" "calc/calc-stat.el"
+;;;;;; "calc/calc-store.el" "calc/calc-stuff.el" "calc/calc-trail.el"
+;;;;;; "calc/calc-undo.el" "calc/calc-units.el" "calc/calc-vec.el"
+;;;;;; "calc/calc-yank.el" "calc/calcalg2.el" "calc/calcalg3.el"
+;;;;;; "calc/calccomp.el" "calc/calcsel2.el" "calendar/cal-bahai.el"
+;;;;;; "calendar/cal-coptic.el" "calendar/cal-french.el" "calendar/cal-html.el"
+;;;;;; "calendar/cal-islam.el" "calendar/cal-iso.el" "calendar/cal-julian.el"
+;;;;;; "calendar/cal-loaddefs.el" "calendar/cal-mayan.el" "calendar/cal-menu.el"
+;;;;;; "calendar/cal-move.el" "calendar/cal-persia.el" "calendar/cal-tex.el"
+;;;;;; "calendar/cal-x.el" "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el"
+;;;;;; "cdl.el" "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
;;;;;; "cedet/cedet-idutils.el" "cedet/cedet.el" "cedet/ede/autoconf-edit.el"
;;;;;; "cedet/ede/cpp-root.el" "cedet/ede/dired.el" "cedet/ede/emacs.el"
-;;;;;; "cedet/ede/files.el" "cedet/ede/linux.el" "cedet/ede/locate.el"
-;;;;;; "cedet/ede/make.el" "cedet/ede/makefile-edit.el" "cedet/ede/pconf.el"
-;;;;;; "cedet/ede/pmake.el" "cedet/ede/proj-archive.el" "cedet/ede/proj-aux.el"
-;;;;;; "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el" "cedet/ede/proj-info.el"
-;;;;;; "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el" "cedet/ede/proj-prog.el"
-;;;;;; "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el" "cedet/ede/proj.el"
-;;;;;; "cedet/ede/project-am.el" "cedet/ede/shell.el" "cedet/ede/simple.el"
-;;;;;; "cedet/ede/source.el" "cedet/ede/speedbar.el" "cedet/ede/srecode.el"
-;;;;;; "cedet/ede/system.el" "cedet/ede/util.el" "cedet/inversion.el"
-;;;;;; "cedet/mode-local.el" "cedet/pulse.el" "cedet/semantic/analyze.el"
-;;;;;; "cedet/semantic/analyze/complete.el" "cedet/semantic/analyze/debug.el"
-;;;;;; "cedet/semantic/analyze/fcn.el" "cedet/semantic/analyze/refs.el"
-;;;;;; "cedet/semantic/bovine.el" "cedet/semantic/bovine/c-by.el"
-;;;;;; "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/debug.el"
-;;;;;; "cedet/semantic/bovine/el.el" "cedet/semantic/bovine/gcc.el"
-;;;;;; "cedet/semantic/bovine/make-by.el" "cedet/semantic/bovine/make.el"
-;;;;;; "cedet/semantic/bovine/scm-by.el" "cedet/semantic/bovine/scm.el"
-;;;;;; "cedet/semantic/chart.el" "cedet/semantic/complete.el" "cedet/semantic/ctxt.el"
-;;;;;; "cedet/semantic/db-debug.el" "cedet/semantic/db-ebrowse.el"
-;;;;;; "cedet/semantic/db-el.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
-;;;;;; "cedet/semantic/db-global.el" "cedet/semantic/db-javascript.el"
-;;;;;; "cedet/semantic/db-mode.el" "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
+;;;;;; "cedet/ede/files.el" "cedet/ede/linux.el" "cedet/ede/loaddefs.el"
+;;;;;; "cedet/ede/locate.el" "cedet/ede/make.el" "cedet/ede/makefile-edit.el"
+;;;;;; "cedet/ede/pconf.el" "cedet/ede/pmake.el" "cedet/ede/proj-archive.el"
+;;;;;; "cedet/ede/proj-aux.el" "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el"
+;;;;;; "cedet/ede/proj-info.el" "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el"
+;;;;;; "cedet/ede/proj-prog.el" "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el"
+;;;;;; "cedet/ede/proj.el" "cedet/ede/project-am.el" "cedet/ede/shell.el"
+;;;;;; "cedet/ede/simple.el" "cedet/ede/source.el" "cedet/ede/speedbar.el"
+;;;;;; "cedet/ede/srecode.el" "cedet/ede/system.el" "cedet/ede/util.el"
+;;;;;; "cedet/inversion.el" "cedet/mode-local.el" "cedet/pulse.el"
+;;;;;; "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
+;;;;;; "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
+;;;;;; "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
+;;;;;; "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
+;;;;;; "cedet/semantic/bovine/debug.el" "cedet/semantic/bovine/el.el"
+;;;;;; "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make-by.el"
+;;;;;; "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm-by.el"
+;;;;;; "cedet/semantic/bovine/scm.el" "cedet/semantic/chart.el"
+;;;;;; "cedet/semantic/complete.el" "cedet/semantic/ctxt.el" "cedet/semantic/db-debug.el"
+;;;;;; "cedet/semantic/db-ebrowse.el" "cedet/semantic/db-el.el"
+;;;;;; "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" "cedet/semantic/db-global.el"
+;;;;;; "cedet/semantic/db-javascript.el" "cedet/semantic/db-mode.el"
+;;;;;; "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
;;;;;; "cedet/semantic/db.el" "cedet/semantic/debug.el" "cedet/semantic/decorate.el"
;;;;;; "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el"
;;;;;; "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/ede-grammar.el"
;;;;;; "cedet/semantic/fw.el" "cedet/semantic/grammar-wy.el" "cedet/semantic/grammar.el"
;;;;;; "cedet/semantic/html.el" "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el"
;;;;;; "cedet/semantic/idle.el" "cedet/semantic/imenu.el" "cedet/semantic/java.el"
-;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/mru-bookmark.el"
-;;;;;; "cedet/semantic/sb.el" "cedet/semantic/scope.el" "cedet/semantic/senator.el"
-;;;;;; "cedet/semantic/sort.el" "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el"
-;;;;;; "cedet/semantic/symref/filter.el" "cedet/semantic/symref/global.el"
-;;;;;; "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el"
-;;;;;; "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el"
-;;;;;; "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
+;;;;;; "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/loaddefs.el"
+;;;;;; "cedet/semantic/mru-bookmark.el" "cedet/semantic/sb.el" "cedet/semantic/scope.el"
+;;;;;; "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el"
+;;;;;; "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/filter.el"
+;;;;;; "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el"
+;;;;;; "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el"
+;;;;;; "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
;;;;;; "cedet/semantic/util.el" "cedet/semantic/wisent.el" "cedet/semantic/wisent/comp.el"
;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
;;;;;; "cedet/srecode/el.el" "cedet/srecode/expandproto.el" "cedet/srecode/extract.el"
;;;;;; "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
;;;;;; "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
-;;;;;; "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/semantic.el"
-;;;;;; "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el" "cedet/srecode/table.el"
-;;;;;; "cedet/srecode/template.el" "cedet/srecode/texi.el" "cus-dep.el"
-;;;;;; "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el" "dos-vars.el"
-;;;;;; "dos-w32.el" "ediff-diff.el" "ediff-init.el" "ediff-merg.el"
-;;;;;; "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el" "electric.el"
-;;;;;; "emacs-lisp/assoc.el" "emacs-lisp/authors.el" "emacs-lisp/avl-tree.el"
-;;;;;; "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/chart.el"
-;;;;;; "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el"
-;;;;;; "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el"
-;;;;;; "emacs-lisp/cust-print.el" "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-comp.el"
-;;;;;; "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
+;;;;;; "cedet/srecode/loaddefs.el" "cedet/srecode/map.el" "cedet/srecode/mode.el"
+;;;;;; "cedet/srecode/semantic.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
+;;;;;; "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
+;;;;;; "cus-dep.el" "cus-load.el" "dframe.el" "dired-aux.el" "dired-x.el"
+;;;;;; "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
+;;;;;; "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
+;;;;;; "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+;;;;;; "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
+;;;;;; "emacs-lisp/chart.el" "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el"
+;;;;;; "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el"
+;;;;;; "emacs-lisp/cl-specs.el" "emacs-lisp/cust-print.el" "emacs-lisp/eieio-base.el"
+;;;;;; "emacs-lisp/eieio-comp.el" "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
;;;;;; "emacs-lisp/eieio-opt.el" "emacs-lisp/eieio-speedbar.el"
;;;;;; "emacs-lisp/eieio.el" "emacs-lisp/find-gc.el" "emacs-lisp/gulp.el"
;;;;;; "emacs-lisp/lisp-mnt.el" "emacs-lisp/lmenu.el" "emacs-lisp/regi.el"
;;;;;; "eshell/em-pred.el" "eshell/em-prompt.el" "eshell/em-rebind.el"
;;;;;; "eshell/em-script.el" "eshell/em-smart.el" "eshell/em-term.el"
;;;;;; "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
-;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-io.el"
-;;;;;; "eshell/esh-module.el" "eshell/esh-opt.el" "eshell/esh-proc.el"
-;;;;;; "eshell/esh-util.el" "eshell/esh-var.el" "ezimage.el" "foldout.el"
-;;;;;; "font-setting.el" "format-spec.el" "forms-d2.el" "forms-pass.el"
-;;;;;; "fringe.el" "generic-x.el" "gnus/auth-source.el" "gnus/compface.el"
-;;;;;; "gnus/gnus-async.el" "gnus/gnus-bcklg.el" "gnus/gnus-cite.el"
-;;;;;; "gnus/gnus-cus.el" "gnus/gnus-demon.el" "gnus/gnus-dup.el"
-;;;;;; "gnus/gnus-eform.el" "gnus/gnus-ems.el" "gnus/gnus-int.el"
-;;;;;; "gnus/gnus-logic.el" "gnus/gnus-mh.el" "gnus/gnus-salt.el"
-;;;;;; "gnus/gnus-score.el" "gnus/gnus-setup.el" "gnus/gnus-srvr.el"
-;;;;;; "gnus/gnus-sum.el" "gnus/gnus-topic.el" "gnus/gnus-undo.el"
-;;;;;; "gnus/gnus-util.el" "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/ietf-drums.el"
+;;;;;; "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
+;;;;;; "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
+;;;;;; "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
+;;;;;; "ezimage.el" "finder-inf.el" "foldout.el" "font-setting.el"
+;;;;;; "format-spec.el" "forms-d2.el" "forms-pass.el" "fringe.el"
+;;;;;; "generic-x.el" "gnus/auth-source.el" "gnus/compface.el" "gnus/gnus-async.el"
+;;;;;; "gnus/gnus-bcklg.el" "gnus/gnus-cite.el" "gnus/gnus-cus.el"
+;;;;;; "gnus/gnus-demon.el" "gnus/gnus-dup.el" "gnus/gnus-eform.el"
+;;;;;; "gnus/gnus-ems.el" "gnus/gnus-int.el" "gnus/gnus-logic.el"
+;;;;;; "gnus/gnus-mh.el" "gnus/gnus-salt.el" "gnus/gnus-score.el"
+;;;;;; "gnus/gnus-setup.el" "gnus/gnus-srvr.el" "gnus/gnus-sum.el"
+;;;;;; "gnus/gnus-topic.el" "gnus/gnus-undo.el" "gnus/gnus-util.el"
+;;;;;; "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/ietf-drums.el"
;;;;;; "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el" "gnus/mail-prsvr.el"
;;;;;; "gnus/mail-source.el" "gnus/mailcap.el" "gnus/messcompat.el"
;;;;;; "gnus/mm-bodies.el" "gnus/mm-decode.el" "gnus/mm-encode.el"
;;;;;; "gnus/rfc2047.el" "gnus/rfc2104.el" "gnus/rfc2231.el" "gnus/sieve-manage.el"
;;;;;; "gnus/smime.el" "gnus/spam-stat.el" "gnus/spam-wash.el" "gnus/starttls.el"
;;;;;; "gnus/utf7.el" "gnus/webmail.el" "hex-util.el" "hfy-cmap.el"
-;;;;;; "ibuf-ext.el" "international/charprop.el" "international/cp51932.el"
-;;;;;; "international/eucjp-ms.el" "international/fontset.el" "international/iso-ascii.el"
-;;;;;; "international/ja-dic-cnv.el" "international/ja-dic-utl.el"
-;;;;;; "international/ogonek.el" "international/uni-bidi.el" "international/uni-category.el"
-;;;;;; "international/uni-combining.el" "international/uni-comment.el"
-;;;;;; "international/uni-decimal.el" "international/uni-decomposition.el"
-;;;;;; "international/uni-digit.el" "international/uni-lowercase.el"
-;;;;;; "international/uni-mirrored.el" "international/uni-name.el"
-;;;;;; "international/uni-numeric.el" "international/uni-old-name.el"
-;;;;;; "international/uni-titlecase.el" "international/uni-uppercase.el"
-;;;;;; "json.el" "kermit.el" "language/hanja-util.el" "language/thai-word.el"
-;;;;;; "ldefs-boot.el" "mail/blessmail.el" "mail/mailheader.el"
-;;;;;; "mail/mailpost.el" "mail/mspools.el" "mail/rfc2368.el" "mail/rfc822.el"
-;;;;;; "mail/rmail-spam-filter.el" "mail/rmailedit.el" "mail/rmailkwd.el"
-;;;;;; "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el"
-;;;;;; "mail/rmailsum.el" "mail/undigest.el" "md4.el" "mh-e/mh-acros.el"
-;;;;;; "mh-e/mh-alias.el" "mh-e/mh-buffers.el" "mh-e/mh-compat.el"
-;;;;;; "mh-e/mh-funcs.el" "mh-e/mh-gnus.el" "mh-e/mh-identity.el"
-;;;;;; "mh-e/mh-inc.el" "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el"
+;;;;;; "htmlfontify.el" "ibuf-ext.el" "international/charprop.el"
+;;;;;; "international/cp51932.el" "international/eucjp-ms.el" "international/fontset.el"
+;;;;;; "international/iso-ascii.el" "international/ja-dic-cnv.el"
+;;;;;; "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el"
+;;;;;; "international/uni-category.el" "international/uni-combining.el"
+;;;;;; "international/uni-comment.el" "international/uni-decimal.el"
+;;;;;; "international/uni-decomposition.el" "international/uni-digit.el"
+;;;;;; "international/uni-lowercase.el" "international/uni-mirrored.el"
+;;;;;; "international/uni-name.el" "international/uni-numeric.el"
+;;;;;; "international/uni-old-name.el" "international/uni-titlecase.el"
+;;;;;; "international/uni-uppercase.el" "json.el" "kermit.el" "language/hanja-util.el"
+;;;;;; "language/thai-word.el" "ldefs-boot.el" "mail/blessmail.el"
+;;;;;; "mail/mailheader.el" "mail/mailpost.el" "mail/mspools.el"
+;;;;;; "mail/rfc2368.el" "mail/rfc822.el" "mail/rmail-spam-filter.el"
+;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el"
+;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el"
+;;;;;; "mail/undigest.el" "md4.el" "mh-e/mh-acros.el" "mh-e/mh-alias.el"
+;;;;;; "mh-e/mh-buffers.el" "mh-e/mh-compat.el" "mh-e/mh-funcs.el"
+;;;;;; "mh-e/mh-gnus.el" "mh-e/mh-identity.el" "mh-e/mh-inc.el"
+;;;;;; "mh-e/mh-junk.el" "mh-e/mh-letter.el" "mh-e/mh-limit.el"
;;;;;; "mh-e/mh-loaddefs.el" "mh-e/mh-mime.el" "mh-e/mh-print.el"
;;;;;; "mh-e/mh-scan.el" "mh-e/mh-search.el" "mh-e/mh-seq.el" "mh-e/mh-show.el"
;;;;;; "mh-e/mh-speed.el" "mh-e/mh-thread.el" "mh-e/mh-tool-bar.el"
;;;;;; "net/hmac-def.el" "net/hmac-md5.el" "net/imap-hash.el" "net/imap.el"
;;;;;; "net/ldap.el" "net/mairix.el" "net/netrc.el" "net/newsticker.el"
;;;;;; "net/ntlm.el" "net/sasl-cram.el" "net/sasl-digest.el" "net/sasl-ntlm.el"
-;;;;;; "net/sasl.el" "net/socks.el" "net/tls.el" "net/tramp-cache.el"
-;;;;;; "net/tramp-cmds.el" "net/tramp-compat.el" "net/tramp-fish.el"
-;;;;;; "net/tramp-gvfs.el" "net/tramp-gw.el" "net/tramp-imap.el"
-;;;;;; "net/tramp-smb.el" "net/tramp-uu.el" "net/trampver.el" "net/zeroconf.el"
-;;;;;; "nxml/nxml-enc.el" "nxml/nxml-maint.el" "nxml/nxml-ns.el"
-;;;;;; "nxml/nxml-outln.el" "nxml/nxml-parse.el" "nxml/nxml-rap.el"
-;;;;;; "nxml/nxml-util.el" "nxml/rng-dt.el" "nxml/rng-loc.el" "nxml/rng-maint.el"
-;;;;;; "nxml/rng-match.el" "nxml/rng-parse.el" "nxml/rng-pttrn.el"
-;;;;;; "nxml/rng-uri.el" "nxml/rng-util.el" "nxml/xsd-regexp.el"
-;;;;;; "org/org-bibtex.el" "org/org-colview.el" "org/org-compat.el"
-;;;;;; "org/org-crypt.el" "org/org-datetree.el" "org/org-exp-blocks.el"
-;;;;;; "org/org-faces.el" "org/org-gnus.el" "org/org-habit.el" "org/org-info.el"
-;;;;;; "org/org-inlinetask.el" "org/org-install.el" "org/org-jsinfo.el"
-;;;;;; "org/org-list.el" "org/org-mac-message.el" "org/org-macs.el"
-;;;;;; "org/org-mew.el" "org/org-mhe.el" "org/org-mouse.el" "org/org-protocol.el"
+;;;;;; "net/sasl.el" "net/secrets.el" "net/socks.el" "net/tls.el"
+;;;;;; "net/tramp-cache.el" "net/tramp-cmds.el" "net/tramp-compat.el"
+;;;;;; "net/tramp-fish.el" "net/tramp-gvfs.el" "net/tramp-gw.el"
+;;;;;; "net/tramp-imap.el" "net/tramp-smb.el" "net/tramp-uu.el"
+;;;;;; "net/trampver.el" "net/zeroconf.el" "nxml/nxml-enc.el" "nxml/nxml-maint.el"
+;;;;;; "nxml/nxml-ns.el" "nxml/nxml-outln.el" "nxml/nxml-parse.el"
+;;;;;; "nxml/nxml-rap.el" "nxml/nxml-util.el" "nxml/rng-dt.el" "nxml/rng-loc.el"
+;;;;;; "nxml/rng-maint.el" "nxml/rng-match.el" "nxml/rng-parse.el"
+;;;;;; "nxml/rng-pttrn.el" "nxml/rng-uri.el" "nxml/rng-util.el"
+;;;;;; "nxml/xsd-regexp.el" "org/org-bibtex.el" "org/org-colview.el"
+;;;;;; "org/org-compat.el" "org/org-crypt.el" "org/org-datetree.el"
+;;;;;; "org/org-exp-blocks.el" "org/org-faces.el" "org/org-gnus.el"
+;;;;;; "org/org-habit.el" "org/org-info.el" "org/org-inlinetask.el"
+;;;;;; "org/org-install.el" "org/org-jsinfo.el" "org/org-list.el"
+;;;;;; "org/org-mac-message.el" "org/org-macs.el" "org/org-mew.el"
+;;;;;; "org/org-mhe.el" "org/org-mouse.el" "org/org-protocol.el"
;;;;;; "org/org-rmail.el" "org/org-src.el" "org/org-vm.el" "org/org-w3m.el"
-;;;;;; "org/org-wl.el" "password-cache.el" "patcomp.el" "pcvs-info.el"
-;;;;;; "pcvs-parse.el" "pcvs-util.el" "pgg-def.el" "pgg-parse.el"
-;;;;;; "pgg-pgp.el" "pgg-pgp5.el" "play/gamegrid.el" "play/gametree.el"
-;;;;;; "play/meese.el" "progmodes/ada-prj.el" "progmodes/cc-align.el"
-;;;;;; "progmodes/cc-awk.el" "progmodes/cc-bytecomp.el" "progmodes/cc-cmds.el"
-;;;;;; "progmodes/cc-defs.el" "progmodes/cc-fonts.el" "progmodes/cc-langs.el"
-;;;;;; "progmodes/cc-menus.el" "progmodes/ebnf-abn.el" "progmodes/ebnf-bnf.el"
-;;;;;; "progmodes/ebnf-dtd.el" "progmodes/ebnf-ebx.el" "progmodes/ebnf-iso.el"
-;;;;;; "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el" "progmodes/idlw-complete-structtag.el"
-;;;;;; "progmodes/idlw-help.el" "progmodes/idlw-toolbar.el" "progmodes/mantemp.el"
-;;;;;; "progmodes/xscheme.el" "ps-def.el" "ps-mule.el" "ps-samp.el"
-;;;;;; "s-region.el" "saveplace.el" "sb-image.el" "scroll-bar.el"
-;;;;;; "select.el" "soundex.el" "subdirs.el" "tempo.el" "textmodes/bib-mode.el"
-;;;;;; "textmodes/makeinfo.el" "textmodes/page-ext.el" "textmodes/refbib.el"
-;;;;;; "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
-;;;;;; "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
-;;;;;; "textmodes/texnfo-upd.el" "timezone.el" "tooltip.el" "tree-widget.el"
-;;;;;; "uniquify.el" "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
-;;;;;; "url/url-expand.el" "url/url-ftp.el" "url/url-history.el"
-;;;;;; "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
-;;;;;; "url/url-vars.el" "vc-dav.el" "vcursor.el" "vt-control.el"
-;;;;;; "vt100-led.el" "w32-fns.el" "w32-vars.el" "x-dnd.el") (19428
-;;;;;; 55161 909254))
+;;;;;; "org/org-wl.el" "patcomp.el" "pcvs-info.el" "pcvs-parse.el"
+;;;;;; "pcvs-util.el" "pgg-def.el" "pgg-parse.el" "pgg-pgp.el" "pgg-pgp5.el"
+;;;;;; "play/gamegrid.el" "play/gametree.el" "play/meese.el" "progmodes/ada-prj.el"
+;;;;;; "progmodes/cc-align.el" "progmodes/cc-awk.el" "progmodes/cc-bytecomp.el"
+;;;;;; "progmodes/cc-cmds.el" "progmodes/cc-defs.el" "progmodes/cc-fonts.el"
+;;;;;; "progmodes/cc-langs.el" "progmodes/cc-menus.el" "progmodes/ebnf-abn.el"
+;;;;;; "progmodes/ebnf-bnf.el" "progmodes/ebnf-dtd.el" "progmodes/ebnf-ebx.el"
+;;;;;; "progmodes/ebnf-iso.el" "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el"
+;;;;;; "progmodes/idlw-complete-structtag.el" "progmodes/idlw-help.el"
+;;;;;; "progmodes/idlw-toolbar.el" "progmodes/mantemp.el" "progmodes/xscheme.el"
+;;;;;; "ps-def.el" "ps-mule.el" "ps-samp.el" "saveplace.el" "sb-image.el"
+;;;;;; "scroll-bar.el" "select.el" "soundex.el" "subdirs.el" "tempo.el"
+;;;;;; "textmodes/bib-mode.el" "textmodes/makeinfo.el" "textmodes/page-ext.el"
+;;;;;; "textmodes/refbib.el" "textmodes/refer.el" "textmodes/reftex-auc.el"
+;;;;;; "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
+;;;;;; "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el" "timezone.el"
+;;;;;; "tooltip.el" "tree-widget.el" "uniquify.el" "url/url-about.el"
+;;;;;; "url/url-cookie.el" "url/url-dired.el" "url/url-expand.el"
+;;;;;; "url/url-ftp.el" "url/url-history.el" "url/url-imap.el" "url/url-methods.el"
+;;;;;; "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "vc-dav.el"
+;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el"
+;;;;;; "w32-vars.el" "x-dnd.el") (19375 51700 955763))
;;;***
\f
(equal (nth 3 command-line-args) "unidata-gen.el")
(equal (nth 4 command-line-args) "unidata-gen-files")
;; In case CANNOT_DUMP.
- (equal (nth 0 command-line-args) "../src/bootstrap-emacs"))
+ (string-match "src/bootstrap-emacs" (nth 0 command-line-args)))
(let ((dir (car load-path)))
;; We'll probably overflow the pure space.
(setq purify-flag nil)
(expand-file-name "international" dir)
(expand-file-name "textmodes" dir)))))
+(if (eq t purify-flag)
+ ;; Hash consing saved around 11% of pure space in my tests.
+ (setq purify-flag (make-hash-table :test 'equal)))
+
(message "Using load-path %s" load-path)
(if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
(load "dnd")
(load "tool-bar")))
-(if (or (featurep 'system-font-setting) (featurep 'font-render-setting))
- (load "font-setting"))
+(if (featurep 'dynamic-setting)
+ (load "dynamic-setting"))
(if (featurep 'x)
(progn
;; At this point, we're ready to resume undo recording for scratch.
(buffer-enable-undo "*scratch*")
+;; Avoid error if user loads some more libraries now and make sure the
+;; hash-consing hash table is GC'd.
+(setq purify-flag nil)
+
(if (null (garbage-collect))
(setq pure-space-overflow t))
(add-name-to-file "emacs" name t)))
(kill-emacs)))
-;; Avoid error if user loads some more libraries now.
-(setq purify-flag nil)
-
;; For machines with CANNOT_DUMP defined in config.h,
;; this file must be loaded each time Emacs is run.
;; So run the startup code now. First, remove `-l loadup' from args.
(locate-do-setup search-string)
))
(and (not (string-equal (buffer-name) locate-buffer-name))
- (switch-to-buffer-other-window locate-buffer-name))
+ (pop-to-buffer locate-buffer-name))
(run-hooks 'dired-mode-hook)
(dired-next-line 3) ;move to first matching file.
:type 'boolean)
(defcustom log-edit-hook '(log-edit-insert-cvs-template
+ log-edit-show-files
log-edit-insert-changelog)
"Hook run at the end of `log-edit'."
:group 'log-edit
(defvar log-edit-callback nil)
(defvar log-edit-diff-function nil)
(defvar log-edit-listfun nil)
+
(defvar log-edit-parent-buffer nil)
;;; Originally taken from VC-Log mode
;;; Actual code
;;;
+(defface log-edit-summary '((t :inherit font-lock-function-name-face))
+ "Face for the summary in `log-edit-mode' buffers.")
+
+(defface log-edit-header '((t :inherit font-lock-keyword-face))
+ "Face for the headers in `log-edit-mode' buffers.")
+
+(defface log-edit-unknown-header '((t :inherit font-lock-comment-face))
+ "Face for unknown headers in `log-edit-mode' buffers.")
+
+(defvar log-edit-headers-alist '(("Summary" . log-edit-summary)
+ ("Fixes") ("Author"))
+ "AList of known headers and the face to use to highlight them.")
+
+(defconst log-edit-header-contents-regexp
+ "[ \t]*\\(.*\\(\n[ \t].*\\)*\\)\n?")
+
+(defun log-edit-match-to-eoh (limit)
+ ;; FIXME: copied from message-match-to-eoh.
+ (let ((start (point)))
+ (rfc822-goto-eoh)
+ ;; Typical situation: some temporary change causes the header to be
+ ;; incorrect, so EOH comes earlier than intended: the last lines of the
+ ;; intended headers are now not considered part of the header any more,
+ ;; so they don't have the multiline property set. When the change is
+ ;; completed and the header has its correct shape again, the lack of the
+ ;; multiline property means we won't rehighlight the last lines of
+ ;; the header.
+ (if (< (point) start)
+ nil ;No header within start..limit.
+ ;; Here we disregard LIMIT so that we may extend the area again.
+ (set-match-data (list start (point)))
+ (point))))
+
(defvar log-edit-font-lock-keywords
- '(("\\`\\(Summary:\\)\\(.*\\)"
- (1 font-lock-keyword-face)
- (2 font-lock-function-name-face))))
+ ;; Copied/inspired by message-font-lock-keywords.
+ `((log-edit-match-to-eoh
+ (,(concat "^\\(\\([a-z]+\\):\\)" log-edit-header-contents-regexp
+ "\\|\\(.*\\)")
+ (progn (goto-char (match-beginning 0)) (match-end 0)) nil
+ (1 (if (assoc (match-string 2) log-edit-headers-alist)
+ 'log-edit-header
+ 'log-edit-unknown-header)
+ nil lax)
+ (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist))
+ 'log-edit-header)
+ nil lax)
+ (4 font-lock-warning-face)))))
;;;###autoload
-(defun log-edit (callback &optional setup params buffer &rest ignore)
+(defun log-edit (callback &optional setup params buffer mode &rest ignore)
"Setup a buffer to enter a log message.
-\\<log-edit-mode-map>The buffer will be put in `log-edit-mode'.
+\\<log-edit-mode-map>The buffer will be put in mode MODE or `log-edit-mode'
+if MODE is nil.
If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run.
Mark and point will be set around the entire contents of the buffer so
that it is easy to kill the contents of the buffer with \\[kill-region].
(if buffer (pop-to-buffer buffer))
(when (and log-edit-setup-invert (not (eq setup 'force)))
(setq setup (not setup)))
- (when setup (erase-buffer))
- (log-edit-mode)
+ (when setup
+ (erase-buffer)
+ (insert "Summary: ")
+ (save-excursion (insert "\n\n")))
+ (if mode
+ (funcall mode)
+ (log-edit-mode))
(set (make-local-variable 'log-edit-callback) callback)
(if (listp params)
(dolist (crt params)
\\{log-edit-mode-map}"
(set (make-local-variable 'font-lock-defaults)
- '(log-edit-font-lock-keywords t))
- (make-local-variable 'log-edit-comment-ring-index))
+ '(log-edit-font-lock-keywords t t))
+ (make-local-variable 'log-edit-comment-ring-index)
+ (hack-dir-local-variables-non-file-buffer))
(defun log-edit-hide-buf (&optional buf where)
(when (setq buf (get-buffer (or buf log-edit-files-buf)))
"Finish editing the log message and commit the files.
If you want to abort the commit, simply delete the buffer."
(interactive)
+ ;; Clean up empty headers.
+ (goto-char (point-min))
+ (while (looking-at (concat "^[a-z]*:" log-edit-header-contents-regexp))
+ (let ((beg (match-beginning 0)))
+ (goto-char (match-end 0))
+ (if (string-match "\\`[ \n\t]*\\'" (match-string 1))
+ (delete-region beg (point)))))
+ ;; Get rid of leading empty lines.
+ (goto-char (point-min))
+ (when (looking-at "\\([ \t]*\n\\)+")
+ (delete-region (match-beginning 0) (match-end 0)))
;; Get rid of trailing empty lines
(goto-char (point-max))
(skip-syntax-backward " ")
"(Un)Indent the current buffer rigidly to `log-edit-common-indent'."
(save-excursion
(let ((common (point-max)))
- (goto-char (point-min))
+ (rfc822-goto-eoh)
(while (< (point) (point-max))
(if (not (looking-at "^[ \t]*$"))
(setq common (min common (current-indentation))))
(forward-line 1))
- (indent-rigidly (point-min) (point-max)
+ (rfc822-goto-eoh)
+ (indent-rigidly (point) (point-max)
(- log-edit-common-indent common)))))
(defun log-edit-show-diff ()
or if the command is repeated a second time in a row, use the first log entry
regardless of user name or time."
(interactive "P")
+ (let ((eoh (save-excursion (rfc822-goto-eoh) (point))))
+ (when (<= (point) eoh)
+ (goto-char eoh)
+ (if (looking-at "\n") (forward-char 1))))
(let ((log-edit-changelog-use-first
(or use-first (eq last-command 'log-edit-insert-changelog))))
(log-edit-insert-changelog-entries (log-edit-files)))
(log-edit-changelog-insert-entries (car buffer-entry) (cdr buffer-entry))
(when (cdr buffer-entry) (newline)))))
+(defun log-edit-extract-headers (headers comment)
+ "Extract headers from COMMENT to form command line arguments.
+HEADERS should be an alist with elements of the form (HEADER . CMDARG)
+associating header names to the corresponding cmdline option name and the
+result is then a list of the form (MSG CMDARG1 HDRTEXT1 CMDARG2 HDRTEXT2...).
+where MSG is the remaining text from STRING.
+If \"Summary\" is not in HEADERS, then the \"Summary\" header is extracted
+anyway and put back as the first line of MSG."
+ (with-temp-buffer
+ (insert comment)
+ (rfc822-goto-eoh)
+ (narrow-to-region (point-min) (point))
+ (let ((case-fold-search t)
+ (summary ())
+ (res ()))
+ (dolist (header (if (assoc "Summary" headers) headers
+ (cons '("Summary" . t) headers)))
+ (goto-char (point-min))
+ (while (re-search-forward (concat "^" (car header)
+ ":" log-edit-header-contents-regexp)
+ nil t)
+ (if (eq t (cdr header))
+ (setq summary (match-string 1))
+ (push (match-string 1) res)
+ (push (or (cdr header) (car header)) res))
+ (replace-match "" t t)))
+ ;; Remove header separator if the header is empty.
+ (widen)
+ (goto-char (point-min))
+ (when (looking-at "\\([ \t]*\n\\)+")
+ (delete-region (match-beginning 0) (match-end 0)))
+ (if summary (insert summary "\n"))
+ (cons (buffer-string) res))))
+
(provide 'log-edit)
;; arch-tag: 8089b39c-983b-4e83-93cd-ed0a64c7fdcc
;; 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
-;; Keywords: rcs sccs cvs log version-control tools
+;; Keywords: rcs, sccs, cvs, log, version control, tools
;; This file is part of GNU Emacs.
'log-view-beginning-of-defun)
(set (make-local-variable 'end-of-defun-function)
'log-view-end-of-defun)
- (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap))
+ (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap)
+ (hack-dir-local-variables-non-file-buffer))
;;;;
;;;; Navigation
(goto-char start)
(when (re-search-forward binhex-begin-line end t)
(setq work-buffer (generate-new-buffer " *binhex-work*"))
- (with-current-buffer work-buffer (set-buffer-multibyte nil))
+ (unless (featurep 'xemacs)
+ (with-current-buffer work-buffer (set-buffer-multibyte nil)))
(beginning-of-line)
(setq bits 0 counter 0)
(while tmp
:group 'maint
:group 'mail)
+(define-obsolete-variable-alias 'report-emacs-bug-pretest-address
+ 'report-emacs-bug-address "24.1")
+
(defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org"
"Address of mailing list for GNU Emacs bugs."
:group 'emacsbug
:type 'string)
-(defcustom report-emacs-bug-pretest-address "bug-gnu-emacs@gnu.org"
- "Address of mailing list for GNU Emacs pretest bugs."
- :group 'emacsbug
- :type 'string
- :version "23.2") ; emacs-pretest-bug -> bug-gnu-emacs
-
(defcustom report-emacs-bug-no-confirmation nil
"If non-nil, suppress the confirmations asked for the sake of novice users."
:group 'emacsbug
(declare-function x-server-vendor "xfns.c" (&optional terminal))
(declare-function x-server-version "xfns.c" (&optional terminal))
(declare-function message-sort-headers "message" ())
+(defvar message-strip-special-text-properties)
;;;###autoload
(defun report-emacs-bug (topic &optional recent-keys)
(setq topic (concat emacs-version "; " topic))
(when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
(setq topic (concat (match-string 1 emacs-version) "; " topic))))
- ;; If there are four numbers in emacs-version (three for MS-DOS),
- ;; this is a pretest version.
- (let* ((pretest-p (string-match (if (eq system-type 'ms-dos)
- "\\..*\\."
- "\\..*\\..*\\.")
- emacs-version))
- (from-buffer (current-buffer))
- (reporting-address (if pretest-p
- report-emacs-bug-pretest-address
- report-emacs-bug-address))
- ;; Put these properties on semantically-void text.
- ;; report-emacs-bug-hook deletes these regions before sending.
- (prompt-properties '(field emacsbug-prompt
- intangible but-helpful
- rear-nonsticky t))
- user-point message-end-point)
+ (let ((from-buffer (current-buffer))
+ ;; Put these properties on semantically-void text.
+ ;; report-emacs-bug-hook deletes these regions before sending.
+ (prompt-properties '(field emacsbug-prompt
+ intangible but-helpful
+ rear-nonsticky t))
+ user-point message-end-point)
(setq message-end-point
(with-current-buffer (get-buffer-create "*Messages*")
(point-max-marker)))
- (compose-mail reporting-address topic)
+ (compose-mail report-emacs-bug-address topic)
;; The rest of this does not execute if the user was asked to
;; confirm and said no.
- ;; Message-mode sorts the headers before sending. We sort now so
- ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
- (if (eq major-mode 'message-mode)
- (message-sort-headers))
+ (when (eq major-mode 'message-mode)
+ ;; Message-mode sorts the headers before sending. We sort now so
+ ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
+ (message-sort-headers)
+ ;; Stop message-mode stealing the properties we will add.
+ (set (make-local-variable 'message-strip-special-text-properties) nil))
(rfc822-goto-eoh)
(forward-line 1)
(let ((signature (buffer-substring (point) (point-max))))
(backward-char (length signature)))
(unless report-emacs-bug-no-explanations
;; Insert warnings for novice users.
- (when (string-match "@gnu\\.org$" reporting-address)
+ (when (string-match "@gnu\\.org$" report-emacs-bug-address)
(insert "This bug report will be sent to the Free Software Foundation,\n")
(let ((pos (point)))
(insert "not to your local site managers!")
(insert " if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.\n\n")
(insert (format "Your bug report will be posted to the %s mailing list"
- reporting-address))
- ;; Nowadays all bug reports end up there.
-;;; (if pretest-p (insert ".\n\n")
+ report-emacs-bug-address))
(insert ",\nand to the gnu.emacs.bug news group.\n\n"))
(insert "Please describe exactly what actions triggered the bug\n"
"and the precise symptoms of the bug. If you can, give\n"
"a recipe starting from `emacs -Q':\n\n")
- ;; Stop message-mode stealing the properties we are about to add.
- (if (boundp 'message-strip-special-text-properties)
- (set (make-local-variable 'message-strip-special-text-properties) nil))
(add-text-properties (save-excursion
(rfc822-goto-eoh)
(line-beginning-position 2))
;;; hashcash.el --- Add hashcash payments to email
-;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation
+;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
+;; Free Software Foundation
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: Paul Foley <mycroft@actrix.gen.nz>
(require 'mail-utils)
(eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
-
(if (fboundp 'point-at-bol)
(defalias 'hashcash-point-at-bol 'point-at-bol)
(defalias 'hashcash-point-at-bol 'line-beginning-position))
(concat (match-string 1 addr) (match-string 2 addr))
addr))
-(declare-function message-narrow-to-headers-or-head "message" ())
-(declare-function message-fetch-field "message" (header &optional not-all))
-(declare-function message-goto-eoh "message" ())
-(declare-function message-narrow-to-headers "message" ())
+(declare-function message-narrow-to-headers-or-head "message" ())
+(declare-function message-fetch-field "message" (header &optional not-all))
+(declare-function message-goto-eoh "message" ())
+(declare-function message-narrow-to-headers "message" ())
(defun hashcash-token-substring ()
(save-excursion
"Ask user whether to wait for hashcash processes to finish."
(interactive)
(when (hashcash-processes-running-p (current-buffer))
- (if (y-or-n-p
+ (if (y-or-n-p
"Hashcash process(es) still running; wait for them to finish? ")
(hashcash-wait-async)
(hashcash-cancel-async))))
(defgroup metamail nil
"Metamail interface for Emacs."
:group 'mail
- :group 'hypermedia
:group 'processes)
(defcustom metamail-program-name "metamail"
\f
(require 'regi)
-(require 'sendmail) ;; For mail-header-end.
;; start user configuration variables
;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
"Does nothing. Use this instead of nil to get a blank header."
())
-(defun sc-no-blank-line-or-header()
+(declare-function mh-in-header-p "mh-utils" ())
+
+(defun sc-no-blank-line-or-header ()
"Similar to `sc-no-header' except it removes the preceding blank line."
- (if (not (bobp))
- (if (and (eolp)
- (progn (forward-line -1)
- (or (= (point) (mail-header-end))
- (and (eq major-mode 'mh-letter-mode)
- (with-no-warnings
- (mh-in-header-p))))))
- (progn (forward-line)
- (let ((kill-lines-magic t))
- (kill-line))))))
+ (and (not (bobp))
+ (eolp)
+ (progn (forward-line -1)
+ (or (= (point)
+ (save-excursion
+ (rfc822-goto-eoh)
+ (line-beginning-position 2)))
+ (and (eq major-mode 'mh-letter-mode)
+ (mh-in-header-p))))
+ (progn
+ (forward-line)
+ (kill-line))))
(defun sc-header-on-said ()
"\"On <date>, <from> said:\" unless:
(cadr err) sc-eref-style)
(beep))))))
-(defun sc-electric-mode (&optional arg)
- "
-Mode for viewing Supercite reference headers. Commands are:
+(defun sc-electric-mode (&optional style)
+ "Mode for viewing Supercite reference headers. Commands are:
\n\\{sc-electric-mode-map}
`sc-electric-mode' is not intended to be run interactively, but rather
accessed through Supercite's electric reference feature. See
-`sc-insert-reference' for more details. Optional ARG is the initial
+`sc-insert-reference' for more details. Optional STYLE is the initial
header style to use, unless not supplied or invalid, in which case
`sc-preferred-header-style' is used."
(let ((info sc-mail-info))
(setq sc-eref-style
- (or (sc-valid-index-p arg)
+ (or (sc-valid-index-p style)
(sc-valid-index-p sc-preferred-header-style)
0))
(skip-chars-forward non-data-chars end))
(if file-name
(with-temp-file file-name
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert (apply 'concat (nreverse result))))
(or (markerp end) (setq end (set-marker (make-marker) end)))
(goto-char start)
:type '(repeat string)
:group 'man)
+(defcustom Man-name-local-regexp (concat "^" (regexp-opt '("NOM" "NAME")) "$")
+ "Regexp that matches the text that precedes the command's name.
+Used in `bookmark-set' to get the default bookmark name."
+ :type 'string :group 'bookmark)
+
(defvar manual-program "man"
"The name of the program that produces man pages.")
(man man-args)))
(defun Man-getpage-in-background (topic)
- "Use TOPIC to build and fire off the manpage and cleaning command."
+ "Use TOPIC to build and fire off the manpage and cleaning command.
+Return the buffer in which the manpage will appear."
(let* ((man-args topic)
(bufname (concat "*Man " man-args "*"))
(buffer (get-buffer bufname)))
(format "exited abnormally with code %d"
exit-status)))
(setq msg exit-status))
- (Man-bgproc-sentinel bufname msg)))))))
+ (Man-bgproc-sentinel bufname msg)))))
+ buffer))
(defun Man-notify-when-ready (man-buffer)
"Notify the user when MAN-BUFFER is ready.
See the variable `Man-notify-method' for the different notification behaviors."
(let ((saved-frame (with-current-buffer man-buffer
Man-original-frame)))
- (cond
- ((eq Man-notify-method 'newframe)
+ (case Man-notify-method
+ (newframe
;; Since we run asynchronously, perhaps while Emacs is waiting
;; for input, we must not leave a different buffer current. We
;; can't rely on the editor command loop to reselect the
(set-window-dedicated-p (frame-selected-window frame) t)
(or (display-multi-frame-p frame)
(select-frame frame)))))
- ((eq Man-notify-method 'pushy)
+ (pushy
(switch-to-buffer man-buffer))
- ((eq Man-notify-method 'bully)
+ (bully
(and (frame-live-p saved-frame)
(select-frame saved-frame))
(pop-to-buffer man-buffer)
(delete-other-windows))
- ((eq Man-notify-method 'aggressive)
+ (aggressive
(and (frame-live-p saved-frame)
(select-frame saved-frame))
(pop-to-buffer man-buffer))
- ((eq Man-notify-method 'friendly)
+ (friendly
(and (frame-live-p saved-frame)
(select-frame saved-frame))
(display-buffer man-buffer 'not-this-window))
- ((eq Man-notify-method 'polite)
+ (polite
(beep)
(message "Manual buffer %s is ready" (buffer-name man-buffer)))
- ((eq Man-notify-method 'quiet)
+ (quiet
(message "Manual buffer %s is ready" (buffer-name man-buffer)))
- ((or (eq Man-notify-method 'meek)
- t)
+ (t ;; meek
(message ""))
)))
;; ======================================================================
;; set up manual mode in buffer and build alists
+(defvar bookmark-make-record-function)
+
(put 'Man-mode 'mode-class 'special)
(defun Man-mode ()
(setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
(set (make-local-variable 'outline-regexp) Man-heading-regexp)
(set (make-local-variable 'outline-level) (lambda () 1))
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'Man-bookmark-make-record)
(Man-build-page-list)
(Man-strip-page-headers)
(Man-unindent)
(setq path nil))
(setq complete-path nil)))
complete-path))
+
+;;; Bookmark Man Support
+(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-prop-get "bookmark" (bookmark prop))
+(declare-function bookmark-default-handler "bookmark" (bmk))
+(declare-function bookmark-get-bookmark-record "bookmark" (bmk))
+
+(defun Man-default-bookmark-title ()
+ "Default bookmark name for Man or WoMan pages.
+Uses `Man-name-local-regexp'."
+ (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward Man-name-local-regexp nil t)
+ (skip-chars-forward "\n\t ")
+ (buffer-substring-no-properties (point) (line-end-position)))))
+
+(defun Man-bookmark-make-record ()
+ "Make a bookmark entry for a Man buffer."
+ `(,(Man-default-bookmark-title)
+ ,@(bookmark-make-record-default 'point-only)
+ (location . ,(concat "man " Man-arguments))
+ (man-args . ,Man-arguments)
+ (handler . Man-bookmark-jump)))
+
+;;;###autoload
+(defun Man-bookmark-jump (bookmark)
+ "Default bookmark handler for Man buffers."
+ (let* ((man-args (bookmark-prop-get bookmark 'man-args))
+ ;; Let bookmark.el do the window handling.
+ ;; This let-binding needs to be active during the call to both
+ ;; Man-getpage-in-background and accept-process-output.
+ (Man-notify-method 'meek)
+ (buf (Man-getpage-in-background man-args))
+ (proc (get-buffer-process buf)))
+ (while (and proc (eq (process-status proc) 'run))
+ (accept-process-output proc))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
\f
;; Init the man package variables, if not already done.
(Man-init-defvars)
+++ /dev/null
-# Auto-generated lisp files, which ignore
-precious ^(mh-loaddefs)\.el$
-
-# arch-tag: 03c1cf02-6c80-44af-b4ec-b41b53fbf8f2
+2010-05-14 Peter S Galbraith <psg@debian.org>
+
+ * mh-mime.el (mh-decode-message-subject): New function to decode
+ RFC2047 encoded Subject lines. Used for reply drafts.
+ * mh-comp.el (mh-compose-and-send-mail): Call
+ `mh-decode-message-subject' on (reply or forward) message drafts.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
-2010-03-22 Juanma Barranquero <lekktu@gmail.com>
+2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * mh-show.el (mh-showing-mode): Move function to mh-e.el.
+ * mh-e.el (mh-showing-mode): Use define-minor-mode.
+
+2010-03-24 Juanma Barranquero <lekktu@gmail.com>
* mh-scan.el (mh-scan-cmd-note-width): Doc fix.
(mh-scan-format-mh, mh-scan-body-regexp, mh-scan-cur-msg-number-regexp)
(mh-scan-subject-regexp, mh-update-scan-format)
(mh-msg-num-width-to-column): Fix typos in docstrings.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2009-12-01 Bill Wohler <wohler@newt.com>
* mh-search.el (mh-mairix-execute-search): Use mh vfolder_format.
2005-05-28 Bill Wohler <wohler@newt.com>
- Released MH-E version 7.84.
+ Released MH-E version 7.84.
- * MH-E-NEWS, README: Updated for release 7.84.
+ * MH-E-NEWS, README: Updated for release 7.84.
- * mh-e.el (Version, mh-version): Updated for release 7.84.
+ * mh-e.el (Version, mh-version): Updated for release 7.84.
2005-05-28 Bill Wohler <wohler@newt.com>
mh-xemacs-toolbar.el: Removed RCS keywords per Emacs conventions
(closes SF #680731).
-
2003-03-26 Satyaki Das <satyaki@theforce.stanford.edu>
* mh-index.el: Fix commentary to mention that mairix is supported
the MH pick command to give the user more information when
choosing between mh-search-folder and mh-index-folder.
- * mh-index.el (mh-index-search): Edited the docstring. Direct the
- user to mh-index-program if necessary.
- (mh-index-program): Edited this docstring too. Viewing the help
- in a *Help* buffer really exposes grammatical flaws.
+ * mh-index.el (mh-index-search): Edited the docstring. Direct the
+ user to mh-index-program if necessary.
+ (mh-index-program): Edited this docstring too. Viewing the help
+ in a *Help* buffer really exposes grammatical flaws.
2002-11-05 Peter S Galbraith <psg@debian.org>
(.PHONY): Added emacs, xemacs, autoloads, custom-loads. Broke up
target and moved pieces into their own sections.
-
2002-10-30 Peter S Galbraith <psg@debian.org>
* mh-utils.el (mh-show-font-lock-keywords): Wrap an
2002-10-22 Mark D. Baushke <mdb@gnu.org>
* mh-mime.el (mh-graphical-smileys-flag): Renamed from
- mh-graphical-smileys-p.
- (mh-display-smileys): Use it.
- (mh-graphical-emphasis-flag): Renamed from
- mh-graphical-emphasis-p.
- (mh-display-emphasis): Use it. This addresses part of SF #627015.
+ mh-graphical-smileys-p.
+ (mh-display-smileys): Use it.
+ (mh-graphical-emphasis-flag): Renamed from mh-graphical-emphasis-p.
+ (mh-display-emphasis): Use it. This addresses part of SF #627015.
2002-10-22 Satyaki Das <satyaki@theforce.stanford.edu>
* mh-mime.el (mh-store-mime-parts-directory): New defcustom.
Default directory to use for mh-store-mime-parts.
(mh-store-mime-parts): New Command. Store the MIME parts of the
- current message.
+ current message.
(mh-store-mime-parts-directory-default): New internal working
variable. Default to use for mh-store-mime-parts-directory, set
from last use.
* mh-e.el (mh-folder-seq-tool-bar-map): Add mh-store-mime-parts to
toolbar.
-
2002-08-22 Satyaki Das <satyaki@theforce.stanford.edu>
* mh-seq.el (mh-thread-generate-scan-lines): In threaded view,
(clean): New target that blows away MH-E-OBJ.
(dist): Added $(MH-E-OBJ) to tarball.
-
Attempt to quiet compilation errors to a dull roar.
* mh-e.el: Require easymenu, added autoload of info.
* mh-comp.el: Require mh-e and easymenu, moved autoloads to top of
file.
-
* Makefile: (EMACS): New constant to hold emacs calling sequence.
(install): Renamed to install-emacs.
(compile): New target to compile all files.
(mh-identity-make-menu)
(mh-identity-add-menu)
+ ;; Cleanup possibly RFC2047 encoded subject header
+ (mh-decode-message-subject)
+
;; Insert extra fields.
(mh-insert-x-mailer)
(mh-insert-x-face)
(defvar mh-show-buffer nil
"Buffer that displays message for this folder.")
-(defvar mh-showing-mode nil
- "If non-nil, show the message in a separate window.")
+(define-minor-mode mh-showing-mode
+ "Minor mode to show the message in a separate window."
+ ;; FIXME: maybe this should be moved to mh-show.el.
+ :lighter " Show")
(defvar mh-view-ops nil
"Stack of operations that change the folder view.
(let ((buffer-read-only nil))
(rfc2047-decode-region (point-min) (mh-mail-header-end)))))
+;;;###mh-autoload
+(defun mh-decode-message-subject ()
+ "Decode RFC2047 encoded message header fields."
+ (when mh-decode-mime-flag
+ (save-excursion
+ (let ((buffer-read-only nil))
+ (rfc2047-decode-region (progn (mh-goto-header-field "subject:") (point))
+ (progn (mh-header-field-end) (point)))))))
+
;;;###mh-autoload
(defun mh-mime-display (&optional pre-dissected-handles)
"Display (and possibly decode) MIME handles.
(apply #'mh-speed-flists t folders)))
(run-hooks 'mh-show-hook)))
-;;;###mh-autoload
-(defun mh-showing-mode (&optional arg)
- "Change whether messages should be displayed.
-
-With ARG, display messages if ARG is positive, otherwise don't display them."
- (setq mh-showing-mode
- (if (null arg)
- (not mh-showing-mode)
- (> (prefix-numeric-value arg) 0))))
-
;;;###mh-autoload
(defun mh-start-of-uncleaned-message ()
"Position uninteresting headers off the top of the window."
;; Copyright (C) 1998, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;; Author: Sam Steingold <sds@usa.net>
-;; Maintainer: Sam Steingold <sds@usa.net>
+;; Author: Sam Steingold <sds@gnu.org>
+;; Maintainer: Sam Steingold <sds@gnu.org>
;; Created: 1998-05-18
;; Keywords: utilities
(defun midnight-next ()
"Return the number of seconds till the next midnight."
- (multiple-value-bind (sec min hrs)
+ (multiple-value-bind (sec min hrs)
(values-list (decode-time))
(- (* 24 60 60) (* 60 60 hrs) (* 60 min) sec)))
;; the provided string (as is the case in filecache.el), in which
;; case partial-completion (for example) doesn't make any sense
;; and neither does the completions-first-difference highlight.
+;; - indicate how to display the completions in *Completions* (turn
+;; \n into something else, add special boundaries between
+;; completions). E.g. when completing from the kill-ring.
;; - make partial-completion-mode obsolete:
;; - (?) <foo.h> style completion for file names.
the method is applied to all the preceding fields that do not yet match.
E.g. C-x C-f /u/mo/s TAB could complete to /usr/monnier/src.
Additionally the user can use the char \"*\" as a glob pattern.")
+ (substring
+ completion-substring-try-completion completion-substring-all-completions
+ "Completion of the string taken as a substring.
+I.e. when completing \"foo_bar\" (where _ is the position of point),
+it will consider all completions candidates matching the glob
+pattern \"*foo*bar*\".")
(initials
completion-initials-try-completion completion-initials-all-completions
"Completion of acronyms and initialisms.
(insert newtext)
(delete-region (point) (+ (point) (- end beg))))
+(defcustom completion-cycle-threshold nil
+ "Number of completion candidates below which cycling is used.
+Depending on this setting `minibuffer-complete' may use cycling,
+like `minibuffer-force-complete'.
+If nil, cycling is never used.
+If t, cycling is always used.
+If an integer, cycling is used as soon as there are fewer completion
+candidates than this number."
+ :type '(choice (const :tag "No cycling" nil)
+ (const :tag "Always cycle" t)
+ (integer :tag "Threshold")))
+
(defun completion--do-completion (&optional try-completion-function)
"Do the completion and return a summary of what happened.
M = completion was performed, the text was Modified.
;; It did find a match. Do we match some possibility exactly now?
(let ((exact (test-completion completion
minibuffer-completion-table
- minibuffer-completion-predicate)))
- (if completed
+ minibuffer-completion-predicate))
+ (comps
+ ;; Check to see if we want to do cycling. We do it
+ ;; here, after having performed the normal completion,
+ ;; so as to take advantage of the difference between
+ ;; try-completion and all-completions, for things
+ ;; like completion-ignored-extensions.
+ (when (and completion-cycle-threshold
+ ;; Check that the completion didn't make
+ ;; us jump to a different boundary.
+ (or (not completed)
+ (< (car (completion-boundaries
+ (substring completion 0 comp-pos)
+ minibuffer-completion-table
+ minibuffer-completion-predicate
+ ""))
+ comp-pos)))
+ (completion-all-sorted-completions))))
+ (setq completion-all-sorted-completions nil)
+ (cond
+ ((and (not (ignore-errors
+ ;; This signal an (intended) error if comps is too
+ ;; short or if completion-cycle-threshold is t.
+ (consp (nthcdr completion-cycle-threshold comps))))
+ ;; More than 1, so there's something to cycle.
+ (consp (cdr comps)))
+ ;; Fewer than completion-cycle-threshold remaining
+ ;; completions: let's cycle.
+ (setq completed t exact t)
+ (setq completion-all-sorted-completions comps)
+ (minibuffer-force-complete))
+ (completed
;; We could also decide to refresh the completions,
;; if they're displayed (and assuming there are
;; completions left).
- (minibuffer-hide-completions)
+ (minibuffer-hide-completions))
;; Show the completion table, if requested.
- (cond
((not exact)
(if (case completion-auto-help
(lazy (eq this-command last-command))
;; means we've already given a "Next char not unique" message
;; and the user's hit TAB again, so now we give him help.
((eq this-command last-command)
- (if completion-auto-help (minibuffer-completion-help)))))
+ (if completion-auto-help (minibuffer-completion-help))))
(minibuffer--bitset completed t exact))))))))
;; If the previous command was not this,
;; mark the completion buffer obsolete.
(unless (eq this-command last-command)
+ (setq completion-all-sorted-completions nil)
(setq minibuffer-scroll-window nil))
- (let ((window minibuffer-scroll-window))
+ (cond
;; If there's a fresh completion window with a live buffer,
;; and this command is repeated, scroll that window.
- (if (window-live-p window)
+ ((window-live-p minibuffer-scroll-window)
+ (let ((window minibuffer-scroll-window))
(with-current-buffer (window-buffer window)
(if (pos-visible-in-window-p (point-max) window)
;; If end is in view, scroll up to the beginning.
(set-window-start window (point-min) nil)
;; Else scroll down one screen.
(scroll-other-window))
- nil)
-
- (case (completion--do-completion)
+ nil)))
+ ;; If we're cycling, keep on cycling.
+ (completion-all-sorted-completions
+ (minibuffer-force-complete)
+ t)
+ (t (case (completion--do-completion)
(#b000 nil)
(#b001 (minibuffer-message "Sole completion")
t)
"Display a list of possible completions of the current minibuffer contents."
(interactive)
(message "Making completion list...")
- (let* ((start (field-beginning))
+ (let* ((non-essential t)
+ (start (field-beginning))
(string (field-string))
(completions (completion-all-completions
string
(call-interactively 'minibuffer-complete)
(delete-overlay ol)))))
-(defvar completion-at-point-functions nil
+(defvar completion-at-point-functions '(tags-completion-at-point-function)
"Special hook to find the completion table for the thing at point.
It is called without any argument and should return either nil,
or a function of no argument to perform completion (discouraged),
`:predicate' a predicate that completion candidates need to satisfy.
`:annotation-function' the value to use for `completion-annotate-function'.")
-(defun completion-at-point ()
- "Complete the thing at point according to local mode.
-This runs the hook `completion-at-point-functions' until a member returns
-non-nil."
- (interactive)
- (let ((res (run-hook-with-args-until-success
- 'completion-at-point-functions)))
- (cond
- ((functionp res) (funcall res))
- (res
- (let* ((plist (nthcdr 3 res))
- (start (nth 0 res))
- (end (nth 1 res))
- (completion-annotate-function
- (or (plist-get plist :annotation-function)
- completion-annotate-function)))
- (completion-in-region start end (nth 2 res)
- (plist-get plist :predicate)))))))
+(defun completion-at-point (&optional arg)
+ "Perform completion on the text around point.
+The completion method is determined by `completion-at-point-functions'.
+
+With a prefix argument, this command does completion within
+the collection of symbols listed in the index of the manual for the
+language you are using."
+ (interactive "P")
+ (if arg
+ (info-complete-symbol)
+ (let ((res (run-hook-with-args-until-success
+ 'completion-at-point-functions)))
+ (cond
+ ((functionp res) (funcall res))
+ (res
+ (let* ((plist (nthcdr 3 res))
+ (start (nth 0 res))
+ (end (nth 1 res))
+ (completion-annotate-function
+ (or (plist-get plist :annotation-function)
+ completion-annotate-function)))
+ (completion-in-region start end (nth 2 res)
+ (plist-get plist :predicate))))))))
+
+(define-obsolete-function-alias 'complete-symbol 'completion-at-point "24.1")
;;; Key bindings.
(substitute-in-file-name string)
(error string)))
(comp (completion-file-name-table
- str (or pred read-file-name-predicate) action)))
+ str
+ (with-no-warnings (or pred read-file-name-predicate))
+ action)))
(cond
((stringp comp)
;; Nothing to merge.
suffix))
+(defun completion-basic--pattern (beforepoint afterpoint bounds)
+ (delete
+ "" (list (substring beforepoint (car bounds))
+ 'point
+ (substring afterpoint 0 (cdr bounds)))))
+
(defun completion-basic-try-completion (string table pred point)
(let* ((beforepoint (substring string 0 point))
(afterpoint (substring string point))
(length completion))))
(let* ((suffix (substring afterpoint (cdr bounds)))
(prefix (substring beforepoint 0 (car bounds)))
- (pattern (delete
- "" (list (substring beforepoint (car bounds))
- 'point
- (substring afterpoint 0 (cdr bounds)))))
+ (pattern (completion-basic--pattern
+ beforepoint afterpoint bounds))
(all (completion-pcm--all-completions prefix pattern table pred)))
(if minibuffer-completing-file-name
(setq all (completion-pcm--filename-try-filter all)))
(let* ((beforepoint (substring string 0 point))
(afterpoint (substring string point))
(bounds (completion-boundaries beforepoint table pred afterpoint))
- (suffix (substring afterpoint (cdr bounds)))
(prefix (substring beforepoint 0 (car bounds)))
- (pattern (delete
- "" (list (substring beforepoint (car bounds))
- 'point
- (substring afterpoint 0 (cdr bounds)))))
+ (pattern (completion-basic--pattern beforepoint afterpoint bounds))
(all (completion-pcm--all-completions prefix pattern table pred)))
(completion-hilit-commonality all point (car bounds))))
:group 'minibuffer
:type 'string)
+(defcustom completion-pcm-complete-word-inserts-delimiters nil
+ "Treat the SPC or - inserted by `minibuffer-complete-word' as delimiters.
+Those chars are treated as delimiters iff this variable is non-nil.
+I.e. if non-nil, M-x SPC will just insert a \"-\" in the minibuffer, whereas
+if nil, it will list all possible commands in *Completions* because none of
+the commands start with a \"-\" or a SPC."
+ :type 'boolean)
+
(defun completion-pcm--pattern-trivial-p (pattern)
(and (stringp (car pattern))
;; It can be followed by `point' and "" and still be trivial.
(defun completion-pcm--string->pattern (string &optional point)
"Split STRING into a pattern.
A pattern is a list where each element is either a string
-or a symbol chosen among `any', `star', `point'."
+or a symbol chosen among `any', `star', `point', `prefix'."
(if (and point (< point (length string)))
(let ((prefix (substring string 0 point))
(suffix (substring string point)))
(while (and (setq p (string-match completion-pcm--delim-wild-regex
string p))
- ;; If the char was added by minibuffer-complete-word, then
- ;; don't treat it as a delimiter, otherwise "M-x SPC"
- ;; ends up inserting a "-" rather than listing
- ;; all completions.
- (not (get-text-property p 'completion-try-word string)))
+ (or completion-pcm-complete-word-inserts-delimiters
+ ;; If the char was added by minibuffer-complete-word,
+ ;; then don't treat it as a delimiter, otherwise
+ ;; "M-x SPC" ends up inserting a "-" rather than listing
+ ;; all completions.
+ (not (get-text-property p 'completion-try-word string))))
;; Usually, completion-pcm--delim-wild-regex matches a delimiter,
;; meaning that something can be added *before* it, but it can also
;; match a prefix and postfix, in which case something can be added
(concat "\\`"
(mapconcat
(lambda (x)
- (case x
- ((star any point)
- (if (if (consp group) (memq x group) group)
- "\\(.*?\\)" ".*?"))
- (t (regexp-quote x))))
+ (cond
+ ((stringp x) (regexp-quote x))
+ ((if (consp group) (memq x group) group) "\\(.*?\\)")
+ (t ".*?")))
pattern
""))))
;; Avoid pathological backtracking.
(nconc (completion-pcm--hilit-commonality pattern all)
(length prefix)))))
+(defun completion--sreverse (str)
+ "Like `reverse' but for a string STR rather than a list."
+ (apply 'string (nreverse (mapcar 'identity str))))
+
+(defun completion--common-suffix (strs)
+ "Return the common suffix of the strings STRS."
+ (completion--sreverse
+ (try-completion
+ ""
+ (mapcar 'completion--sreverse strs))))
+
(defun completion-pcm--merge-completions (strs pattern)
"Extract the commonality in STRS, with the help of PATTERN."
;; When completing while ignoring case, we want to try and avoid
;; `any' into a `star' because the surrounding context has
;; changed such that string->pattern wouldn't add an `any'
;; here any more.
- (unless unique (push elem res))
+ (unless unique
+ (push elem res)
+ (when (memq elem '(star point prefix))
+ ;; Extract common suffix additionally to common prefix.
+ ;; Only do it for `point', `star', and `prefix' since for
+ ;; `any' it could lead to a merged completion that
+ ;; doesn't itself match the candidates.
+ (let ((suffix (completion--common-suffix comps)))
+ (assert (stringp suffix))
+ (unless (equal suffix "")
+ (push suffix res)))))
(setq fixed "")))))
;; We return it in reverse order.
res)))))
(mapconcat (lambda (x) (cond
((stringp x) x)
((eq x 'star) "*")
- ((eq x 'any) "")
- ((eq x 'point) "")))
+ (t ""))) ;any, point, prefix.
pattern
""))
(pointpat (or (memq 'point mergedpat)
(memq 'any mergedpat)
(memq 'star mergedpat)
+ ;; Not `prefix'.
mergedpat))
;; New pos from the start.
(newpos (length (completion-pcm--pattern->string pointpat)))
'completion-pcm--filename-try-filter))
(completion-pcm--merge-try pattern all prefix suffix)))
-;;; Initials completion
+;;; Substring completion
+;; Mostly derived from the code of `basic' completion.
+
+(defun completion-substring--all-completions (string table pred point)
+ (let* ((beforepoint (substring string 0 point))
+ (afterpoint (substring string point))
+ (bounds (completion-boundaries beforepoint table pred afterpoint))
+ (suffix (substring afterpoint (cdr bounds)))
+ (prefix (substring beforepoint 0 (car bounds)))
+ (basic-pattern (completion-basic--pattern
+ beforepoint afterpoint bounds))
+ (pattern (if (not (stringp (car basic-pattern)))
+ basic-pattern
+ (cons 'prefix basic-pattern)))
+ (all (completion-pcm--all-completions prefix pattern table pred)))
+ (list all pattern prefix suffix (car bounds))))
+
+(defun completion-substring-try-completion (string table pred point)
+ (destructuring-bind (all pattern prefix suffix carbounds)
+ (completion-substring--all-completions string table pred point)
+ (if minibuffer-completing-file-name
+ (setq all (completion-pcm--filename-try-filter all)))
+ (completion-pcm--merge-try pattern all prefix suffix)))
+
+(defun completion-substring-all-completions (string table pred point)
+ (destructuring-bind (all pattern prefix suffix carbounds)
+ (completion-substring--all-completions string table pred point)
+ (when all
+ (nconc (completion-pcm--hilit-commonality pattern all)
+ (length prefix)))))
+
+;; Initials completion
;; Complete /ums to /usr/monnier/src or lch to list-command-history.
(defun completion-initials-expand (str table pred)
(eval-when-compile (require 'cl))
-;;; Backward compatibility.
-;; This code is meant for Emacs-CVS, so to get it to run on anything else,
-;; we need to define some more things.
-
-(unless (fboundp 'tool-bar-local-item)
- (defun tool-bar-local-item (icon def key map &rest props)
- (define-key-after map (vector key)
- `(menu-item ,(symbol-name key) ,def
- :image ,(find-image
- `((:type xpm :file ,(concat icon ".xpm"))))
- ,@props))))
-
-(unless (fboundp 'process-put)
- (defconst mpc-process-hash (make-hash-table :weakness 'key))
- (defun process-put (proc prop val)
- (let ((sym (gethash proc mpc-process-hash)))
- (unless sym
- (setq sym (puthash proc (make-symbol "mpc-proc-sym") mpc-process-hash)))
- (put sym prop val)))
- (defun process-get (proc prop)
- (let ((sym (gethash proc mpc-process-hash)))
- (when sym (get sym prop))))
- (defun process-plist (proc)
- (let ((sym (gethash proc mpc-process-hash)))
- (when sym (symbol-plist sym)))))
-(unless (fboundp 'with-local-quit)
- (defmacro with-local-quit (&rest body)
- `(condition-case nil (let ((inhibit-quit nil)) ,@body)
- (quit (setq quit-flag t) nil))))
-(unless (fboundp 'balance-windows-area)
- (defalias 'balance-windows-area 'balance-windows))
-(unless (fboundp 'posn-object) (defalias 'posn-object 'ignore))
-(unless (fboundp 'buffer-local-value)
- (defun buffer-local-value (var buf)
- (with-current-buffer buf (symbol-value var))))
-
-
-;;; Main code starts here.
-
(defgroup mpc ()
"A Client for the Music Player Daemon."
:prefix "mpc-"
:group 'multimedia
:group 'applications)
-(defcustom mpc-browser-tags '(Genre Artist Album Playlist)
+(defcustom mpc-browser-tags '(Genre Artist|Composer|Performer
+ Album|Playlist)
"Tags for which a browser buffer should be created by default."
- :type '(repeat string))
+ ;; FIXME: provide a list of tags, for completion.
+ :type '(repeat symbol))
;;; Misc utils ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (mpc--queue-head)))
;; (message "MPC's queue is out of sync"))))))
+(defvar mpc--find-memoize-union-tags nil)
+
+(defun mpc-cmd-flush (tag value)
+ (puthash (cons tag value) nil mpc--find-memoize)
+ (dolist (uniontag mpc--find-memoize-union-tags)
+ (if (member (symbol-name tag) (split-string (symbol-name uniontag) "|"))
+ (puthash (cons uniontag value) nil mpc--find-memoize))))
+
+
+(defun mpc-cmd-special-tag-p (tag)
+ (or (memq tag '(Playlist Search Directory))
+ (string-match "|" (symbol-name tag))))
+
(defun mpc-cmd-find (tag value)
"Return a list of all songs whose tag TAG has value VALUE.
The songs are returned as alists."
(cond
((eq tag 'Playlist)
;; Special case for pseudo-tag playlist.
- (let ((l (mpc-proc-buf-to-alists
- (mpc-proc-cmd (list "listplaylistinfo" value))))
+ (let ((l (condition-case err
+ (mpc-proc-buf-to-alists
+ (mpc-proc-cmd (list "listplaylistinfo" value)))
+ (mpc-proc-error
+ ;; "[50@0] {listplaylistinfo} No such playlist"
+ nil)))
(i 0))
(mapcar (lambda (s)
(prog1 (cons (cons 'Pos (number-to-string i)) s)
(if (eq (car pair) 'directory)
nil pair))
pairs)))))
+ ((string-match "|" (symbol-name tag))
+ (add-to-list 'mpc--find-memoize-union-tags tag)
+ (let ((tag1 (intern (substring (symbol-name tag)
+ 0 (match-beginning 0))))
+ (tag2 (intern (substring (symbol-name tag)
+ (match-end 0)))))
+ (mpc-union (mpc-cmd-find tag1 value)
+ (mpc-cmd-find tag2 value))))
(t
(condition-case err
(mpc-proc-buf-to-alists
(when other-tag
(dolist (pl (prog1 pls (setq pls nil)))
(let ((plsongs (mpc-cmd-find 'Playlist pl)))
- (if (not (member other-tag '(Playlist Search Directory)))
+ (if (not (mpc-cmd-special-tag-p other-tag))
(when (member (cons other-tag value)
(apply 'append plsongs))
(push pl pls))
;; useful that would be tho.
((eq tag 'Search) (error "Not supported"))
+ ((string-match "|" (symbol-name tag))
+ (let ((tag1 (intern (substring (symbol-name tag)
+ 0 (match-beginning 0))))
+ (tag2 (intern (substring (symbol-name tag)
+ (match-end 0)))))
+ (mpc-union (mpc-cmd-list tag1 other-tag value)
+ (mpc-cmd-list tag2 other-tag value))))
+
((null other-tag)
(condition-case nil
(mapcar 'cdr (mpc-proc-cmd-to-alist (list "list" (symbol-name tag))))
(mpc-assq-all tag (mpc-proc-cmd-to-alist "listallinfo")))))
(t
(condition-case nil
- (if (member other-tag '(Search Playlist Directory))
+ (if (mpc-cmd-special-tag-p other-tag)
(signal 'mpc-proc-error "Not implemented")
(mapcar 'cdr
(mpc-proc-cmd-to-alist
(list "add" file)))
files)))
(if (stringp playlist)
- (puthash (cons 'Playlist playlist) nil mpc--find-memoize)))
+ (mpc-cmd-flush 'Playlist playlist)))
(defun mpc-cmd-delete (song-poss &optional playlist)
"Delete the songs at positions SONG-POSS from PLAYLIST.
;;; Formatter ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mpc-secs-to-time (secs)
+ ;; We could use `format-seconds', but it doesn't seem worth the trouble
+ ;; because we'd still need to check (>= secs (* 60 100)) since the special
+ ;; %z only allows us to drop the large units for small values but
+ ;; not to drop the small units for large values.
(if (stringp secs) (setq secs (string-to-number secs)))
(if (>= secs (* 60 100)) ;More than 100 minutes.
(format "%dh%02d" ;"%d:%02d:%02d"
(with-current-buffer buf (with-local-quit (mpc-tagbrowser-refresh)))))
(with-local-quit (mpc-songs-refresh))))
+(defun mpc-tagbrowser-tag-name (tag)
+ (cond
+ ((string-match "|" (symbol-name tag))
+ (let ((tag1 (intern (substring (symbol-name tag)
+ 0 (match-beginning 0))))
+ (tag2 (intern (substring (symbol-name tag)
+ (match-end 0)))))
+ (concat (mpc-tagbrowser-tag-name tag1)
+ " | "
+ (mpc-tagbrowser-tag-name tag2))))
+ ((string-match "y\\'" (symbol-name tag))
+ (concat (substring (symbol-name tag) 0 -1) "ies"))
+ (t (concat (symbol-name tag) "s"))))
+
(defun mpc-tagbrowser-buf (tag)
(let ((buf (mpc-proc-buffer (mpc-proc) tag)))
(if (buffer-live-p buf) buf
(insert mpc-tagbrowser-all-name "\n"))
(forward-line -1)
(setq mpc-tag tag)
- (setq mpc-tag-name
- (if (string-match "y\\'" (symbol-name tag))
- (concat (substring (symbol-name tag) 0 -1) "ies")
- (concat (symbol-name tag) "s")))
+ (setq mpc-tag-name (mpc-tagbrowser-tag-name tag))
(mpc-tagbrowser-all-select)
(mpc-tagbrowser-refresh)
buf))))
(mapcar (lambda (val)
(mpc-cmd-find (car cst) val))
(cdr cst)))))
- (setq active (if (null active)
- (progn
+ (setq active (cond
+ ((null active)
(if (eq (car cst) 'Playlist)
(setq dontsort t))
vals)
- (if (or dontsort
+ ((or dontsort
;; Try to preserve ordering and
;; repetitions from playlists.
(not (eq (car cst) 'Playlist)))
(mpc-intersection active vals
- (lambda (x) (assq 'file x)))
+ (lambda (x) (assq 'file x))))
+ (t
(setq dontsort t)
(mpc-intersection vals active
- (lambda (x) (assq 'file x)))))))))
+ (lambda (x)
+ (assq 'file x)))))))))
(mpc-select-save
(erase-buffer)
;; Sorting songs is surprisingly difficult: when comparing two
))
(goto-char (point-min))
(forward-line (car curline))
- (when (or (search-forward (cdr curline) nil t)
+ (if (or (search-forward (cdr curline) nil t)
(search-backward (cdr curline) nil t))
- (beginning-of-line))
+ (beginning-of-line)
+ (goto-char (point-min)))
(set (make-local-variable 'mpc-songs-totaltime)
(unless (zerop totaltime)
(list " " (mpc-secs-to-time totaltime))))
(run-with-timer mouse-wheel-inhibit-click-time nil
'mwheel-inhibit-click-timeout))))
+(put 'mwheel-scroll 'scroll-command t)
+
(defvar mwheel-installed-bindings nil)
;; preloaded ;;;###autoload
"Accessing remote files and directories using FTP
made as simple and transparent as possible."
:group 'files
+ :group 'comm
:prefix "ange-ftp-")
(defcustom ange-ftp-name-format
ange-ftp-gateway-tmp-name-template
ange-ftp-tmp-name-template)))
-(defalias 'ange-ftp-del-tmp-name 'delete-file)
+(defun ange-ftp-del-tmp-name (filename)
+ "Force to delete temporary file."
+ (delete-file filename 'force))
+
\f
;;;; ------------------------------------------------------------
;;;; Interactive gateway program support.
(file-exists-p file)
(ange-ftp-real-file-executable-p file))))
-(defun ange-ftp-delete-file (file)
+(defun ange-ftp-delete-file (file &optional force)
(interactive "fDelete file: ")
(setq file (expand-file-name file))
(let ((parsed (ange-ftp-ftp-name file)))
(format "FTP Error: \"%s\"" (cdr result))
file)))
(ange-ftp-delete-file-entry file))
- (ange-ftp-real-delete-file file))))
+ (ange-ftp-real-delete-file file force))))
(defun ange-ftp-file-modtime (file)
"Return the modification time of remote file FILE.
(ange-ftp-call-cont cont result line)))
(defun ange-ftp-copy-file (filename newname &optional ok-if-already-exists
- keep-date preserve-uid-gid)
+ keep-date preserve-uid-gid
+ preserve-selinux-context)
(interactive "fCopy file: \nFCopy %s to file: \np")
(ange-ftp-copy-file-internal filename
newname
(ange-ftp-add-file-entry newname)
(ange-ftp-delete-file-entry filename))
(ange-ftp-copy-file-internal filename newname t nil)
- (delete-file filename))))
+ (delete-file filename 'force))))
(defun ange-ftp-rename-local-to-remote (filename newname)
"Rename local file FILENAME to remote file NEWNAME."
(msg (format "Renaming %s to %s" fabbr nabbr)))
(ange-ftp-copy-file-internal filename newname t nil msg)
(let (ange-ftp-process-verbose)
- (delete-file filename))))
+ (delete-file filename 'force))))
(defun ange-ftp-rename-remote-to-local (filename newname)
"Rename remote file FILENAME to local file NEWNAME."
(msg (format "Renaming %s to %s" fabbr nabbr)))
(ange-ftp-copy-file-internal filename newname t nil msg)
(let (ange-ftp-process-verbose)
- (delete-file filename))))
+ (delete-file filename 'force))))
(defun ange-ftp-rename-file (filename newname &optional ok-if-already-exists)
(interactive "fRename file: \nFRename %s to file: \np")
(if copy
(unwind-protect
(funcall 'load copy noerror nomessage nosuffix)
- (delete-file copy))
+ (delete-file copy 'force))
(or noerror
(signal 'file-error (list "Cannot open load file" file)))
nil))
(if (zerop (buffer-size))
(progn
(let (ange-ftp-process-verbose)
- (delete-file file))
+ (delete-file file 'force))
(ange-ftp-copy-file-internal tmp2 nfile t nil msg2))))
(ange-ftp-del-tmp-name tmp1)
(ange-ftp-del-tmp-name tmp2))))
(if (zerop (buffer-size))
(progn
(let (ange-ftp-process-verbose)
- (delete-file file))
+ (delete-file file 'force))
(ange-ftp-copy-file-internal tmp2 nfile t nil msg2))))
(ange-ftp-del-tmp-name tmp1)
(ange-ftp-del-tmp-name tmp2))))
"Use a web browser to look at a URL."
:prefix "browse-url-"
:link '(emacs-commentary-link "browse-url")
- :group 'hypermedia)
+ :group 'external
+ :group 'comm)
;;;###autoload
(defcustom browse-url-browser-function
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
-;;;###autoload
-(defcustom browse-url-firefox-program (purecopy "firefox")
+(defcustom browse-url-firefox-program
+ (let ((candidates '("firefox" "iceweasel")))
+ (while (and candidates (not (executable-find (car candidates))))
+ (setq candidates (cdr candidates)))
+ (or (car candidates) "firefox"))
"The name by which to invoke Firefox."
:type 'string
:group 'browse-url)
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
-;;;###autoload
-(defcustom browse-url-galeon-program (purecopy "galeon")
+(defcustom browse-url-galeon-program "galeon"
"The name by which to invoke Galeon."
:type 'string
:group 'browse-url)
(defun dns-read-string-name (string buffer)
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert string)
(goto-char (point-min))
(dns-read-name buffer)))
"Write a DNS packet according to SPEC.
If TCP-P, the first two bytes of the package with be the length field."
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(dns-write-bytes (dns-get 'id spec) 2)
(dns-write-bytes
(logior
(defun dns-read (packet)
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(let ((spec nil)
queries answers authorities additionals)
(insert packet)
(point (point)))
(prog1
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert string)
(goto-char (point-min))
(cond
(if (not dns-servers)
(message "No DNS server configuration found")
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(let ((process (condition-case ()
(dns-make-network-process (car dns-servers))
(error
(defgroup goto-address nil
"Click to browse URL or to send to e-mail address."
:group 'mouse
- :group 'hypermedia)
+ :group 'comm)
;; I don't expect users to want fontify'ing without highlighting.
;; Copyright (C) 1999, 2001, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
-;; Keywords: HMAC, RFC-2104
+;; Keywords: HMAC, RFC2104
;; This file is part of GNU Emacs.
;;; Commentary:
-;; This program is implemented from RFC 2104,
+;; This program is implemented from RFC2104,
;; "HMAC: Keyed-Hashing for Message Authentication".
;;; Code:
;; Copyright (C) 1999, 2001, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
-;; Keywords: HMAC, RFC-2104, HMAC-MD5, MD5, KEYED-MD5, CRAM-MD5
+;; Keywords: HMAC, RFC2104, HMAC-MD5, MD5, KEYED-MD5, CRAM-MD5
;; This file is part of GNU Emacs.
(setcdr alist (imap-remassoc key (cdr alist)))
alist)))
-(defsubst imap-disable-multibyte ()
+(defmacro imap-disable-multibyte ()
"Enable multibyte in the current buffer."
- (when (fboundp 'set-buffer-multibyte)
- (set-buffer-multibyte nil)))
+ (unless (featurep 'xemacs)
+ '(set-buffer-multibyte nil)))
(defsubst imap-utf7-encode (string)
(if imap-use-utf7
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
+;;
;; Modularized by Ted Zlatanov <tzz@lifelogs.com>
;; when it was part of Gnus.
``\\[universal-argument] 1 M-x rlogin-directory-tracking-mode\'',
then do directory tracking but assume the remote filesystem is the same as
the local system. This only works in general if the remote machine and the
-local one share the same directories (through NFS)."
+local one share the same directories (e.g. through NFS)."
(interactive "P")
(cond
((or (null prefix)
--- /dev/null
+;;; secrets.el --- Client interface to gnome-keyring and kwallet.
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albinus@gmx.de>
+;; Keywords: comm password passphrase
+
+;; 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:
+
+;; This package provides an implementation of the Secret Service API
+;; <http://www.freedesktop.org/wiki/Specifications/secret-storage-spec>.
+;; This API is meant to make GNOME-Keyring- and KWallet-like daemons
+;; available under a common D-BUS interface and thus increase
+;; interoperability between GNOME, KDE and other applications having
+;; the need to securely store passwords and other confidential
+;; information.
+
+;; In order to activate this package, you must add the following code
+;; into your .emacs:
+;;
+;; (require 'secrets)
+;;
+;; Afterwards, the variable `secrets-enabled' is non-nil when there is
+;; a daemon providing this interface.
+
+;; The atomic objects to be managed by the Secret Service API are
+;; secret items, which are something an application wishes to store
+;; securely. A good example is a password that an application needs
+;; to save and use at a later date.
+
+;; Secret items are grouped in collections. A collection is similar
+;; in concept to the terms 'keyring' or 'wallet'. A common collection
+;; is called "login". A collection is stored permanently under the
+;; user's permissions, and can be accessed in a user session context.
+
+;; A collection can have an alias name. The use case for this is to
+;; set the alias "default" for a given collection, making it
+;; transparent for clients, which collection is used. Other aliases
+;; are not supported (yet). Since an alias is visible to all
+;; applications, this setting shall be performed with care.
+
+;; A list of all available collections is available by
+;;
+;; (secrets-list-collections)
+;; => ("session" "login" "ssh keys")
+
+;; The "default" alias could be set to the "login" collection by
+;;
+;; (secrets-set-alias "login" "default")
+
+;; An alias can also be dereferenced
+;;
+;; (secrets-get-alias "default")
+;; => "login"
+
+;; Collections can be created and deleted. As already said,
+;; collections are used by different applications. Therefore, those
+;; operations shall also be performed with care. Common collections,
+;; like "login", shall not be changed except adding or deleting secret
+;; items.
+;;
+;; (secrets-delete-collection "my collection")
+;; (secrets-create-collection "my collection")
+
+;; There exists a special collection called "session", which has the
+;; lifetime of the corrresponding client session (aka Emacs'
+;; lifetime). It is created automatically when Emacs uses the Secret
+;; Service interface, and it is deleted when Emacs is killed.
+;; Therefore, it can be used to store and retrieve secret items
+;; temporarily. This shall be preferred over creation of a persistent
+;; collection, when the information shall not live longer than Emacs.
+;; The session collection can be addressed either by the string
+;; "session", or by `nil', whenever a collection parameter is needed.
+
+;; As already said, a collection is a group of secret items. A secret
+;; item has a label, the "secret" (which is a string), and a set of
+;; lookup attributes. The attributes can be used to search and
+;; retrieve a secret item at a later date.
+
+;; A list of all available secret items of a collection is available by
+;;
+;; (secrets-list-items "my collection")
+;; => ("this item" "another item")
+
+;; Secret items can be added or deleted to a collection. In the
+;; following examples, we use the special collection "session", which
+;; is bound to Emacs' lifetime.
+;;
+;; (secrets-delete-item "session" "my item")
+;; (secrets-create-item "session" "my item" "geheim"
+;; :user "joe" :host "remote-host")
+
+;; The string "geheim" is the secret of the secret item "my item".
+;; The secret string can be retrieved from items:
+;;
+;; (secrets-get-secret "session" "my item")
+;; => "geheim"
+
+;; The lookup attributes, which are specified during creation of a
+;; secret item, must be a key-value pair. Keys are keyword symbols,
+;; starting with a colon; values are strings. They can be retrieved
+;; from a given secret item:
+;;
+;; (secrets-get-attribute "session" "my item" :host)
+;; => "remote-host"
+;;
+;; (secrets-get-attributes "session" "my item")
+;; => ((:user . "joe") (:host ."remote-host"))
+
+;; The lookup attributes can be used for searching of items. If you,
+;; for example, are looking for all secret items for the user "joe",
+;; you would perform
+;;
+;; (secrets-search-items "session" :user "joe")
+;; => ("my item" "another item")
+
+;; Interactively, collections, items and their attributes could be
+;; inspected by the command `secrets-show-secrets'.
+
+;;; Code:
+
+;; It has been tested with GNOME Keyring 2.29.92. An implementation
+;; for KWallet will be available at
+;; svn://anonsvn.kde.org/home/kde/trunk/playground/base/ksecretservice;
+;; not tested yet.
+
+;; Pacify byte-compiler. D-Bus support in the Emacs core can be
+;; disabled with configuration option "--without-dbus". Declare used
+;; subroutines and variables of `dbus' therefore.
+(eval-when-compile
+ (require 'cl))
+
+(declare-function dbus-call-method "dbusbind.c")
+(declare-function dbus-register-signal "dbusbind.c")
+(defvar dbus-debug)
+
+(require 'dbus)
+
+(autoload 'tree-widget-set-theme "tree-widget")
+(autoload 'widget-create-child-and-convert "wid-edit")
+(autoload 'widget-default-value-set "wid-edit")
+(autoload 'widget-field-end "wid-edit")
+(autoload 'widget-member "wid-edit")
+(defvar tree-widget-after-toggle-functions)
+
+(defvar secrets-enabled nil
+ "Whether there is a daemon offering the Secret Service API.")
+
+(defvar secrets-debug t
+ "Write debug messages")
+
+(defconst secrets-service "org.freedesktop.secrets"
+ "The D-Bus name used to talk to Secret Service.")
+
+(defconst secrets-path "/org/freedesktop/secrets"
+ "The D-Bus root object path used to talk to Secret Service.")
+
+(defconst secrets-empty-path "/"
+ "The D-Bus object path representing an empty object.")
+
+(defsubst secrets-empty-path (path)
+ "Check, whether PATH is a valid object path.
+It returns t if not."
+ (or (not (stringp path))
+ (string-equal path secrets-empty-path)))
+
+(defconst secrets-interface-service "org.freedesktop.Secret.Service"
+ "The D-Bus interface managing sessions and collections.")
+
+;; <interface name="org.freedesktop.Secret.Service">
+;; <property name="Collections" type="ao" access="read"/>
+;; <method name="OpenSession">
+;; <arg name="algorithm" type="s" direction="in"/>
+;; <arg name="input" type="v" direction="in"/>
+;; <arg name="output" type="v" direction="out"/>
+;; <arg name="result" type="o" direction="out"/>
+;; </method>
+;; <method name="CreateCollection">
+;; <arg name="props" type="a{sv}" direction="in"/>
+;; <arg name="collection" type="o" direction="out"/>
+;; <arg name="prompt" type="o" direction="out"/>
+;; </method>
+;; <method name="SearchItems">
+;; <arg name="attributes" type="a{ss}" direction="in"/>
+;; <arg name="unlocked" type="ao" direction="out"/>
+;; <arg name="locked" type="ao" direction="out"/>
+;; </method>
+;; <method name="Unlock">
+;; <arg name="objects" type="ao" direction="in"/>
+;; <arg name="unlocked" type="ao" direction="out"/>
+;; <arg name="prompt" type="o" direction="out"/>
+;; </method>
+;; <method name="Lock">
+;; <arg name="objects" type="ao" direction="in"/>
+;; <arg name="locked" type="ao" direction="out"/>
+;; <arg name="Prompt" type="o" direction="out"/>
+;; </method>
+;; <method name="GetSecrets">
+;; <arg name="items" type="ao" direction="in"/>
+;; <arg name="session" type="o" direction="in"/>
+;; <arg name="secrets" type="a{o(oayay)}" direction="out"/>
+;; </method>
+;; <method name="ReadAlias">
+;; <arg name="name" type="s" direction="in"/>
+;; <arg name="collection" type="o" direction="out"/>
+;; </method>
+;; <method name="SetAlias">
+;; <arg name="name" type="s" direction="in"/>
+;; <arg name="collection" type="o" direction="in"/>
+;; </method>
+;; <signal name="CollectionCreated">
+;; <arg name="collection" type="o"/>
+;; </signal>
+;; <signal name="CollectionDeleted">
+;; <arg name="collection" type="o"/>
+;; </signal>
+;; </interface>
+
+(defconst secrets-interface-collection "org.freedesktop.Secret.Collection"
+ "A collection of items containing secrets.")
+
+;; <interface name="org.freedesktop.Secret.Collection">
+;; <property name="Items" type="ao" access="read"/>
+;; <property name="Label" type="s" access="readwrite"/>
+;; <property name="Locked" type="s" access="read"/>
+;; <property name="Created" type="t" access="read"/>
+;; <property name="Modified" type="t" access="read"/>
+;; <method name="Delete">
+;; <arg name="prompt" type="o" direction="out"/>
+;; </method>
+;; <method name="SearchItems">
+;; <arg name="attributes" type="a{ss}" direction="in"/>
+;; <arg name="results" type="ao" direction="out"/>
+;; </method>
+;; <method name="CreateItem">
+;; <arg name="props" type="a{sv}" direction="in"/>
+;; <arg name="secret" type="(oayay)" direction="in"/>
+;; <arg name="replace" type="b" direction="in"/>
+;; <arg name="item" type="o" direction="out"/>
+;; <arg name="prompt" type="o" direction="out"/>
+;; </method>
+;; <signal name="ItemCreated">
+;; <arg name="item" type="o"/>
+;; </signal>
+;; <signal name="ItemDeleted">
+;; <arg name="item" type="o"/>
+;; </signal>
+;; <signal name="ItemChanged">
+;; <arg name="item" type="o"/>
+;; </signal>
+;; </interface>
+
+(defconst secrets-session-collection-path
+ "/org/freedesktop/secrets/collection/session"
+ "The D-Bus temporary session collection object path.")
+
+(defconst secrets-interface-prompt "org.freedesktop.Secret.Prompt"
+ "A session tracks state between the service and a client application.")
+
+;; <interface name="org.freedesktop.Secret.Prompt">
+;; <method name="Prompt">
+;; <arg name="window-id" type="s" direction="in"/>
+;; </method>
+;; <method name="Dismiss"></method>
+;; <signal name="Completed">
+;; <arg name="dismissed" type="b"/>
+;; <arg name="result" type="v"/>
+;; </signal>
+;; </interface>
+
+(defconst secrets-interface-item "org.freedesktop.Secret.Item"
+ "A collection of items containing secrets.")
+
+;; <interface name="org.freedesktop.Secret.Item">
+;; <property name="Locked" type="b" access="read"/>
+;; <property name="Attributes" type="a{ss}" access="readwrite"/>
+;; <property name="Label" type="s" access="readwrite"/>
+;; <property name="Created" type="t" access="read"/>
+;; <property name="Modified" type="t" access="read"/>
+;; <method name="Delete">
+;; <arg name="prompt" type="o" direction="out"/>
+;; </method>
+;; <method name="GetSecret">
+;; <arg name="session" type="o" direction="in"/>
+;; <arg name="secret" type="(oayay)" direction="out"/>
+;; </method>
+;; <method name="SetSecret">
+;; <arg name="secret" type="(oayay)" direction="in"/>
+;; </method>
+;; </interface>
+;;
+;; STRUCT secret
+;; OBJECT PATH session
+;; ARRAY BYTE parameters
+;; ARRAY BYTE value
+
+(defconst secrets-interface-item-type-generic "org.freedesktop.Secret.Generic"
+ "The default item type we are using.")
+
+(defconst secrets-interface-session "org.freedesktop.Secret.Session"
+ "A session tracks state between the service and a client application.")
+
+;; <interface name="org.freedesktop.Secret.Session">
+;; <method name="Close"></method>
+;; </interface>
+
+;;; Sessions.
+
+(defvar secrets-session-path secrets-empty-path
+ "The D-Bus session path of the active session.
+A session path `secrets-empty-path' indicates there is no open session.")
+
+(defun secrets-close-session ()
+ "Close the secret service session, if any."
+ (dbus-ignore-errors
+ (dbus-call-method
+ :session secrets-service secrets-session-path
+ secrets-interface-session "Close"))
+ (setq secrets-session-path secrets-empty-path))
+
+(defun secrets-open-session (&optional reopen)
+ "Open a new session with \"plain\" algorithm.
+If there exists another active session, and REOPEN is nil, that
+session will be used. The object path of the session will be
+returned, and it will be stored in `secrets-session-path'."
+ (when reopen (secrets-close-session))
+ (when (secrets-empty-path secrets-session-path)
+ (setq secrets-session-path
+ (cadr
+ (dbus-call-method
+ :session secrets-service secrets-path
+ secrets-interface-service "OpenSession" "plain" '(:variant "")))))
+ (when secrets-debug
+ (message "Secret Service session: %s" secrets-session-path))
+ secrets-session-path)
+
+;;; Prompts.
+
+(defvar secrets-prompt-signal nil
+ "Internal variable to catch signals from `secrets-interface-prompt'.")
+
+(defun secrets-prompt (prompt)
+ "Handle the prompt identified by object path PROMPT."
+ (unless (secrets-empty-path prompt)
+ (let ((object
+ (dbus-register-signal
+ :session secrets-service prompt
+ secrets-interface-prompt "Completed" 'secrets-prompt-handler)))
+ (dbus-call-method
+ :session secrets-service prompt
+ secrets-interface-prompt "Prompt" (frame-parameter nil 'window-id))
+ (unwind-protect
+ (progn
+ ;; Wait until the returned prompt signal has put the
+ ;; result into `secrets-prompt-signal'.
+ (while (null secrets-prompt-signal)
+ (read-event nil nil 0.1))
+ ;; Return the object(s). It is a variant, so we must use a car.
+ (car secrets-prompt-signal))
+ ;; Cleanup.
+ (setq secrets-prompt-signal nil)
+ (dbus-unregister-object object)))))
+
+(defun secrets-prompt-handler (&rest args)
+ "Handler for signals emitted by `secrets-interface-prompt'."
+ ;; An empty object path is always identified as `secrets-empty-path'
+ ;; or `nil'. Either we set it explicitely, or it is returned by the
+ ;; "Completed" signal.
+ (if (car args) ;; dismissed
+ (setq secrets-prompt-signal (list secrets-empty-path))
+ (setq secrets-prompt-signal (cadr args))))
+
+;;; Collections.
+
+(defvar secrets-collection-paths nil
+ "Cached D-Bus object paths of available collections.")
+
+(defun secrets-collection-handler (&rest args)
+ "Handler for signals emitted by `secrets-interface-service'."
+ (cond
+ ((string-equal (dbus-event-member-name last-input-event) "CollectionCreated")
+ (add-to-list 'secrets-collection-paths (car args)))
+ ((string-equal (dbus-event-member-name last-input-event) "CollectionDeleted")
+ (setq secrets-collection-paths
+ (delete (car args) secrets-collection-paths)))))
+
+(defun secrets-get-collections ()
+ "Return the object paths of all available collections."
+ (setq secrets-collection-paths
+ (or secrets-collection-paths
+ (dbus-get-property
+ :session secrets-service secrets-path
+ secrets-interface-service "Collections"))))
+
+(defun secrets-get-collection-properties (collection-path)
+ "Return all properties of collection identified by COLLECTION-PATH."
+ (unless (secrets-empty-path collection-path)
+ (dbus-get-all-properties
+ :session secrets-service collection-path
+ secrets-interface-collection)))
+
+(defun secrets-get-collection-property (collection-path property)
+ "Return property PROPERTY of collection identified by COLLECTION-PATH."
+ (unless (or (secrets-empty-path collection-path) (not (stringp property)))
+ (dbus-get-property
+ :session secrets-service collection-path
+ secrets-interface-collection property)))
+
+(defun secrets-list-collections ()
+ "Return a list of collection names."
+ (mapcar
+ (lambda (collection-path)
+ (if (string-equal collection-path secrets-session-collection-path)
+ "session"
+ (secrets-get-collection-property collection-path "Label")))
+ (secrets-get-collections)))
+
+(defun secrets-collection-path (collection)
+ "Return the object path of collection labelled COLLECTION.
+If COLLECTION is nil, return the session collection path.
+If there is no such COLLECTION, return nil."
+ (or
+ ;; The "session" collection.
+ (if (or (null collection) (string-equal "session" collection))
+ secrets-session-collection-path)
+ ;; Check for an alias.
+ (let ((collection-path
+ (dbus-call-method
+ :session secrets-service secrets-path
+ secrets-interface-service "ReadAlias" collection)))
+ (unless (secrets-empty-path collection-path)
+ collection-path))
+ ;; Check the collections.
+ (catch 'collection-found
+ (dolist (collection-path (secrets-get-collections) nil)
+ (when
+ (string-equal
+ collection
+ (secrets-get-collection-property collection-path "Label"))
+ (throw 'collection-found collection-path))))))
+
+(defun secrets-create-collection (collection)
+ "Create collection labelled COLLECTION if it doesn't exist.
+Return the D-Bus object path for collection."
+ (let ((collection-path (secrets-collection-path collection)))
+ ;; Create the collection.
+ (when (secrets-empty-path collection-path)
+ (setq collection-path
+ (secrets-prompt
+ (cadr
+ ;; "CreateCollection" returns the prompt path as second arg.
+ (dbus-call-method
+ :session secrets-service secrets-path
+ secrets-interface-service "CreateCollection"
+ `(:array (:dict-entry "Label" (:variant ,collection))))))))
+ ;; Return object path of the collection.
+ collection-path))
+
+(defun secrets-get-alias (alias)
+ "Return the collection name ALIAS is referencing to.
+For the time being, only the alias \"default\" is supported."
+ (secrets-get-collection-property
+ (dbus-call-method
+ :session secrets-service secrets-path
+ secrets-interface-service "ReadAlias" alias)
+ "Label"))
+
+(defun secrets-set-alias (collection alias)
+ "Set ALIAS as alias of collection labelled COLLECTION.
+For the time being, only the alias \"default\" is supported."
+ (let ((collection-path (secrets-collection-path collection)))
+ (unless (secrets-empty-path collection-path)
+ (dbus-call-method
+ :session secrets-service secrets-path
+ secrets-interface-service "SetAlias"
+ alias :object-path collection-path))))
+
+(defun secrets-unlock-collection (collection)
+ "Unlock collection labelled COLLECTION.
+If successful, return the object path of the collection."
+ (let ((collection-path (secrets-collection-path collection)))
+ (unless (secrets-empty-path collection-path)
+ (secrets-prompt
+ (cadr
+ (dbus-call-method
+ :session secrets-service secrets-path secrets-interface-service
+ "Unlock" `(:array :object-path ,collection-path)))))
+ collection-path))
+
+(defun secrets-delete-collection (collection)
+ "Delete collection labelled COLLECTION."
+ (let ((collection-path (secrets-collection-path collection)))
+ (unless (secrets-empty-path collection-path)
+ (secrets-prompt
+ (dbus-call-method
+ :session secrets-service collection-path
+ secrets-interface-collection "Delete")))))
+
+;;; Items.
+
+(defun secrets-get-items (collection-path)
+ "Return the object paths of all available items in COLLECTION-PATH."
+ (unless (secrets-empty-path collection-path)
+ (secrets-open-session)
+ (dbus-get-property
+ :session secrets-service collection-path
+ secrets-interface-collection "Items")))
+
+(defun secrets-get-item-properties (item-path)
+ "Return all properties of item identified by ITEM-PATH."
+ (unless (secrets-empty-path item-path)
+ (dbus-get-all-properties
+ :session secrets-service item-path
+ secrets-interface-item)))
+
+(defun secrets-get-item-property (item-path property)
+ "Return property PROPERTY of item identified by ITEM-PATH."
+ (unless (or (secrets-empty-path item-path) (not (stringp property)))
+ (dbus-get-property
+ :session secrets-service item-path
+ secrets-interface-item property)))
+
+(defun secrets-list-items (collection)
+ "Return a list of all item labels of COLLECTION."
+ (let ((collection-path (secrets-unlock-collection collection)))
+ (unless (secrets-empty-path collection-path)
+ (mapcar
+ (lambda (item-path)
+ (secrets-get-item-property item-path "Label"))
+ (secrets-get-items collection-path)))))
+
+(defun secrets-search-items (collection &rest attributes)
+ "Search items in COLLECTION with ATTRIBUTES.
+ATTRIBUTES are key-value pairs. The keys are keyword symbols,
+starting with a colon. Example:
+
+ \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
+ :method \"sudo\" :user \"joe\" :host \"remote-host\"\)
+
+The object paths of the found items are returned as list."
+ (let ((collection-path (secrets-unlock-collection collection))
+ result props)
+ (unless (secrets-empty-path collection-path)
+ ;; Create attributes list.
+ (while (consp (cdr attributes))
+ (unless (keywordp (car attributes))
+ (error 'wrong-type-argument (car attributes)))
+ (setq props (add-to-list
+ 'props
+ (list :dict-entry
+ (substring (symbol-name (car attributes)) 1)
+ (cadr attributes))
+ 'append)
+ attributes (cddr attributes)))
+ ;; Search. The result is a list of two lists, the object paths
+ ;; of the unlocked and the locked items.
+ (setq result
+ (dbus-call-method
+ :session secrets-service collection-path
+ secrets-interface-collection "SearchItems"
+ (if props
+ (cons :array props)
+ '(:array :signature "{ss}"))))
+ ;; Return the found items.
+ (mapcar
+ (lambda (item-path) (secrets-get-item-property item-path "Label"))
+ (append (car result) (cadr result))))))
+
+(defun secrets-create-item (collection item password &rest attributes)
+ "Create a new item in COLLECTION with label ITEM and password PASSWORD.
+ATTRIBUTES are key-value pairs set for the created item. The
+keys are keyword symbols, starting with a colon. Example:
+
+ \(secrets-create-item \"Tramp collection\" \"item\" \"geheim\"
+ :method \"sudo\" :user \"joe\" :host \"remote-host\"\)
+
+The object path of the created item is returned."
+ (unless (member item (secrets-list-items collection))
+ (let ((collection-path (secrets-unlock-collection collection))
+ result props)
+ (unless (secrets-empty-path collection-path)
+ ;; Create attributes list.
+ (while (consp (cdr attributes))
+ (unless (keywordp (car attributes))
+ (error 'wrong-type-argument (car attributes)))
+ (setq props (add-to-list
+ 'props
+ (list :dict-entry
+ (substring (symbol-name (car attributes)) 1)
+ (cadr attributes))
+ 'append)
+ attributes (cddr attributes)))
+ ;; Create the item.
+ (setq result
+ (dbus-call-method
+ :session secrets-service collection-path
+ secrets-interface-collection "CreateItem"
+ ;; Properties.
+ (append
+ `(:array
+ (:dict-entry "Label" (:variant ,item))
+ (:dict-entry
+ "Type" (:variant ,secrets-interface-item-type-generic)))
+ (when props
+ `((:dict-entry
+ "Attributes" (:variant ,(append '(:array) props))))))
+ ;; Secret.
+ `(:struct :object-path ,secrets-session-path
+ (:array :signature "y") ;; no parameters.
+ ,(dbus-string-to-byte-array password))
+ ;; Do not replace. Replace does not seem to work.
+ nil))
+ (secrets-prompt (cadr result))
+ ;; Return the object path.
+ (car result)))))
+
+(defun secrets-item-path (collection item)
+ "Return the object path of item labelled ITEM in COLLECTION.
+If there is no such item, return nil."
+ (let ((collection-path (secrets-unlock-collection collection)))
+ (catch 'item-found
+ (dolist (item-path (secrets-get-items collection-path))
+ (when (string-equal item (secrets-get-item-property item-path "Label"))
+ (throw 'item-found item-path))))))
+
+(defun secrets-get-secret (collection item)
+ "Return the secret of item labelled ITEM in COLLECTION.
+If there is no such item, return nil."
+ (let ((item-path (secrets-item-path collection item)))
+ (unless (secrets-empty-path item-path)
+ (dbus-byte-array-to-string
+ (caddr
+ (dbus-call-method
+ :session secrets-service item-path secrets-interface-item
+ "GetSecret" :object-path secrets-session-path))))))
+
+(defun secrets-get-attributes (collection item)
+ "Return the lookup attributes of item labelled ITEM in COLLECTION.
+If there is no such item, or the item has no attributes, return nil."
+ (unless (stringp collection) (setq collection "default"))
+ (let ((item-path (secrets-item-path collection item)))
+ (unless (secrets-empty-path item-path)
+ (mapcar
+ (lambda (attribute)
+ (cons (intern (concat ":" (car attribute))) (cadr attribute)))
+ (dbus-get-property
+ :session secrets-service item-path
+ secrets-interface-item "Attributes")))))
+
+(defun secrets-get-attribute (collection item attribute)
+ "Return the value of ATTRIBUTE of item labelled ITEM in COLLECTION.
+If there is no such item, or the item doesn't own this attribute, return nil."
+ (cdr (assoc attribute (secrets-get-attributes collection item))))
+
+(defun secrets-delete-item (collection item)
+ "Delete ITEM in COLLECTION."
+ (let ((item-path (secrets-item-path collection item)))
+ (unless (secrets-empty-path item-path)
+ (secrets-prompt
+ (dbus-call-method
+ :session secrets-service item-path
+ secrets-interface-item "Delete")))))
+
+;;; Visualization.
+
+(define-derived-mode secrets-mode nil "Secrets"
+ "Major mode for presenting password entries retrieved by Security Service.
+In this mode, widgets represent the search results.
+
+\\{secrets-mode-map}"
+ ;; Keymap.
+ (setq secrets-mode-map (copy-keymap special-mode-map))
+ (set-keymap-parent secrets-mode-map widget-keymap)
+ (define-key secrets-mode-map "z" 'kill-this-buffer)
+
+ ;; When we toggle, we must set temporary widgets.
+ (set (make-local-variable 'tree-widget-after-toggle-functions)
+ '(secrets-tree-widget-after-toggle-function))
+
+ (when (not (called-interactively-p 'interactive))
+ ;; Initialize buffer.
+ (setq buffer-read-only t)
+ (let ((inhibit-read-only t))
+ (erase-buffer))))
+
+;; It doesn't make sense to call it interactively.
+(put 'secrets-mode 'disabled t)
+
+;; The very first buffer created with `secrets-mode' does not have the
+;; keymap etc. So we create a dummy buffer. Stupid.
+(with-temp-buffer (secrets-mode))
+
+;; We autoload `secrets-show-secrets' only on systems with D-Bus support.
+;;;###autoload(when (featurep 'dbusbind)
+;;;###autoload (autoload 'secrets-show-secrets "secrets" nil t))
+
+(defun secrets-show-secrets ()
+ "Display a list of collections from the Secret Service API.
+The collections are in tree view, that means they can be expanded
+to the corresponding secret items, which could also be expanded
+to their attributes."
+ (interactive)
+
+ ;; Check, whether the Secret Service API is enabled.
+ (if (null secrets-enabled)
+ (message "Secret Service not available")
+
+ ;; Create the search buffer.
+ (with-current-buffer (get-buffer-create "*Secrets*")
+ (switch-to-buffer-other-window (current-buffer))
+ ;; Inialize buffer with `secrets-mode'.
+ (secrets-mode)
+ (secrets-show-collections))))
+
+(defun secrets-show-collections ()
+ "Show all available collections."
+ (let ((inhibit-read-only t)
+ (alias (secrets-get-alias "default")))
+ (erase-buffer)
+ (tree-widget-set-theme "folder")
+ (dolist (coll (secrets-list-collections))
+ (widget-create
+ `(tree-widget
+ :tag ,coll
+ :collection ,coll
+ :open nil
+ :sample-face bold
+ :expander secrets-expand-collection)))))
+
+(defun secrets-expand-collection (widget)
+ "Expand items of collection shown as WIDGET."
+ (let ((coll (widget-get widget :collection)))
+ (mapcar
+ (lambda (item)
+ `(tree-widget
+ :tag ,item
+ :collection ,coll
+ :item ,item
+ :open nil
+ :sample-face bold
+ :expander secrets-expand-item))
+ (secrets-list-items coll))))
+
+(defun secrets-expand-item (widget)
+ "Expand password and attributes of item shown as WIDGET."
+ (let* ((coll (widget-get widget :collection))
+ (item (widget-get widget :item))
+ (attributes (secrets-get-attributes coll item))
+ ;; padding is needed to format attribute names.
+ (padding
+ (apply
+ 'max
+ (cons
+ (1+ (length "password"))
+ (mapcar
+ ;; Atribute names have a leading ":", which will be suppressed.
+ (lambda (attribute) (length (symbol-name (car attribute))))
+ attributes)))))
+ (cons
+ ;; The password widget.
+ `(editable-field :tag "password"
+ :secret ?*
+ :value ,(secrets-get-secret coll item)
+ :sample-face widget-button-pressed
+ ;; We specify :size in order to limit the field.
+ :size 0
+ :format ,(concat
+ "%{%t%}:"
+ (make-string (- padding (length "password")) ? )
+ "%v\n"))
+ (mapcar
+ (lambda (attribute)
+ (let ((name (substring (symbol-name (car attribute)) 1))
+ (value (cdr attribute)))
+ ;; The attribute widget.
+ `(editable-field :tag ,name
+ :value ,value
+ :sample-face widget-documentation
+ ;; We specify :size in order to limit the field.
+ :size 0
+ :format ,(concat
+ "%{%t%}:"
+ (make-string (- padding (length name)) ? )
+ "%v\n"))))
+ attributes))))
+
+(defun secrets-tree-widget-after-toggle-function (widget &rest ignore)
+ "Add a temporary widget to show the password."
+ (dolist (child (widget-get widget :children))
+ (when (widget-member child :secret)
+ (goto-char (widget-field-end child))
+ (widget-insert " ")
+ (widget-create-child-and-convert
+ child 'push-button
+ :notify 'secrets-tree-widget-show-password
+ "Show password")))
+ (widget-setup))
+
+(defun secrets-tree-widget-show-password (widget &rest ignore)
+ "Show password, and remove temporary widget."
+ (let ((parent (widget-get widget :parent)))
+ (widget-put parent :secret nil)
+ (widget-default-value-set parent (widget-get parent :value))
+ (widget-setup)))
+
+;;; Initialization.
+
+(when (dbus-ping :session secrets-service 100)
+
+ ;; We must reset all variables, when there is a new instance of the
+ ;; "org.freedesktop.secrets" service.
+ (dbus-register-signal
+ :session dbus-service-dbus dbus-path-dbus
+ dbus-interface-dbus "NameOwnerChanged"
+ (lambda (&rest args)
+ (when secrets-debug (message "Secret Service has changed: %S" args))
+ (setq secrets-session-path secrets-empty-path
+ secrets-prompt-signal nil
+ secrets-collection-paths nil))
+ secrets-service)
+
+ ;; We want to refresh our cache, when there is a change in
+ ;; collections.
+ (dbus-register-signal
+ :session secrets-service secrets-path
+ secrets-interface-service "CollectionCreated"
+ 'secrets-collection-handler)
+
+ (dbus-register-signal
+ :session secrets-service secrets-path
+ secrets-interface-service "CollectionDeleted"
+ 'secrets-collection-handler)
+
+ ;; We shall inform, whether the secret service is enabled on this
+ ;; machine.
+ (setq secrets-enabled t))
+
+(provide 'secrets)
+
+;;; TODO:
+
+;; * secrets-debug should be structured like auth-source-debug to
+;; prevent leaking sensitive information. Right now I don't see
+;; anything sensitive though.
+;; * Check, whether the dh-ietf1024-aes128-cbc-pkcs7 algorithm can be
+;; used for the transfer of the secrets. Currently, we use the
+;; plain algorithm.
(setq tramp-locked nil)
;; Flush password cache.
- (when (functionp 'password-reset)
- (funcall (symbol-function 'password-reset)))
+ (tramp-compat-funcall 'password-reset)
;; Flush file and connection cache.
(clrhash tramp-cache-data)
(base64-encode-string val))))))
;; Dump variable.
- (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf)
+ (tramp-compat-funcall 'reporter-dump-variable varsym mailbuf)
(unless (hash-table-p val)
;; Remove string quotation.
(load "mml" 'noerror))
(require 'message nil 'noerror)
(require 'mml nil 'noerror))
- (when (functionp 'message-mode)
- (funcall (symbol-function 'message-mode)))
- (when (functionp 'mml-mode)
- (funcall (symbol-function 'mml-mode) t)))
+ (tramp-compat-funcall 'message-mode)
+ (tramp-compat-funcall 'mml-mode t))
(defun tramp-append-tramp-buffers ()
"Append Tramp buffers and buffer local variables into the bug report."
(erase-buffer)
(insert "\n(setq\n")
(lisp-indent-line)
- (funcall (symbol-function 'reporter-dump-variable)
- 'buffer-name (current-buffer))
+ (tramp-compat-funcall
+ 'reporter-dump-variable 'buffer-name (current-buffer))
(dolist (varsym-or-cons-cell (buffer-local-variables buffer))
(let ((varsym (or (car-safe varsym-or-cons-cell)
varsym-or-cons-cell)))
(when (string-match "tramp" (symbol-name varsym))
- (funcall
- (symbol-function 'reporter-dump-variable)
- varsym (current-buffer)))))
+ (tramp-compat-funcall
+ 'reporter-dump-variable varsym (current-buffer)))))
(lisp-indent-line)
(insert ")\n"))
(insert-buffer-substring elbuf)))
(symbol-value 'mml-mode))
(let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
- (buffer-list (funcall (symbol-function 'tramp-list-tramp-buffers)))
+ (buffer-list (tramp-compat-funcall 'tramp-list-tramp-buffers))
(curbuf (current-buffer)))
;; There is at least one Tramp buffer.
use another mail agent (by copying the contents of this buffer)
please ensure that the buffers are attached to your email.\n\n")
(dolist (buffer buffer-list)
- (funcall (symbol-function 'mml-insert-empty-tag)
- 'part 'type "text/plain" 'encoding "base64"
- 'disposition "attachment" 'buffer buffer
- 'description buffer))
+ (tramp-compat-funcall
+ 'mml-insert-empty-tag 'part 'type "text/plain"
+ 'encoding "base64" 'disposition "attachment" 'buffer buffer
+ 'description buffer))
(set-buffer-modified-p nil))
;; Don't send. Delete the message buffer.
;;; Commentary:
-;; Tramp's main Emacs version for development is GNU Emacs 23. This
-;; package provides compatibility functions for GNU Emacs 21, GNU
-;; Emacs 22 and XEmacs 21.4+.
+;; Tramp's main Emacs version for development is GNU Emacs 24. This
+;; package provides compatibility functions for GNU Emacs 22, GNU
+;; Emacs 23 and XEmacs 21.4+.
;;; Code:
(unless (boundp 'byte-compile-not-obsolete-var)
(defvar byte-compile-not-obsolete-var nil))
(setq byte-compile-not-obsolete-var 'directory-sep-char)
- (if (boundp 'byte-compile-not-obsolete-vars) ; Emacs 23.2
- (setq byte-compile-not-obsolete-vars '(directory-sep-char)))
+ ;; Emacs 23.2.
+ (unless (boundp 'byte-compile-not-obsolete-vars)
+ (defvar byte-compile-not-obsolete-vars nil))
+ (setq byte-compile-not-obsolete-vars '(directory-sep-char))
;; `with-temp-message' does not exists in XEmacs.
(condition-case nil
(with-temp-message (current-message) nil)
(error (defmacro with-temp-message (message &rest body) `(progn ,@body))))
+ ;; For not existing functions, or functions with a changed argument
+ ;; list, there are compiler warnings. We want to avoid them in
+ ;; cases we know what we do.
+ (defmacro tramp-compat-funcall (function &rest arguments)
+ (if (featurep 'xemacs)
+ `(funcall (symbol-function ,function) ,@arguments)
+ `(when (or (subrp ,function) (functionp ,function))
+ (with-no-warnings (funcall ,function ,@arguments)))))
+
;; `set-buffer-multibyte' comes from Emacs Leim.
(unless (fboundp 'set-buffer-multibyte)
(defalias 'set-buffer-multibyte 'ignore))
(tramp-file-name-handler
'file-remote-p file identification connected)))))
- ;; `process-file' exists since Emacs 22.
+ ;; `process-file' does not exist in XEmacs.
(unless (fboundp 'process-file)
(defalias 'process-file
(lambda (program &optional infile buffer display &rest args)
;; return the original filename if it can't expand anything. Let's
;; just hope that this doesn't break anything else.
;; It is not needed anymore since GNU Emacs 23.2.
- (unless (or (featurep 'xemacs) (featurep 'files 'remote-wildcards))
+ (unless (or (featurep 'xemacs)
+ ;; `featurep' has only one argument in XEmacs.
+ (funcall 'featurep 'files 'remote-wildcards))
(defadvice file-expand-wildcards
(around tramp-advice-file-expand-wildcards activate)
(let ((name (ad-get-arg 0)))
own implementation."
(cond
((fboundp 'line-beginning-position)
- (funcall (symbol-function 'line-beginning-position)))
- ((fboundp 'point-at-bol) (funcall (symbol-function 'point-at-bol)))
+ (tramp-compat-funcall 'line-beginning-position))
+ ((fboundp 'point-at-bol) (tramp-compat-funcall 'point-at-bol))
(t (save-excursion (beginning-of-line) (point)))))
(defsubst tramp-compat-line-end-position ()
Calls `line-end-position' or `point-at-eol' if defined, else
own implementation."
(cond
- ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position)))
- ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol)))
+ ((fboundp 'line-end-position) (tramp-compat-funcall 'line-end-position))
+ ((fboundp 'point-at-eol) (tramp-compat-funcall 'point-at-eol))
(t (save-excursion (end-of-line) (point)))))
(defsubst tramp-compat-temporary-file-directory ()
this is the function `temp-directory'."
(cond
((boundp 'temporary-file-directory) (symbol-value 'temporary-file-directory))
- ((fboundp 'temp-directory) (funcall (symbol-function 'temp-directory)))
+ ((fboundp 'temp-directory) (tramp-compat-funcall 'temp-directory))
((let ((d (getenv "TEMP"))) (and d (file-directory-p d)))
(file-name-as-directory (getenv "TEMP")))
((let ((d (getenv "TMP"))) (and d (file-directory-p d)))
"`temp-directory' is defined -- using /tmp."))
(file-name-as-directory "/tmp"))))
-;; `make-temp-file' exists in Emacs only. The third parameter SUFFIX
-;; has been introduced with Emacs 22. We try it, if it fails, we fall
-;; back to `make-temp-name', creating the temporary file immediately
-;; in order to avoid a security hole.
+;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own
+;; implementation with `make-temp-name', creating the temporary file
+;; immediately in order to avoid a security hole.
(defsubst tramp-compat-make-temp-file (filename &optional dir-flag)
"Create a temporary file (compat function).
Add the extension of FILENAME, if existing."
(tramp-compat-temporary-file-directory)))
(extension (file-name-extension filename t))
result)
- (condition-case nil
+ (if (fboundp 'make-temp-file)
(setq result
- (funcall
- (symbol-function 'make-temp-file) prefix dir-flag extension))
- (error
- ;; We use our own implementation, taken from files.el.
- (while
- (condition-case ()
- (progn
- (setq result (concat (make-temp-name prefix) extension))
- (if dir-flag
- (make-directory result)
- (write-region
- "" nil result nil 'silent nil
- ;; 7th parameter is MUSTBENEW in Emacs, and
- ;; CODING-SYSTEM in XEmacs. It is not a security
- ;; hole in XEmacs if we cannot use this parameter,
- ;; because XEmacs uses a user-specific
- ;; subdirectory with 0700 permissions.
- (when (not (featurep 'xemacs)) 'excl)))
- nil)
- (file-already-exists t))
- ;; The file was somehow created by someone else between
- ;; `make-temp-name' and `write-region', let's try again.
- nil)))
+ (tramp-compat-funcall 'make-temp-file prefix dir-flag extension))
+ ;; We use our own implementation, taken from files.el.
+ (while
+ (condition-case ()
+ (progn
+ (setq result (concat (make-temp-name prefix) extension))
+ (if dir-flag
+ (make-directory result)
+ (write-region "" nil result nil 'silent))
+ nil)
+ (file-already-exists t))
+ ;; The file was somehow created by someone else between
+ ;; `make-temp-name' and `write-region', let's try again.
+ nil))
result))
-;; `most-positive-fixnum' arrived in Emacs 22. Before, and in XEmacs,
-;; it is a fixed value.
+;; `most-positive-fixnum' does not exist in XEmacs.
(defsubst tramp-compat-most-positive-fixnum ()
"Return largest positive integer value (compat function)."
(cond
((boundp 'most-positive-fixnum) (symbol-value 'most-positive-fixnum))
- ;; Default value in XEmacs and Emacs 21.
+ ;; Default value in XEmacs.
(t 134217727)))
-;; ID-FORMAT exists since Emacs 22.
+;; ID-FORMAT does not exists in XEmacs.
(defun tramp-compat-file-attributes (filename &optional id-format)
"Like `file-attributes' for Tramp files (compat function)."
(cond
((tramp-tramp-file-p filename)
(tramp-file-name-handler 'file-attributes filename id-format))
(t (condition-case nil
- (funcall (symbol-function 'file-attributes) filename id-format)
- (error (file-attributes filename))))))
+ (tramp-compat-funcall 'file-attributes filename id-format)
+ (wrong-number-of-arguments (file-attributes filename))))))
;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not
;; hurt to ignore it for other (X)Emacs versions.
+;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.
(defun tramp-compat-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files (compat function)."
- (if preserve-uid-gid
- (funcall
- (symbol-function 'copy-file)
- filename newname ok-if-already-exists keep-date preserve-uid-gid)
- (copy-file filename newname ok-if-already-exists keep-date)))
+ (cond
+ (preserve-selinux-context
+ (tramp-compat-funcall
+ 'copy-file filename newname ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context))
+ (preserve-uid-gid
+ (tramp-compat-funcall
+ 'copy-file filename newname ok-if-already-exists keep-date
+ preserve-uid-gid))
+ (t
+ (copy-file filename newname ok-if-already-exists keep-date))))
;; `copy-directory' is a new function in Emacs 23.2. Implementation
;; is taken from there.
(directory newname &optional keep-time parents)
"Make a copy of DIRECTORY (compat function)."
(if (fboundp 'copy-directory)
- (funcall
- (symbol-function 'copy-directory) directory newname keep-time parents)
+ (tramp-compat-funcall 'copy-directory directory newname keep-time parents)
- ;; If default-directory is a remote directory, make sure we find
- ;; its copy-directory handler.
+ ;; If `default-directory' is a remote directory, make sure we find
+ ;; its `copy-directory' handler.
(let ((handler (or (find-file-name-handler directory 'copy-directory)
(find-file-name-handler newname 'copy-directory))))
(if handler
(if keep-time
(set-file-times newname (nth 5 (file-attributes directory))))))))
-;; `copy-tree' is a built-in function in XEmacs. In Emacs 21, it is
-;; an autoloaded function in cl-extra.el. Since Emacs 22, it is part
-;; of subr.el. There are problems when autoloading, therefore we test
-;; for `subrp' and `symbol-file'. Implementation is taken from Emacs 23.
-(defun tramp-compat-copy-tree (tree)
- "Make a copy of TREE (compat function)."
- (if (or (subrp 'copy-tree) (symbol-file 'copy-tree))
- (funcall (symbol-function 'copy-tree) tree)
- (let (result)
- (while (consp tree)
- (let ((newcar (car tree)))
- (if (consp (car tree))
- (setq newcar (tramp-compat-copy-tree (car tree))))
- (push newcar result))
- (setq tree (cdr tree)))
- (nconc (nreverse result) tree))))
+;; FORCE has been introduced with Emacs 24.1.
+(defun tramp-compat-delete-file (filename &optional force)
+ "Like `delete-file' for Tramp files (compat function)."
+ (if (null force)
+ (delete-file filename)
+ (condition-case nil
+ (tramp-compat-funcall 'delete-file filename force)
+ ;; This Emacs version does not support the FORCE flag. Setting
+ ;; `delete-by-moving-to-trash' shall give us the same effect.
+ (wrong-number-of-arguments
+ (let ((delete-by-moving-to-trash
+ (cond
+ ((null force) t)
+ ((boundp 'delete-by-moving-to-trash)
+ (symbol-value 'delete-by-moving-to-trash))
+ (t nil))))
+ (delete-file filename))))))
;; RECURSIVE has been introduced with Emacs 23.2.
(defun tramp-compat-delete-directory (directory &optional recursive)
"Like `delete-directory' for Tramp files (compat function)."
- (if recursive
- (funcall (symbol-function 'delete-directory) directory recursive)
- (delete-directory directory)))
-
-;; `number-sequence' has been introduced in Emacs 22. Implementation
-;; is taken from Emacs 23.
+ (if (null recursive)
+ (delete-directory directory)
+ (condition-case nil
+ (tramp-compat-funcall 'delete-directory directory recursive)
+ ;; This Emacs version does not support the RECURSIVE flag. We
+ ;; use the implementation from Emacs 23.2.
+ (wrong-number-of-arguments
+ (setq directory (directory-file-name (expand-file-name directory)))
+ (if (not (file-symlink-p directory))
+ (mapc (lambda (file)
+ (if (eq t (car (file-attributes file)))
+ (tramp-compat-delete-directory file recursive)
+ (delete-file file)))
+ (directory-files
+ directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
+ (delete-directory directory)))))
+
+;; `number-sequence' does not exist in XEmacs. Implementation is
+;; taken from Emacs 23.
(defun tramp-compat-number-sequence (from &optional to inc)
"Return a sequence of numbers from FROM to TO as a list (compat function)."
(if (or (subrp 'number-sequence) (symbol-file 'number-sequence))
- (funcall (symbol-function 'number-sequence) from to inc)
+ (tramp-compat-funcall 'number-sequence from to inc)
(if (or (not to) (= from to))
(list from)
(or inc (setq inc 1))
(cond
;; GNU Emacs 22 on w32.
((fboundp 'w32-window-exists-p)
- (funcall (symbol-function 'w32-window-exists-p)
- process-name process-name))
+ (tramp-compat-funcall 'w32-window-exists-p process-name process-name))
;; GNU Emacs 23.
((and (fboundp 'list-system-processes) (fboundp 'process-attributes))
(let (result)
- (dolist (pid (funcall (symbol-function 'list-system-processes)) result)
- (let ((attributes
- (funcall (symbol-function 'process-attributes) pid)))
+ (dolist (pid (tramp-compat-funcall 'list-system-processes) result)
+ (let ((attributes (tramp-compat-funcall 'process-attributes pid)))
(when (and (string-equal
(cdr (assoc 'user attributes)) (user-login-name))
(let ((comm (cdr (assoc 'comm attributes))))
;; parameter of `write-region'. Transfer of binary data fails due to
;; Emacs' process input/output handling.
-
;;; Code:
+(eval-when-compile
+ ;; Pacify byte-compiler.
+ (require 'cl))
+
(require 'tramp)
(require 'tramp-cache)
(require 'tramp-compat)
(file-executable-p . tramp-fish-handle-file-executable-p)
(file-exists-p . tramp-fish-handle-file-exists-p)
(file-local-copy . tramp-fish-handle-file-local-copy)
- (file-remote-p . tramp-handle-file-remote-p)
(file-modes . tramp-handle-file-modes)
(file-name-all-completions . tramp-fish-handle-file-name-all-completions)
(file-name-as-directory . tramp-handle-file-name-as-directory)
(file-ownership-preserved-p . ignore)
(file-readable-p . tramp-fish-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
+ (file-remote-p . tramp-handle-file-remote-p)
+ ;; `file-selinux-context' performed by default handler.
(file-symlink-p . tramp-handle-file-symlink-p)
;; `file-truename' performed by default handler
(file-writable-p . tramp-fish-handle-file-writable-p)
(make-symbolic-link . tramp-fish-handle-make-symbolic-link)
(rename-file . tramp-fish-handle-rename-file)
(set-file-modes . tramp-fish-handle-set-file-modes)
+ ;; `set-file-selinux-context' performed by default handler.
(set-file-times . tramp-fish-handle-set-file-times)
(set-visited-file-modtime . ignore)
(shell-command . tramp-handle-shell-command)
v1 'file-error "Error with add-name-to-file %s" newname)))))
(defun tramp-fish-handle-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files."
(tramp-fish-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
(tramp-flush-directory-property v localname)
(tramp-fish-send-command-and-check v (format "#RMD %s" localname)))))
-(defun tramp-fish-handle-delete-file (filename)
+(defun tramp-fish-handle-delete-file (filename &optional force)
"Like `delete-file' for Tramp files."
(when (file-exists-p filename)
(with-parsed-tramp-file-name (expand-file-name filename) nil
"Like `directory-files-and-attributes' for Tramp files."
(mapcar
(lambda (x)
- ;; We cannot call `file-attributes' for backward compatibility reasons.
- ;; Its optional parameter ID-FORMAT is introduced with Emacs 22.
- (cons x (tramp-fish-handle-file-attributes
- (if full x (expand-file-name x directory)) id-format)))
+ (cons x
+ (tramp-compat-file-attributes
+ (if full x (expand-file-name x directory))
+ id-format)))
(directory-files directory full match nosort)))
(defun tramp-fish-handle-expand-file-name (name &optional dir)
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
- (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfile)
- (when (tramp-fish-retrieve-data v)
- ;; Save file
- (with-current-buffer (tramp-get-buffer v)
- (write-region (point-min) (point-max) tmpfile))
- (tramp-message v 4 "Fetching %s to tmp file %s...done" filename tmpfile)
- tmpfile))))
+ (with-progress-reporter
+ v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
+ (when (tramp-fish-retrieve-data v)
+ ;; Save file
+ (with-current-buffer (tramp-get-buffer v)
+ (write-region (point-min) (point-max) tmpfile))
+ tmpfile)))))
;; This function should return "foo/" for directories and "bar" for
;; files.
(let ((point (point))
size)
- (tramp-message v 4 "Fetching file %s..." filename)
- (when (tramp-fish-retrieve-data v)
- ;; Insert file
- (insert
- (with-current-buffer (tramp-get-buffer v)
- (let ((beg (or beg (point-min)))
- (end (min (or end (point-max)) (point-max))))
- (setq size (- end beg))
- (buffer-substring beg end))))
- (goto-char point))
- (tramp-message v 4 "Fetching file %s...done" filename)
+ (with-progress-reporter v 3 (format "Fetching file %s" filename)
+ (when (tramp-fish-retrieve-data v)
+ ;; Insert file
+ (insert
+ (with-current-buffer (tramp-get-buffer v)
+ (let ((beg (or beg (point-min)))
+ (end (min (or end (point-max)) (point-max))))
+ (setq size (- end beg))
+ (buffer-substring beg end))))
+ (goto-char point)))
(list (expand-file-name filename) size)))))
localname)))))
(tramp-error
v 'file-already-exists "File %s already exists" localname)
- (delete-file linkname)))
+ (tramp-compat-delete-file linkname 'force)))
;; If FILENAME is a Tramp name, use just the localname component.
(when (tramp-tramp-file-p filename)
;; Provide error file.
(when tmpstderr (rename-file tmpstderr (cadr destination) t))
;; Cleanup.
- (when tmpinput (delete-file tmpinput))
- (when tmpoutput (delete-file tmpoutput))
+ (when tmpinput (tramp-compat-delete-file tmpinput 'force))
+ (when tmpoutput (tramp-compat-delete-file tmpoutput 'force))
;; Return exit status.
ret)))
;; last line
((looking-at "^$")
(return)))
- ;; delete line
+ ;; Delete line.
(forward-line)
(delete-region (point-min) (point))))
- ;; delete trailing empty line
+ ;; Delete trailing empty line.
(forward-line)
(delete-region (point-min) (point))
- ;; Return entry in file-attributes format
+ ;; Return entry in `file-attributes' format.
(list localname link -1 uid gid '(0 0) mtime '(0 0) size mode nil)))
(defun tramp-fish-retrieve-data (vec)
(delete-process p))
(setenv "TERM" tramp-terminal-type)
(setenv "PS1" tramp-initial-end-of-output)
- (tramp-message
- vec 3 "Opening connection for %s@%s using %s..."
- tramp-current-user tramp-current-host tramp-current-method)
-
- (let* ((process-connection-type tramp-process-connection-type)
- (inhibit-eol-conversion nil)
- (coding-system-for-read 'binary)
- (coding-system-for-write 'binary)
- ;; This must be done in order to avoid our file name handler.
- (p (let ((default-directory
- (tramp-compat-temporary-file-directory)))
- (start-process
- (or (tramp-get-connection-property vec "process-name" nil)
- (tramp-buffer-name vec))
- (tramp-get-connection-buffer vec)
- "ssh" "-l"
- (tramp-file-name-user vec)
- (tramp-file-name-host vec)))))
- (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " "))
-
- ;; Check whether process is alive.
- (tramp-set-process-query-on-exit-flag p nil)
-
- (tramp-process-actions p vec tramp-actions-before-shell 60)
- (tramp-fish-send-command vec tramp-fish-start-fish-server-command)
- (tramp-message
- vec 3
- "Found remote shell prompt on `%s'" (tramp-file-name-host vec))))))
+ (with-progress-reporter
+ vec 3
+ (format "Opening connection for %s@%s using %s"
+ tramp-current-user tramp-current-host tramp-current-method)
+
+ (let* ((process-connection-type tramp-process-connection-type)
+ (inhibit-eol-conversion nil)
+ (coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ ;; This must be done in order to avoid our file name handler.
+ (p (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (start-process
+ (or (tramp-get-connection-property vec "process-name" nil)
+ (tramp-buffer-name vec))
+ (tramp-get-connection-buffer vec)
+ "ssh" "-l"
+ (tramp-file-name-user vec)
+ (tramp-file-name-host vec)))))
+ (tramp-message
+ vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+
+ ;; Check whether process is alive.
+ (tramp-set-process-query-on-exit-flag p nil)
+
+ (tramp-process-actions p vec tramp-actions-before-shell 60)
+ (tramp-fish-send-command vec tramp-fish-start-fish-server-command)
+ (tramp-message
+ vec 3
+ "Found remote shell prompt on `%s'" (tramp-file-name-host vec)))))))
(defun tramp-fish-send-command (vec command)
"Send the COMMAND to connection VEC."
;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
(unwind-protect
(rename-file tmpfile newname (car args))
;; Cleanup.
- (ignore-errors (delete-file tmpfile)))))
+ (ignore-errors (tramp-compat-delete-file tmpfile 'force)))))
;; Normally, the handlers must be discarded.
;; `inhibit-file-name-handlers' isn't sufficient, because the
(file-executable-p . tramp-gvfs-handle-file-executable-p)
(file-exists-p . tramp-gvfs-handle-file-exists-p)
(file-local-copy . tramp-gvfs-handle-file-local-copy)
- (file-remote-p . tramp-handle-file-remote-p)
;; `file-modes' performed by default handler.
(file-name-all-completions . tramp-gvfs-handle-file-name-all-completions)
(file-name-as-directory . tramp-handle-file-name-as-directory)
(file-ownership-preserved-p . ignore)
(file-readable-p . tramp-gvfs-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
+ (file-remote-p . tramp-handle-file-remote-p)
+ (file-selinux-context . tramp-gvfs-handle-file-selinux-context)
(file-symlink-p . tramp-handle-file-symlink-p)
;; `file-truename' performed by default handler.
(file-writable-p . tramp-gvfs-handle-file-writable-p)
(process-file . tramp-gvfs-handle-process-file)
(rename-file . tramp-gvfs-handle-rename-file)
(set-file-modes . tramp-gvfs-handle-set-file-modes)
+ (set-file-selinux-context . tramp-gvfs-handle-set-file-selinux-context)
(set-visited-file-modtime . tramp-gvfs-handle-set-visited-file-modtime)
(shell-command . tramp-gvfs-handle-shell-command)
(start-file-process . tramp-gvfs-handle-start-file-process)
;; File name primitives.
(defun tramp-gvfs-handle-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files."
- (copy-file
- (if (tramp-gvfs-file-name-p filename)
- (tramp-gvfs-fuse-file-name filename)
- filename)
- (if (tramp-gvfs-file-name-p newname)
- (tramp-gvfs-fuse-file-name newname)
- newname)
- ok-if-already-exists keep-date preserve-uid-gid))
+ (let ((args
+ (list
+ (if (tramp-gvfs-file-name-p filename)
+ (tramp-gvfs-fuse-file-name filename)
+ filename)
+ (if (tramp-gvfs-file-name-p newname)
+ (tramp-gvfs-fuse-file-name newname)
+ newname)
+ ok-if-already-exists keep-date preserve-uid-gid)))
+ (when preserve-selinux-context
+ (setq args (append args (list preserve-selinux-context))))
+ (apply 'copy-file args)))
(defun tramp-gvfs-handle-delete-directory (directory &optional recursive)
"Like `delete-directory' for Tramp files."
(tramp-compat-delete-directory
(tramp-gvfs-fuse-file-name directory) recursive))
-(defun tramp-gvfs-handle-delete-file (filename)
+(defun tramp-gvfs-handle-delete-file (filename &optional force)
"Like `delete-file' for Tramp files."
- (delete-file (tramp-gvfs-fuse-file-name filename)))
+ (tramp-compat-delete-file (tramp-gvfs-fuse-file-name filename) force))
(defun tramp-gvfs-handle-directory-files
(directory &optional full match nosort)
"Like `file-readable-p' for Tramp files."
(file-readable-p (tramp-gvfs-fuse-file-name filename)))
+(defun tramp-gvfs-handle-file-selinux-context (filename)
+ "Like `file-selinux-context' for Tramp files."
+ (tramp-compat-funcall
+ 'file-selinux-context (tramp-gvfs-fuse-file-name filename)))
+
(defun tramp-gvfs-handle-file-writable-p (filename)
"Like `file-writable-p' for Tramp files."
(file-writable-p (tramp-gvfs-fuse-file-name filename)))
(with-tramp-gvfs-error-message filename 'set-file-modes
(tramp-gvfs-fuse-file-name filename) mode))
+(defun tramp-gvfs-handle-set-file-selinux-context (filename context)
+ "Like `set-file-selinux-context' for Tramp files."
+ (with-tramp-gvfs-error-message filename 'set-file-selinux-context
+ (tramp-gvfs-fuse-file-name filename) context))
+
(defun tramp-gvfs-handle-set-visited-file-modtime (&optional time-list)
"Like `set-visited-file-modtime' for Tramp files."
(let ((buffer-file-name (tramp-gvfs-fuse-file-name (buffer-file-name))))
"gvfs-save" tmpfile (tramp-get-buffer v) nil
(tramp-gvfs-url-file-name filename)))
(signal (car err) (cdr err)))
- (delete-file tmpfile)))))
+ (tramp-compat-delete-file tmpfile 'force)))))
;; Set file modification time.
(when (or (eq visit t) (stringp visit))
(tramp-gvfs-object-path
(tramp-make-tramp-file-name method user host ""))))
- (if (zerop (length (tramp-file-name-user vec)))
- (tramp-message
- vec 3 "Opening connection for %s using %s..." host method)
- (tramp-message
- vec 3 "Opening connection for %s@%s using %s..." user host method))
-
- ;; Enable auth-sorce and password-cache.
- (tramp-set-connection-property vec "first-password-request" t)
-
- ;; There will be a callback of "askPassword", when a password is
- ;; needed.
- (dbus-register-method
- :session dbus-service-emacs object-path
- tramp-gvfs-interface-mountoperation "askPassword"
- 'tramp-gvfs-handler-askpassword)
-
- ;; There could be a callback of "askQuestion", when adding fingerprint.
- (dbus-register-method
- :session dbus-service-emacs object-path
- tramp-gvfs-interface-mountoperation "askQuestion"
- 'tramp-gvfs-handler-askquestion)
-
- ;; The call must be asynchronously, because of the "askPassword"
- ;; or "askQuestion"callbacks.
- (with-tramp-dbus-call-method vec nil
- :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
- tramp-gvfs-interface-mounttracker "mountLocation"
- `(:struct
- ,(dbus-string-to-byte-array "/")
- ,(tramp-gvfs-mount-spec vec))
- (dbus-get-unique-name :session)
- :object-path object-path)
-
- ;; We must wait, until the mount is applied. This will be
- ;; indicated by the "mounted" signal, i.e. the "fuse-mountpoint"
- ;; file property.
- (with-timeout
- (60
- (if (zerop (length (tramp-file-name-user vec)))
+ (with-progress-reporter
+ vec 3
+ (if (zerop (length user))
+ (format "Opening connection for %s using %s" host method)
+ (format "Opening connection for %s@%s using %s" user host method))
+
+ ;; Enable auth-sorce and password-cache.
+ (tramp-set-connection-property vec "first-password-request" t)
+
+ ;; There will be a callback of "askPassword", when a password is
+ ;; needed.
+ (dbus-register-method
+ :session dbus-service-emacs object-path
+ tramp-gvfs-interface-mountoperation "askPassword"
+ 'tramp-gvfs-handler-askpassword)
+
+ ;; There could be a callback of "askQuestion", when adding fingerprint.
+ (dbus-register-method
+ :session dbus-service-emacs object-path
+ tramp-gvfs-interface-mountoperation "askQuestion"
+ 'tramp-gvfs-handler-askquestion)
+
+ ;; The call must be asynchronously, because of the "askPassword"
+ ;; or "askQuestion"callbacks.
+ (with-tramp-dbus-call-method vec nil
+ :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
+ tramp-gvfs-interface-mounttracker "mountLocation"
+ `(:struct
+ ,(dbus-string-to-byte-array "/")
+ ,(tramp-gvfs-mount-spec vec))
+ (dbus-get-unique-name :session)
+ :object-path object-path)
+
+ ;; We must wait, until the mount is applied. This will be
+ ;; indicated by the "mounted" signal, i.e. the "fuse-mountpoint"
+ ;; file property.
+ (with-timeout
+ (60
+ (if (zerop (length (tramp-file-name-user vec)))
+ (tramp-error
+ vec 'file-error
+ "Timeout reached mounting %s using %s" host method)
(tramp-error
vec 'file-error
- "Timeout reached mounting %s using %s" host method)
- (tramp-error
- vec 'file-error
- "Timeout reached mounting %s@%s using %s" user host method)))
- (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil))
- (read-event nil nil 0.1)))
-
- ;; We set the connection property "started" in order to put the
- ;; remote location into the cache, which is helpful for further
- ;; completion.
- (tramp-set-connection-property vec "started" t)
-
- (if (zerop (length (tramp-file-name-user vec)))
- (tramp-message
- vec 3 "Opening connection for %s using %s...done" host method)
- (tramp-message
- vec 3
- "Opening connection for %s@%s using %s...done" user host method)))))
+ "Timeout reached mounting %s@%s using %s" user host method)))
+ (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil))
+ (read-event nil nil 0.1)))
+
+ ;; We set the connection property "started" in order to put the
+ ;; remote location into the cache, which is helpful for further
+ ;; completion.
+ (tramp-set-connection-property vec "started" t)))))
\f
;; D-Bus BLUEZ functions.
(autoload 'epg-context-set-progress-callback "epg")
(autoload 'epg-decrypt-string "epg")
(autoload 'epg-encrypt-string "epg")
+(autoload 'epg-make-context "epg")
(autoload 'imap-hash-get "imap-hash")
(autoload 'imap-hash-make "imap-hash")
(autoload 'imap-hash-map "imap-hash")
(file-executable-p . tramp-imap-handle-file-executable-p)
(file-exists-p . tramp-imap-handle-file-exists-p)
(file-local-copy . tramp-imap-handle-file-local-copy)
- (file-remote-p . tramp-handle-file-remote-p)
(file-modes . tramp-handle-file-modes)
(file-name-all-completions . tramp-imap-handle-file-name-all-completions)
(file-name-as-directory . tramp-handle-file-name-as-directory)
(file-ownership-preserved-p . ignore)
(file-readable-p . tramp-imap-handle-file-readable-p)
(file-regular-p . tramp-handle-file-regular-p)
+ (file-remote-p . tramp-handle-file-remote-p)
+ ;; `file-selinux-context' performed by default handler.
(file-symlink-p . tramp-handle-file-symlink-p)
;; `file-truename' performed by default handler
(file-writable-p . tramp-imap-handle-file-writable-p)
(make-symbolic-link . ignore)
(rename-file . tramp-imap-handle-rename-file)
(set-file-modes . ignore)
+ ;; `set-file-selinux-context' performed by default handler.
(set-file-times . ignore) ;; tramp-imap-handle-set-file-times)
(set-visited-file-modtime . ignore)
(shell-command . ignore)
(defgroup tramp-imap nil
"Tramp over IMAP configuration."
:version "23.2"
- :group 'applications)
+ :group 'tramp)
(defcustom tramp-imap-subject-marker "tramp-imap-subject-marker"
"The subject marker that Tramp-IMAP will use."
(cons 'tramp-imap-file-name-p 'tramp-imap-file-name-handler))
(defun tramp-imap-handle-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files."
(tramp-imap-do-copy-or-rename-file
'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
(t2 (and (tramp-tramp-file-p newname)
(tramp-imap-file-name-p newname))))
- (when (and (not ok-if-already-exists) (file-exists-p newname))
- (with-parsed-tramp-file-name (if t1 filename newname) nil
- (tramp-error
- v 'file-already-exists "File %s already exists" newname)))
-
(with-parsed-tramp-file-name (if t1 filename newname) nil
- (tramp-message v 0 "Transferring %s to %s..." filename newname))
-
- ;; We just make a local copy of FILENAME, and write it then to
- ;; NEWNAME. This must be optimized, when both files are located
- ;; on the same IMAP server.
- (with-temp-buffer
- (if (and t1 t2)
- ;; We don't encrypt.
- (with-parsed-tramp-file-name newname nil
- (insert (tramp-imap-get-file filename nil))
- (tramp-imap-put-file
- v (current-buffer)
- (tramp-imap-file-name-name v)
- nil nil (nth 7 (file-attributes filename))))
- ;; One of them is not located on a IMAP mailbox.
- (insert-file-contents filename)
- (write-region (point-min) (point-max) newname)))
-
- (with-parsed-tramp-file-name (if t1 filename newname) nil
- (tramp-message v 0 "Transferring %s to %s...done" filename newname))
+ (when (and (not ok-if-already-exists) (file-exists-p newname))
+ (tramp-error
+ v 'file-already-exists "File %s already exists" newname))
+
+ (with-progress-reporter
+ v 0 (format "%s %s to %s"
+ (if (eq op 'copy) "Copying" "Renaming")
+ filename newname)
+
+ ;; We just make a local copy of FILENAME, and write it then to
+ ;; NEWNAME. This must be optimized, when both files are
+ ;; located on the same IMAP server.
+ (with-temp-buffer
+ (if (and t1 t2)
+ ;; We don't encrypt.
+ (with-parsed-tramp-file-name newname v1
+ (insert (tramp-imap-get-file filename nil))
+ (tramp-imap-put-file
+ v1 (current-buffer)
+ (tramp-imap-file-name-name v1)
+ nil nil (nth 7 (file-attributes filename))))
+ ;; One of them is not located on a IMAP mailbox.
+ (insert-file-contents filename)
+ (write-region (point-min) (point-max) newname)))))
(when (eq op 'rename)
- (delete-file filename))))
+ (tramp-compat-delete-file filename 'force))))
;; TODO: revise this much
(defun tramp-imap-handle-expand-file-name (name &optional dir)
v 'file-error "File `%s' not found on remote host" filename)
(let ((point (point))
size data)
- (tramp-message v 4 "Fetching file %s..." filename)
- (insert (tramp-imap-get-file filename t))
- (setq size (- (point) point))
+ (with-progress-reporter v 3 (format "Fetching file %s" filename)
+ (insert (tramp-imap-get-file filename t))
+ (setq size (- (point) point))
;;; TODO: handle ranges.
;;; (let ((beg (or beg (point-min)))
;;; (end (min (or end (point-max)) (point-max))))
;;; (setq size (- end beg))
;;; (buffer-substring beg end))
- (goto-char point)
- (tramp-message v 4 "Fetching file %s...done" filename)
- (list (expand-file-name filename) size)))))
+ (goto-char point)
+ (list (expand-file-name filename) size))))))
(defun tramp-imap-handle-file-exists-p (filename)
"Like `file-exists-p' for Tramp files."
;; (file-exists-p (file-name-directory filename)))
(file-directory-p (file-name-directory filename)))
-(defun tramp-imap-handle-delete-file (filename)
+(defun tramp-imap-handle-delete-file (filename &optional force)
"Like `delete-file' for Tramp files."
(cond
((not (file-exists-p filename)) nil)
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
- (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfile)
- (with-temp-buffer
- (insert-file-contents filename)
- (write-region (point-min) (point-max) tmpfile)
- (tramp-message v 4 "Fetching %s to tmp file %s...done" filename tmpfile)
- tmpfile))))
+ (with-progress-reporter
+ v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
+ (with-temp-buffer
+ (insert-file-contents filename)
+ (write-region (point-min) (point-max) tmpfile)
+ tmpfile)))))
(defun tramp-imap-put-file
(vec filename-or-buffer &optional subject inode encode size)
(file-executable-p . tramp-smb-handle-file-exists-p)
(file-exists-p . tramp-smb-handle-file-exists-p)
(file-local-copy . tramp-smb-handle-file-local-copy)
- (file-remote-p . tramp-handle-file-remote-p)
(file-modes . tramp-handle-file-modes)
(file-name-all-completions . tramp-smb-handle-file-name-all-completions)
(file-name-as-directory . tramp-handle-file-name-as-directory)
(file-ownership-preserved-p . ignore)
(file-readable-p . tramp-smb-handle-file-exists-p)
(file-regular-p . tramp-handle-file-regular-p)
+ (file-remote-p . tramp-handle-file-remote-p)
+ ;; `file-selinux-context' performed by default handler.
(file-symlink-p . tramp-handle-file-symlink-p)
;; `file-truename' performed by default handler.
(file-writable-p . tramp-smb-handle-file-writable-p)
(make-symbolic-link . tramp-smb-handle-make-symbolic-link)
(rename-file . tramp-smb-handle-rename-file)
(set-file-modes . tramp-smb-handle-set-file-modes)
+ ;; `set-file-selinux-context' performed by default handler.
(set-file-times . ignore)
(set-visited-file-modtime . ignore)
(shell-command . ignore)
'copy-directory (list dirname newname keep-date parents)))))))
(defun tramp-smb-handle-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files.
KEEP-DATE is not handled in case NEWNAME resides on an SMB server.
PRESERVE-UID-GID is completely ignored."
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
+ (with-progress-reporter
+ (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
+ 0 (format "Copying %s to %s" filename newname)
+
+ (let ((tmpfile (file-local-copy filename)))
+
+ (if tmpfile
+ ;; Remote filename.
+ (condition-case err
+ (rename-file tmpfile newname ok-if-already-exists)
+ ((error quit)
+ (tramp-compat-delete-file tmpfile 'force)
+ (signal (car err) (cdr err))))
+
+ ;; Remote newname.
+ (when (file-directory-p newname)
+ (setq newname
+ (expand-file-name (file-name-nondirectory filename) newname)))
+
+ (with-parsed-tramp-file-name newname nil
+ (when (and (not ok-if-already-exists)
+ (file-exists-p newname))
+ (tramp-error v 'file-already-exists newname))
- (let ((tmpfile (file-local-copy filename)))
-
- (if tmpfile
- ;; Remote filename.
- (condition-case err
- (rename-file tmpfile newname ok-if-already-exists)
- ((error quit)
- (delete-file tmpfile)
- (signal (car err) (cdr err))))
-
- ;; Remote newname.
- (when (file-directory-p newname)
- (setq newname (expand-file-name
- (file-name-nondirectory filename) newname)))
-
- (with-parsed-tramp-file-name newname nil
- (when (and (not ok-if-already-exists)
- (file-exists-p newname))
- (tramp-error v 'file-already-exists newname))
-
- ;; We must also flush the cache of the directory, because
- ;; `file-attributes' reads the values from there.
- (tramp-flush-file-property v (file-name-directory localname))
- (tramp-flush-file-property v localname)
- (unless (tramp-smb-get-share v)
- (tramp-error
- v 'file-error "Target `%s' must contain a share name" newname))
- (tramp-message v 0 "Copying file %s to file %s..." filename newname)
- (if (tramp-smb-send-command
- v (format "put \"%s\" \"%s\""
- filename (tramp-smb-get-localname v)))
- (tramp-message
- v 0 "Copying file %s to file %s...done" filename newname)
- (tramp-error v 'file-error "Cannot copy `%s'" filename)))))
+ ;; We must also flush the cache of the directory, because
+ ;; `file-attributes' reads the values from there.
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ (unless (tramp-smb-get-share v)
+ (tramp-error
+ v 'file-error "Target `%s' must contain a share name" newname))
+ (unless (tramp-smb-send-command
+ v (format "put \"%s\" \"%s\""
+ filename (tramp-smb-get-localname v)))
+ (tramp-error v 'file-error "Cannot copy `%s'" filename))))))
;; KEEP-DATE handling.
(when keep-date (set-file-times newname (nth 5 (file-attributes filename)))))
(tramp-error
v 'file-error "%s `%s'" (match-string 0) directory))))))
-(defun tramp-smb-handle-delete-file (filename)
+(defun tramp-smb-handle-delete-file (filename &optional force)
"Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename))
(when (file-exists-p filename)
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
- (tramp-message v 4 "Fetching %s to tmp file %s..." filename tmpfile)
- (if (tramp-smb-send-command
- v (format "get \"%s\" \"%s\"" (tramp-smb-get-localname v) tmpfile))
- (tramp-message
- v 4 "Fetching %s to tmp file %s...done" filename tmpfile)
- ;; Oops, an error. We shall cleanup.
- (delete-file tmpfile)
- (tramp-error
- v 'file-error "Cannot make local copy of file `%s'" filename))
+ (with-progress-reporter
+ v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
+ (unless (tramp-smb-send-command
+ v (format "get \"%s\" \"%s\""
+ (tramp-smb-get-localname v) tmpfile))
+ ;; Oops, an error. We shall cleanup.
+ (tramp-compat-delete-file tmpfile 'force)
+ (tramp-error
+ v 'file-error "Cannot make local copy of file `%s'" filename)))
tmpfile)))
;; This function should return "foo/" for directories and "bar" for
"Like `rename-file' for Tramp files."
(setq filename (expand-file-name filename)
newname (expand-file-name newname))
+ (with-progress-reporter
+ (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
+ 0 (format "Renaming %s to %s" filename newname)
+
+ (let ((tmpfile (file-local-copy filename)))
+
+ (if tmpfile
+ ;; Remote filename.
+ (condition-case err
+ (rename-file tmpfile newname ok-if-already-exists)
+ ((error quit)
+ (tramp-compat-delete-file tmpfile 'force)
+ (signal (car err) (cdr err))))
+
+ ;; Remote newname.
+ (when (file-directory-p newname)
+ (setq newname (expand-file-name
+ (file-name-nondirectory filename) newname)))
+
+ (with-parsed-tramp-file-name newname nil
+ (when (and (not ok-if-already-exists)
+ (file-exists-p newname))
+ (tramp-error v 'file-already-exists newname))
+ ;; We must also flush the cache of the directory, because
+ ;; `file-attributes' reads the values from there.
+ (tramp-flush-file-property v (file-name-directory localname))
+ (tramp-flush-file-property v localname)
+ (unless (tramp-smb-send-command
+ v (format "put %s \"%s\""
+ filename (tramp-smb-get-localname v)))
+ (tramp-error v 'file-error "Cannot rename `%s'" filename)))))
- (let ((tmpfile (file-local-copy filename)))
-
- (if tmpfile
- ;; Remote filename.
- (condition-case err
- (rename-file tmpfile newname ok-if-already-exists)
- ((error quit)
- (delete-file tmpfile)
- (signal (car err) (cdr err))))
-
- ;; Remote newname.
- (when (file-directory-p newname)
- (setq newname (expand-file-name
- (file-name-nondirectory filename) newname)))
-
- (with-parsed-tramp-file-name newname nil
- (when (and (not ok-if-already-exists)
- (file-exists-p newname))
- (tramp-error v 'file-already-exists newname))
- ;; We must also flush the cache of the directory, because
- ;; `file-attributes' reads the values from there.
- (tramp-flush-file-property v (file-name-directory localname))
- (tramp-flush-file-property v localname)
- (tramp-message v 0 "Copying file %s to file %s..." filename newname)
- (if (tramp-smb-send-command
- v (format "put %s \"%s\"" filename (tramp-smb-get-localname v)))
- (tramp-message
- v 0 "Copying file %s to file %s...done" filename newname)
- (tramp-error v 'file-error "Cannot rename `%s'" filename)))))
-
- (delete-file filename))
+ (tramp-compat-delete-file filename 'force)))
(defun tramp-smb-handle-set-file-modes (filename mode)
"Like `set-file-modes' for Tramp files."
(list start end tmpfile append 'no-message lockname confirm)
(list start end tmpfile append 'no-message lockname)))
- (tramp-message v 5 "Writing tmp file %s to file %s..." tmpfile filename)
- (unwind-protect
- (if (tramp-smb-send-command
- v (format "put %s \"%s\"" tmpfile (tramp-smb-get-localname v)))
- (tramp-message
- v 5 "Writing tmp file %s to file %s...done" tmpfile filename)
- (tramp-error v 'file-error "Cannot write `%s'" filename))
- (delete-file tmpfile))
+ (with-progress-reporter
+ v 3 (format "Moving tmp file %s to %s" tmpfile filename)
+ (unwind-protect
+ (unless (tramp-smb-send-command
+ v (format "put %s \"%s\""
+ tmpfile (tramp-smb-get-localname v)))
+ (tramp-error v 'file-error "Cannot write `%s'" filename))
+ (tramp-compat-delete-file tmpfile 'force)))
(unless (equal curbuf (current-buffer))
(tramp-error
(setq args (append args (list "-s" tramp-smb-conf))))
;; OK, let's go.
- (tramp-message
- vec 3 "Opening connection for //%s%s/%s..."
- (if (not (zerop (length user))) (concat user "@") "")
- host (or share ""))
-
- (let* ((coding-system-for-read nil)
- (process-connection-type tramp-process-connection-type)
- (p (let ((default-directory
- (tramp-compat-temporary-file-directory)))
- (apply #'start-process
- (tramp-buffer-name vec) (tramp-get-buffer vec)
- tramp-smb-program args))))
-
- (tramp-message
- vec 6 "%s" (mapconcat 'identity (process-command p) " "))
- (tramp-set-process-query-on-exit-flag p nil)
-
- ;; Set variables for computing the prompt for reading password.
- (setq tramp-current-method tramp-smb-method
- tramp-current-user user
- tramp-current-host host)
-
- ;; Play login scenario.
- (tramp-process-actions
- p vec
- (if share
- tramp-smb-actions-with-share
- tramp-smb-actions-without-share))
-
- ;; Check server version.
- (with-current-buffer (tramp-get-connection-buffer vec)
- (goto-char (point-min))
- (search-forward-regexp
- "Domain=\\[[^]]*\\] OS=\\[[^]]*\\] Server=\\[[^]]*\\]" nil t)
- (let ((smbserver-version (match-string 0)))
- (unless
- (string-equal
- smbserver-version
- (tramp-get-connection-property
- vec "smbserver-version" smbserver-version))
- (tramp-flush-directory-property vec "")
- (tramp-flush-connection-property vec))
- (tramp-set-connection-property
- vec "smbserver-version" smbserver-version)))
-
- ;; Set chunksize. Otherwise, `tramp-send-string' might
- ;; try it itself.
- (tramp-set-connection-property p "smb-share" share)
- (tramp-set-connection-property p "chunksize" tramp-chunksize)
-
- (tramp-message
- vec 3 "Opening connection for //%s%s/%s...done"
- (if (not (zerop (length user))) (concat user "@") "")
- host (or share ""))))))))
+ (with-progress-reporter
+ vec 3
+ (format "Opening connection for //%s%s/%s"
+ (if (not (zerop (length user))) (concat user "@") "")
+ host (or share ""))
+
+ (let* ((coding-system-for-read nil)
+ (process-connection-type tramp-process-connection-type)
+ (p (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (apply #'start-process
+ (tramp-buffer-name vec) (tramp-get-buffer vec)
+ tramp-smb-program args))))
+
+ (tramp-message
+ vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+ (tramp-set-process-query-on-exit-flag p nil)
+
+ ;; Set variables for computing the prompt for reading password.
+ (setq tramp-current-method tramp-smb-method
+ tramp-current-user user
+ tramp-current-host host)
+
+ ;; Play login scenario.
+ (tramp-process-actions
+ p vec
+ (if share
+ tramp-smb-actions-with-share
+ tramp-smb-actions-without-share))
+
+ ;; Check server version.
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (goto-char (point-min))
+ (search-forward-regexp
+ "Domain=\\[[^]]*\\] OS=\\[[^]]*\\] Server=\\[[^]]*\\]" nil t)
+ (let ((smbserver-version (match-string 0)))
+ (unless
+ (string-equal
+ smbserver-version
+ (tramp-get-connection-property
+ vec "smbserver-version" smbserver-version))
+ (tramp-flush-directory-property vec "")
+ (tramp-flush-connection-property vec))
+ (tramp-set-connection-property
+ vec "smbserver-version" smbserver-version)))
+
+ ;; Set chunksize. Otherwise, `tramp-send-string' might
+ ;; try it itself.
+ (tramp-set-connection-property p "smb-share" share)
+ (tramp-set-connection-property
+ p "chunksize" tramp-chunksize))))))))
;; We don't use timeouts. If needed, the caller shall wrap around.
(defun tramp-smb-wait-for-output (vec)
;; Notes:
;; -----
;;
-;; This package only works for Emacs 21.1 and higher, and for XEmacs 21.4
+;; This package only works for Emacs 22.1 and higher, and for XEmacs 21.4
;; and higher. For XEmacs 21, you need the package `fsf-compat' for
;; the `with-timeout' macro.
;;
(when (featurep 'tramp-compat)
(unload-feature 'tramp-compat 'force))))
-(require 'format-spec) ; from Gnus 5.8, also in tar ball
+(require 'format-spec)
;; As long as password.el is not part of (X)Emacs, it shouldn't
;; be mandatory
(if (featurep 'xemacs)
;; this would load dbus.el.
(when (and (featurep 'dbusbind)
(condition-case nil
- (funcall 'dbus-get-unique-name :session)
+ (tramp-compat-funcall 'dbus-get-unique-name :session)
(error nil))
(tramp-compat-process-running-p "gvfs-fuse-daemon"))
'tramp-gvfs)
(defgroup tramp nil
"Edit remote files with a combination of rsh and rcp or similar programs."
:group 'files
+ :group 'comm
:version "22.1")
;; Maybe we need once a real Tramp mode, with key bindings etc.
:group 'tramp
:type 'string)
+(defcustom tramp-inline-compress-start-size 4096
+ "*The minimum size of compressing where inline transfer.
+When inline transfer, compress transfered data of file
+whose size is this value or above (up to `tramp-copy-size-limit').
+If it is nil, no compression at all will be applied."
+ :group 'tramp
+ :type '(choice (const nil) integer))
+
(defcustom tramp-copy-size-limit 10240
- "*The maximum file size where inline copying is preferred over an out-of-the-band copy."
+ "*The maximum file size where inline copying is preferred over an out-of-the-band copy.
+If it is nil, inline out-of-the-band copy will be used without a check."
:group 'tramp
- :type 'integer)
+ :type '(choice (const nil) integer))
(defcustom tramp-terminal-type "dumb"
"*Value of TERM environment variable for logging in to remote host.
(tramp-copy-recursive t)
(tramp-password-end-of-line nil))
("scp" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
(tramp-copy-args (("-P" "%p") ("-p" "%k")
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("scp1" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-1" "-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
(tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k")
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("scp2" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-2" "-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
(tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k")
("sftp" (tramp-login-program "ssh")
(tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "sftp")
(tramp-copy-args nil)
("rsync" (tramp-login-program "ssh")
(tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync")
(tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r")))
("-o" "ControlPath=%t.%%r@%%h:%%p")
("-o" "ControlMaster=yes")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync")
(tramp-copy-args (("-t" "%k") ("-r")))
(tramp-copy-keep-date nil)
(tramp-password-end-of-line nil))
("ssh" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program nil)
(tramp-copy-args nil)
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("ssh1" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-1" "-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program nil)
(tramp-copy-args nil)
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("ssh2" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-2" "-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program nil)
(tramp-copy-args nil)
(tramp-login-program "ssh1")
(tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program nil)
(tramp-copy-args nil)
(tramp-copy-keep-date nil)
(tramp-password-end-of-line nil))
("scpc" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-o" "ControlPath=%t.%%r@%%h:%%p")
("-o" "ControlMaster=yes")
("-e" "none")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
(tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q")
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("scpx" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none" "-t" "-t" "/bin/sh")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
(tramp-copy-args (("-p" "%k")))
("-o" "StrictHostKeyChecking=no")))
(tramp-default-port 22))
("sshx" (tramp-login-program "ssh")
- (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p") ("-q")
+ (tramp-login-args (("%h") ("-l" "%u") ("-p" "%p")
("-e" "none" "-t" "-t" "/bin/sh")))
+ (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program nil)
(tramp-copy-args nil)
\"%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.
+ * `tramp-async-args'
+ When an asynchronous process is started, we know already that
+ the connection works. Therefore, we can pass additional
+ parameters to suppress diagnostic messages, in order not to
+ tamper the process output.
* `tramp-copy-program'
This specifies the name of the program to use for remotely copying
the file; this might be the absolute filename of rcp or the name of
`localhost' or the name of the local host. Another host name is
useful only in combination with `tramp-default-proxies-alist'.")
+(defun tramp-detect-ssh-controlmaster ()
+ "Call ssh to detect whether it supports the ControlMaster argument.
+This function may return nil when the argument is supported, but
+shouldn't return t when it isn't."
+ (ignore-errors
+ (with-temp-buffer
+ (call-process "ssh" nil t nil "-o" "ControlMaster")
+ (goto-char (point-min))
+ (search-forward-regexp "Missing ControlMaster argument" nil t))))
+
(defcustom tramp-default-method
;; An external copy method seems to be preferred, because it is much
;; more performant for large files, and it hasn't too serious delays
;; permanent password queries. Either a password agent like
;; "ssh-agent" or "Pageant" shall run, or the optional
;; password-cache.el or auth-sources.el packages shall be active for
- ;; password caching. "scpc" would be another good choice because of
- ;; the "ControlMaster" option, but this is a more modern alternative
- ;; in OpenSSH 4, which cannot be taken as default.
+ ;; password caching. "scpc" is chosen if we detect that the user is
+ ;; running OpenSSH 4.0 or newer.
(cond
;; PuTTY is installed.
((executable-find "pscp")
"plink"))
;; There is an ssh installation.
((executable-find "scp")
- (if (or (fboundp 'password-read)
- (fboundp 'auth-source-user-or-password)
- ;; ssh-agent is running.
- (getenv "SSH_AUTH_SOCK")
- (getenv "SSH_AGENT_PID"))
- "scp"
- "ssh"))
+ (cond
+ ((tramp-detect-ssh-controlmaster) "scpc")
+ ((or (fboundp 'password-read)
+ (fboundp 'auth-source-user-or-password)
+ ;; ssh-agent is running.
+ (getenv "SSH_AUTH_SOCK")
+ (getenv "SSH_AGENT_PID"))
+ "scp")
+ (t "ssh")))
;; Fallback.
(t "ftp"))
"*Default method to use for transferring files.
(defvar tramp-completion-function-alist nil
"*Alist of methods for remote files.
-This is a list of entries of the form (NAME PAIR1 PAIR2 ...).
+This is a list of entries of the form \(NAME PAIR1 PAIR2 ...\).
Each NAME stands for a remote access method. Each PAIR is of the form
-\(FUNCTION FILE). FUNCTION is responsible to extract user names and host
+\(FUNCTION FILE\). FUNCTION is responsible to extract user names and host
names from FILE for completion. The following predefined FUNCTIONs exists:
* `tramp-parse-rhosts' for \"~/.rhosts\" like files,
(defcustom tramp-remote-process-environment
`("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
- ,(concat "TERM=" tramp-terminal-type)
+ ,(format "TERM=%s" tramp-terminal-type)
"EMACS=t" ;; Deprecated.
,(format "INSIDE_EMACS=%s,tramp:%s" emacs-version tramp-version)
"CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH="
(t (error "Wrong `tramp-syntax' defined")))
"*Regular expression matching file names handled by Tramp.
This regexp should match Tramp file names but no other file names.
-\(When tramp.el is loaded, this regular expression is prepended to
+When tramp.el is loaded, this regular expression is prepended to
`file-name-handler-alist', and that is searched sequentially. Thus,
if the Tramp entry appears rather early in the `file-name-handler-alist'
and is a bit too general, then some files might be considered Tramp
files which are not really Tramp files.
Please note that the entry in `file-name-handler-alist' is made when
-this file (tramp.el) is loaded. This means that this variable must be set
+this file \(tramp.el\) is loaded. This means that this variable must be set
before loading tramp.el. Alternatively, `file-name-handler-alist' can be
updated after changing this variable.
In the Emacs normally running Tramp, evaluate the above code
\(replace \"xxx\" and \"yyy\" by the remote user and host name,
-respectively). You can do this, for example, by pasting it into
+respectively\). You can do this, for example, by pasting it into
the `*scratch*' buffer and then hitting C-j with the cursor after the
last closing parenthesis. Note that it works only if you have configured
-\"ssh\" to run without password query, see ssh-agent(1).
+\"ssh\" to run without password query, see ssh-agent\(1\).
You will see the number of bytes sent successfully to the remote host.
If that number exceeds 1000, you can stop the execution by hitting
C-g, because your Emacs is likely clean.
When it is necessary to set `tramp-chunksize', you might consider to
-use an out-of-the-band method (like \"scp\") instead of an internal one
-\(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases
+use an out-of-the-band method \(like \"scp\"\) instead of an internal one
+\(like \"ssh\"\), because setting `tramp-chunksize' to non-nil decreases
performance.
If your Emacs is buggy, the code stops and gives you an indication
(dired-uncache . tramp-handle-dired-uncache)
(set-visited-file-modtime . tramp-handle-set-visited-file-modtime)
(verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)
+ (file-selinux-context . tramp-handle-file-selinux-context)
+ (set-file-selinux-context . tramp-handle-set-file-selinux-context)
(vc-registered . tramp-handle-vc-registered))
"Alist of handler functions.
Operations not mentioned here will be handled by the normal Emacs functions.")
(save-window-excursion
(unwind-protect
(apply 'tramp-error vec-or-proc signal fmt-string args)
- (when (and vec-or-proc (not (zerop tramp-verbose)))
+ (when (and vec-or-proc
+ (not (zerop tramp-verbose))
+ (not (tramp-completion-mode-p)))
(let ((enable-recursive-minibuffers t))
(pop-to-buffer
(or (and (bufferp buffer) buffer)
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-file-property\\>"))
(defmacro with-connection-property (key property &rest body)
- "Checks in Tramp for property PROPERTY, otherwise executes BODY and set."
+ "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
`(let ((value (tramp-get-connection-property ,key ,property 'undef)))
(when (eq value 'undef)
;; We cannot pass ,@body as parameter to
(put 'with-connection-property 'edebug-form-spec t)
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>"))
-(eval-and-compile ; silence compiler
+(defmacro with-progress-reporter (vec level message &rest body)
+ "Executes BODY, spinning a progress reporter with MESSAGE."
+ `(let (pr tm)
+ (tramp-message ,vec ,level "%s..." ,message)
+ ;; We start a pulsing progress reporter after 3 seconds. Feature
+ ;; introduced in Emacs 24.1.
+ (when (and tramp-message-show-message
+ ;; Display only when there is a minimum level.
+ (<= ,level (min tramp-verbose 3)))
+ (condition-case nil
+ (setq pr (tramp-compat-funcall 'make-progress-reporter ,message)
+ tm (if pr (run-at-time 3 0.1 'progress-reporter-update pr)))
+ (error nil)))
+ (unwind-protect
+ ;; Execute the body.
+ (let ((tramp-message-show-message
+ (and tramp-message-show-message (not tm))))
+ ,@body)
+ ;; Stop progress reporter.
+ (if tm (tramp-compat-funcall 'cancel-timer tm))
+ (tramp-message ,vec ,level "%s...done" ,message))))
+
+(put 'with-progress-reporter 'lisp-indent-function 3)
+(put 'with-progress-reporter 'edebug-form-spec t)
+(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-progress-reporter\\>"))
+
+(eval-and-compile ;; Silence compiler.
(if (memq system-type '(cygwin windows-nt))
(defun tramp-drop-volume-letter (name)
"Cut off unnecessary drive letter from file NAME.
special handling of `substitute-in-file-name'."
(when (symbol-value 'minibuffer-completing-file-name)
(setq tramp-rfn-eshadow-overlay
- (funcall (symbol-function 'make-overlay)
- (funcall (symbol-function 'minibuffer-prompt-end))
- (funcall (symbol-function 'minibuffer-prompt-end))))
+ (tramp-compat-funcall
+ 'make-overlay
+ (tramp-compat-funcall 'minibuffer-prompt-end)
+ (tramp-compat-funcall 'minibuffer-prompt-end)))
;; Copy rfn-eshadow-overlay properties.
- (let ((props (funcall (symbol-function 'overlay-properties)
- (symbol-value 'rfn-eshadow-overlay))))
+ (let ((props (tramp-compat-funcall
+ 'overlay-properties (symbol-value 'rfn-eshadow-overlay))))
(while props
- (funcall (symbol-function 'overlay-put)
- tramp-rfn-eshadow-overlay (pop props) (pop props))))))
+ (tramp-compat-funcall
+ 'overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props))))))
(when (boundp 'rfn-eshadow-setup-minibuffer-hook)
(add-hook 'rfn-eshadow-setup-minibuffer-hook
`file-name-shadow-mode'; the minibuffer should have already
been set up by `rfn-eshadow-setup-minibuffer'."
;; In remote files name, there is a shadowing just for the local part.
- (let ((end (or (funcall (symbol-function 'overlay-end)
- (symbol-value 'rfn-eshadow-overlay))
- (funcall (symbol-function 'minibuffer-prompt-end)))))
- (when (file-remote-p (buffer-substring-no-properties end (point-max)))
+ (let ((end (or (tramp-compat-funcall
+ 'overlay-end (symbol-value 'rfn-eshadow-overlay))
+ (tramp-compat-funcall 'minibuffer-prompt-end))))
+ (when
+ (file-remote-p
+ (tramp-compat-funcall 'buffer-substring-no-properties end (point-max)))
(save-excursion
(save-restriction
(narrow-to-region
(point-max))
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
(rfn-eshadow-update-overlay-hook nil))
- (move-overlay rfn-eshadow-overlay (point-max) (point-max))
- (funcall (symbol-function 'rfn-eshadow-update-overlay))))))))
+ (tramp-compat-funcall
+ 'move-overlay rfn-eshadow-overlay (point-max) (point-max))
+ (tramp-compat-funcall 'rfn-eshadow-update-overlay)))))))
(when (boundp 'rfn-eshadow-update-overlay-hook)
(add-hook 'rfn-eshadow-update-overlay-hook
l-localname)))))
(tramp-error
l 'file-already-exists "File %s already exists" l-localname)
- (delete-file linkname)))
+ (tramp-compat-delete-file linkname 'force)))
;; If FILENAME is a Tramp name, use just the localname component.
(when (tramp-tramp-file-p filename)
(tramp-error v 'file-error "Cannot load nonexistent file `%s'" file)))
(if (not (file-exists-p file))
nil
- (unless nomessage (tramp-message v 0 "Loading %s..." file))
- (let ((local-copy (file-local-copy file)))
- ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
- (unwind-protect
- (load local-copy noerror t t)
- (delete-file local-copy)))
- (unless nomessage (tramp-message v 0 "Loading %s...done" file))
+ (let ((tramp-message-show-message (not nomessage)))
+ (with-progress-reporter v 0 (format "Loading %s" file)
+ (let ((local-copy (file-local-copy file)))
+ ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
+ (unwind-protect
+ (load local-copy noerror t t)
+ (tramp-compat-delete-file local-copy 'force)))))
t)))
;; Localname manipulation functions that grok Tramp localnames...
(tramp-send-command-and-read
vec
(format
- "((%s %s || %s -h %s) && %s -c '((\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)' %s || echo nil)"
+ ;; On Opsware, pdksh (which is the true name of ksh there) doesn't
+ ;; parse correctly the sequence "((". Therefore, we add a space.
+ "( (%s %s || %s -h %s) && %s -c '( (\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)' %s || echo nil)"
(tramp-get-file-exists-command vec)
(tramp-shell-quote-argument localname)
(tramp-get-test-command vec)
function directly, unless those two cases are already taken care
of."
(with-current-buffer buf
- ;; There is no file visiting the buffer, or the buffer has no
- ;; recorded last modification time.
- (if (or (not (buffer-file-name))
- (eq (visited-file-modtime) 0))
- t
- (let ((f (buffer-file-name)))
+ (let ((f (buffer-file-name)))
+ ;; There is no file visiting the buffer, or the buffer has no
+ ;; recorded last modification time, or there is no established
+ ;; connection.
+ (if (or (not f)
+ (eq (visited-file-modtime) 0)
+ (not (tramp-file-name-handler 'file-remote-p f nil 'connected)))
+ t
(with-parsed-tramp-file-name f nil
(tramp-flush-file-property v localname)
(let* ((attr (file-attributes f))
(let ((time (if (or (null time) (equal time '(0 0)))
(current-time)
time))
- (utc
- ;; With GNU Emacs, `format-time-string' has an
- ;; optional parameter UNIVERSAL. This is preferred,
- ;; because we could handle the case when the remote
- ;; host is located in a different time zone as the
- ;; local host.
- (and (functionp 'subr-arity)
- (subrp (symbol-function 'format-time-string))
- (= 3 (cdr (funcall (symbol-function 'subr-arity)
- (symbol-function
- 'format-time-string)))))))
+ ;; With GNU Emacs, `format-time-string' has an optional
+ ;; parameter UNIVERSAL. This is preferred, because we
+ ;; could handle the case when the remote host is
+ ;; located in a different time zone as the local host.
+ (utc (not (featurep 'xemacs))))
(tramp-send-command-and-check
v (format "%s touch -t %s %s"
(if utc "TZ=UTC; export TZ;" "")
"chown" nil nil nil
(format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
+(defun tramp-remote-selinux-p (vec)
+ "Check, whether SELINUX is enabled on the remote host."
+ (with-connection-property (tramp-get-connection-process vec) "selinux-p"
+ (let ((result (tramp-find-executable
+ vec "getenforce" (tramp-get-remote-path vec) t t)))
+ (and result
+ (string-equal
+ (tramp-send-command-and-read
+ vec (format "echo \\\"`%S`\\\"" result))
+ "Enforcing")))))
+
+(defun tramp-handle-file-selinux-context (filename)
+ "Like `file-selinux-context' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (with-file-property v localname "file-selinux-context"
+ (let ((context '(nil nil nil nil))
+ (regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):"
+ "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)")))
+ (when (and (tramp-remote-selinux-p v)
+ (zerop (tramp-send-command-and-check
+ v (format
+ "%s -d -Z %s"
+ (tramp-get-ls-command v)
+ (tramp-shell-quote-argument localname)))))
+ (with-current-buffer (tramp-get-connection-buffer v)
+ (goto-char (point-min))
+ (when (re-search-forward regexp (tramp-compat-line-end-position) t)
+ (setq context (list (match-string 1) (match-string 2)
+ (match-string 3) (match-string 4))))))
+ ;; Return the context.
+ context))))
+
+(defun tramp-handle-set-file-selinux-context (filename context)
+ "Like `set-file-selinux-context' for Tramp files."
+ (with-parsed-tramp-file-name filename nil
+ (if (and (consp context)
+ (tramp-remote-selinux-p v)
+ (zerop (tramp-send-command-and-check
+ v (format "chcon %s %s %s %s %s"
+ (if (stringp (nth 0 context))
+ (format "--user=%s" (nth 0 context)) "")
+ (if (stringp (nth 1 context))
+ (format "--role=%s" (nth 1 context)) "")
+ (if (stringp (nth 2 context))
+ (format "--type=%s" (nth 2 context)) "")
+ (if (stringp (nth 3 context))
+ (format "--range=%s" (nth 3 context)) "")
+ (tramp-shell-quote-argument localname)))))
+ (tramp-set-file-property v localname "file-selinux-context" context)
+ (tramp-set-file-property v localname "file-selinux-context" 'undef)))
+ ;; We always return nil.
+ nil)
+
;; Simple functions using the `test' command.
(defun tramp-handle-file-executable-p (filename)
(when (file-directory-p directory)
(setq directory (expand-file-name directory))
(let* ((temp
- (tramp-compat-copy-tree
+ (copy-tree
(with-parsed-tramp-file-name directory nil
(with-file-property
v localname
(tramp-shell-quote-argument localname)
(tramp-shell-quote-argument filename)
(if (symbol-value
- 'read-file-name-completion-ignore-case)
+ ;; `read-file-name-completion-ignore-case'
+ ;; is introduced with Emacs 22.1.
+ (if (boundp
+ 'read-file-name-completion-ignore-case)
+ 'read-file-name-completion-ignore-case
+ 'completion-ignore-case))
1 0)))
(format (concat
"file-name-all-completions"
result))))))))
-;; The following isn't needed for Emacs 20 but for 19.34?
(defun tramp-handle-file-name-completion
(filename directory &optional predicate)
"Like `file-name-completion' for Tramp files."
(buffer-name))))))
(defun tramp-handle-copy-file
- (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Like `copy-file' for Tramp files."
- ;; Check if both files are local -- invoke normal copy-file.
- ;; Otherwise, use Tramp from local system.
(setq filename (expand-file-name filename))
(setq newname (expand-file-name newname))
(cond
((or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
(tramp-do-copy-or-rename-file
- 'copy filename newname ok-if-already-exists keep-date preserve-uid-gid))
+ 'copy filename newname ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context))
;; Compat section.
+ (preserve-selinux-context
+ (tramp-run-real-handler
+ 'copy-file
+ (list filename newname ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)))
(preserve-uid-gid
(tramp-run-real-handler
'copy-file
'rename-file (list filename newname ok-if-already-exists))))
(defun tramp-do-copy-or-rename-file
- (op filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+ (op filename newname &optional ok-if-already-exists keep-date
+ preserve-uid-gid preserve-selinux-context)
"Copy or rename a remote file.
OP must be `copy' or `rename' and indicates the operation to perform.
FILENAME specifies the file to copy or rename, NEWNAME is the name of
KEEP-DATE means to make sure that NEWNAME has the same timestamp
as FILENAME. PRESERVE-UID-GID, when non-nil, instructs to keep
the uid and gid if both files are on the same host.
+PRESERVE-SELINUX-CONTEXT activates selinux commands.
This function is invoked by `tramp-handle-copy-file' and
`tramp-handle-rename-file'. It is an error if OP is neither of `copy'
(unless (memq op '(copy rename))
(error "Unknown operation `%s', must be `copy' or `rename'" op))
(let ((t1 (tramp-tramp-file-p filename))
- (t2 (tramp-tramp-file-p newname)))
+ (t2 (tramp-tramp-file-p newname))
+ (context (and preserve-selinux-context
+ (apply 'file-selinux-context (list filename))))
+ pr tm)
- (when (and (not ok-if-already-exists) (file-exists-p newname))
- (with-parsed-tramp-file-name (if t1 filename newname) nil
+ (with-parsed-tramp-file-name (if t1 filename newname) nil
+ (when (and (not ok-if-already-exists) (file-exists-p newname))
(tramp-error
- v 'file-already-exists "File %s already exists" newname)))
+ v 'file-already-exists "File %s already exists" newname))
- (with-parsed-tramp-file-name (if t1 filename newname) nil
- (tramp-message v 0 "Transferring %s to %s..." filename newname))
+ (with-progress-reporter
+ v 0 (format "%s %s to %s"
+ (if (eq op 'copy) "Copying" "Renaming")
+ filename newname)
- (prog1
(cond
;; Both are Tramp files.
((and t1 t2)
(with-parsed-tramp-file-name filename v1
(with-parsed-tramp-file-name newname v2
(cond
- ;; Shortcut: if method, host, user are the same for both
- ;; files, we invoke `cp' or `mv' on the remote host
- ;; directly.
+ ;; Shortcut: if method, host, user are the same for
+ ;; both files, we invoke `cp' or `mv' on the remote
+ ;; host directly.
((tramp-equal-remote filename newname)
(tramp-do-copy-or-rename-file-directly
op filename newname
(tramp-do-copy-or-rename-file-out-of-band
op filename newname keep-date))
- ;; No shortcut was possible. So we copy the
- ;; file first. If the operation was `rename', we go
- ;; back and delete the original file (if the copy was
+ ;; No shortcut was possible. So we copy the file
+ ;; first. If the operation was `rename', we go back
+ ;; and delete the original file (if the copy was
;; successful). The approach is simple-minded: we
;; create a new buffer, insert the contents of the
;; source file into it, then write out the buffer to
;; One file is a Tramp file, the other one is local.
((or t1 t2)
- (with-parsed-tramp-file-name (if t1 filename newname) nil
- (cond
- ;; Fast track on local machine.
- ((tramp-local-host-p v)
- (tramp-do-copy-or-rename-file-directly
- op filename newname
- ok-if-already-exists keep-date preserve-uid-gid))
-
- ;; If the Tramp file has an out-of-band method, the corresponding
- ;; copy-program can be invoked.
- ((tramp-method-out-of-band-p v (nth 7 (file-attributes filename)))
- (tramp-do-copy-or-rename-file-out-of-band
- op filename newname keep-date))
-
- ;; Use the inline method via a Tramp buffer.
- (t (tramp-do-copy-or-rename-file-via-buffer
- op filename newname keep-date)))))
+ (cond
+ ;; Fast track on local machine.
+ ((tramp-local-host-p v)
+ (tramp-do-copy-or-rename-file-directly
+ op filename newname
+ ok-if-already-exists keep-date preserve-uid-gid))
+
+ ;; If the Tramp file has an out-of-band method, the
+ ;; corresponding copy-program can be invoked.
+ ((tramp-method-out-of-band-p v (nth 7 (file-attributes filename)))
+ (tramp-do-copy-or-rename-file-out-of-band
+ op filename newname keep-date))
+
+ ;; Use the inline method via a Tramp buffer.
+ (t (tramp-do-copy-or-rename-file-via-buffer
+ op filename newname keep-date))))
(t
;; One of them must be a Tramp file.
(error "Tramp implementation says this cannot happen")))
- ;; In case of `rename', we must flush the cache of the source file.
- (when (and t1 (eq op 'rename))
- (with-parsed-tramp-file-name filename nil
- (tramp-flush-file-property v (file-name-directory localname))
- (tramp-flush-file-property v localname)))
+ ;; Handle `preserve-selinux-context'.
+ (when context (apply 'set-file-selinux-context (list newname context)))
- ;; When newname did exist, we have wrong cached values.
- (when t2
- (with-parsed-tramp-file-name newname nil
- (tramp-flush-file-property v (file-name-directory localname))
- (tramp-flush-file-property v localname)))
+ ;; In case of `rename', we must flush the cache of the source file.
+ (when (and t1 (eq op 'rename))
+ (with-parsed-tramp-file-name filename v1
+ (tramp-flush-file-property v1 (file-name-directory localname))
+ (tramp-flush-file-property v1 localname)))
- (with-parsed-tramp-file-name (if t1 filename newname) nil
- (tramp-message v 0 "Transferring %s to %s...done" filename newname)))))
+ ;; When newname did exist, we have wrong cached values.
+ (when t2
+ (with-parsed-tramp-file-name newname v2
+ (tramp-flush-file-property v2 (file-name-directory localname))
+ (tramp-flush-file-property v2 localname)))))))
(defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date)
"Use an Emacs buffer to copy or rename a file.
;; Set the mode.
(set-file-modes newname (tramp-default-file-modes filename))
;; If the operation was `rename', delete the original file.
- (unless (eq op 'copy) (delete-file filename)))
+ (unless (eq op 'copy) (tramp-compat-delete-file filename 'force)))
(defun tramp-do-copy-or-rename-file-directly
(op filename newname ok-if-already-exists keep-date preserve-uid-gid)
"Unknown operation `%s', must be `copy' or `rename'"
op))))
(localname1
- (if t1 (tramp-handle-file-remote-p filename 'localname) filename))
+ (if t1
+ (tramp-file-name-handler 'file-remote-p filename 'localname)
+ filename))
(localname2
- (if t2 (tramp-handle-file-remote-p newname 'localname) newname))
+ (if t2
+ (tramp-file-name-handler 'file-remote-p newname 'localname)
+ newname))
(prefix (file-remote-p (if t1 filename newname)))
cmd-result)
;; Save exit.
(condition-case nil
- (delete-file tmpfile)
+ (tramp-compat-delete-file tmpfile 'force)
(error)))))))))
;; Set the time and mode. Mask possible errors.
;; Save exit.
(condition-case nil
(if dir-flag
- (delete-directory
+ (tramp-compat-delete-directory
(expand-file-name ".." tmpfile) 'recursive)
- (delete-file tmpfile))
+ (tramp-compat-delete-file tmpfile 'force))
(error))))
;; Expand hops. Might be necessary for gateway methods.
port (or (and port (number-to-string port)) ""))
;; Compose copy command.
- (setq spec `((?h . ,host) (?u . ,user) (?p . ,port)
- (?t . ,(tramp-get-connection-property
- (tramp-get-connection-process v) "temp-file" ""))
- (?k . ,(if keep-date " " "")))
+ (setq spec (format-spec-make
+ ?h host ?u user ?p port
+ ?t (tramp-get-connection-property
+ (tramp-get-connection-process v) "temp-file" "")
+ ?k (if keep-date " " ""))
copy-program (tramp-get-method-parameter
method 'tramp-copy-program)
copy-keep-date (tramp-get-method-parameter
;; If the operation was `rename', delete the original file.
(unless (eq op 'copy)
(if (file-regular-p filename)
- (delete-file filename)
- (delete-directory filename 'recursive))))))
+ (tramp-compat-delete-file filename 'force)
+ (tramp-compat-delete-directory filename 'recursive))))))
(defun tramp-handle-make-directory (dir &optional parents)
"Like `make-directory' for Tramp files."
(tramp-shell-quote-argument localname))))
(tramp-error v 'file-error "Couldn't delete %s" directory))))
-(defun tramp-handle-delete-file (filename)
+(defun tramp-handle-delete-file (filename &optional force)
"Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil
nil)
((and suffix (nth 2 suffix))
;; We found an uncompression rule.
- (tramp-message v 0 "Uncompressing %s..." file)
- (when (zerop (tramp-send-command-and-check
- v (concat (nth 2 suffix) " "
- (tramp-shell-quote-argument localname))))
- (tramp-message v 0 "Uncompressing %s...done" file)
- ;; `dired-remove-file' is not defined in XEmacs
- (funcall (symbol-function 'dired-remove-file) file)
- (string-match (car suffix) file)
- (concat (substring file 0 (match-beginning 0)))))
+ (with-progress-reporter v 0 (format "Uncompressing %s" file)
+ (when (zerop
+ (tramp-send-command-and-check
+ v (concat (nth 2 suffix) " "
+ (tramp-shell-quote-argument localname))))
+ ;; `dired-remove-file' is not defined in XEmacs.
+ (tramp-compat-funcall 'dired-remove-file file)
+ (string-match (car suffix) file)
+ (concat (substring file 0 (match-beginning 0))))))
(t
;; We don't recognize the file as compressed, so compress it.
;; Try gzip.
- (tramp-message v 0 "Compressing %s..." file)
- (when (zerop (tramp-send-command-and-check
- v (concat "gzip -f "
- (tramp-shell-quote-argument localname))))
- (tramp-message v 0 "Compressing %s...done" file)
- ;; `dired-remove-file' is not defined in XEmacs
- (funcall (symbol-function 'dired-remove-file) file)
- (cond ((file-exists-p (concat file ".gz"))
- (concat file ".gz"))
- ((file-exists-p (concat file ".z"))
- (concat file ".z"))
- (t nil)))))))))
+ (with-progress-reporter v 0 (format "Compressing %s" file)
+ (when (zerop
+ (tramp-send-command-and-check
+ v (concat "gzip -f "
+ (tramp-shell-quote-argument localname))))
+ ;; `dired-remove-file' is not defined in XEmacs.
+ (tramp-compat-funcall 'dired-remove-file file)
+ (cond ((file-exists-p (concat file ".gz"))
+ (concat file ".gz"))
+ ((file-exists-p (concat file ".z"))
+ (concat file ".z"))
+ (t nil))))))))))
(defun tramp-handle-dired-uncache (dir &optional dir-p)
"Like `dired-uncache' for Tramp files."
(unless (file-name-absolute-p name)
(setq name (concat (file-name-as-directory dir) name)))
;; If NAME is not a Tramp file, run the real handler.
- (if (not (tramp-tramp-file-p name))
+ (if (not (tramp-connectable-p name))
(tramp-run-real-handler 'expand-file-name (list name nil))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; Cleanup. We remove all file cache values for the connection,
;; because the remote process could have changed them.
- (when tmpinput (delete-file tmpinput))
+ (when tmpinput (tramp-compat-delete-file tmpinput 'force))
;; `process-file-side-effects' has been introduced with GNU
;; Emacs 23.2. If set to `nil', no remote file will be changed
(when delete (delete-region start end))
(unwind-protect
(apply 'call-process program tmpfile buffer display args)
- (delete-file tmpfile))))
+ (tramp-compat-delete-file tmpfile 'force))))
(defun tramp-handle-shell-command
(command &optional output-buffer error-buffer)
(when (listp buffer)
(with-current-buffer error-buffer
(insert-file-contents (cadr buffer)))
- (delete-file (cadr buffer)))
+ (tramp-compat-delete-file (cadr buffer) 'force))
(if current-buffer-p
;; This is like exchange-point-and-mark, but doesn't
;; activate the mark. It is cleaner to avoid activation,
;; There's some output, display it.
(when (with-current-buffer output-buffer (> (point-max) (point-min)))
(if (functionp 'display-message-or-buffer)
- (funcall (symbol-function 'display-message-or-buffer)
- output-buffer)
+ (tramp-compat-funcall 'display-message-or-buffer output-buffer)
(pop-to-buffer output-buffer))))))))
;; File Editing.
v 'file-error
"Cannot make local copy of non-existing file `%s'" filename))
- (let ((rem-enc (tramp-get-remote-coding v "remote-encoding"))
- (loc-dec (tramp-get-local-coding v "local-decoding"))
- (tmpfile (tramp-compat-make-temp-file filename)))
+ (let* ((size (nth 7 (file-attributes filename)))
+ (rem-enc (tramp-get-inline-coding v "remote-encoding" size))
+ (loc-dec (tramp-get-inline-coding v "local-decoding" size))
+ (tmpfile (tramp-compat-make-temp-file filename)))
(condition-case err
(cond
;; `copy-file' handles direct copy and out-of-band methods.
((or (tramp-local-host-p v)
- (tramp-method-out-of-band-p
- v (nth 7 (file-attributes filename))))
+ (tramp-method-out-of-band-p v size))
(copy-file filename tmpfile t t))
;; Use inline encoding for file transfer.
(rem-enc
(save-excursion
- (tramp-message v 5 "Encoding remote file %s..." filename)
- (tramp-barf-unless-okay
- v
- (format "%s < %s" rem-enc (tramp-shell-quote-argument localname))
- "Encoding remote file failed")
- (tramp-message v 5 "Encoding remote file %s...done" filename)
+ (with-progress-reporter
+ v 3 (format "Encoding remote file %s" filename)
+ (tramp-barf-unless-okay
+ v (format rem-enc (tramp-shell-quote-argument localname))
+ "Encoding remote file failed"))
- (if (and (symbolp loc-dec) (fboundp loc-dec))
+ (if (functionp loc-dec)
;; If local decoding is a function, we call it. We
;; must disable multibyte, because
;; `uudecode-decode-region' doesn't handle it
(with-temp-buffer
(set-buffer-multibyte nil)
(insert-buffer-substring (tramp-get-buffer v))
- (tramp-message
- v 5 "Decoding remote file %s with function %s..."
- filename loc-dec)
- (funcall loc-dec (point-min) (point-max))
- ;; Unset `file-name-handler-alist'. Otherwise,
- ;; epa-file gets confused.
- (let (file-name-handler-alist
- (coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile)))
+ (with-progress-reporter
+ v 3 (format "Decoding remote file %s with function %s"
+ filename loc-dec)
+ (funcall loc-dec (point-min) (point-max))
+ ;; Unset `file-name-handler-alist'. Otherwise,
+ ;; epa-file gets confused.
+ (let (file-name-handler-alist
+ (coding-system-for-write 'binary))
+ (write-region (point-min) (point-max) tmpfile))))
;; If tramp-decoding-function is not defined for this
;; method, we invoke tramp-decoding-command instead.
(let (file-name-handler-alist
(coding-system-for-write 'binary))
(write-region (point-min) (point-max) tmpfile2))
- (tramp-message
- v 5 "Decoding remote file %s with command %s..."
- filename loc-dec)
- (unwind-protect
- (tramp-call-local-coding-command loc-dec tmpfile2 tmpfile)
- (delete-file tmpfile2))))
+ (with-progress-reporter
+ v 3 (format "Decoding remote file %s with command %s"
+ filename loc-dec)
+ (unwind-protect
+ (tramp-call-local-coding-command
+ loc-dec tmpfile2 tmpfile)
+ (tramp-compat-delete-file tmpfile2 'force)))))
- (tramp-message v 5 "Decoding remote file %s...done" filename)
;; Set proper permissions.
(set-file-modes tmpfile (tramp-default-file-modes filename))
;; Set local user ownership.
;; Error handling.
((error quit)
- (delete-file tmpfile)
+ (tramp-compat-delete-file tmpfile 'force)
(signal (car err) (cdr err))))
(run-hooks 'tramp-handle-file-local-copy-hook)
"Like `insert-file-contents' for Tramp files."
(barf-if-buffer-read-only)
(setq filename (expand-file-name filename))
- (let (coding-system-used result local-copy remote-copy)
+ (let (result local-copy remote-copy)
(with-parsed-tramp-file-name filename nil
(unwind-protect
(if (not (file-exists-p filename))
(setq tramp-temp-buffer-file-name local-copy)
(put 'tramp-temp-buffer-file-name 'permanent-local t))
- (tramp-message
- v 4 "Inserting local temp file `%s'..." local-copy)
-
- ;; We must ensure that `file-coding-system-alist'
- ;; matches `local-copy'.
- (let ((file-coding-system-alist
- (tramp-find-file-name-coding-system-alist
- filename local-copy)))
- (setq result
- (insert-file-contents
- local-copy nil nil nil replace))
- ;; Now `last-coding-system-used' has right value.
- ;; Remember it.
- (when (boundp 'last-coding-system-used)
- (setq coding-system-used
- (symbol-value 'last-coding-system-used))))
-
- (tramp-message
- v 4 "Inserting local temp file `%s'...done" local-copy)
- (when (boundp 'last-coding-system-used)
- (set 'last-coding-system-used coding-system-used))))
+ (with-progress-reporter
+ v 3 (format "Inserting local temp file `%s'" local-copy)
+ ;; We must ensure that `file-coding-system-alist'
+ ;; matches `local-copy'.
+ (let ((file-coding-system-alist
+ (tramp-find-file-name-coding-system-alist
+ filename local-copy)))
+ (setq result
+ (insert-file-contents
+ local-copy nil nil nil replace))))))
;; Save exit.
(progn
(set-buffer-modified-p nil))
(when (and (stringp local-copy)
(or remote-copy (null tramp-temp-buffer-file-name)))
- (delete-file local-copy))
+ (tramp-compat-delete-file local-copy 'force))
(when (stringp remote-copy)
- (delete-file
- (tramp-make-tramp-file-name method user host remote-copy))))))
+ (tramp-compat-delete-file
+ (tramp-make-tramp-file-name method user host remote-copy)
+ 'force)))))
;; Result.
(list (expand-file-name filename)
"Like `find-backup-file-name' for Tramp files."
(with-parsed-tramp-file-name filename nil
;; We set both variables. It doesn't matter whether it is
- ;; Emacs or XEmacs
+ ;; Emacs or XEmacs.
(let ((backup-directory-alist
- ;; Emacs case
+ ;; Emacs case.
(when (boundp 'backup-directory-alist)
(if (symbol-value 'tramp-backup-directory-alist)
(mapcar
(symbol-value 'backup-directory-alist))))
(bkup-backup-directory-info
- ;; XEmacs case
+ ;; XEmacs case.
(when (boundp 'bkup-backup-directory-info)
(if (symbol-value 'tramp-bkup-backup-directory-info)
(mapcar
'write-region
(list start end localname append 'no-message lockname confirm))
- (let ((rem-dec (tramp-get-remote-coding v "remote-decoding"))
- (loc-enc (tramp-get-local-coding v "local-encoding"))
- (modes (save-excursion (tramp-default-file-modes filename)))
+ (let ((modes (save-excursion (tramp-default-file-modes filename)))
;; We use this to save the value of
- ;; `last-coding-system-used' after writing the tmp file.
- ;; At the end of the function, we set
+ ;; `last-coding-system-used' after writing the tmp
+ ;; file. At the end of the function, we set
;; `last-coding-system-used' to this saved value. This
;; way, any intermediary coding systems used while
;; talking to the remote shell or suchlike won't hose
;; file. We call `set-visited-file-modtime' ourselves later
;; on. We must ensure that `file-coding-system-alist'
;; matches `tmpfile'.
- (let ((file-coding-system-alist
+ (let (file-name-handler-alist
+ (file-coding-system-alist
(tramp-find-file-name-coding-system-alist filename tmpfile)))
(condition-case err
(tramp-run-real-handler
(list start end tmpfile append 'no-message lockname confirm))
((error quit)
(setq tramp-temp-buffer-file-name nil)
- (delete-file tmpfile)
+ (tramp-compat-delete-file tmpfile 'force)
(signal (car err) (cdr err))))
;; Now, `last-coding-system-used' has the right value. Remember it.
;; specified. However, if the method _also_ specifies an
;; encoding function, then that is used for encoding the
;; contents of the tmp file.
- (cond
- ;; `copy-file' handles direct copy and out-of-band methods.
- ((or (tramp-local-host-p v)
- (tramp-method-out-of-band-p
- v (nth 7 (file-attributes tmpfile))))
- (if (and (not (stringp start))
- (= (or end (point-max)) (point-max))
- (= (or start (point-min)) (point-min))
- (tramp-get-method-parameter
- method 'tramp-copy-keep-tmpfile))
- (progn
- (setq tramp-temp-buffer-file-name tmpfile)
- (condition-case err
- ;; We keep the local file for performance
- ;; reasons, useful for "rsync".
- (copy-file tmpfile filename t)
- ((error quit)
- (setq tramp-temp-buffer-file-name nil)
- (delete-file tmpfile)
- (signal (car err) (cdr err)))))
- (setq tramp-temp-buffer-file-name nil)
- ;; Don't rename, in order to keep context in SELinux.
+ (let* ((size (nth 7 (file-attributes tmpfile)))
+ (rem-dec (tramp-get-inline-coding v "remote-decoding" size))
+ (loc-enc (tramp-get-inline-coding v "local-encoding" size)))
+ (cond
+ ;; `copy-file' handles direct copy and out-of-band methods.
+ ((or (tramp-local-host-p v)
+ (tramp-method-out-of-band-p v size))
+ (if (and (not (stringp start))
+ (= (or end (point-max)) (point-max))
+ (= (or start (point-min)) (point-min))
+ (tramp-get-method-parameter
+ method 'tramp-copy-keep-tmpfile))
+ (progn
+ (setq tramp-temp-buffer-file-name tmpfile)
+ (condition-case err
+ ;; We keep the local file for performance
+ ;; reasons, useful for "rsync".
+ (copy-file tmpfile filename t)
+ ((error quit)
+ (setq tramp-temp-buffer-file-name nil)
+ (tramp-compat-delete-file tmpfile 'force)
+ (signal (car err) (cdr err)))))
+ (setq tramp-temp-buffer-file-name nil)
+ ;; Don't rename, in order to keep context in SELinux.
+ (unwind-protect
+ (copy-file tmpfile filename t)
+ (tramp-compat-delete-file tmpfile 'force))))
+
+ ;; Use inline file transfer.
+ (rem-dec
+ ;; Encode tmpfile.
(unwind-protect
- (copy-file tmpfile filename t)
- (delete-file tmpfile))))
-
- ;; Use inline file transfer.
- (rem-dec
- ;; Encode tmpfile.
- (tramp-message v 5 "Encoding region...")
- (unwind-protect
- (with-temp-buffer
- ;; Use encoding function or command.
- (if (and (symbolp loc-enc) (fboundp loc-enc))
- (progn
- (tramp-message
- v 5 "Encoding region using function `%s'..."
- (symbol-name loc-enc))
- (let ((coding-system-for-read 'binary))
- (insert-file-contents-literally tmpfile))
- ;; The following `let' is a workaround for the
- ;; base64.el that comes with pgnus-0.84. If
- ;; both of the following conditions are
- ;; satisfied, it tries to write to a local
- ;; file in default-directory, but at this
- ;; point, default-directory is remote.
- ;; (`call-process-region' can't write to
- ;; remote files, it seems.) The file in
- ;; question is a tmp file anyway.
- (let ((default-directory
- (tramp-compat-temporary-file-directory)))
- (funcall loc-enc (point-min) (point-max))))
-
- (tramp-message
- v 5 "Encoding region using command `%s'..." loc-enc)
- (unless (equal 0 (tramp-call-local-coding-command
- loc-enc tmpfile t))
- (tramp-error
- v 'file-error
- "Cannot write to `%s', local encoding command `%s' failed"
- filename loc-enc)))
-
- ;; Send buffer into remote decoding command which
- ;; writes to remote file. Because this happens on
- ;; the remote host, we cannot use the function.
- (goto-char (point-max))
- (unless (bolp) (newline))
- (tramp-message
- v 5 "Decoding region into remote file %s..." filename)
- (tramp-send-command
- v
- (format
- "%s >%s <<'EOF'\n%sEOF"
- rem-dec
- (tramp-shell-quote-argument localname)
- (buffer-string)))
- (tramp-barf-unless-okay
- v nil
- "Couldn't write region to `%s', decode using `%s' failed"
- filename rem-dec)
- ;; When `file-precious-flag' is set, the region is
- ;; written to a temporary file. Check that the
- ;; checksum is equal to that from the local tmpfile.
- (when file-precious-flag
- (erase-buffer)
- (and
- ;; cksum runs locally, if possible.
- (zerop (tramp-local-call-process "cksum" tmpfile t))
- ;; cksum runs remotely.
- (zerop
- (tramp-send-command-and-check
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ ;; Use encoding function or command.
+ (if (functionp loc-enc)
+ (with-progress-reporter
+ v 3 (format "Encoding region using function `%s'"
+ loc-enc)
+ (let ((coding-system-for-read 'binary))
+ (insert-file-contents-literally tmpfile))
+ ;; The following `let' is a workaround for the
+ ;; base64.el that comes with pgnus-0.84. If
+ ;; both of the following conditions are
+ ;; satisfied, it tries to write to a local
+ ;; file in default-directory, but at this
+ ;; point, default-directory is remote.
+ ;; (`call-process-region' can't write to
+ ;; remote files, it seems.) The file in
+ ;; question is a tmp file anyway.
+ (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (funcall loc-enc (point-min) (point-max))))
+
+ (with-progress-reporter
+ v 3 (format "Encoding region using command `%s'"
+ loc-enc)
+ (unless (zerop (tramp-call-local-coding-command
+ loc-enc tmpfile t))
+ (tramp-error
+ v 'file-error
+ (concat "Cannot write to `%s', "
+ "local encoding command `%s' failed")
+ filename loc-enc))))
+
+ ;; Send buffer into remote decoding command which
+ ;; writes to remote file. Because this happens on
+ ;; the remote host, we cannot use the function.
+ (with-progress-reporter
+ v 3
+ (format "Decoding region into remote file %s" filename)
+ (goto-char (point-max))
+ (unless (bolp) (newline))
+ (tramp-send-command
v
(format
- "cksum <%s" (tramp-shell-quote-argument localname))))
- ;; ... they are different.
- (not
- (string-equal
- (buffer-string)
- (with-current-buffer (tramp-get-buffer v)
- (buffer-string))))
- (tramp-error
- v 'file-error
- (concat "Couldn't write region to `%s',"
- " decode using `%s' failed")
- filename rem-dec)))
- (tramp-message
- v 5 "Decoding region into remote file %s...done" filename))
+ (concat rem-dec " <<'EOF'\n%sEOF")
+ (tramp-shell-quote-argument localname)
+ (buffer-string)))
+ (tramp-barf-unless-okay
+ v nil
+ "Couldn't write region to `%s', decode using `%s' failed"
+ filename rem-dec)
+ ;; When `file-precious-flag' is set, the region is
+ ;; written to a temporary file. Check that the
+ ;; checksum is equal to that from the local tmpfile.
+ (when file-precious-flag
+ (erase-buffer)
+ (and
+ ;; cksum runs locally, if possible.
+ (zerop (tramp-local-call-process "cksum" tmpfile t))
+ ;; cksum runs remotely.
+ (zerop
+ (tramp-send-command-and-check
+ v
+ (format
+ "cksum <%s"
+ (tramp-shell-quote-argument localname))))
+ ;; ... they are different.
+ (not
+ (string-equal
+ (buffer-string)
+ (with-current-buffer (tramp-get-buffer v)
+ (buffer-string))))
+ (tramp-error
+ v 'file-error
+ (concat "Couldn't write region to `%s',"
+ " decode using `%s' failed")
+ filename rem-dec)))))
- ;; Save exit.
- (delete-file tmpfile)))
+ ;; Save exit.
+ (tramp-compat-delete-file tmpfile 'force)))
- ;; That's not expected.
- (t
- (tramp-error
- v 'file-error
- (concat "Method `%s' should specify both encoding and "
- "decoding command or an rcp program")
- method)))
+ ;; That's not expected.
+ (t
+ (tramp-error
+ v 'file-error
+ (concat "Method `%s' should specify both encoding and "
+ "decoding command or an rcp program")
+ method))))
;; Make `last-coding-system-used' have the right value.
(when coding-system-used
;; any other remote command.
(defun tramp-handle-vc-registered (file)
"Like `vc-registered' for Tramp files."
- (with-parsed-tramp-file-name file nil
-
- ;; There could be new files, created by the vc backend. We cannot
- ;; reuse the old cache entries, therefore.
- (let (tramp-vc-registered-file-names
- (tramp-cache-inhibit-cache (current-time))
- (file-name-handler-alist
- `((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
-
- ;; Here we collect only file names, which need an operation.
- (tramp-run-real-handler 'vc-registered (list file))
- (tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
-
- ;; Send just one command, in order to fill the cache.
- (when tramp-vc-registered-file-names
- (tramp-maybe-send-script
- v
- (format tramp-vc-registered-read-file-names
- (tramp-get-file-exists-command v)
- (format "%s -r" (tramp-get-test-command v)))
- "tramp_vc_registered_read_file_names")
-
- (dolist
- (elt
- (tramp-send-command-and-read
- v
- (format
- "tramp_vc_registered_read_file_names %s"
- (mapconcat 'tramp-shell-quote-argument
- tramp-vc-registered-file-names
- " "))))
-
- (tramp-set-file-property v (car elt) (cadr elt) (cadr (cdr elt))))))
-
- ;; Second run. Now all `file-exists-p' or `file-readable-p' calls
- ;; shall be answered from the file cache.
- ;; We unset `process-file-side-effects' in order to keep the cache
- ;; when `process-file' calls appear.
- (let (process-file-side-effects)
- (tramp-run-real-handler 'vc-registered (list file)))))
+ (with-temp-message ""
+ (with-parsed-tramp-file-name file nil
+ (with-progress-reporter
+ v 3 (format "Checking `vc-registered' for %s" file)
+
+ ;; There could be new files, created by the vc backend. We
+ ;; cannot reuse the old cache entries, therefore.
+ (let (tramp-vc-registered-file-names
+ (tramp-cache-inhibit-cache (current-time))
+ (file-name-handler-alist
+ `((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
+
+ ;; Here we collect only file names, which need an operation.
+ (tramp-run-real-handler 'vc-registered (list file))
+ (tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
+
+ ;; Send just one command, in order to fill the cache.
+ (when tramp-vc-registered-file-names
+ (tramp-maybe-send-script
+ v
+ (format tramp-vc-registered-read-file-names
+ (tramp-get-file-exists-command v)
+ (format "%s -r" (tramp-get-test-command v)))
+ "tramp_vc_registered_read_file_names")
+
+ (dolist
+ (elt
+ (tramp-send-command-and-read
+ v
+ (format
+ "tramp_vc_registered_read_file_names %s"
+ (mapconcat 'tramp-shell-quote-argument
+ tramp-vc-registered-file-names
+ " "))))
+
+ (tramp-set-file-property
+ v (car elt) (cadr elt) (cadr (cdr elt))))))
+
+ ;; Second run. Now all `file-exists-p' or `file-readable-p'
+ ;; calls shall be answered from the file cache. We unset
+ ;; `process-file-side-effects' in order to keep the cache when
+ ;; `process-file' calls appear.
+ (let (process-file-side-effects)
+ (tramp-run-real-handler 'vc-registered (list file)))))))
;;;###autoload
(progn (defun tramp-run-real-handler (operation args)
"Return file name related to OPERATION file primitive.
ARGS are the arguments OPERATION has been called with."
(cond
- ; FILE resp DIRECTORY
+ ;; FILE resp DIRECTORY.
((member operation
(list 'access-file 'byte-compiler-base-file-name 'delete-directory
'delete-file 'diff-latest-backup-file 'directory-file-name
'load 'make-directory 'make-directory-internal
'set-file-modes 'substitute-in-file-name
'unhandled-file-name-directory 'vc-registered
- ; Emacs 22 only
+ ;; Emacs 22+ only.
'set-file-times
- ; XEmacs only
+ ;; Emacs 24+ only.
+ 'file-selinux-context 'set-file-selinux-context
+ ;; XEmacs only.
'abbreviate-file-name 'create-file-buffer
'dired-file-modtime 'dired-make-compressed-filename
'dired-recursive-delete-directory 'dired-set-file-modtime
(if (file-name-absolute-p (nth 0 args))
(nth 0 args)
(expand-file-name (nth 0 args))))
- ; FILE DIRECTORY resp FILE1 FILE2
+ ;; FILE DIRECTORY resp FILE1 FILE2.
((member operation
(list 'add-name-to-file 'copy-file 'expand-file-name
'file-name-all-completions 'file-name-completion
'file-newer-than-file-p 'make-symbolic-link 'rename-file
- ; Emacs 23 only
+ ;; Emacs 23+ only.
'copy-directory
- ; XEmacs only
+ ;; XEmacs only.
'dired-make-relative-symlink
'vm-imap-move-mail 'vm-pop-move-mail 'vm-spool-move-mail))
(save-match-data
((string-match tramp-file-name-regexp (nth 0 args)) (nth 0 args))
((string-match tramp-file-name-regexp (nth 1 args)) (nth 1 args))
(t (buffer-file-name (current-buffer))))))
- ; START END FILE
+ ;; START END FILE.
((eq operation 'write-region)
(nth 2 args))
- ; BUF
+ ;; BUFFER.
((member operation
(list 'set-visited-file-modtime 'verify-visited-file-modtime
- ; since Emacs 22 only
+ ;; Emacs 22+ only.
'make-auto-save-file-name
- ; XEmacs only
+ ;; XEmacs only.
'backup-buffer))
(buffer-file-name
(if (bufferp (nth 0 args)) (nth 0 args) (current-buffer))))
- ; COMMAND
+ ;; COMMAND.
((member operation
- (list ; not in Emacs 23
+ (list ;; not in Emacs 23+.
'dired-call-process
- ; Emacs only
+ ;; Emacs only.
'shell-command
- ; since Emacs 22 only
+ ;; Emacs 22+ only.
'process-file
- ; since Emacs 23 only
+ ;; Emacs 23+ only.
'start-file-process
- ; XEmacs only
+ ;; XEmacs only.
'dired-print-file 'dired-shell-call-process
- ; nowhere yet
+ ;; nowhere yet.
'executable-find 'start-process 'call-process))
default-directory)
- ; unknown file primitive
+ ;; Unknown file primitive.
(t (error "unknown file I/O primitive: %s" operation))))
(defun tramp-find-foreign-file-name-handler (filename)
"Return foreign file name handler if exists."
- (when (and (stringp filename) (tramp-tramp-file-p filename))
+ (when (tramp-tramp-file-p filename)
(let ((v (tramp-dissect-file-name filename t))
(handler tramp-foreign-file-name-handler-alist)
elt res)
(completion (tramp-completion-mode-p))
(foreign (tramp-find-foreign-file-name-handler filename)))
(with-parsed-tramp-file-name filename nil
- (cond
- ;; When we are in completion mode, some operations
- ;; shouldn't be handled by backend.
- ((and completion (zerop (length localname))
- (memq operation '(file-exists-p file-directory-p)))
- t)
- ((and completion (zerop (length localname))
- (memq operation '(file-name-as-directory)))
- filename)
- ;; Call the backend function.
- (foreign (apply foreign operation args))
- ;; Nothing to do for us.
- (t (tramp-run-real-handler operation args))))))
+ ;; Call the backend function.
+ (if foreign
+ (condition-case err
+ (apply foreign operation args)
+ (error
+ (cond
+ ;; When we are in completion mode, some failed
+ ;; operations shall return at least a default
+ ;; value in order to give the user a chance to
+ ;; correct the file name in the minibuffer.
+ ((and completion (zerop (length localname))
+ (memq operation '(file-exists-p file-directory-p)))
+ t)
+ ((and completion (zerop (length localname))
+ (memq operation
+ '(expand-file-name file-name-as-directory)))
+ filename)
+ ;; Propagate the error.
+ (t (signal (car err) (cdr err))))))
+ ;; Nothing to do for us.
+ (tramp-run-real-handler operation args)))))
+
;; When `tramp-mode' is not enabled, we don't do anything.
(tramp-run-real-handler operation args)))
;; disable this part of the completion, unless the user implicitly
;; indicated his interest in using a fancier completion system.
(or (eq tramp-syntax 'sep)
- (featurep 'tramp) ; If it's loaded, we may as well use it.
- (and (boundp 'partial-completion-mode) partial-completion-mode)
+ (featurep 'tramp) ;; If it's loaded, we may as well use it.
+ ;; `partial-completion-mode' does not exist in XEmacs.
+ ;; It is obsoleted with Emacs 24.1.
+ (and (boundp 'partial-completion-mode)
+ (symbol-value 'partial-completion-mode))
;; FIXME: These may have been loaded even if the user never
;; intended to use them.
(featurep 'ido)
;; overwriting this check in such cases. Or we change Tramp file name
;; syntax in order to avoid ambiguities, like in XEmacs ...
(defun tramp-completion-mode-p ()
- "Checks whether method / user name / host name completion is active."
+ "Check, whether method / user name / host name completion is active."
(or
- ;; Signal from outside.
+ ;; Signal from outside. `non-essential' has been introduced in Emacs 24.
+ (and (boundp 'non-essential) (symbol-value 'non-essential))
tramp-completion-mode
;; Emacs.
(equal last-input-event 'tab)
;; `last-input-event' might be nil.
(not (null last-input-event))
;; `last-input-event' may have no character approximation.
- (funcall (symbol-function 'event-to-character) last-input-event)
+ (tramp-compat-funcall 'event-to-character last-input-event)
(or
;; ?\t has event-modifier 'control.
(equal
- (funcall (symbol-function 'event-to-character)
- last-input-event) ?\t)
+ (tramp-compat-funcall 'event-to-character last-input-event) ?\t)
(and (not (event-modifiers last-input-event))
(or (equal
- (funcall (symbol-function 'event-to-character)
- last-input-event) ?\?)
+ (tramp-compat-funcall 'event-to-character last-input-event)
+ ?\?)
(equal
- (funcall (symbol-function 'event-to-character)
- last-input-event) ?\ )))))))
+ (tramp-compat-funcall 'event-to-character last-input-event)
+ ?\ )))))))
+
+(defun tramp-connectable-p (filename)
+ "Check, whether it is possible to connect the remote host w/o side-effects.
+This is true, if either the remote host is already connected, or if we are
+not in completion mode."
+ (and (tramp-tramp-file-p filename)
+ (with-parsed-tramp-file-name filename nil
+ (or (get-buffer (tramp-buffer-name v))
+ (not (tramp-completion-mode-p))))))
;; Method, host name and user name completion.
;; `tramp-completion-dissect-file-name' returns a list of
(append
result1
(condition-case nil
- (tramp-completion-run-real-handler
- 'file-name-all-completions (list filename directory))
+ (apply (if (tramp-connectable-p fullname)
+ 'tramp-completion-run-real-handler
+ 'tramp-run-real-handler)
+ 'file-name-all-completions (list (list filename directory)))
(error nil)))))
;; Method, host name and user name completion for a file.
(try-completion
filename
(mapcar 'list (file-name-all-completions filename directory))
- (when predicate
+ (when (and predicate
+ (tramp-connectable-p (expand-file-name filename directory)))
(lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
;; I misuse a little bit the tramp-file-name structure in order to handle
(let* ((p (tramp-get-connection-process vec))
(scripts (tramp-get-connection-property p "scripts" nil)))
(unless (member name scripts)
- (tramp-message vec 5 "Sending script `%s'..." name)
- ;; The script could contain a call of Perl. This is masked with `%s'.
- (tramp-send-command-and-check
- vec
- (format "%s () {\n%s\n}" name
- (format script (tramp-get-remote-perl vec))))
- (tramp-set-connection-property p "scripts" (cons name scripts))
- (tramp-message vec 5 "Sending script `%s'...done." name))))
+ (with-progress-reporter vec 5 (format "Sending script `%s'" name)
+ ;; The script could contain a call of Perl. This is masked with `%s'.
+ (tramp-send-command-and-check
+ vec
+ (format "%s () {\n%s\n}" name
+ (format script (tramp-get-remote-perl vec))))
+ (tramp-set-connection-property p "scripts" (cons name scripts))))))
(defun tramp-set-auto-save ()
(when (and ;; ange-ftp has its own auto-save mechanism
"Remove temporary files related to current buffer."
(when (stringp tramp-temp-buffer-file-name)
(condition-case nil
- (delete-file tramp-temp-buffer-file-name)
+ (tramp-compat-delete-file tramp-temp-buffer-file-name 'force)
(error nil))))
(add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function)
(format "*debug tramp/%s %s@%s*" method user host)
(format "*debug tramp/%s %s*" method host))))
+(defconst tramp-debug-outline-regexp
+ "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #")
+
(defun tramp-get-debug-buffer (vec)
"Get the debug buffer for VEC."
(with-current-buffer
(get-buffer-create (tramp-debug-buffer-name vec))
(when (bobp)
(setq buffer-undo-list t)
- ;; Activate outline-mode. This runs `text-mode-hook' and
+ ;; 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"
- ;; ...
- (let ((default-directory (tramp-compat-temporary-file-directory)))
+ ;; die. Yes: I've seen `flyspell-mode', which starts "ispell".
+ ;; Furthermore, `outline-regexp' must have the correct value
+ ;; already, because it is used by `font-lock-compile-keywords'.
+ (let ((default-directory (tramp-compat-temporary-file-directory))
+ (outline-regexp tramp-debug-outline-regexp))
(outline-mode))
- (set (make-local-variable 'outline-regexp)
- "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #")
-; (set (make-local-variable 'outline-regexp)
-; "[a-z.-]+:[0-9]+: [a-z0-9-]+ (\\([0-9]+\\)) #")
+ (set (make-local-variable 'outline-regexp) tramp-debug-outline-regexp)
(set (make-local-variable 'outline-level) 'tramp-outline-level))
(current-buffer)))
(setq result (concat "\\" progname))))
(unless result
(when ignore-tilde
- ;; Remove all ~/foo directories from dirlist. In Emacs 20,
+ ;; Remove all ~/foo directories from dirlist. In XEmacs,
;; `remove' is in CL, and we want to avoid CL dependencies.
(let (newdl d)
(while dirlist
(setq extra-args (cdr item))))
(when extra-args (setq shell (concat shell " " extra-args))))
(tramp-message
- vec 5 "Starting remote shell `%s' for tilde expansion..." shell)
+ vec 5 "Starting remote shell `%s' for tilde expansion" shell)
(let ((tramp-end-of-output tramp-initial-end-of-output))
(tramp-send-command
vec
(shell-quote-argument tramp-end-of-output) shell)
t))
;; Setting prompts.
- (tramp-message vec 5 "Setting remote shell prompt...")
- (tramp-send-command
- vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t)
- (tramp-send-command vec "PS2=''" t)
- (tramp-send-command vec "PS3=''" t)
- (tramp-send-command vec "PROMPT_COMMAND=''" t)
- (tramp-message vec 5 "Setting remote shell prompt...done"))
+ (with-progress-reporter vec 5 (format "Setting remote shell prompt")
+ (tramp-send-command
+ vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t)
+ (tramp-send-command vec "PS2=''" t)
+ (tramp-send-command vec "PS3=''" t)
+ (tramp-send-command vec "PROMPT_COMMAND=''" t)))
(t (tramp-message
vec 5 "Remote `%s' groks tilde expansion, good"
(tramp-send-string vec tramp-terminal-type))
(defun tramp-action-process-alive (proc vec)
- "Check whether a process has finished."
+ "Check, whether a process has finished."
(unless (memq (process-status proc) '(run open))
(throw 'tramp-action 'process-died)))
(defun tramp-action-out-of-band (proc vec)
- "Check whether an out-of-band copy has finished."
+ "Check, whether an out-of-band copy has finished."
(cond ((and (memq (process-status proc) '(stop exit))
(zerop (process-exit-status proc)))
(tramp-message vec 3 "Process has finished.")
(tramp-message proc 10 "\n%s" (buffer-string))))
(defun tramp-check-for-regexp (proc regexp)
- "Check whether REGEXP is contained in process buffer of PROC.
+ "Check, whether REGEXP is contained in process buffer of PROC.
Erase echoed commands if exists."
(with-current-buffer (process-buffer proc)
(goto-char (point-min))
;; Discard echo from remote output.
(tramp-set-connection-property proc "check-remote-echo" nil)
(tramp-message proc 5 "echo-mark found")
- (forward-line)
+ (forward-line 1)
(delete-region begin (point))
(goto-char (point-min)))))
(when (or (not (tramp-get-connection-property proc "check-remote-echo" nil))
;; Sometimes, the echo string is suppressed on the remote side.
(not (string-equal
- (substring-no-properties
- tramp-echo-mark-marker
+ (tramp-compat-funcall
+ 'substring-no-properties tramp-echo-mark-marker
0 (min tramp-echo-mark-marker-length (1- (point-max))))
- (buffer-substring-no-properties
+ (tramp-compat-funcall
+ 'buffer-substring-no-properties
1 (min (1+ tramp-echo-mark-marker-length) (point-max))))))
;; No echo to be handled, now we can look for the regexp.
(goto-char (point-min))
(if (featurep 'mule)
;; Use MULE to select the right EOL convention for communicating
;; with the process.
- (let* ((cs (or (funcall (symbol-function 'process-coding-system) proc)
+ (let* ((cs (or (tramp-compat-funcall 'process-coding-system proc)
(cons 'undecided 'undecided)))
cs-decode cs-encode)
(when (symbolp cs) (setq cs (cons cs cs)))
(when (search-forward "\r" nil t)
(setq cs-decode (tramp-coding-system-change-eol-conversion
cs-decode 'dos)))
- (funcall (symbol-function 'set-buffer-process-coding-system)
- cs-decode cs-encode)
+ (tramp-compat-funcall
+ 'set-buffer-process-coding-system cs-decode cs-encode)
(tramp-message
vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))
;; Look for ^M and do something useful if found.
(tramp-send-command-and-read vec "echo \\\"`uname -sr`\\\""))))
(when (and (stringp old-uname) (not (string-equal old-uname new-uname)))
(with-current-buffer (tramp-get-debug-buffer vec)
- ;; Keep the debug buffer
+ ;; Keep the debug buffer.
(rename-buffer
(generate-new-buffer-name tramp-temp-buffer-name) 'unique)
- (funcall (symbol-function 'tramp-cleanup-connection) vec)
+ (tramp-compat-funcall 'tramp-cleanup-connection vec)
(if (= (point-min) (point-max))
(kill-buffer nil)
(rename-buffer (tramp-debug-buffer-name vec) 'unique))
"List of local coding commands for inline transfer.
Each item is a list that looks like this:
-\(FORMAT ENCODING DECODING)
+\(FORMAT ENCODING DECODING\)
FORMAT is symbol describing the encoding/decoding format. It can be
`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing.
"List of remote coding commands for inline transfer.
Each item is a list that looks like this:
-\(FORMAT ENCODING DECODING)
+\(FORMAT ENCODING DECODING\)
FORMAT is symbol describing the encoding/decoding format. It can be
`b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing.
(if (string-match "%s" cmd) (format cmd input) cmd)
(if (stringp output) (concat "> " output) ""))))
+(defconst tramp-inline-compress-commands
+ '(("gzip" "gzip -d")
+ ("bzip2" "bzip2 -d")
+ ("compress" "compress -d"))
+ "List of compress and decompress commands for inline transfer.
+Each item is a list that looks like this:
+
+\(COMPRESS DECOMPRESS\)
+
+COMPRESS or DECOMPRESS are strings with the respective commands.")
+
+(defun tramp-find-inline-compress (vec)
+ "Find an inline transfer compress command that works.
+Goes through the list `tramp-inline-compress-commands'."
+ (save-excursion
+ (let ((commands tramp-inline-compress-commands)
+ (magic "xyzzy")
+ item compress decompress
+ found)
+ (while (and commands (not found))
+ (catch 'next
+ (setq item (pop commands)
+ compress (nth 0 item)
+ decompress (nth 1 item))
+ (tramp-message
+ vec 5
+ "Checking local compress command `%s', `%s' for sanity"
+ compress decompress)
+ (unless (zerop (tramp-call-local-coding-command
+ (format "echo %s | %s | %s"
+ magic compress decompress) nil nil))
+ (throw 'next nil))
+ (tramp-message
+ vec 5
+ "Checking remote compress command `%s', `%s' for sanity"
+ compress decompress)
+ (unless (zerop (tramp-send-command-and-check
+ vec (format "echo %s | %s | %s"
+ magic compress decompress) t))
+ (throw 'next nil))
+ (setq found t)))
+
+ ;; Did we find something?
+ (if found
+ (progn
+ ;; Set connection properties.
+ (tramp-message
+ vec 5 "Using inline transfer compress command `%s'" compress)
+ (tramp-set-connection-property vec "inline-compress" compress)
+ (tramp-message
+ vec 5 "Using inline transfer decompress command `%s'" decompress)
+ (tramp-set-connection-property vec "inline-decompress" decompress))
+
+ (tramp-set-connection-property vec "inline-compress" nil)
+ (tramp-set-connection-property vec "inline-decompress" nil)
+ (tramp-message
+ vec 2 "Couldn't find an inline transfer compress command")))))
+
(defun tramp-compute-multi-hops (vec)
"Expands VEC according to `tramp-default-proxies-alist'.
Gateway hops are already opened."
(setq proxy
(format-spec
proxy
- `((?u . ,(or (tramp-file-name-user (car target-alist)) ""))
- (?h . ,(or (tramp-file-name-host (car target-alist)) "")))))
+ (format-spec-make
+ ?u (or (tramp-file-name-user (car target-alist)) "")
+ ?h (or (tramp-file-name-host (car target-alist)) ""))))
(with-parsed-tramp-file-name proxy l
;; Add the hop.
(add-to-list 'target-alist l)
'target-alist
(vector
(tramp-file-name-method hop) (tramp-file-name-user hop)
- (funcall (symbol-function 'tramp-gw-open-connection) vec gw hop) nil))
+ (tramp-compat-funcall 'tramp-gw-open-connection vec gw hop) nil))
;; For the password prompt, we need the correct values.
;; Therefore, we must remember the gateway vector. But we
;; cannot do it as connection property, because it shouldn't
connection if a previous connection has died for some reason."
(catch 'uname-changed
(let ((p (tramp-get-connection-process vec))
+ (process-name (tramp-get-connection-property vec "process-name" nil))
(process-environment (copy-sequence process-environment)))
;; If too much time has passed since last command was sent, look
;; We call `tramp-get-buffer' in order to get a debug buffer for
;; messages from the beginning.
(tramp-get-buffer vec)
- (if (zerop (length (tramp-file-name-user vec)))
- (tramp-message
- vec 3 "Opening connection for %s using %s..."
- (tramp-file-name-host vec)
- (tramp-file-name-method vec))
- (tramp-message
- vec 3 "Opening connection for %s@%s using %s..."
- (tramp-file-name-user vec)
- (tramp-file-name-host vec)
- (tramp-file-name-method vec)))
-
- ;; Start new process.
- (when (and p (processp p))
- (delete-process p))
- (setenv "TERM" tramp-terminal-type)
- (setenv "LC_ALL" "C")
- (setenv "PROMPT_COMMAND")
- (setenv "PS1" tramp-initial-end-of-output)
- (let* ((target-alist (tramp-compute-multi-hops vec))
- (process-connection-type tramp-process-connection-type)
- (process-adaptive-read-buffering nil)
- (coding-system-for-read nil)
- ;; This must be done in order to avoid our file name handler.
- (p (let ((default-directory
- (tramp-compat-temporary-file-directory)))
- (start-process
- (or (tramp-get-connection-property vec "process-name" nil)
- (tramp-buffer-name vec))
- (tramp-get-connection-buffer vec)
- tramp-encoding-shell))))
-
- (tramp-message
- vec 6 "%s" (mapconcat 'identity (process-command p) " "))
-
- ;; Check whether process is alive.
- (tramp-set-process-query-on-exit-flag p nil)
- (tramp-message vec 3 "Waiting 60s for local shell to come up...")
- (tramp-barf-if-no-shell-prompt
- p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
-
- ;; Now do all the connections as specified.
- (while target-alist
- (let* ((hop (car target-alist))
- (l-method (tramp-file-name-method hop))
- (l-user (tramp-file-name-user hop))
- (l-host (tramp-file-name-host hop))
- (l-port nil)
- (login-program
- (tramp-get-method-parameter l-method 'tramp-login-program))
- (login-args
- (tramp-get-method-parameter l-method 'tramp-login-args))
- (gw-args
- (tramp-get-method-parameter l-method 'tramp-gw-args))
- (gw (tramp-get-file-property hop "" "gateway" nil))
- (g-method (and gw (tramp-file-name-method gw)))
- (g-user (and gw (tramp-file-name-user gw)))
- (g-host (and gw (tramp-file-name-host gw)))
- (command login-program)
- ;; We don't create the temporary file. In fact, it
- ;; is just a prefix for the ControlPath option of
- ;; ssh; the real temporary file has another name, and
- ;; it is created and protected by ssh. It is also
- ;; removed by ssh, when the connection is closed.
- (tmpfile
- (tramp-set-connection-property
- p "temp-file"
- (make-temp-name
- (expand-file-name
- tramp-temp-name-prefix
- (tramp-compat-temporary-file-directory)))))
- spec)
-
- ;; Add gateway arguments if necessary.
- (when (and gw gw-args)
- (setq login-args (append login-args gw-args)))
+ (with-progress-reporter
+ vec 3
+ (if (zerop (length (tramp-file-name-user vec)))
+ (format "Opening connection for %s using %s"
+ (tramp-file-name-host vec)
+ (tramp-file-name-method vec))
+ (format "Opening connection for %s@%s using %s"
+ (tramp-file-name-user vec)
+ (tramp-file-name-host vec)
+ (tramp-file-name-method vec)))
+
+ ;; Start new process.
+ (when (and p (processp p))
+ (delete-process p))
+ (setenv "TERM" tramp-terminal-type)
+ (setenv "LC_ALL" "C")
+ (setenv "PROMPT_COMMAND")
+ (setenv "PS1" tramp-initial-end-of-output)
+ (let* ((target-alist (tramp-compute-multi-hops vec))
+ (process-connection-type tramp-process-connection-type)
+ (process-adaptive-read-buffering nil)
+ (coding-system-for-read nil)
+ ;; This must be done in order to avoid our file name handler.
+ (p (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (start-process
+ (or process-name (tramp-buffer-name vec))
+ (tramp-get-connection-buffer vec)
+ tramp-encoding-shell))))
- ;; Check for port number. Until now, there's no need
- ;; for handling like method, user, host.
- (when (string-match tramp-host-with-port-regexp l-host)
+ (tramp-message
+ vec 6 "%s" (mapconcat 'identity (process-command p) " "))
+
+ ;; Check whether process is alive.
+ (tramp-set-process-query-on-exit-flag p nil)
+ (tramp-barf-if-no-shell-prompt
+ p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
+
+ ;; Now do all the connections as specified.
+ (while target-alist
+ (let* ((hop (car target-alist))
+ (l-method (tramp-file-name-method hop))
+ (l-user (tramp-file-name-user hop))
+ (l-host (tramp-file-name-host hop))
+ (l-port nil)
+ (login-program
+ (tramp-get-method-parameter
+ l-method 'tramp-login-program))
+ (login-args
+ (tramp-get-method-parameter l-method 'tramp-login-args))
+ (async-args
+ (tramp-get-method-parameter l-method 'tramp-async-args))
+ (gw-args
+ (tramp-get-method-parameter l-method 'tramp-gw-args))
+ (gw (tramp-get-file-property hop "" "gateway" nil))
+ (g-method (and gw (tramp-file-name-method gw)))
+ (g-user (and gw (tramp-file-name-user gw)))
+ (g-host (and gw (tramp-file-name-host gw)))
+ (command login-program)
+ ;; We don't create the temporary file. In fact,
+ ;; it is just a prefix for the ControlPath option
+ ;; of ssh; the real temporary file has another
+ ;; name, and it is created and protected by ssh.
+ ;; It is also removed by ssh, when the connection
+ ;; is closed.
+ (tmpfile
+ (tramp-set-connection-property
+ p "temp-file"
+ (make-temp-name
+ (expand-file-name
+ tramp-temp-name-prefix
+ (tramp-compat-temporary-file-directory)))))
+ spec)
+
+ ;; Add arguments for asynchrononous processes.
+ (when (and process-name async-args)
+ (setq login-args (append login-args async-args)))
+
+ ;; Add gateway arguments if necessary.
+ (when (and gw gw-args)
+ (setq login-args (append login-args gw-args)))
+
+ ;; Check for port number. Until now, there's no need
+ ;; for handling like method, user, host.
+ (when (string-match tramp-host-with-port-regexp l-host)
(setq l-port (match-string 2 l-host)
l-host (match-string 1 l-host)))
- ;; Set variables for computing the prompt for reading
- ;; password. They can also be derived from a gateway.
- (setq tramp-current-method (or g-method l-method)
- tramp-current-user (or g-user l-user)
- tramp-current-host (or g-host l-host))
-
- ;; Replace login-args place holders.
- (setq
- l-host (or l-host "")
- l-user (or l-user "")
- l-port (or l-port "")
- spec `((?h . ,l-host) (?u . ,l-user) (?p . ,l-port)
- (?t . ,tmpfile))
- command
- (concat
- ;; We do not want to see the trailing local prompt in
- ;; `start-file-process'.
- (unless (memq system-type '(windows-nt)) "exec ")
- command " "
- (mapconcat
- (lambda (x)
- (setq x (mapcar (lambda (y) (format-spec y spec)) x))
- (unless (member "" x) (mapconcat 'identity x " ")))
- login-args " ")
- ;; Local shell could be a Windows COMSPEC. It doesn't
- ;; know the ";" syntax, but we must exit always for
- ;; `start-file-process'. "exec" does not work either.
- (if (memq system-type '(windows-nt)) " && exit || exit")))
-
- ;; Send the command.
- (tramp-message vec 3 "Sending command `%s'" command)
- (tramp-send-command vec command t t)
- (tramp-process-actions p vec tramp-actions-before-shell 60)
- (tramp-message vec 3 "Found remote shell prompt on `%s'" l-host))
- ;; Next hop.
- (setq target-alist (cdr target-alist)))
-
- ;; Make initial shell settings.
- (tramp-open-connection-setup-interactive-shell p vec))))))
+ ;; Set variables for computing the prompt for reading
+ ;; password. They can also be derived from a gateway.
+ (setq tramp-current-method (or g-method l-method)
+ tramp-current-user (or g-user l-user)
+ tramp-current-host (or g-host l-host))
+
+ ;; Replace login-args place holders.
+ (setq
+ l-host (or l-host "")
+ l-user (or l-user "")
+ l-port (or l-port "")
+ spec (format-spec-make
+ ?h l-host ?u l-user ?p l-port ?t tmpfile)
+ command
+ (concat
+ ;; We do not want to see the trailing local prompt in
+ ;; `start-file-process'.
+ (unless (memq system-type '(windows-nt)) "exec ")
+ command " "
+ (mapconcat
+ (lambda (x)
+ (setq x (mapcar (lambda (y) (format-spec y spec)) x))
+ (unless (member "" x) (mapconcat 'identity x " ")))
+ login-args " ")
+ ;; Local shell could be a Windows COMSPEC. It
+ ;; doesn't know the ";" syntax, but we must exit
+ ;; always for `start-file-process'. "exec" does not
+ ;; work either.
+ (if (memq system-type '(windows-nt)) " && exit || exit")))
+
+ ;; Send the command.
+ (tramp-message vec 3 "Sending command `%s'" command)
+ (tramp-send-command vec command t t)
+ (tramp-process-actions p vec tramp-actions-before-shell 60)
+ (tramp-message
+ vec 3 "Found remote shell prompt on `%s'" l-host))
+ ;; Next hop.
+ (setq target-alist (cdr target-alist)))
+
+ ;; Make initial shell settings.
+ (tramp-open-connection-setup-interactive-shell p vec)))))))
(defun tramp-send-command (vec command &optional neveropen nooutput)
"Send the COMMAND to connection VEC.
;; data structure.
(defun tramp-file-name-p (vec)
- "Check whether VEC is a Tramp object."
+ "Check, whether VEC is a Tramp object."
(and (vectorp vec) (= 4 (length vec))))
(defun tramp-file-name-method (vec)
localname))))))
(defun tramp-equal-remote (file1 file2)
- "Checks, whether the remote parts of FILE1 and FILE2 are identical.
+ "Check, whether the remote parts of FILE1 and FILE2 are identical.
The check depends on method, user and host name of the files. If
one of the components is missing, the default values are used.
The local file name parts of FILE1 and FILE2 are not taken into
(tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-copy-program)
;; Either the file size is large enough, or (in rare cases) there
;; does not exist a remote encoding.
- (or (> size tramp-copy-size-limit)
- (null (tramp-get-remote-coding vec "remote-encoding")))))
+ (or (null tramp-copy-size-limit)
+ (> size tramp-copy-size-limit)
+ (null (tramp-get-inline-coding vec "remote-encoding" size)))))
(defun tramp-local-host-p (vec)
"Return t if this points to the local host, nil otherwise."
(tramp-get-connection-process vec)
vec)
"remote-path"
- (let* ((remote-path (tramp-compat-copy-tree tramp-remote-path))
+ (let* ((remote-path (copy-tree tramp-remote-path))
(elt1 (memq 'tramp-default-remote-path remote-path))
(elt2 (memq 'tramp-own-remote-path remote-path))
(default-remote-path
(nth 3 (tramp-compat-file-attributes "~/" id-format)))
;; Some predefined connection properties.
-(defun tramp-get-remote-coding (vec prop)
- ;; Local coding handles properties like remote coding. So we could
- ;; call it without pain.
- (let ((ret (tramp-get-local-coding vec prop)))
+(defun tramp-get-inline-compress (vec prop size)
+ "Return the compress command related to PROP.
+PROP is either `inline-compress' or `inline-decompress'. SIZE is
+the length of the file to be compressed.
+
+If no corresponding command is found, nil is returned."
+ (when (and (integerp tramp-inline-compress-start-size)
+ (> size tramp-inline-compress-start-size))
+ (with-connection-property vec prop
+ (tramp-find-inline-compress vec)
+ (tramp-get-connection-property vec prop nil))))
+
+(defun tramp-get-inline-coding (vec prop size)
+ "Return the coding command related to PROP.
+PROP is either `remote-encoding', `remode-decoding',
+`local-encoding' or `local-decoding'.
+
+SIZE is the length of the file to be coded. Depending on SIZE,
+compression might be applied.
+
+If no corresponding command is found, nil is returned.
+Otherwise, either a string is returned which contains a `%s' mark
+to be used for the respective input or output file; or a Lisp
+function cell is returned to be applied on a buffer."
+ (let ((coding
+ (with-connection-property vec prop
+ (tramp-find-inline-encoding vec)
+ (tramp-get-connection-property vec prop nil)))
+ (prop1 (if (string-match "encoding" prop)
+ "inline-compress" "inline-decompress"))
+ compress)
;; The connection property might have been cached. So we must send
- ;; the script - maybe.
- (when (and ret (symbolp ret))
- (let ((name (symbol-name ret)))
+ ;; the script to the remote side - maybe.
+ (when (and coding (symbolp coding) (string-match "remote" prop))
+ (let ((name (symbol-name coding)))
(while (string-match (regexp-quote "-") name)
(setq name (replace-match "_" nil t name)))
- (tramp-maybe-send-script vec (symbol-value ret) name)
- (setq ret name)))
- ;; Return the value.
- ret))
-
-(defun tramp-get-local-coding (vec prop)
- (or
- (tramp-get-connection-property vec prop nil)
- (progn
- (tramp-find-inline-encoding vec)
- (tramp-get-connection-property vec prop nil))))
+ (tramp-maybe-send-script vec (symbol-value coding) name)
+ (setq coding name)))
+ (when coding
+ ;; Check for the `compress' command.
+ (setq compress (tramp-get-inline-compress vec prop1 size))
+ ;; Return the value.
+ (cond
+ ((and compress (symbolp coding))
+ (if (string-match "decompress" prop1)
+ `(lambda (beg end)
+ (,coding beg end)
+ (let ((coding-system-for-write 'binary)
+ (coding-system-for-read 'binary))
+ (apply
+ 'call-process-region (point-min) (point-max)
+ (car (split-string ,compress)) t t nil
+ (cdr (split-string ,compress)))))
+ `(lambda (beg end)
+ (let ((coding-system-for-write 'binary)
+ (coding-system-for-read 'binary))
+ (apply
+ 'call-process-region beg end
+ (car (split-string ,compress)) t t nil
+ (cdr (split-string ,compress))))
+ (,coding (point-min) (point-max)))))
+ ((symbolp coding)
+ coding)
+ ((and compress (string-match "decoding" prop))
+ (format "(%s | %s >%%s)" coding compress))
+ (compress
+ (format "(%s <%%s | %s)" compress coding))
+ ((string-match "decoding" prop)
+ (format "%s >%%s" coding))
+ (t
+ (format "%s <%%s" coding))))))
(defun tramp-get-method-parameter (method param)
"Return the method parameter PARAM.
-If the `tramp-methods' entry does not exist, return NIL."
+If the `tramp-methods' entry does not exist, return nil."
(let ((entry (assoc param (assoc method tramp-methods))))
(when entry (cadr entry))))
;; Auto saving to a special directory.
(defun tramp-exists-file-name-handler (operation &rest args)
- "Checks whether OPERATION runs a file name handler."
+ "Check, whether OPERATION runs a file name handler."
;; The file name handler is determined on base of either an
;; argument, `buffer-file-name', or `default-directory'.
(condition-case nil
(defadvice make-auto-save-file-name
(around tramp-advice-make-auto-save-file-name () activate)
"Invoke `tramp-handle-make-auto-save-file-name' for Tramp files."
- (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))
+ (if (tramp-tramp-file-p (buffer-file-name))
;; We cannot call `tramp-handle-make-auto-save-file-name'
;; directly, because this would bypass the locking mechanism.
(setq ad-return-value
'around 'tramp-advice-make-auto-save-file-name)
(ad-activate 'make-auto-save-file-name))))
-;; In Emacs < 22 and XEmacs < 21.5 autosaved remote files have
-;; permission 0666 minus umask. This is a security threat.
+;; In XEmacs < 21.5, autosaved remote files have permission 0666 minus
+;; umask. This is a security threat.
(defun tramp-set-auto-save-file-modes ()
"Set permissions of autosaved remote files to the original permissions."
(let ((bfn (buffer-file-name)))
- (when (and (stringp bfn)
- (tramp-tramp-file-p bfn)
+ (when (and (tramp-tramp-file-p bfn)
(buffer-modified-p)
(stringp buffer-auto-save-file-name)
(not (equal bfn buffer-auto-save-file-name)))
(set-file-modes buffer-auto-save-file-name
(or (file-modes bfn) (tramp-octal-to-decimal "0600"))))))
-(unless (or (> emacs-major-version 21)
- (and (featurep 'xemacs)
- (= emacs-major-version 21)
- (> emacs-minor-version 4)))
+(unless (and (featurep 'xemacs)
+ (= emacs-major-version 21)
+ (> emacs-minor-version 4))
(add-hook 'auto-save-hook 'tramp-set-auto-save-file-modes)
(add-hook 'tramp-unload-hook
(lambda ()
(and (boundp 'auth-sources)
(tramp-get-connection-property v "first-password-request" nil)
;; Try with Tramp's current method.
- (funcall (symbol-function 'auth-source-user-or-password)
- "password" tramp-current-host tramp-current-method))
+ (tramp-compat-funcall
+ 'auth-source-user-or-password
+ "password" tramp-current-host tramp-current-method))
;; Try the password cache.
(when (functionp 'password-read)
(unless (tramp-get-connection-property
v "first-password-request" nil)
- (funcall (symbol-function 'password-cache-remove) key))
+ (tramp-compat-funcall 'password-cache-remove key))
(let ((password
- (funcall (symbol-function 'password-read) pw-prompt key)))
- (funcall (symbol-function 'password-cache-add) key password)
+ (tramp-compat-funcall 'password-read pw-prompt key)))
+ (tramp-compat-funcall 'password-cache-add key password)
password))
;; Else, get the password interactively.
(read-passwd pw-prompt))
(defun tramp-clear-passwd (vec)
"Clear password cache for connection related to VEC."
- (when (functionp 'password-cache-remove)
- (funcall
- (symbol-function 'password-cache-remove)
- (tramp-make-tramp-file-name
- (tramp-file-name-method vec)
- (tramp-file-name-user vec)
- (tramp-file-name-host vec)
- ""))))
+ (tramp-compat-funcall
+ 'password-cache-remove
+ (tramp-make-tramp-file-name
+ (tramp-file-name-method vec)
+ (tramp-file-name-user vec)
+ (tramp-file-name-host vec)
+ "")))
;; Snarfed code from time-date.el and parse-time.el
;; Pacify byte-compiler with `symbol-function'.
(cond ((and (fboundp 'subtract-time)
(fboundp 'float-time))
- (funcall (symbol-function 'float-time)
- (funcall (symbol-function 'subtract-time) t1 t2)))
+ (tramp-compat-funcall
+ 'float-time (tramp-compat-funcall 'subtract-time t1 t2)))
((and (fboundp 'subtract-time)
(fboundp 'time-to-seconds))
- (funcall (symbol-function 'time-to-seconds)
- (funcall (symbol-function 'subtract-time) t1 t2)))
+ (tramp-compat-funcall
+ 'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2)))
((fboundp 'itimer-time-difference)
- (funcall (symbol-function 'itimer-time-difference)
- (if (< (length t1) 3) (append t1 '(0)) t1)
- (if (< (length t2) 3) (append t2 '(0)) t2)))
+ (tramp-compat-funcall
+ 'itimer-time-difference
+ (if (< (length t1) 3) (append t1 '(0)) t1)
+ (if (< (length t2) 3) (append t2 '(0)) t2)))
(t
(let ((time (tramp-time-subtract t1 t2)))
(+ (* (car time) 65536.0)
"Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
EOL-TYPE can be one of `dos', `unix', or `mac'."
(cond ((fboundp 'coding-system-change-eol-conversion)
- (funcall (symbol-function 'coding-system-change-eol-conversion)
- coding-system eol-type))
+ (tramp-compat-funcall
+ 'coding-system-change-eol-conversion coding-system eol-type))
((fboundp 'subsidiary-coding-system)
- (funcall (symbol-function 'subsidiary-coding-system)
- coding-system
- (cond ((eq eol-type 'dos) 'crlf)
- ((eq eol-type 'unix) 'lf)
- ((eq eol-type 'mac) 'cr)
- (t
- (error "Unknown EOL-TYPE `%s', must be %s"
- eol-type
- "`dos', `unix', or `mac'")))))
+ (tramp-compat-funcall
+ 'subsidiary-coding-system coding-system
+ (cond ((eq eol-type 'dos) 'crlf)
+ ((eq eol-type 'unix) 'lf)
+ ((eq eol-type 'mac) 'cr)
+ (t
+ (error "Unknown EOL-TYPE `%s', must be %s"
+ eol-type
+ "`dos', `unix', or `mac'")))))
(t (error "Can't change EOL conversion -- is MULE missing?"))))
(defun tramp-set-process-query-on-exit-flag (process flag)
If the second argument flag is non-nil, Emacs will query the user before
exiting if process is running."
(if (fboundp 'set-process-query-on-exit-flag)
- (funcall (symbol-function 'set-process-query-on-exit-flag) process flag)
- (funcall (symbol-function 'process-kill-without-query) process flag)))
+ (tramp-compat-funcall 'set-process-query-on-exit-flag process flag)
+ (tramp-compat-funcall 'process-kill-without-query) process flag))
;; ------------------------------------------------------------
;; When Tramp is not loaded yet, its autoloads are still active.
(tramp-unload-file-name-handlers)
;; ange-ftp settings must be enabled.
- (when (functionp 'tramp-ftp-enable-ange-ftp)
- (funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
+ (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp)
;; Maybe its not loaded yet.
(condition-case nil
(unload-feature 'tramp 'force)
;; * Remove unneeded parameters from methods.
;; * Make it work for different encodings, and for different file name
;; encodings, too. (Daniel Pittman)
-;; * Progress reports while copying files. (Michael Kifer)
;; * Don't search for perl5 and perl. Instead, only search for perl and
;; then look if it's the right version (with `perl -v').
;; * When editing a remote CVS controlled file as a different user, VC
;; expects only English messages? (Juri Linkov)
;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846)
;; * Do not handle files with drive letter as remote. (Bug#5447)
-;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448)
+;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448, Bug#5705)
;; * Try telnet+curl as new method. It might be useful for busybox,
;; without built-in uuencode/uudecode.
;; * Let `shell-dynamic-complete-*' and `comint-dynamic-complete' work
;; on remote hosts.
;; * Use secrets.el for password handling.
+;; * Load ~/.emacs_SHELLNAME on the remote host for `shell'.
;; Functions for file-name-handler-alist:
;; diff-latest-backup-file -- in diff.el
;;; trampver.el --- Transparent Remote Access, Multiple Protocol
;;; lisp/trampver.el. Generated from trampver.el.in by configure.
-;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
;; Keywords: comm, processes
;;; Code:
-;; In the Tramp CVS repository, the version numer and the bug report address
-;; are auto-frobbed from configure.ac, so you should edit that file and run
-;; "autoconf && ./configure" to change them. (X)Emacs version check is defined
-;; in macro AC_EMACS_INFO of aclocal.m4; should be changed only there.
+;; In the Tramp CVS repository, the version number and the bug report
+;; address are auto-frobbed from configure.ac, so you should edit that
+;; file and run "autoconf && ./configure" to change them. (X)Emacs
+;; version check is defined in macro AC_EMACS_INFO of aclocal.m4;
+;; should be changed only there.
-(defconst tramp-version "2.1.18-23.2"
+(defconst tramp-version "2.1.19-pre"
"This version of Tramp.")
(defconst tramp-bug-report-address "tramp-devel@gnu.org"
"Email address to send bug reports to.")
;; Check for (X)Emacs version.
-(let ((x (if (or (< emacs-major-version 21) (and (featurep 'xemacs) (= emacs-major-version 21) (< emacs-minor-version 4))) (format "Tramp 2.1.18-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version)))) "ok")))
+(let ((x (if (or (>= emacs-major-version 22) (and (featurep 'xemacs) (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" (format "Tramp 2.1.19-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))
(provide 'trampver)
(defgroup xesam nil
"Xesam compatible interface to search engines."
:group 'extensions
- :group 'hypermedia
+ :group 'comm
:version "23.1")
(defcustom xesam-query-type 'user-query
(defgroup nxml nil
"New XML editing mode."
- :group 'languages
- :group 'wp)
+ :group 'languages)
(defgroup nxml-faces nil
"Faces for XML syntax highlighting."
(define-key map "\M-}" 'nxml-forward-paragraph)
(define-key map "\M-h" 'nxml-mark-paragraph)
(define-key map "\C-c\C-f" 'nxml-finish-element)
+ (define-key map "\C-c/" 'nxml-finish-element)
(define-key map "\C-c\C-m" 'nxml-split-element)
(define-key map "\C-c\C-b" 'nxml-balanced-close-start-tag-block)
(define-key map "\C-c\C-i" 'nxml-balanced-close-start-tag-inline)
;; Author: Dave Gillespie <daveg@synaptics.com>
;; Keywords: abbrev convenience
+;; Obsolete-since: 24.1
+;;
;; Special thanks to Hallvard Furuseth for his many ideas and contributions.
;; This file is part of GNU Emacs.
;; Author: Morten Welinder <terra@diku.dk>
;; Keywords: terminals
;; Favourite-brand-of-beer: None, I hate beer.
+;; Obsolete-since: 24.1
;; This file is part of GNU Emacs.
* Version 23.2 released.
+2010-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * org-table.el (orgtbl-setup):
+ * org-agenda.el (org-agenda-entry-text-mode): Simplify.
+
+2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * org-table.el (orgtbl-mode): Use define-minor-mode.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-insert-link): Find the link buffer on visible frames.
+ (org-export-latex-default-packages-alist): Hyperref must be loaded
+ late.
+ (org-open-file): More care with the new matching for file links.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-preprocess): Do not yet protect
+ defined entities - these will be taken care of later.
+ (org-export-latex-special-chars): Post-process entity replacement.
+ (org-export-latex-fontify-headline): Do not yet protect defined
+ entities - these will be taken care of later.
+ (org-export-latex-tables, org-export-latex-links): Format the
+ caption properly.
+
+ * org-entities.el (org-entities-user): Fix typo.
+
+ * org.el (org-prepare-agenda-buffers): Uniquify TODO keywords
+
+ * org-entities.el (org-entities-user): Improve docstring.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-entities.el (org-macs): Require org-macs, to be sure that we
+ have `declare-function' defined.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-classes): Update docstring.
+
+ * org.el (org-format-latex-header): Add cookies to the header.
+ (org-splice-latex-header): Implement placement according to cookies.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-publish.el (org-publish-aux-preprocess): Control case
+ sensitivity.
+
+2010-04-10 Bastien Guerry <bzg@altern.org>
+
+ * org.el (org-splice-latex-header): Fix typo.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-make-header):
+ Use `org-splice-latex-header' to build the header.
+ (org-export-latex-classes): Update docstring.
+
+ * org.el (org-splice-latex-header): New function.
+ (org-create-formula-image): Use `org-splice-latex-header' to build
+ the header.
+
+ * org-gnus.el (org-gnus-follow-link): Handle nndoc backend.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-export-latex-packages-alist)
+ (org-export-latex-default-packages-alist): Fix docstring to
+ reflect the expected structure.
+
+ * org-docbook.el (org-docbook-do-expand): Fix bug with variable names.
+ (org-export-docbook-finalize-table): Make use of label for tables.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-attach.el (org-attach-commit): Split on newlines.
+
+ * org.el (org-export-latex-default-packages-alist): Use list
+ instead of cons for the entries.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-entities.el (org-entity-get-representation): Catch the case
+ that there is not entry in the list.
+
+ * org-mobile.el (org-mobile-use-encryption)
+ (org-mobile-encryption-tempfile, org-mobile-encryption-password):
+ New options.
+ (org-mobile-check-setup): CHeck the encryption setup.
+ (org-mobile-copy-agenda-files, org-mobile-sumo-agenda-command)
+ (org-mobile-create-sumo-agenda): Use encryption code.
+ (org-mobile-encrypt-and-move): New function.
+ (org-mobile-encrypt-file, org-mobile-decrypt-file): New
+ functions.
+ (org-mobile-move-capture): Decrypt the capture file.
+
+ * org.el (org-entities): Require the new file.
+ (org-export-latex-default-packages-alist): New variable.
+ (org-complete): Use new entity code for completion.
+ (org-create-formula-image): Use the new packages variable.
+
+ * org-latex.el (org-export-latex-classes): Remove the standard
+ packages from the class headers.
+ (org-export-latex-make-header): Use the new package variable.
+ (org-export-latex-special-chars): Better regexp for entities, to
+ support entity name that contain numbers.
+ (org-export-latex-treat-backslash-char): Use the new entity code.
+
+ * org-html.el (org-html-do-expand): Use the new entity code.
+
+ * org-exp.el (org-export): Add the new export commands.
+ (org-html-entities): Constant removed.
+ (org-export-visible): Add the new export commands.
+
+ * org-docbook.el (org-docbook-do-expand): Use new entity code.
+
+ * org-ascii.el (org-export-ascii-entities): New variable.
+ (org-export-as-latin1, org-export-as-latin1-to-buffer)
+ (org-export-as-utf8, org-export-as-utf8-to-buffer): New commands.
+ (org-export-as-encoding): New function.
+ (org-export-ascii-preprocess): Call `org-ascii-replace-entities'.
+ (org-ascii-replace-entities): New function.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+ Ulf Stegemann <ulf@zeitform.de>
+
+ * org-entities.el: New file.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-html.el (org-html-level-start): Catch the case that target
+ might be nil.
+
+2010-04-10 Dan Davison <davison@stats.ox.ac.uk>
+
+ * org.el (org-appearance): Change Customize group variable name
+ from org-font-lock to org-appearance, and change tag from "Org
+ Font Lock" to "Org Appearance"
+ (org-odd-levels-only): Change Customize group variable name
+ (org-level-color-stars-only): Change Customize group variable name
+ (org-hide-leading-stars): Change Customize group variable name
+ (org-hidden-keywords): Change Customize group variable name
+ (org-fontify-done-headline): Change Customize group variable name
+ (org-fontify-emphasized-text): Change Customize group variable name
+ (org-fontify-whole-heading-line): Change Customize group variable name
+ (org-highlight-latex-fragments-and-specials): Change Customize
+ group variable name
+ (org-hide-emphasis-markers): Change Customize group variable name
+ (org-emphasis-alist): Change Customize group variable name
+ (org-emphasis-regexp-components): Change Customize group variable
+ name
+ (org-modules): Remove mention of org-R
+
+ * org-faces.el (org-faces): Change Customize group variable name
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-diary-last-run-time): New variable.
+ (org-diary): prepare agenda buffers only if last call was some
+ time ago.
+
+ * org-html.el (org-export-html-preprocess): Replace \ref macros
+ with a link.
+ (org-format-org-table-html): Add the label as an anchor.
+
+ * org-docbook.el (org-export-docbook-format-image): Do some
+ formatting on captions.
+
+ * org-latex.el (org-export-latex-tables, org-export-latex-links):
+ Do some formatting on captions.
+
+ * org-html.el (org-export-html-format-image)
+ (org-format-org-table-html): Do some formatting on captions.
+
+2010-04-10 Dan Davison <davison@stats.ox.ac.uk>
+
+ * org.el (org-hidden-keywords): New customizable variable. This is
+ a list of symbols specifying which of the special keywords #+DATE,
+ #+AUTHOR, #+EMAIL and #+TITLE should be hidden by font lock.
+ (org-fontify-meta-lines-and-blocks): Changes to font-lock code
+ implementing new faces and hiding behaviour.
+
+ * org-faces.el (org-document-title): New face for #+TITLE lines
+ (org-document-info): New face for #+DATE, #+AUTHOR, #+EMAIL lines
+ (org-document-info-keyword): New face for #+DATE, #+AUTHOR, #+EMAIL keywords
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-publish.el (org-publish-sanitize-plist): New function to
+ rename "index" properties to "sitemap". Do this renaming
+ globally.
+ (org-publish-with-aux-preprocess-maybe): New macro.
+ (org-publish-org-to-pdf, org-publish-org-to-html): Use the new
+ macro.
+ (org-publish-aux-preprocess)
+ (org-publish-index-generate-theindex.inc): New function.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-table.el (org-table-align): Interpret <N> at fixed width,
+ not as maximum width.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-author-info, org-export-email-info): Fix
+ docstrings.
+
+ * org-beamer.el (org-beamer-select-environment): Renamed from
+ `org-beamer-set-environment-tag'. Improve docstring.
+
+ * org-freemind.el (org-freemind-write-mm-buffer): Fix another
+ problem with odd levels.
+
+ * org-ascii.el (org-export-as-ascii): Export email only if the
+ author wants it.
+
+ * org-docbook.el (org-export-as-docbook): Export email only if the
+ author wants it.
+
+ * org-html.el (org-export-as-html): Export email only if the
+ author wants it.
+
+ * org-exp.el (org-export-email-info): New option.
+ (org-export-plist-vars): Add entry for `org-export-email'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-table.el (org-table-goto-line): Fix typo.
+
+2010-04-10 Mikael Fornius <mfo@abc.se>
+
+ * org.el (org-agenda-files): Typo.
+ (org-read-agenda-file-list): Add optional argument to help
+ `org-store-new-agenda-file-list' to remember un-expanded file
+ names. Expand file names relative to `org-directory'.
+ (org-store-new-agenda-file-list): Keep un-expanded file names when
+ saving, if available.
+ (org-agenda-files): Update documentation.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-ascii.el (org-export-as-ascii): Catch the case of exporting
+ a buffer with no file name attached.
+
+ * org.el (org-log-refile): New option.
+ (org-log-note-headings): Add a heading for refiling.
+ (org-startup-options): Add keywords for logging of the refile
+ action.
+ (org-refile): Add logging action.
+ (org-add-log-note): Allow for refiling action.
+
+ * org-agenda.el (org-agenda-bulk-action): Make sure
+ `org-log-refile' is not `note' during a bulk action.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-map-dblocks): Use save-excursion to remember the
+ position.
+
+ * org-attach.el (org-attach-commit): Remove dependence on xargs.
+ (org-attach-delete-one): Commit after deleting a file.
+
+ * org-latex.el (org-export-latex-fontify): Do not mistake table.el
+ borders for strike-through emphasis.
+
+ * org-freemind.el (org-freemind-write-mm-buffer): Simplify the
+ handling of odd levels.
+
+ * org-agenda.el (org-agenda-todo-ignore-deadlines): Document `past'
+ and `future' values.
+ (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
+ Handle `past' and `future' values.
+
+ * org.el (org-read-agenda-file-list): Interpret file names
+ relative to org-directory and allow environment variables and
+ "~".
+
+ * org-latex.el (org-export-latex-special-chars): Allow a
+ parenthesis before an exponent or subscript.
+
+2010-04-10 Dan Davison <davison@stats.ox.ac.uk>
+
+ * org-src.el (org-edit-src-exit): When returning from code edit
+ buffer, if code block is hidden, leave point at start of
+ #+begin_src line
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-insert-heading): Do not remove all spaces if the
+ headline is empty.
+
+ * org-indent.el (org-indent): Fix group name.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-table.el (org-table-goto-column): Fix forcing a non-existing
+ column.
+ (org-table-get, org-table-put, org-table-goto-line)
+ (org-table-current-line): New functions.
+
+2010-04-10 Jan Böcker <jan.boecker@jboecker.de>
+
+ * org.el (org-open-file): Allow regular expressions in
+ org-file-apps to capture link parameters using groups. In a
+ command string to be executed, the parameters can be referenced
+ using %1, %2, etc. Lisp forms can access them using
+ (match-string n link).
+ (org-apps-regexp-alist): Adopt the created regexp, as this is now
+ matched against a file: link instead of the file name.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-crypt.el (org-reveal-start-hook): Add a decryption function
+ to this hook.
+ (org-decrypt-entries, org-encrypt-entries, org-decrypt-entry): Add
+ docstrings.
+
+ * org.el (org-point-at-end-of-empty-headline)
+ (org-level-increment, org-get-previous-line-level): New function.
+ (org-cycle-level): Rewritten to be independent of when this
+ function is called.
+ (org-in-regexps-block-p): New function.
+ (org-reveal-start-hook): New hook.
+ (org-reveal): Run new hook.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-keywords): Start a new paragraph
+ after time keywords, do not add "\newline".
+
+ * org-html.el (org-export-as-html): Avoid double # in href.
+
+ * org.el (org-refile-get-location): Catch an invalid target
+ specification.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
+ Make sure the behavior regarding to extracting time is
+ consistent.
+
+2010-04-10 Stephen Eglen <stephen@gnu.org>
+
+ * org-agenda.el (org-agenda-insert-diary-extract-time): New
+ variable.
+ (org-agenda-add-entry-to-org-agenda-diary-file): Use this new
+ variable rather than `org-agenda-search-headline-for-time'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-list.el (org-fix-bullet-type): Improve cursor positioning.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-adaptive-fill-regexp-backup): New variable.
+ (org-set-autofill-regexps): Store a backup of
+ `adaptive-fill-regexp'.
+ (org-adaptive-fill-function): Fix filling of comments and ordered
+ lists. If there is no other match, till try adaptive fill.
+
+2010-04-10 John Wiegley <jwiegley@gmail.com>
+
+ * org-agenda.el (org-agenda-include-deadlines): Added new
+ customization variable to determine whether unscheduled tasks
+ should appear in the agenda solely because of their deadline.
+ Default to true, which was the previous behavior (it just wasn't
+ configurable).
+ (org-agenda-mode-map, org-agenda-view-mode-dispatch): Bind ! in
+ the agenda to show/hide deadline tasks.
+ (org-agenda-menu): Added menu option for show/hide deadlines.
+ (org-agenda-list): Make the agenda list sensitive to the value of
+ `org-agenda-include-deadlines'.
+ (org-agenda-toggle-deadlines): New function to toggle the value of
+ `org-agenda-include-deadlines' and repaint the modeline
+ indicators.
+ (org-agenda-set-mode-name): Show "Deadlines" in the agenda
+ modeline if deadline tasks are being displayed.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-table.el (org-table-eval-formula): Replace $# and @# by
+ current column and row number.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-set-property, org-delete-property): Go back to
+ prompting for the property.
+
+ * org-latex.el (org-export-latex-make-header): Fully process
+ author line.
+ (org-export-latex-fontify-headline): Allow several arguments, not
+ just one.
+ (org-export-latex-fix-inputenc): Catch the error when
+ `latexenc-coding-system-to-inputenc' is not defined.
+
+ * org-agenda.el (org-agenda-skip-if-todo): New function.
+ (org-agenda-skip-if): Add conditions for TODO keywords.
+ (org-agenda-skip-if): Document the new todo conditions.
+
+2010-04-10 Mikael Fornius <mfo@abc.se>
+
+ * org.el (org-at-property-p): Check if we are inside a property
+ drawer not just any drawer.
+ (org-set-property, org-delete-property): When cursor is on a
+ property key value pair do not prompt for property name instead
+ use name at cursor.
+ (org-ctrl-c-ctrl-c): Still do org-property-action when cursor is
+ on the first line of a property drawer.
+ (org-property-end-re): Spell check.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-attach-captions-and-attributes): Add the
+ properties to the entire table, in case the first line is
+ removed.
+
+ * org-archive.el (org-archive-reversed-order): New option.
+ (org-archive-subtree, org-archive-to-archive-sibling): Use the new
+ option `org-archive-reversed-order'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-entry-types): New variable.
+ (org-agenda-list): Use `org-agenda-entry-types'.
+ (org-agenda-custom-commands-local-options): Support for setting
+ `org-agenda-entry-types' as an option.
+ (org-diary): Shift some documentation from here to the variable
+ `org-agenda-entry-types'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-make-header): Apply macros in
+ author field.
+
+ * org-clock.el (org-clocking-buffer, org-clocking-p): New function.
+ (org-clock-select-task, org-clock-notify-once-if-expired)
+ (org-clock-in, org-clock-out, org-clock-cancel, org-clock-goto)
+ (org-clock-out-if-current, org-clock-save): Use the new functions.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-docbook.el (org-export-as-docbook): Remove unnecessary
+ newline.
+ (org-export-as-docbook): Remove unnecessary newline.
+ (org-export-as-docbook): Fix problem with double footnote
+ reference in one place.
+
+ * org-exp.el (org-export-format-source-code-or-example): Remove
+ unnecessary newline.
+
+ * org.el (org-deadline, org-schedule): Allow rescheduling entries
+ with repeaters.
+
+ * org-table.el (org-table-convert-refs-to-rc): Better way to catch
+ function calls that look like references.
+
+ * org.el (org-open-at-point): Get link abbreviations from
+ reference buffer.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-table.el (org-table-convert-refs-to-rc): Do not read arctan2
+ as a reference.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-link-unescape): Solve issue with lower-case escapes.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-classes): Add
+ \usepackage{latexsym} to all classes.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-html.el (org-export-as-html): Do not allow protected lines
+ into the table of contents.
+
+ * org-latex.el (org-export-latex-special-chars): Find subsequent
+ occurrences of special characters.
+ (org-export-latex-tables): Do not convert table-like stuff that is
+ protected.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-list.el (org-toggle-checkbox): No errors when updating
+ checkbox count fails because there is no heading.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-clock-report-include-clocking-task): New
+ option.
+ (org-clock-sum): Add the current clocking task.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-cycle): Print a message when in a table.el table.
+ (org-edit-special): Recognize the table.el context.
+ (org-ctrl-c-ctrl-c): Print a message when in a table.el table.
+
+ * org-src.el (org-at-table.el-p): Declare.
+ (org-edit-src-code): Handle a special case for table.el editing.
+ (org-edit-src-find-region-and-lang): Recognize the table.el
+ context.
+
+ * org-latex.el (org-export-latex-tables): Convert table.el
+ tables.
+ (org-export-latex-convert-table.el-table): New function.
+
+ * org-html.el (org-html-expand): Fix table.el export.
+
+ * org-latex.el (org-export-latex-preprocess): Protect footnotes in
+ headings.
+
+ * org-id.el (org-id-find-id-file): Fix bug when there is no hash
+ table for the id locations.
+
+ * org.el (org-read-date-analyze): Match American-style dates, like
+ 5/30 or 5/13/7. Make sure cal-iso.el is loaded. Don't force he
+ current year when reading ISO and American dates.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-face-from-face-or-color): New function.
+ (org-get-todo-face, org-font-lock-add-priority-faces)
+ (org-get-tag-face): Use `org-face-from-face-or-color'.
+
+ * org-faces.el (org-todo-keyword-faces, org-priority-faces): Allow
+ simple colors as values.
+ (org-faces-easy-properties): New option.
+
+ * org-agenda.el (org-agenda-set-mode-name): Show if the agenda is
+ restricted, as an agenda mode.
+ (org-agenda-fontify-priorities): Allow simple colors as values.
+
+2010-04-10 Bastien Guerry <bzg@altern.org>
+
+ * org-timer.el (org-timer-current-timer): Renamed from
+ `org-timer-last-timer'.
+ (org-timer-timer1, org-timer-timer2, org-timer-timer3): Removed.
+ (org-timer-cancel-timer, org-timer-show-remaining-time)
+ (org-timer-set-timer): Update to use only one timer.
+
+ * org.el (org-set-property): Remove useless space in the prompt.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-html.el (org-export-html-style-default): Add a default style
+ for textareas.
+
+ * org-exp.el (org-export-format-source-code-or-example): Fix
+ textarea tag.
+
+2010-04-10 Bastien Guerry <bzg@altern.org>
+
+ * org-clock.el (org-clock-current-task): New variable to store
+ last clocked in task.
+ (org-clock-set-current, org-clock-delete-current): New functions.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-remember.el (org-remember-apply-template): Extend comment.
+ (org-remember-handler): Implement clock sibling filing.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-publish.el (org-publish-all, org-publish-current-file)
+ (org-publish-current-project): When called with prefix argument
+ FORCE, also rebuild the validation file list.
+
+ * org-latex.el (org-export-latex-preprocess): Protect footnotes in
+ section headings.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-html.el (org-export-as-html-and-open): Kill product buffer
+ if the user wants that.
+
+ * org-latex.el (org-export-as-pdf-and-open): Kill product buffer
+ if the user wants that.
+
+ * org-exp.el (org-export-kill-product-buffer-when-displayed): New
+ option.
+
+ * org-agenda.el (org-batch-agenda-csv): Use the time property
+ instead of the `time-of-day' property.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-timer.el (org-timer-start-hook, org-timer-stop-hook)
+ (org-timer-pause-hook, org-timer-set-hook)
+ (org-timer-cancel-hook): New hooks.
+ (org-timer-start): Run `org-timer-start-hook'.
+ (org-timer-pause-or-continue): Run `org-timer-pause-hook'.
+ (org-timer-stop): Run `org-timer-stop-hook'.
+ (org-timer-cancel-timers): Run `org-timer-cancel-hook'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-reveal): Double prefix arg shows the subtree of the
+ parent.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-search-view): Fix bug with searching full
+ words in headlines in search view.
+ (org-agenda-skip-deadline-prewarning-if-scheduled): New option.
+ (org-agenda-get-deadlines): Suppress pre-warning if the entry is
+ scheduled (if the user configures it so.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-hide-archived-subtrees): Don't jump to end of
+ subtree if the match was not in a headline.
+ (org-inside-latex-macro-p): Allow more complex arguments.
+ (org-emphasize): Protect against use at end of buffer.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-align-tags): Avoid side effects on
+ text properties.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-todo-ignore-scheduled): More allowed
+ values.
+ (org-agenda-todo-ignore-scheduled)
+ (org-agenda-todo-ignore-deadlines): More control with different
+ allowed values.
+ (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
+ Honor the new option settings.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-get-location): Make sure the selection buffer is
+ shown in the current frame.
+
+ * org-ascii.el (org-export-ascii-table-widen-columns): New
+ option.
+ (org-export-ascii-preprocess): Realign tables to remove narrowing
+ if `org-export-ascii-table-widen-columns' is set.
+
+ * org-table.el (org-table-do-narrow): New variable.
+ (org-table-align): Narrow only if `org-table-do-narrow' is t.
+
+ * org.el (org-deadline, org-schedule): Allow updating if the
+ relevant time stamp does not have a repeater, i.e. do not require
+ that no time stamp has a repeater.
+
+ * org-agenda.el (org-agenda-align-tags): Don't add a face to the
+ new white space before the tags.
+
+ * org-latex.el (org-export-as-latex): Do nit require the buffer to
+ be visiting a file when only exporting to a buffer or string.
+ (org-export-latex-fix-inputenc): Only save the buffer is there is
+ a file name attached to it.
+
+2010-04-10 Dan Davison <davison@stats.ox.ac.uk>
+
+ * org-src.el (org-edit-src-exit): Widen before exiting edit buffers
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-fontify-meta-lines-and-blocks): Honor
+ `org-fontify-quote-and-verse-blocks'.
+
+ * org-faces.el (org-fontify-quote-and-verse-blocks): New option.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-open-at-point): Also check for text property
+ org-linked-text before offering collected links.
+
+2010-04-10 Stephen Eglen <stephen@gnu.org>
+
+ * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
+ Optionally extract time specification from text and add to the
+ timestamp.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-html-entities): Fix typo.
+
+ * org-latex.el (org-export-latex-make-header): Use \providecommand
+ to make sure the \alert macro is defined.
+
+ * org.el (org-format-latex-signal-error)
+ (org-create-formula-image): Use `org-format-latex-signal-error'.
+
+2010-04-10 Stephen Eglen <stephen@gnu.org>
+
+ * org.el (org-store-link): For dired buffers, use
+ default-directory as link name if dired-get-filename returns
+ nil.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-concatenate-multiline-links): The for
+ protectedness at beginning of match.
+
+ * org-latex.el (org-export-latex-fix-inputenc): Never leave the
+ AUTO as a coding system, instead default to utf8.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-block-todo-from-children-or-siblings-or-parent)
+ (org-block-todo-from-checkboxes): Respect the local variable
+ value when deciding if blocking should be active.
+
+ * org-latex.el (org-export-latex-make-header): Define the align
+ macro if it is not yet defined.
+
+ * org-agenda.el (org-agenda-insert-diary-make-new-entry): Call
+ `org-insert-heading' with the INVISIBLE-OK argument.
+
+ * org-mac-message.el (org-mac-message-insert-flagged): Call
+ `org-insert-heading' with the INVISIBLE-OK argument.
+
+ * org.el (org-insert-heading): New argument INVISIBLE-OK.
+
+ * org-agenda.el (org-agenda-view-mode-dispatch): Improve the
+ prompt message.
+
+ * org-html.el (org-html-level-start): Use the
+ `html-container-class' text property to set an additional class
+ for an outline container.
+
+ * org-exp.el (org-export-remember-html-container-classes): New
+ function.
+ (org-export-preprocess-string): Call
+ `org-export-remember-html-container-classes'.
+
+ * org.el (org-cycle): Mention level cycling in the docstring.
+ (org-default-properties): Add new property HTML_CONTAINER_CLASS.
+
+ * org-remember.el (org-remember-apply-template): Do file insertion
+ first.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-habit.el (org-habit-insert-consistency-graphs): Fix a
+ problem with mis-aligned graphs when showing habits.
+
+2010-04-10 Mikael Fornius <mfo@abc.se>
+
+ * org.el (org-assign-fast-keys): Prefer keys used in keyword name
+ when assigning. Begin using numerical characters when all in name
+ is used up. This is to spare alphanumeric characters for better
+ match with other keywords.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-preprocess-hook): Improve documentation.
+
+ * org-latex.el (org-export-latex-preprocess): More consistent
+ conversion and protection of the words LaTeX and TeX.
+ (org-export-latex-fontify-headline, org-export-latex-preprocess):
+ Allow angle brackets in commands, for beamer.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-clock-in): Improve the look of the clock line
+ by formatting links.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-classes): Use AUTO as the place
+ holder string for the coding system. And improve the
+ documentation.
+ (org-export-latex-fix-inputenc): Only modify the coding system if
+ it is given by the placeholder AUTO.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-task-overrun-text): New option.
+ (org-task-overrun, org-clock-update-period): New variables.
+ (org-clock-get-clock-string, org-clock-update-mode-line): Mark
+ overrun clock.
+ (org-clock-notify-once-if-expired): Check if clock is overrun.
+
+ * org-faces.el: New face `org-mode-line-clock-overrun'.
+
+2010-04-10 Jan Böcker <jan.boecker@jboecker.de>
+
+ * org.el (org-narrow-to-subtree): Position the end of the narrowed
+ region before the line with the next heading, to prevent the user
+ from prepending text to the next headline.
+
+2010-04-10 Stephen Eglen <stephen@gnu.org>
+
+ * org-agenda.el (org-get-time-of-day): Use
+ org-agenda-time-leading-zero to allow leading zero (rather than
+ space) for times.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure
+ org-datetree.el is loaded.
+
+ * org-datetree.el: autoload `org-datetree-find-day-create'
+
+ * org-latex.el (org-export-latex-hyperref-format): New option.
+ (org-export-latex-links): Use `org-export-latex-hyperref-format'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-ctags.el (org-ctags-enable): Change order of functions.
+ (org-ctags-create-tags): Add wildcard to file name expansion.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-entry-properties): Fix some important bugs.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-link-unescape, org-link-escape): Only use hexlify if
+ the table is not explicitly given.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-clock-out-when-done): Allow a list of keywords
+ as value.
+ (org-clock-out-if-current): Work with the new list value of
+ `org-clock-out-when-done'.
+ (org-clock-out, org-clock-out-if-current): Avoid circular logic
+ between clocking out and state changes.
+
+ * org-ctags.el (org-ctags-path-to-ctags): Better system-type test.
+
+ * org-latex.el (org-export-latex-treat-backslash-char): Do not by
+ accident protect a character that is before a backslash.
+
+2010-04-10 Paul Sexton <eeeickythump@gmail.com>
+
+ * org-ctags.el: New file.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-diary-class): Use
+ `org-order-calendar-date-args'.
+
+ * org.el (org-order-calendar-date-args): New function.
+
+ * org-exp.el (org-export-target-internal-links): Check for
+ protectedness after the first bracket.
+
+ * org.el (org-entry-properties): Don't match wrong-case TODO
+ keywords.
+
+ * org-agenda.el (org-agenda-schedule, org-agenda-deadline):
+ Document that ARG is passed through to remove the date.
+ (org-agenda-bulk-action): Accept prefix arg and pass it on. Do
+ not read a date when the user has given a `C-u' prefix.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-fix-displayed-tags): Fix bug when all
+ tags are hidden.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-fix-inputenc): New function.
+ (org-export-latex-inputenc-alist): New option.
+
+ * org-exp.el (org-export): New key SPC to publish enclosing
+ subtree.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-indent.el (org-indent-add-properties): Catch case when there
+ is no headline in the buffer.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-html-entities): Add checkmark symbol.
+
+ * org-ascii.el (org-export-ascii-preprocess): Protect targets in
+ verbatim code for ASCII export.
+
+ * org.el (org-update-statistics-cookies): Also see checkboxes in
+ ordered lists.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-view-mode-dispatch): Define the `L'
+ key.
+
+ * org-beamer.el (org-beamer-amend-header): Change the location
+ where `org-beamer-header-extra' is inserted.
+
+ * org.el (org-compute-latex-and-specials-regexp): Don't do BIND
+ just for computing this regexp.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-beamer.el (org-beamer-frame-default-options): New option.
+ (org-beamer-sectioning): Use default options if the user does not
+ have defined any.
+ (org-beamer-fix-toc): Put a frame around the table of contents.
+
+ * org-exp.el (org-export-remove-comment-blocks-and-subtrees): Make
+ sure case-folding works well when processing comment stuff.
+
+ * org-latex.el (org-export-latex-after-save-hook): New hook.
+ (org-export-as-latex): Run the new hook.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-beamer.el (org-beamer-environments-default): Add the note
+ environments.
+ (org-beamer-after-initial-vars): Allow several BEAMER_HEADER_EXTRA
+ lines and collect and combine the content.
+ (org-beamer-after-initial-vars): Check for note tags and make sure
+ they will be seen like a property.
+
+ * org.el (org-offer-links-in-entry): Fix bug when there is a
+ single link.
+
+ * org-exp.el (org-export): Make sure the mark is activated, also
+ when `transient-mark-mode' is off.
+
+ * org-agenda.el (org-agenda-search-view-always-boolean): New option.
+ (org-agenda-search-view-search-words-only): Obsolete variable, is
+ now an alias for `org-agenda-search-view-always-boolean'.
+ (org-agenda-search-view-force-full-words): New option.
+ (org-search-view): Improve docstring, and implement a better logic
+ for Boolean and phrase searches.
+ (org-agenda-last-search-view-search-was-boolean): New variable.
+ (org-agenda-manipulate-query): Consider the type of the last
+ search when modifying the search string.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-as-latex): Do the first letbind in the
+ right moment.
+
+ * org-agenda.el (org-get-entries-from-diary): Add the new face to
+ these entries.
+
+ * org-faces.el (org-agenda-diary): New face.
+
+ * org.el (org-make-link-regexps): Allow regexp-special characters
+ in link types.
+ (org-open-file): When in-emacs is `system', also force system
+ opening, like when the value was `(16)'.
+ (org-update-statistics-cookies): Handle entries without children.
+
+ * org-exp.el
+ (org-export-preprocess-before-normalizing-links-hook): New hook.
+ (org-export-preprocess-string): Run the new hook.
+
+ * org.el (org-offer-links-in-entry): Make RET open all links.
+
+ * org-html.el (org-export-as-html): Remove any leftover display
+ properties in the html file.
+
+ * org-wl.el (org-wl-store-link): Work-around for format bug with
+ text properties.
+
+ * org-habit.el (org-habit-insert-consistency-graphs): Turn off
+ invisibility while adding the graphs.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-remember.el (org-select-remember-template): Use C letter to
+ customize remember templates.
+
+ * org-agenda.el (org-agenda-bulk-mark, org-agenda-bulk-unmark):
+ Move cursor to next visible line.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-beamer.el (org-beamer-sectioning): Leave columns environment
+ by specifying 0 or 1 for column width.
+ (org-beamer-column-widths): Make 0 stand for 0.0.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-mark-radio-links): Don't match inside
+ <<target>>.
+
+ * org.el (org-format-latex-header-extra): New variable.
+ (org-format-latex): Set org-format-latex-header-extra from
+ in-buffer stuff.
+ (org-format-latex): Add org-format-latex-header-extra to the
+ variables on which image creation depends.
+ (org-create-formula-image): Add the header stuff from in-buffer
+ settings.
+ (org-read-date-analyze): Base the analysis for future preference
+ on NOW, not on the default date.
+
+ * org-inlinetask.el (org-inlinetask-export-handler): Add CSS class
+ for TODO keyword in inline tasks.
+
+ * org.el (org-log-note-headings): New headings for removing
+ deadline or scheduling date.
+ (org-deadline, org-schedule): Arrange for logging when removing a
+ date.
+ (org-add-log-note): Handle deadline and scheduling removal.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-visible): Add LaTeX/pdf export.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-diary-class): New function.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-preprocess): Do process the text
+ of a radio target.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-entry-properties): Add TIMESTAMP properties back
+ in.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-all-time-keywords): New variable.
+ (org-set-regexps-and-options): Set `org-all-time-keywords'.
+ (org-entry-blocked-p): New function.
+ (org-special-properties): Add BLOCKED as a new special property.
+ (org-entry-properties): New optional argument SPECIFIC, only parse
+ for this property when it is specified.
+ (org-entry-get): Pass a SPECIFIC argument to
+ `org-entry-properties'.
+
+ * org-latex.el (org-export-as-latex): Preprocess TEXT as well.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-tables): No forced line end if
+ there is no caption.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-html-entities): Add Euro symbols from Marvosym
+ package.
+
+ * org-latex.el (org-export-latex-tables): Only add a caption when
+ macro in in longtable environments if one has been defined.
+
+ * org-html.el (org-export-as-html): Only take title from buffer if
+ not exporting body-only.
+
+ * org-latex.el (org-export-latex-preprocess): Better version of
+ the regular expression for protecting LaTeX macros.
+ (org-export-latex-preprocess): Start searching for macros to
+ protect from beginning of buffer.
+
+ * org-exp.el (org-export-target-internal-links): Check for
+ protectedness earlier in the string.
+
+ * org-agenda.el (org-agenda-highlight-todo): Match TODO keywords
+ case sensitively.
+
+ * org-id.el (org-id-store-link): Match TODO keywords case
+ sensitively.
+
+ * org.el (org-heading-components, org-get-outline-path)
+ (org-display-outline-path): Match TODO keywords case sensitively.
+
+ * org-latex.el (org-export-as-latex): Ignore read-only
+ properties.
+
+ * org-exp.el (org-export-preprocess-string): Remove any
+ `read-only' properties.
+
+ * org-agenda.el (org-agenda-inactive-leader): New option.
+ (org-agenda-get-timestamps): Use `org-agenda-inactive-leader'.
+ (org-tags-view): Prompt for matcher if MATCH is an empty string.
+ (org-todo-list): Prompt for matcher if ARG is an empty string.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-open-link-functions): New hook.
+ (org-open-at-point): Run `org-open-link-functions'.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-agenda.el (org-agenda-date-prompt): Allow inactive time
+ stamps as well.
+
+ * org.el (org-inhibit-startup-visibility-stuff): New variable.
+ (org-mode): Don't do startup visibility if inhibited.
+ (org-outline-overlay-data, org-set-outline-overlay-data): New
+ functions.
+ (org-save-outline-visibility): New macro.
+ (org-log-note-headings): Document that one should not change the
+ `state' note format.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-make-link-regexps): Capture link path into a group.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-beamer.el (org-beamer-after-initial-vars): Do not overwrite
+ the options plist.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org.el (org-startup-with-beamer-mode): New option.
+ (org-property-changed-functions)
+ (org-property-allowed-value-functions): New hooks.
+ (org-entry-put, org-property-get-allowed-values): Run the new
+ hooks.
+ (org-property-next-allowed-value): Run the new hooks.
+
+ * org-exp.el (org-export-select-backend-specific-text): Add the
+ special beamer tags.
+
+ * org-beamer.el: New file.
+
+ * org-latex.el (org-export-latex-after-initial-vars-hook): New hook.
+ (org-export-as-latex): Run
+ `org-export-latex-after-initial-vars-hook'.
+ (org-export-latex-format-toc-function)
+ (org-export-latex-make-header): Call
+ `org-export-latex-format-toc-function'.
+
+ * org.el (org-fill-template): Make template searches case sensitive.
+
+ * org-exp.el (org-export): Use "1" as a sign to export only the
+ subtree.
+
+ * org-colview-xemacs.el (org-columns-edit-value): Use
+ org-unrestricted property.
+
+ * org-colview.el (org-columns-edit-value): Use
+ org-unrestricted property.
+
+ * org.el (org-compute-property-at-point): Set org-unrestricted
+ text property if the list contains ":ETC".
+ (org-insert-property-drawer): Use
+ org-unrestricted property.
+
+ * org-exp.el
+ (org-export-preprocess-before-selecting-backend-code-hook): New hook.
+ (org-export-preprocess-string): Run
+ `org-export-preprocess-before-selecting-backend-code-hook'.
+
+ * org-xoxo.el (org-export-as-xoxo): Run `org-export-first-hook'.
+
+ * org-latex.el (org-export-region-as-latex): Run
+ `org-export-first-hook'.
+
+ * org-html.el (org-export-as-html): Run `org-export-first-hook'.
+
+ * org-docbook.el (org-export-as-docbook): Run
+ `org-export-first-hook'.
+
+ * org-ascii.el (org-export-as-ascii): Run `org-export-first-hook'.
+
+ * org-exp.el (org-export-first-hook): New hook.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-list.el (org-previous-item): Exit at the beginning of the
+ buffer.
+
+ * org-id.el (org-id-locations-save): Only write the id locations
+ if any are defined.
+
+ * org-archive.el (org-archive-all-done): Make this work in a file
+ with org-odd-levels-only set.
+
+ * org.el (org-get-refile-targets): Catch the case when a buffer
+ has no file.
+
+ * org-latex.el (org-export-as-latex): Cleanup forced line ends
+ where they are not needed.
+ (org-export-latex-subcontent): Remove unnecessary newlines.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-make-header): Remove \obeylines.
+ (org-export-latex-fontify): Fix regexp bug that takes special
+ care of protecting the right boundary characters in emphasis
+ matches.
+ (org-export-latex-preprocess): Allow multiple arguments to latex
+ macros.
+
+ * org.el (org-make-link-regexps): Use John Gruber's regexp for
+ urls.
+
+ * org-macs.el (org-re): Interpret :punct: in regexps.
+
+ * org-exp.el (org-export-replace-src-segments-and-examples): Also
+ take the final newline after the END line.
+
+ * org.el (org-clean-visibility-after-subtree-move): Only fix
+ entries that are not entirely invisible already.
+ (org-insert-link): Respect org-link-file-path-type for
+ "docview:" links in addition to "file:" links.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-exp.el (org-export-format-source-code-or-example): Avoid
+ additional extra white lines in LaTeX.
+
+ * org-list.el (org-list-parse-list): Leave empty lines after the
+ list, don't consider them as part of the list.
+
+ * org-mobile.el (org-mobile-sumo-agenda-command): Allow tagstodo
+ searches.
+
+ * org-clock.el (org-clock-select-task): Convert integer to
+ character for XEmacs.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-clock-resolve): Make reading a char XEmacs
+ compatible.
+
+2010-04-10 Tassilo Horn <tassilo@member.fsf.org>
+
+ * org.el (org-complete-tags-always-offer-all-agenda-tags): New
+ variable.
+ (org-set-tags): Use it.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-list.el (org-empty-line-terminates-plain-lists): Update
+ docstring.
+
+ * org.el (org-format-latex): Fix link creation for processed latex
+ snippets.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-footnote.el (org-footnote-normalize): Protect replacement
+ text.
+
+ * org.el (org-inside-latex-macro-p): Save match data.
+
+2010-04-10 Jan Böcker <jan.boecker@jboecker.de>
+
+ * org-docview.el: New file.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-class-options): New variable.
+ (org-export-latex-set-initial-vars): Use the class options.
+
+ * org.el (org-forward-same-level): Stop at headings that start
+ with an invisible character.
+ (org-additional-option-like-keywords): Add LaTeX_CLASS_OPTIONS.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-footnote.el (org-footnote-normalize): Don't take optional
+ arguments in LaTeX macros as footnotes.
+
+ * org.el (org-inside-latex-macro-p): New function.
+
+ * org-latex.el (org-latex-to-pdf-process): Change customization
+ group to `org-export-pdf'.
+
+ * org-agenda.el (org-agenda-get-blocks): Look at time string also
+ on days after the first one.
+
+ * org.el (org-insert-heading): Also check for item before assuming
+ before-first-heading condition.
+
+ * org-latex.el (org-latex-to-pdf-process): Fix typo in group tag.
+ (org-export-pdf-logfiles): New option.
+ (org-export-as-pdf): Use `org-export-pdf-logfiles'.
+ (org-export-pdf-logfiles): Fix customization type.
+
+ * org.el (org-insert-link): Improve error message when there is no
+ default link to select with RET.
+
+ * org-agenda.el (org-agenda-filter-by-tag): Use char argument from
+ parameter list.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-parse-global)
+ (org-export-latex-parse-content)
+ (org-export-latex-parse-subcontent): Use
+ `org-re-search-forward-unprotected'.
+ (org-export-as-pdf): Remove log files produced by XeTeX.
+
+ * org-macs.el (org-re-search-forward-unprotected): New function.
+
+2010-04-10 James TD Smith <ahktenzero@mohorovi.cc>
+
+ * org-colview.el (org-agenda-colview-summarize): Sort out some
+ confusion between properties and titles, which resulted in
+ agenda summaries not working if a title was set for a column.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-mobile.el (org-mobile-agendas): New option.
+ (org-mobile-sumo-agenda-command): Select the right agendas.
+
+ * org-latex.el (org-export-latex-format-image): Preserve the
+ original-indentation property.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-clock.el (org-clock-insert-selection-line): Catch error when
+ an old tasks no longer exists.
+
+ * org-latex.el (org-export-as-pdf): Remove also the .idx file.
+ (org-export-as-pdf): Don't remove the old PDF file before making
+ the new one.
+
+ * org-mouse.el (org-mouse-end-headline, org-mouse-insert-item)
+ (org-mouse-context-menu): Use `org-looking-back'.
+
+ * org.el (org-cycle-level): Use `org-looking-back'.
+
+ * org-list.el (org-cycle-item-indentation): Use
+ `org-looking-back'.
+
+ * org-compat.el (org-looking-back): New function.
+
+ * org.el (org-insert-heading): Catch before-first-headline when
+ inserting a headline.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-latex.el (org-export-latex-format-image): Indent figure
+ environment, so that it does not interrupt plain list.
+
+ * org.el (org-open-at-point): Allow long link descriptions.
+
+2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>
+
+ * org-html.el (org-export-as-html): Remove empty lines at the
+ beginning of the exported text.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * org.el (org): Remove from hypermedia group.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-02-15 Chong Yidong <cyd@stupidchicken.com>
* org-freemind.el (org-freemind-from-org-mode-node)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(integer :tag "When more than N lines")))
(defcustom org-agenda-compact-blocks nil
- "Non-nil means, make the block agenda more compact.
+ "Non-nil means make the block agenda more compact.
This is done by leaving out unnecessary lines."
:group 'org-agenda
:type 'boolean)
:group 'org-agenda)
(defcustom org-agenda-with-colors t
- "Non-nil means, use colors in agenda views."
+ "Non-nil means use colors in agenda views."
:group 'org-agenda-export
:type 'boolean)
:type 'integer)
(defcustom org-agenda-add-entry-text-descriptive-links t
- "Non-nil means, export org-links as descriptive links in agenda added text.
+ "Non-nil means export org-links as descriptive links in agenda added text.
This variable applies to the text added to the agenda when
`org-agenda-add-entry-text-maxlines' is larger than 0.
When this variable nil, the URL will (also) be shown."
(const :format "" quote)
(repeat
(string :tag "+tag or -tag"))))
+ (list :tag "Set daily/weekly entry types"
+ (const org-agenda-entry-types)
+ (set :greedy t :value (:deadline :scheduled :timestamp :sexp)
+ (const :deadline)
+ (const :scheduled)
+ (const :timestamp)
+ (const :sexp)))
(list :tag "Standard skipping condition"
:value (org-agenda-skip-function '(org-agenda-skip-entry-if))
(const org-agenda-skip-function)
:tag "Condition type"
(list :tag "Regexp matches" :inline t (const :format "" 'regexp) (regexp))
(list :tag "Regexp does not match" :inline t (const :format "" 'notregexp) (regexp))
+ (list :tag "TODO state is" :inline t
+ (const 'todo)
+ (choice
+ (const :tag "any not-done state" 'todo)
+ (const :tag "any done state" 'done)
+ (const :tag "any state" 'any)
+ (list :tag "Keyword list"
+ (const :format "" quote)
+ (repeat (string :tag "Keyword")))))
+ (list :tag "TODO state is not" :inline t
+ (const 'nottodo)
+ (choice
+ (const :tag "any not-done state" 'todo)
+ (const :tag "any done state" 'done)
+ (const :tag "any state" 'any)
+ (list :tag "Keyword list"
+ (const :format "" quote)
+ (repeat (string :tag "Keyword")))))
(const :tag "scheduled" 'scheduled)
(const :tag "not scheduled" 'notscheduled)
(const :tag "deadline" 'deadline)
:group 'org-agenda)
(defvar org-agenda-archives-mode nil
- "Non-nil means, the agenda will include archived items.
+ "Non-nil means the agenda will include archived items.
If this is the symbol `trees', trees in the selected agenda scope
that are marked with the ARCHIVE tag will be included anyway. When this is
t, also all archive files associated with the current selection of agenda
files will be included.")
(defcustom org-agenda-skip-comment-trees t
- "Non-nil means, skip trees that start with the COMMENT keyword.
+ "Non-nil means skip trees that start with the COMMENT keyword.
When nil, these trees are also scanned by agenda commands."
:group 'org-agenda-skip
:type 'boolean)
(defcustom org-agenda-todo-list-sublevels t
- "Non-nil means, check also the sublevels of a TODO entry for TODO entries.
+ "Non-nil means check also the sublevels of a TODO entry for TODO entries.
When nil, the sublevels of a TODO entry are not checked, resulting in
potentially much shorter TODO lists."
:group 'org-agenda-skip
:type 'boolean)
(defcustom org-agenda-todo-ignore-with-date nil
- "Non-nil means, don't show entries with a date in the global todo list.
+ "Non-nil means don't show entries with a date in the global todo list.
You can use this if you prefer to mark mere appointments with a TODO keyword,
but don't want them to show up in the TODO list.
When this is set, it also covers deadlines and scheduled items, the settings
:type 'boolean)
(defcustom org-agenda-todo-ignore-scheduled nil
- "Non-nil means, don't show scheduled entries in the global todo list.
-The idea behind this is that by scheduling it, you have already taken care
-of this item.
+ "Non-nil means, ignore some scheduled TODO items when making TODO list.
+This applies when creating the global todo list.
+Valid values are:
+
+past Don't show entries scheduled today or in the past.
+
+future Don't show entries scheduled in the future.
+ The idea behind this is that by scheduling it, you don't want to
+ think about it until the scheduled date.
+
+all Don't show any scheduled entries in the global todo list.
+ The idea behind this is that by scheduling it, you have already
+ \"taken care\" of this item.
+
+t Same as `all', for backward compatibility.
+
See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options'."
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
- :type 'boolean)
+ :type '(choice
+ (const :tag "Ignore future-scheduled todos" future)
+ (const :tag "Ignore past- or present-scheduled todos" past)
+ (const :tag "Ignore all scheduled todos" all)
+ (const :tag "Ignore all scheduled todos (compatibility)" t)
+ (const :tag "Show scheduled todos" nil)))
(defcustom org-agenda-todo-ignore-deadlines nil
- "Non-nil means, don't show near deadline entries in the global todo list.
-Near means closer than `org-deadline-warning-days' days.
-The idea behind this is that such items will appear in the agenda anyway.
+ "Non-nil means ignore some deadlined TODO items when making TODO list.
+There are different motivations for using different values, please think
+carefully when configuring this variable.
+
+This applie when creating the global todo list.
+Valid values are:
+
+near Don't show near deadline entries. A deadline is near when it is
+ closer than `org-deadline-warning-days' days. The idea behind this
+ is that such items will appear in the agenda anyway.
+
+far Don't show TODO entries where a deadline has been defined, but
+ the deadline is not near. This is useful if you don't want to
+ use the todo list to figure out what to do now.
+
+past Don't show entries with a deadline timestamp for today or in the past.
+
+future Don't show entries with a deadline timestamp in the future, not even
+ when they become `near' ones. Use it with caution.
+
+all Ignore all TODO entries that do have a deadline.
+
+t Same as `near', for backward compatibility.
+
See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options'."
+See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
+to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
- :type 'boolean)
+ :type '(choice
+ (const :tag "Ignore near deadlines" near)
+ (const :tag "Ignore near deadlines (compatibility)" t)
+ (const :tag "Ignore far deadlines" far)
+ (const :tag "Ignore all TODOs with a deadlines" all)
+ (const :tag "Show all TODOs, even if they have a deadline" nil)))
(defcustom org-agenda-tags-todo-honor-ignore-options nil
- "Non-nil means, honor todo-list ...ignore options also in tags-todo search.
+ "Non-nil means honor todo-list ...ignore options also in tags-todo search.
The variables
`org-agenda-todo-ignore-with-date',
`org-agenda-todo-ignore-scheduled'
:group 'org-agenda-daily/weekly
:type 'boolean)
+(defcustom org-agenda-skip-deadline-prewarning-if-scheduled nil
+ "Non-nil means skip deadline prewarning when entry is also scheduled.
+This will apply on all days where a prewarning for the deadline would
+be shown, but not at the day when the entry is actually due. On that day,
+the deadline will be shown anyway.
+This variable may be set to nil, t, or a number which will then give
+the number of days before the actual deadline when the prewarnings
+should resume.
+This can be used in a workflow where the first showing of the deadline will
+trigger you to schedule it, and then you don't want to be reminded of it
+because you will take care of it on the day when scheduled."
+ :group 'org-agenda-skip
+ :group 'org-agenda-daily/weekly
+ :type '(choice
+ (const :tag "Alwas show prewarning" nil)
+ (const :tag "Remove prewarning if entry is scheduled" t)
+ (integer :tag "Restart prewarning N days before deadline")))
+
(defcustom org-agenda-skip-additional-timestamps-same-entry t
"When nil, multiple same-day timestamps in entry make multiple agenda lines.
When non-nil, after the search for timestamps has matched once in an
:type 'boolean)
(defcustom org-agenda-dim-blocked-tasks t
- "Non-nil means, dim blocked tasks in the agenda display.
+ "Non-nil means dim blocked tasks in the agenda display.
This causes some overhead during agenda construction, but if you
have turned on `org-enforce-todo-dependencies',
`org-enforce-todo-checkbox-dependencies', or any other blocking
(const :tag "Make invisible" invisible)))
(defcustom org-timeline-show-empty-dates 3
- "Non-nil means, `org-timeline' also shows dates without an entry.
+ "Non-nil means `org-timeline' also shows dates without an entry.
When nil, only the days which actually have entries are shown.
When t, all days between the first and the last date are shown.
When an integer, show also empty dates, but if there is a gap of more than
:type 'hook)
(defcustom org-agenda-mouse-1-follows-link nil
- "Non-nil means, mouse-1 on a link will follow the link in the agenda.
+ "Non-nil means mouse-1 on a link will follow the link in the agenda.
A longer mouse click will still set point. Does not work on XEmacs.
Needs to be set before org.el is loaded."
:group 'org-agenda-startup
:type 'boolean)
(defcustom org-agenda-show-outline-path t
- "Non-il means, show outline path in echo area after line motion."
+ "Non-nil means show outline path in echo area after line motion."
:group 'org-agenda-startup
:type 'boolean)
expressions listed in `org-agenda-entry-text-exclude-regexps'.")
(defvar org-agenda-include-inactive-timestamps nil
- "Non-nil means, include inactive time stamps in agenda and timeline.")
+ "Non-nil means include inactive time stamps in agenda and timeline.")
(defgroup org-agenda-windows nil
"Options concerning the windows used by the Agenda in Org Mode."
:type '(cons (number :tag "Minimum") (number :tag "Maximum")))
(defcustom org-agenda-restore-windows-after-quit nil
- "Non-nil means, restore window configuration open exiting agenda.
+ "Non-nil means restore window configuration open exiting agenda.
Before the window configuration is changed for displaying the agenda,
the current status is recorded. When the agenda is exited with
`q' or `x' and this option is set, the old state is restored. If
:type 'integer)
(defcustom org-agenda-start-on-weekday 1
- "Non-nil means, start the overview always on the specified weekday.
+ "Non-nil means start the overview always on the specified weekday.
0 denotes Sunday, 1 denotes Monday etc.
When nil, always start on the current day.
Custom commands can set this variable in the options section."
(integer :tag "Weekday No.")))
(defcustom org-agenda-show-all-dates t
- "Non-nil means, `org-agenda' shows every day in the selected range.
+ "Non-nil means `org-agenda' shows every day in the selected range.
When nil, only the days which actually have entries are shown."
:group 'org-agenda-daily/weekly
:type 'boolean)
(format "%-10s %2d %s %4d%s"
dayname day monthname year weekstring)))
+(defcustom org-agenda-time-leading-zero nil
+ "Non-nil means use leading zero for military times in agenda.
+For example, 9:30am would become 09:30 rather than 9:30."
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
(defcustom org-agenda-weekend-days '(6 0)
"Which days are weekend?
These days get the special face `org-agenda-date-weekend' in the agenda
:group 'org-agenda-daily/weekly
:type 'boolean)
+(defcustom org-agenda-include-deadlines t
+ "If non-nil, include entries within their deadline warning period.
+Custom commands can set this variable in the options section."
+ :group 'org-agenda-daily/weekly
+ :type 'boolean)
+
(defcustom org-agenda-include-all-todo nil
"Set means weekly/daily agenda will always contain all TODO entries.
The TODO entries will be listed at the top of the agenda, before
:type 'boolean)
(defcustom org-agenda-repeating-timestamp-show-all t
- "Non-nil means, show all occurrences of a repeating stamp in the agenda.
+ "Non-nil means show all occurrences of a repeating stamp in the agenda.
When nil, only one occurrence is shown, either today or the
nearest into the future."
:group 'org-agenda-daily/weekly
:type '(set :greedy t (const closed) (const clock) (const state)))
(defcustom org-agenda-log-mode-add-notes t
- "Non-nil means, add first line of notes to log entries in agenda views.
+ "Non-nil means add first line of notes to log entries in agenda views.
If a log item like a state change or a clock entry is associated with
notes, the first line of these notes will be added to the entry in the
agenda display."
:group 'org-agenda-daily/weekly
:type 'plist)
-(defcustom org-agenda-search-view-search-words-only nil
- "Non-nil means, the search string is interpreted as individual words
-The search then looks for each word separately in each entry and
-selects entries that have matches for all words.
-When nil, matching as loose words will only take place if the first
-word is preceded by + or -. If that is not the case, the search
-string will just be matched as a substring in the entry, but with
-each space character allowing for any whitespace, including newlines."
+(defcustom org-agenda-search-view-always-boolean nil
+ "Non-nil means the search string is interpreted as individual parts.
+
+The search string for search view can either be interpreted as a phrase,
+or as a list of snippets that define a boolean search for a number of
+strings.
+
+When this is non-nil, the string will be split on whitespace, and each
+snippet will be searched individually, and all must match in order to
+select an entry. A snippet is then a single string of non-white
+characters, or a string in double quotes, or a regexp in {} braces.
+If a snippet is preceeded by \"-\", the snippet must *not* match.
+\"+\" is syntactic sugar for positive selection. Each snippet may
+be found as a full word or a partial word, but see the variable
+`org-agenda-search-view-force-full-words'.
+
+When this is nil, search will look for the entire search phrase as one,
+with each space character matching any amount of whitespace, including
+line breaks.
+
+Even when this is nil, you can still switch to Boolean search dynamically
+by preceeding the first snippet with \"+\" or \"-\". If the first snippet
+is a regexp marked with braces like \"{abc}\", this will also switch to
+boolean search."
+ :group 'org-agenda-search-view
+ :type 'boolean)
+
+(if (fboundp 'defvaralias)
+ (defvaralias 'org-agenda-search-view-search-words-only
+ 'org-agenda-search-view-always-boolean))
+
+(defcustom org-agenda-search-view-force-full-words nil
+ "Non-nil me
+ans, search words must be matches as complete words.
+When nil, they may also match part of a word."
:group 'org-agenda-search-view
:type 'boolean)
:group 'org-agenda)
(defcustom org-agenda-search-headline-for-time t
- "Non-nil means, search headline for a time-of-day.
+ "Non-nil means search headline for a time-of-day.
If the headline contains a time-of-day in one format or another, it will
be used to sort the entry into the time sequence of items for a day.
Some people have time stamps in the headline that refer to the creation
:type 'boolean)
(defcustom org-agenda-use-time-grid t
- "Non-nil means, show a time grid in the agenda schedule.
+ "Non-nil means show a time grid in the agenda schedule.
A time grid is a set of lines for specific times (like every two hours between
8:00 and 20:00). The items scheduled for a day at specific times are
sorted in between these lines.
:type 'symbol)
(defcustom org-sort-agenda-notime-is-late t
- "Non-nil means, items without time are considered late.
+ "Non-nil means items without time are considered late.
This is only relevant for sorting. When t, items which have no explicit
time like 15:30 will be considered as 99:01, i.e. later than any items which
do have a time. When nil, the default time is before 0:00. You can use this
:type 'boolean)
(defcustom org-sort-agenda-noeffort-is-high t
- "Non-nil means, items without effort estimate are sorted as high effort.
+ "Non-nil means items without effort estimate are sorted as high effort.
This also applies when filtering an agenda view with respect to the
< or > effort operator. Then, tasks with no effort defined will be treated
as tasks with high effort.
(string :tag "Scheduled today ")
(string :tag "Scheduled previously")))
+(defcustom org-agenda-inactive-leader "["
+ "Text preceeding item pulled into the agenda by inactive time stamps.
+These entries are added to the agenda when pressing \"[\"."
+ :group 'org-agenda-line-format
+ :type '(list
+ (string :tag "Scheduled today ")
+ (string :tag "Scheduled previously")))
+
(defcustom org-agenda-deadline-leaders '("Deadline: " "In %3d d.: ")
"Text preceeding deadline items in the agenda view.
This is a list with two strings. The first applies when the item has its
(function))))
(defcustom org-agenda-remove-times-when-in-prefix t
- "Non-nil means, remove duplicate time specifications in agenda items.
+ "Non-nil means remove duplicate time specifications in agenda items.
When the format `org-agenda-prefix-format' contains a `%t' specifier, a
time-of-day specification in a headline or diary entry is extracted and
placed into the prefix. If this option is non-nil, the original specification
(const :tag "No default duration")))
(defcustom org-agenda-show-inherited-tags t
- "Non-nil means, show inherited tags in each agenda line."
+ "Non-nil means show inherited tags in each agenda line."
:group 'org-agenda-line-format
:type 'boolean)
(string :tag "Regexp ")))
(defcustom org-agenda-remove-tags nil
- "Non-nil means, remove the tags from the headline copy in the agenda.
+ "Non-nil means remove the tags from the headline copy in the agenda.
When this is the symbol `prefix', only remove tags when
`org-agenda-prefix-format' contains a `%T' specifier."
:group 'org-agenda-line-format
(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column))
(defcustom org-agenda-fontify-priorities 'cookies
- "Non-nil means, highlight low and high priorities in agenda.
+ "Non-nil means highlight low and high priorities in agenda.
When t, the highest priority entries are bold, lowest priority italic.
However, settings in org-priority-faces will overrule these faces.
When this variable is the symbol `cookies', only fontify the
This may also be an association list of priority faces, whose
keys are the character values of `org-highest-priority',
`org-default-priority', and `org-lowest-priority' (the default values
-are ?A, ?B, and ?C, respectively). The face may be a named face,
-or a list like `(:background \"Red\")'."
+are ?A, ?B, and ?C, respectively). The face may be a named face, a
+color as a string, or a list like `(:background \"Red\")'.
+If it is a color, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
:group 'org-agenda-line-format
:type '(choice
(const :tag "Never" nil)
(const :tag "Cookies only" cookies)
(repeat :tag "Specify"
(list (character :tag "Priority" :value ?A)
- (sexp :tag "face")))))
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face"))))))
(defgroup org-agenda-column-view nil
"Options concerning column view in the agenda."
:group 'org-agenda)
(defcustom org-agenda-columns-show-summaries t
- "Non-nil means, show summaries for columns displayed in the agenda view."
+ "Non-nil means show summaries for columns displayed in the agenda view."
:group 'org-agenda-column-view
:type 'boolean)
(defcustom org-agenda-columns-remove-prefix-from-item t
- "Non-nil means, remove the prefix from a headline for agenda column view.
+ "Non-nil means remove the prefix from a headline for agenda column view.
The special ITEM field in the columns format contains the current line, with
all information shown in other columns (like the TODO state or a tag).
When this variable is non-nil, also the agenda prefix will be removed from
:type 'boolean)
(defcustom org-agenda-columns-compute-summary-properties t
- "Non-nil means, recompute all summary properties before column view.
+ "Non-nil means recompute all summary properties before column view.
When column view in the agenda is listing properties that have a summary
operator, it can go to all relevant buffers and recompute the summaries
there. This can mean overhead for the agenda column view, but is necessary
:type 'boolean)
(defcustom org-agenda-columns-add-appointments-to-effort-sum nil
- "Non-nil means, the duration of an appointment will add to day effort.
+ "Non-nil means the duration of an appointment will add to day effort.
The property to which appointment durations will be added is the one given
in the option `org-effort-property'. If an appointment does not have
an end time, `org-agenda-default-appointment-duration' will be used. If that
The sole argument to the function, which is called once for each
possible tag, is a string giving the name of the tag. The
function should return either nil if the tag should be included
-as normal, or \"-<TAG>\" to exclude the tag."
+as normal, or \"-<TAG>\" to exclude the tag.
+Note that for the purpose of tag filtering, only the lower-case version of
+all tags will be considered, so that this function will only ever see
+the lower-case version of all tags."
:group 'org-agenda
:type 'function)
(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
(org-defkey org-agenda-mode-map "v" 'org-agenda-view-mode-dispatch)
(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
+(org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines)
(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
(org-defkey org-agenda-mode-map "g" 'org-agenda-redo)
["Include Diary" org-agenda-toggle-diary
:style toggle :selected org-agenda-include-diary
:active (org-agenda-check-type nil 'agenda)]
+ ["Include Deadlines" org-agenda-toggle-deadlines
+ :style toggle :selected org-agenda-include-deadlines
+ :active (org-agenda-check-type nil 'agenda)]
["Use Time Grid" org-agenda-toggle-time-grid
:style toggle :selected org-agenda-use-time-grid
:active (org-agenda-check-type nil 'agenda)]
;;; Agenda undo
(defvar org-agenda-allow-remote-undo t
- "Non-nil means, allow remote undo from the agenda buffer.")
+ "Non-nil means allow remote undo from the agenda buffer.")
(defvar org-agenda-undo-list nil
"List of undoable operations in the agenda since last refresh.")
(defvar org-agenda-undo-has-started-in nil
(princ
(org-encode-for-stdout
(mapconcat 'org-agenda-export-csv-mapper
- '(org-category txt type todo tags date time-of-day extra
+ '(org-category txt type todo tags date time extra
priority-letter priority agenda-day)
",")))
(princ "\n"))))))
ov (org-make-overlay b e))
(org-overlay-put
ov 'face
- (cond ((cdr (assoc p org-priority-faces)))
+ (cond ((org-face-from-face-or-color
+ 'priority nil
+ (cdr (assoc p org-priority-faces))))
((and (listp org-agenda-fontify-priorities)
- (cdr (assoc p org-agenda-fontify-priorities))))
+ (org-face-from-face-or-color
+ 'priority nil
+ (cdr (assoc p org-agenda-fontify-priorities)))))
((equal p l) 'italic)
((equal p h) 'bold)))
(org-overlay-put ov 'org-type 'org-priority)))))
(defvar org-agenda-span nil) ; local variable in the agenda buffer
(defvar org-include-all-loc nil) ; local variable
+(defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp)
+ "List of types searched for when creating the daily/weekly agenda.
+This variable is a list of symbols that controls the types of
+items that appear in the daily/weekly agenda. Allowed symbols in this
+list are are
+
+ :timestamp List items containing a date stamp or date range matching
+ the selected date. This includes sexp entries in
+ angular brackets.
+
+ :sexp List entries resulting from plain diary-like sexps.
+
+ :deadline List deadline due on that date. When the date is today,
+ also list any deadlines past due, or due within
+ `org-deadline-warning-days'. `:deadline' must appear before
+ `:scheduled' if the setting of
+ `org-agenda-skip-scheduled-if-deadline-is-shown' is to have
+ any effect.
+
+ :scheduled List all items which are scheduled for the given date.
+ The diary for *today* also contains items which were
+ scheduled earlier and are not yet marked DONE.
+
+By default, all four types are turned on.
+
+Never set this variable globally using `setq', because then it
+will apply to all future agenda commands. Instead, bind it with
+`let' to scope it dynamically into the the agenda-constructing
+command. A good way to set it is through options in
+`org-agenda-custom-commands'. For a more flexible (though
+somewhat less efficient) way of determining what is included in
+the daily/weekly agenda, see `org-agenda-skip-function'.")
+
;;;###autoload
(defun org-agenda-list (&optional include-all start-day ndays)
"Produce a daily/weekly view from all files in variable `org-agenda-files'.
(while (setq file (pop files))
(catch 'nextfile
(org-check-agenda-file file)
- (cond
- ((eq org-agenda-show-log 'only)
- (setq rtn (org-agenda-get-day-entries
- file date :closed)))
- (org-agenda-show-log
- (setq rtn (org-agenda-get-day-entries
- file date
- :deadline :scheduled :timestamp :sexp :closed)))
- (t
- (setq rtn (org-agenda-get-day-entries
- file date
- :deadline :scheduled :sexp :timestamp))))
+ (let ((org-agenda-entry-types org-agenda-entry-types))
+ (unless org-agenda-include-deadlines
+ (setq org-agenda-entry-types
+ (delq :deadline org-agenda-entry-types)))
+ (cond
+ ((eq org-agenda-show-log 'only)
+ (setq rtn (org-agenda-get-day-entries
+ file date :closed)))
+ (org-agenda-show-log
+ (setq rtn (apply 'org-agenda-get-day-entries
+ file date
+ (append '(:closed) org-agenda-entry-types))))
+ (t
+ (setq rtn (apply 'org-agenda-get-day-entries
+ file date
+ org-agenda-entry-types)))))
(setq rtnall (append rtnall rtn))))
(if org-agenda-include-diary
(let ((org-agenda-search-headline-for-time t))
(modify-syntax-entry ?` "." org-search-syntax-table))
org-search-syntax-table)
+(defvar org-agenda-last-search-view-search-was-boolean nil)
+
;;;###autoload
(defun org-search-view (&optional todo-only string edit-at)
- "Show all entries that contain words or regular expressions.
-If the first character of the search string is an asterisks,
-search only the headlines.
+ "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
user should get a chance to edit this string, with cursor at position
EDIT-AT.
-The search string is broken into \"words\" by splitting at whitespace.
-Depending on the variable `org-agenda-search-view-search-words-only'
-and on whether the first character in the search string is \"+\" or \"-\",
-The string is then interpreted either as a substring with variable amounts
-of whitespace, or as a list or individual words that should be matched.
-
-The default is a substring match, where each space in the search string
-can expand to an arbitrary amount of whitespace, including newlines.
-
-If matching individual words, these words are then interpreted as a
-boolean expression with logical AND. 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 and the words
-are enclosed by word delimiters.
-
-Words enclosed by curly braces are interpreted as regular expressions
-that must or must not match in the entry.
-
-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.
+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 preceeding 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 preceeded with \"-\") must not
+match in the entry. Snippets enclosed into double quotes will be taken
+as a whole, to incude 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'."
'org-complex-heading-regexp org-complex-heading-regexp
'mouse-face 'highlight
'help-echo (format "mouse-2 or RET jump to location")))
+ (full-words org-agenda-search-view-force-full-words)
regexp rtn rtnall files file pos
- marker category tags c neg re as-words
+ marker category tags c neg re boolean
ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
(unless (and (not edit-at)
(stringp string)
(string-match "\\S-" string))
- (setq string (read-string "[+-]Word/{Regexp} ...: "
- (cond
- ((integerp edit-at) (cons string edit-at))
- (edit-at string))
- 'org-agenda-search-history)))
+ (setq string (read-string
+ (if org-agenda-search-view-always-boolean
+ "[+-]Word/{Regexp} ...: "
+ "Phrase, or [+-]Word/{Regexp} ...: ")
+ (cond
+ ((integerp edit-at) (cons string edit-at))
+ (edit-at string))
+ 'org-agenda-search-history)))
(org-set-local 'org-todo-only todo-only)
(setq org-agenda-redo-command
(list 'org-search-view (if todo-only t nil) string
(when (equal (string-to-char words) ?!)
(setq todo-only t
words (substring words 1)))
- (if (or org-agenda-search-view-search-words-only
- (member (string-to-char string) '(?- ?+)))
- (setq as-words t))
+ (when (equal (string-to-char words) ?:)
+ (setq full-words t
+ words (substring words 1)))
+ (if (or org-agenda-search-view-always-boolean
+ (member (string-to-char words) '(?- ?+ ?\{)))
+ (setq boolean t))
(setq words (org-split-string words))
- (if as-words
+ (setq org-agenda-last-search-view-search-was-boolean boolean)
+ (when boolean
+ (let (wds w)
+ (while (setq w (pop words))
+ (if (or (equal (substring w 0 1) "\"")
+ (and (> (length w) 1)
+ (member (substring w 0 1) '("+" "-"))
+ (equal (substring w 1 2) "\"")))
+ (while (and words (not (equal (substring w -1) "\"")))
+ (setq w (concat w " " (pop words)))))
+ (and (string-match "\\`\\([-+]?\\)\"" w)
+ (setq w (replace-match "\\1" nil nil w)))
+ (and (equal (substring w -1) "\"") (setq w (substring w 0 -1)))
+ (push w wds))
+ (setq words (nreverse wds))))
+ (if boolean
(mapc (lambda (w)
(setq c (string-to-char w))
(if (equal c ?-)
(setq neg t w (substring w 1))
(if (equal c ?+)
(setq neg nil w (substring w 1))
- (setq neg nil)))
+ (setq neg nil)))
(if (string-match "\\`{.*}\\'" w)
(setq re (substring w 1 -1))
- (setq re (concat "\\<" (regexp-quote (downcase w)) "\\>")))
+ (if full-words
+ (setq re (concat "\\<" (regexp-quote (downcase w)) "\\>"))
+ (setq re (regexp-quote (downcase w)))))
(if neg (push re regexps-) (push re regexps+)))
words)
(push (mapconcat (lambda (w) (regexp-quote w)) words "\\s-+")
(org-compile-prefix-format 'todo)
(org-set-sorting-strategy 'todo)
(org-prepare-agenda "TODO")
+ (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
(let* ((today (time-to-days (current-time)))
(date (calendar-gregorian-from-absolute today))
(kwds org-todo-keywords-for-agenda)
(org-compile-prefix-format 'tags)
(org-set-sorting-strategy 'tags)
(let* ((org-tags-match-list-sublevels
-;?????? (if todo-only t org-tags-match-list-sublevels))
org-tags-match-list-sublevels)
(completion-ignore-case t)
rtn rtnall files file pos matcher
buffer)
+ (when (and (stringp match) (not (string-match "\\S-" match)))
+ (setq match nil))
(setq matcher (org-make-tags-matcher match)
match (car matcher) matcher (cdr matcher))
(org-prepare-agenda (concat "TAGS " match))
nottimestamp Check if there is no timestamp (also deadline or scheduled)
regexp Check if regexp matches
notregexp Check if regexp does not match.
+todo Check if TODO keyword matches
+nottodo Check if TODO keyword does not match
The regexp is taken from the conditions list, it must come right after
the `regexp' or `notregexp' element.
+`todo' and `nottodo' accept as an argument a list of todo
+keywords, which may include \"*\" to match any todo keyword.
+
+ (org-agenda-skip-entry-if 'todo '(\"TODO\" \"WAITING\"))
+
+would skip all entries with \"TODO\" or \"WAITING\" keywords.
+
+Instead of a list a keyword class may be given
+
+ (org-agenda-skip-entry-if 'nottodo 'done)
+
+would skip entries that haven't been marked with any of \"DONE\"
+keywords. Possible classes are: `todo', `done', `any'.
+
If any of these conditions is met, this function returns the end point of
the entity, causing the search to continue from there. This is a function
that can be put into `org-agenda-skip-function' for the duration of a command."
(re-search-forward (nth 1 m) end t))
(and (setq m (memq 'notregexp conditions))
(stringp (nth 1 m))
- (not (re-search-forward (nth 1 m) end t))))
+ (not (re-search-forward (nth 1 m) end t)))
+ (and (or
+ (setq m (memq 'todo conditions))
+ (setq m (memq 'nottodo conditions)))
+ (org-agenda-skip-if-todo m end)))
end)))
+(defun org-agenda-skip-if-todo (args end)
+ "Helper function for `org-agenda-skip-if', do not use it directly.
+ARGS is a list with first element either `todo' or `nottodo'.
+The remainder is either a list of TODO keywords, or a state symbol
+`todo' or `done' or `any'."
+ (let ((kw (car args))
+ (arg (cadr args))
+ todo-wds todo-re)
+ (setq todo-wds
+ (org-uniquify
+ (cond
+ ((listp arg) ;; list of keywords
+ (if (member "*" arg)
+ (mapcar 'substring-no-properties org-todo-keywords-1)
+ arg))
+ ((symbolp arg) ;; keyword class name
+ (cond
+ ((eq arg 'todo)
+ (org-delete-all org-done-keywords
+ (mapcar 'substring-no-properties
+ org-todo-keywords-1)))
+ ((eq arg 'done) org-done-keywords)
+ ((eq arg 'any)
+ (mapcar 'substring-no-properties org-todo-keywords-1)))))))
+ (setq todo-re
+ (concat "^\\*+[ \t]+\\<\\("
+ (mapconcat 'identity todo-wds "\\|")
+ "\\)\\>"))
+ (if (eq kw 'todo)
+ (re-search-forward todo-re end t)
+ (not (re-search-forward todo-re end t)))))
+
;;;###autoload
(defun org-agenda-list-stuck-projects (&rest ignore)
"Create agenda view for projects that are stuck.
(setq x (org-format-agenda-item "" x "Diary" nil 'time))
;; Extend the text properties to the beginning of the line
(org-add-props x (text-properties-at (1- (length x)) x)
- 'type "diary" 'date date))
+ 'type "diary" 'date date 'face 'org-agenda-diary))
entries)))))
(defvar org-agenda-cleanup-fancy-diary-hook nil
(apply 'diary-add-to-list args)
(apply 'add-to-diary-list args)))
+(defvar org-diary-last-run-time nil)
+
;;;###autoload
(defun org-diary (&rest args)
"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. The following arguments are allowed:
-
- :timestamp List the headlines of items containing a date stamp or
- date range matching the selected date. Deadlines will
- also be listed, on the expiration day.
-
- :sexp List entries resulting from diary-like sexps.
-
- :deadline List any deadlines past due, or due within
- `org-deadline-warning-days'. The listing occurs only
- in the diary for *today*, not at any other date. If
- an entry is marked DONE, it is no longer listed.
-
- :scheduled List all items which are scheduled for the given date.
- The diary for *today* also contains items which were
- scheduled earlier and are not yet marked DONE.
-
- :todo List all TODO items from the org-file. This may be a
- long list - so this is not turned on by default.
- Like deadlines, these entries only show up in the
- diary for *today*, not at any other date.
+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:
(let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
(list entry)
(org-agenda-files t)))
+ (time (org-float-time))
file rtn results)
- (org-prepare-agenda-buffers files)
+ (when (or (not org-diary-last-run-time)
+ (> (- time
+ org-diary-last-run-time)
+ 3))
+ (org-prepare-agenda-buffers files))
+ (setq org-diary-last-run-time time)
;; If this is called during org-agenda, don't return any entries to
;; the calendar. Org Agenda will list these entries itself.
(if org-disable-agenda-to-diary (setq files nil))
(nreverse ee)))
;;;###autoload
-(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item (&optional end)
- "Do we have a reason to ignore this todo entry because it has a time stamp?"
+(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
+ (&optional end)
+ "Do we have a reason to ignore this TODO entry because it has a time stamp?"
(when (or org-agenda-todo-ignore-with-date
org-agenda-todo-ignore-scheduled
org-agenda-todo-ignore-deadlines)
(or (and org-agenda-todo-ignore-with-date
(re-search-forward org-ts-regexp end t))
(and org-agenda-todo-ignore-scheduled
- (re-search-forward org-scheduled-time-regexp end t))
+ (re-search-forward org-scheduled-time-regexp end t)
+ (cond
+ ((eq org-agenda-todo-ignore-scheduled 'future)
+ (> (org-days-to-time (match-string 1)) 0))
+ ((eq org-agenda-todo-ignore-scheduled 'past)
+ (<= (org-days-to-time (match-string 1)) 0))
+ (t)))
(and org-agenda-todo-ignore-deadlines
(re-search-forward org-deadline-time-regexp end t)
- (org-deadline-close (match-string 1)))))))
+ (cond
+ ((memq org-agenda-todo-ignore-deadlines '(t all)) t)
+ ((eq org-agenda-todo-ignore-deadlines 'far)
+ (not (org-deadline-close (match-string 1))))
+ ((eq org-agenda-todo-ignore-deadlines 'future)
+ (> (org-days-to-time (match-string 1)) 0))
+ ((eq org-agenda-todo-ignore-deadlines 'past)
+ (<= (org-days-to-time (match-string 1)) 0))
+ (t (org-deadline-close (match-string 1)))))))))
(defconst org-agenda-no-heading-message
"No heading for this item in buffer or region.")
(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
(setq head (match-string 1))
(setq txt (org-format-agenda-item
- (if inactivep "[" nil)
+ (if inactivep org-agenda-inactive-leader nil)
head category tags timestr nil
remove-re)))
(setq priority (org-get-priority txt))
(push txt ee))))
(nreverse ee)))
+(defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
+ "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEKS.
+The order of the first 2 times 3 arguments depends on the variable
+`calendar-date-style' or, if that is not defined, on `european-calendar-style'.
+So for american calendars, give this as MONTH DAY YEAR, for european as
+DAY MONTH YEAR, and for ISO as YEAR MONTH DAY.
+DAYNAME is a number between 0 (Sunday) and 6 (Saturday). SKIP-WEEKS
+is any number of ISO weeks in the block period for which the item should
+be skipped."
+ (let* ((date1 (calendar-absolute-from-gregorian
+ (org-order-calendar-date-args m1 d1 y1)))
+ (date2 (calendar-absolute-from-gregorian
+ (org-order-calendar-date-args m2 d2 y2)))
+ (d (calendar-absolute-from-gregorian date)))
+ (and
+ (<= date1 d)
+ (<= d date2)
+ (= (calendar-day-of-week date) dayname)
+ (or (not skip-weeks)
+ (progn
+ (require 'cal-iso)
+ (not (member (car (calendar-iso-from-absolute d)) skip-weeks))))
+ entry)))
+
(defalias 'org-get-closed 'org-agenda-get-progress)
(defun org-agenda-get-progress ()
"Return the logged TODO entries for agenda display."
(todayp (org-agenda-todayp date)) ; DATE bound by calendar
(d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
d2 diff dfrac wdays pos pos1 category tags
+ suppress-prewarning
ee txt head face s todo-state upcomingp donep timestr)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
+ (setq suppress-prewarning nil)
(catch :skip
(org-agenda-skip)
+ (when (and org-agenda-skip-deadline-prewarning-if-scheduled
+ (save-match-data
+ (string-match org-scheduled-time-regexp
+ (buffer-substring (point-at-bol)
+ (point-at-eol)))))
+ (setq suppress-prewarning
+ (if (integerp org-agenda-skip-deadline-prewarning-if-scheduled)
+ org-agenda-skip-deadline-prewarning-if-scheduled
+ 0)))
(setq s (match-string 1)
txt nil
pos (1- (match-beginning 1))
(match-string 1) d1 'past
org-agenda-repeating-timestamp-show-all)
diff (- d2 d1)
- wdays (org-get-wdays s)
+ wdays (if suppress-prewarning
+ (let ((org-deadline-warning-days suppress-prewarning))
+ (org-get-wdays s))
+ (org-get-wdays s))
dfrac (/ (* 1.0 (- wdays diff)) (max wdays 1))
upcomingp (and todayp (> diff 0)))
;; When to show a deadline in the calendar:
org-agenda-timerange-leaders)
(1+ (- d0 d1)) (1+ (- d2 d1)))
head category tags
- (if (= d0 d1) timestr))))
+ timestr)))
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker
'type "block" 'date date
(when (or add-inherited hide-re)
(if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt)
(setq txt (substring txt 0 (match-beginning 0))))
+ (setq tags
+ (delq nil
+ (mapcar (lambda (tg)
+ (if (or (and hide-re (string-match hide-re tg))
+ (and (not add-inherited)
+ (get-text-property 0 'inherited tg)))
+ nil
+ tg))
+ tags)))
(when tags
- (setq tags
- (delq nil
- (mapcar (lambda (tg)
- (if (or (and hide-re (string-match hide-re tg))
- (and (not add-inherited)
- (get-text-property 0 'inherited tg)))
- nil
- tg))
- tags)))
(let ((have-i (get-text-property 0 'inherited (car tags)))
i)
(setq txt (concat txt " :"
(mod h1 24) h1))
(t0 (+ (* 100 h2) m))
(t1 (concat (if (>= h1 24) "+" " ")
+ (if (and org-agenda-time-leading-zero
+ (< t0 1000)) "0" "")
(if (< t0 100) "0" "")
(if (< t0 10) "0" "")
(int-to-string t0))))
(defun org-agenda-highlight-todo (x)
(let ((org-done-keywords org-done-keywords-for-agenda)
+ (case-fold-search nil)
re pl)
(if (eq x 'line)
(save-excursion
(effort-prompt "")
(inhibit-read-only t)
(current org-agenda-filter)
- char a n tag)
+ a n tag)
(unless char
(message
"%s by tag [%s ], [TAB], %s[/]:off, [+-]:narrow, [>=<?]:effort: "
(org-agenda-filter-by-tag-show-all)
(when org-agenda-auto-exclude-function
(setq org-agenda-filter '())
- (dolist (tag org-tag-alist-for-agenda)
- (let ((modifier (funcall org-agenda-auto-exclude-function
- (car tag))))
+ (dolist (tag (org-agenda-get-represented-tags))
+ (let ((modifier (funcall org-agenda-auto-exclude-function tag)))
(if modifier
(push modifier org-agenda-filter))))
(if (not (null org-agenda-filter))
(org-agenda-filter-apply org-agenda-filter))
(t (error "Invalid tag selection character %c" char)))))
+(defun org-agenda-get-represented-tags ()
+ "Get a list of all tags currently represented in the agenda."
+ (let (p tags)
+ (save-excursion
+ (goto-char (point-min))
+ (while (setq p (next-single-property-change (point) 'tags))
+ (goto-char p)
+ (mapc (lambda (x) (add-to-list 'tags x))
+ (get-text-property (point) 'tags))))
+ tags))
+
(defun org-agenda-filter-by-tag-refine (strip &optional char)
"Refine the current filter. See `org-agenda-filter-by-tag."
(interactive "P")
(defun org-agenda-manipulate-query-add ()
"Manipulate the query by adding a search term with positive selection.
-Positive selection means, the term must be matched for selection of an entry."
+Positive selection means the term must be matched for selection of an entry."
(interactive)
(org-agenda-manipulate-query ?\[))
(defun org-agenda-manipulate-query-subtract ()
"Manipulate the query by adding a search term with negative selection.
-Negative selection means, term must not be matched for selection of an entry."
+Negative selection means term must not be matched for selection of an entry."
(interactive)
(org-agenda-manipulate-query ?\]))
(defun org-agenda-manipulate-query-add-re ()
"Manipulate the query by adding a search regexp with positive selection.
-Positive selection means, the regexp must match for selection of an entry."
+Positive selection means the regexp must match for selection of an entry."
(interactive)
(org-agenda-manipulate-query ?\{))
(defun org-agenda-manipulate-query-subtract-re ()
"Manipulate the query by adding a search regexp with negative selection.
-Negative selection means, regexp must not match for selection of an entry."
+Negative selection means regexp must not match for selection of an entry."
(interactive)
(org-agenda-manipulate-query ?\}))
(defun org-agenda-manipulate-query (char)
((eq org-agenda-type 'search)
(org-add-to-string
'org-agenda-query-string
- (cdr (assoc char '((?\[ . " +") (?\] . " -")
- (?\{ . " +{}") (?\} . " -{}")))))
+ (if org-agenda-last-search-view-search-was-boolean
+ (cdr (assoc char '((?\[ . " +") (?\] . " -")
+ (?\{ . " +{}") (?\} . " -{}"))))
+ " "))
(setq org-agenda-redo-command
(list 'org-search-view
org-todo-only
(defun org-agenda-view-mode-dispatch ()
"Call one of the view mode commands."
(interactive)
- (message "View: [d]ay [w]eek [m]onth [y]ear [l]og [L]og-all [a]rch-trees [A]rch-files
- clock[R]eport time[G]rid [[]inactive [E]ntryText include[D]iary")
+ (message "View: [d]ay [w]eek [m]onth [y]ear [q]uit/abort
+ time[G]rid [[]inactive [f]ollow [l]og [L]og-all [E]ntryText
+ [a]rch-trees [A]rch-files clock[R]eport include[D]iary")
(let ((a (read-char-exclusive)))
(case a
(?d (call-interactively 'org-agenda-day-view))
(?m (call-interactively 'org-agenda-month-view))
(?y (call-interactively 'org-agenda-year-view))
(?l (call-interactively 'org-agenda-log-mode))
+ (?L (org-agenda-log-mode '(4)))
((?F ?f) (call-interactively 'org-agenda-follow-mode))
(?a (call-interactively 'org-agenda-archives-mode))
(?A (org-agenda-archives-mode 'files))
((?E ?e) (call-interactively 'org-agenda-entry-text-mode))
(?G (call-interactively 'org-agenda-toggle-time-grid))
(?D (call-interactively 'org-agenda-toggle-diary))
+ (?\! (call-interactively 'org-agenda-toggle-deadlines))
(?\[ (let ((org-agenda-include-inactive-timestamps t))
(org-agenda-check-type t 'timeline 'agenda)
(org-agenda-redo))
(defun org-agenda-entry-text-mode (&optional arg)
"Toggle entry text mode in an agenda buffer."
(interactive "P")
- (if (integerp arg)
- (setq org-agenda-entry-text-mode t)
- (setq org-agenda-entry-text-mode (not org-agenda-entry-text-mode)))
+ (setq org-agenda-entry-text-mode (or (integerp arg)
+ (not org-agenda-entry-text-mode)))
(org-agenda-entry-text-hide)
(and org-agenda-entry-text-mode
(let ((org-agenda-entry-text-maxlines
(message "Diary inclusion turned %s"
(if org-agenda-include-diary "on" "off")))
+(defun org-agenda-toggle-deadlines ()
+ "Toggle diary inclusion in an agenda buffer."
+ (interactive)
+ (org-agenda-check-type t 'agenda)
+ (setq org-agenda-include-deadlines (not org-agenda-include-deadlines))
+ (org-agenda-redo)
+ (org-agenda-set-mode-name)
+ (message "Deadlines inclusion turned %s"
+ (if org-agenda-include-deadlines "on" "off")))
+
(defun org-agenda-toggle-time-grid ()
"Toggle time grid in an agenda buffer."
(interactive)
"Set the mode name to indicate all the small mode settings."
(setq mode-name
(concat "Org-Agenda"
+ (if (get 'org-agenda-files 'org-restrict) " []" "")
(if (equal org-agenda-ndays 1) " Day" "")
(if (equal org-agenda-ndays 7) " Week" "")
(if org-agenda-follow-mode " Follow" "")
(if org-agenda-entry-text-mode " ETxt" "")
(if org-agenda-include-diary " Diary" "")
+ (if org-agenda-include-deadlines " Ddl" "")
(if org-agenda-use-time-grid " Grid" "")
(if (and (boundp 'org-habit-show-habits)
org-habit-show-habits) " Habit" "")
(goto-char (match-beginning 1))
(insert (org-add-props
(make-string (max 1 (- c (current-column))) ?\ )
- (text-properties-at (point)))))
+ (plist-put (copy-sequence (text-properties-at (point)))
+ 'face nil))))
(goto-char (point-min))
(org-font-lock-add-tag-faces (point-max)))))
(with-current-buffer buffer
(widen)
(goto-char pos)
- (if (not (org-at-timestamp-p))
+ (if (not (org-at-timestamp-p t))
(error "Cannot find time stamp"))
- (org-time-stamp arg))
+ (org-time-stamp arg (equal (char-after (match-beginning 0)) ?\[)))
(org-agenda-show-new-time marker org-last-changed-timestamp))
(message "Time stamp changed to %s" org-last-changed-timestamp)))
(defun org-agenda-schedule (arg)
- "Schedule the item at point."
+ "Schedule the item at point.
+Arg is passed through to `org-schedule'."
(interactive "P")
(org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
(org-agenda-check-no-diary)
(message "Item scheduled for %s" ts)))
(defun org-agenda-deadline (arg)
- "Schedule the item at point."
+ "Schedule the item at point.
+Arg is passed through to `org-deadline'."
(interactive "P")
(org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
(org-agenda-check-no-diary)
((equal char ?j)
(org-switch-to-buffer-other-window
(find-file-noselect org-agenda-diary-file))
+ (require 'org-datetree)
(org-datetree-find-date-create d1)
(org-reveal t))
(t (error "Invalid selection character `%c'" char)))))
(const :tag "in a date tree" date-tree)
(const :tag "as top level at end of file" top-level)))
+(defcustom org-agenda-insert-diary-extract-time nil
+ "Non-nil means extract any time specification from the diary entry."
+ :group 'org-agenda
+ :type 'boolean)
+
(defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2)
"Add a diary entry with TYPE to `org-agenda-diary-file'.
If TEXT is not empty, it will become the headline of the new entry, and
(let ((calendar-date-display-form
(if (if (boundp 'calendar-date-style)
(eq calendar-date-style 'european)
- european-calendar-style) ; Emacs 22
+ (org-bound-and-true-p european-calendar-style)) ; Emacs 22
'(day " " month " " year)
'(month " " day " " year))))
(insert (format "%%%%(diary-anniversary %s) %s"
(calendar-date-string d1 nil t) text))))
((eq type 'day)
- (if (eq org-agenda-insert-diary-strategy 'top-level)
- (org-agenda-insert-diary-as-top-level text)
- (require 'org-datetree)
- (org-datetree-find-date-create d1)
- (org-agenda-insert-diary-make-new-entry text))
- (org-insert-time-stamp (org-time-from-absolute
- (calendar-absolute-from-gregorian d1)))
+ (let ((org-prefix-has-time t)
+ (org-agenda-time-leading-zero t)
+ fmt time time2)
+ (if org-agenda-insert-diary-extract-time
+ ;; Use org-format-agenda-item to parse text for a time-range and
+ ;; remove it. FIXME: This is a hack, we should refactor
+ ;; that function to make time extraction available separately
+ (setq fmt (org-format-agenda-item nil text nil nil t)
+ time (get-text-property 0 'time fmt)
+ time2 (if (> (length time) 0)
+ ;; split-string removes trailing ...... if
+ ;; no end time given. First space
+ ;; separates time from date.
+ (concat " " (car (split-string time "\\.")))
+ nil)
+ text (get-text-property 0 'txt fmt)))
+ (if (eq org-agenda-insert-diary-strategy 'top-level)
+ (org-agenda-insert-diary-as-top-level text)
+ (require 'org-datetree)
+ (org-datetree-find-date-create d1)
+ (org-agenda-insert-diary-make-new-entry text))
+ (org-insert-time-stamp (org-time-from-absolute
+ (calendar-absolute-from-gregorian d1))
+ nil nil nil nil time2))
(end-of-line 0))
((eq type 'block)
(if (> (calendar-absolute-from-gregorian d1)
(org-back-over-empty-lines)
(or (looking-at "[ \t]*$")
(progn (insert "\n") (backward-char 1)))
- (org-insert-heading)
+ (org-insert-heading nil t)
(org-do-demote)
(setq col (current-column))
(insert text "\n")
'evaporate)
(org-overlay-put ov 'type 'org-marked-entry-overlay))
(beginning-of-line 2)
+ (while (and (get-char-property (point) 'invisible) (not (eobp)))
+ (beginning-of-line 2))
(message "%d entries marked for bulk action"
(length org-agenda-bulk-marked-entries))))
(delete (org-get-at-bol 'org-hd-marker)
org-agenda-bulk-marked-entries)))
(beginning-of-line 2)
+ (while (and (get-char-property (point) 'invisible) (not (eobp)))
+ (beginning-of-line 2))
(message "%d entries marked for bulk action"
(length org-agenda-bulk-marked-entries)))
(setq org-agenda-bulk-marked-entries nil)
(org-agenda-bulk-remove-overlays (point-min) (point-max)))
-(defun org-agenda-bulk-action ()
- "Execute an remote-editing action on all marked entries."
- (interactive)
+(defun org-agenda-bulk-action (&optional arg)
+ "Execute an remote-editing action on all marked entries.
+The prefix arg is passed through to the command if possible."
+ (interactive "P")
(unless org-agenda-bulk-marked-entries
(error "No entries are marked"))
(message "Bulk: [r]efile [$]archive [A]rch->sib [t]odo [+/-]tag [s]chedule [d]eadline")
(let* ((action (read-char-exclusive))
+ (org-log-refile (if org-log-refile 'time nil))
(entries (reverse org-agenda-bulk-marked-entries))
cmd rfloc state e tag pos (cnt 0) (cntskip 0))
(cond
(setq cmd `(org-agenda-set-tags ,tag ,(if (eq action ?+) ''on ''off))))
((memq action '(?s ?d))
- (let* ((date (org-read-date
- nil nil nil
- (if (eq action ?s) "(Re)Schedule to" "Set Deadline to")))
- (ans org-read-date-final-answer)
+ (let* ((date (unless arg
+ (org-read-date
+ nil nil nil
+ (if (eq action ?s) "(Re)Schedule to" "Set Deadline to"))))
+ (ans (if arg nil org-read-date-final-answer))
(c1 (if (eq action ?s) 'org-agenda-schedule 'org-agenda-deadline)))
(setq cmd `(let* ((bound (fboundp 'read-string))
(old (and bound (symbol-function 'read-string))))
(unwind-protect
(progn
(fset 'read-string (lambda (&rest ignore) ,ans))
- (call-interactively ',c1))
+ (eval '(,c1 arg)))
(if bound
(fset 'read-string old)
(fmakunbound 'read-string)))))))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:type '(choice
(const org-archive-subtree)
(const org-archive-to-archive-sibling)
- (const org-archive-set-tag)))
+ (const org-archive-set-tag)))
+
+(defcustom org-archive-reversed-order nil
+ "Non-nil means make the tree first child under the archive heading, not last."
+ :group 'org-archive
+ :type 'boolean)
(defcustom org-archive-sibling-heading "Archive"
"Name of the local archive sibling that is used to archive entries locally.
:type 'string)
(defcustom org-archive-mark-done nil
- "Non-nil means, mark entries as DONE when they are moved to the archive file.
+ "Non-nil means mark entries as DONE when they are moved to the archive file.
This can be a string to set the keyword to use. When t, Org-mode will
use the first keyword in its list that means done."
:group 'org-archive
(string :tag "Use this keyword")))
(defcustom org-archive-stamp-time t
- "Non-nil means, add a time stamp to entries moved to an archive file.
+ "Non-nil means add a time stamp to entries moved to an archive file.
This variable is obsolete and has no effect anymore, instead add or remove
`time' from the variable `org-archive-save-context-info'."
:group 'org-archive
(end-of-line 0))
;; Make the subtree visible
(show-subtree)
- (org-end-of-subtree t)
+ (if org-archive-reversed-order
+ (progn
+ (org-back-to-heading t)
+ (outline-next-heading))
+ (org-end-of-subtree t))
(skip-chars-backward " \t\r\n")
(and (looking-at "[ \t\r\n]*")
(replace-match "\n\n")))
(beginning-of-line 0)
(org-toggle-tag org-archive-tag 'on))
(beginning-of-line 1)
- (org-end-of-subtree t t)
+ (if org-archive-reversed-order
+ (outline-next-heading)
+ (org-end-of-subtree t t))
(save-excursion
(goto-char pos)
(let ((this-command this-command)) (org-cut-subtree)))
(progn
(setq re1 (concat "^" (regexp-quote
(make-string
- (1+ (- (match-end 0) (match-beginning 0) 1))
+ (+ (- (match-end 0) (match-beginning 0) 1)
+ (if org-odd-levels-only 2 1))
?*))
" "))
(move-marker begm (point))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:type '(repeat character))
(defcustom org-export-ascii-links-to-notes t
- "Non-nil means, convert links to notes before the next headline.
+ "Non-nil means convert links to notes before the next headline.
When nil, the link will be exported in place. If the line becomes long
in this way, it will be wrapped."
:group 'org-export-ascii
:type 'boolean)
(defcustom org-export-ascii-table-keep-all-vertical-lines nil
- "Non-nil means, keep all vertical lines in ASCII tables.
+ "Non-nil means keep all vertical lines in ASCII tables.
When nil, vertical lines will be removed except for those needed
for column grouping."
:group 'org-export-ascii
:type 'boolean)
+(defcustom org-export-ascii-table-widen-columns t
+ "Non-nil means widen narrowed columns for export.
+When nil, narrowed columns will look in ASCII export just like in org-mode,
+i.e. with \"=>\" as ellipsis."
+ :group 'org-export-ascii
+ :type 'boolean)
+
+(defvar org-export-ascii-entities 'ascii
+ "The ascii representation to be used during ascii export.
+Possible values are:
+
+ascii Only use plain ASCII characters
+latin1 Include Latin-1 character
+utf8 Use all UTF-8 characters")
+
;;; Hooks
(defvar org-export-ascii-final-hook nil
(defvar org-ascii-current-indentation nil) ; For communication
+;;;###autoload
+(defun org-export-as-latin1 (&rest args)
+ "Like `org-export-as-ascii', use latin1 encoding for special symbols."
+ (interactive)
+ (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+ 'latin1 args))
+
+;;;###autoload
+(defun org-export-as-latin1-to-buffer (&rest args)
+ "Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols."
+ (interactive)
+ (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+ 'latin1 args))
+
+;;;###autoload
+(defun org-export-as-utf8 (&rest args)
+ "Like `org-export-as-ascii', use use encoding for special symbols."
+ (interactive)
+ (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+ 'utf8 args))
+
+;;;###autoload
+(defun org-export-as-utf8-to-buffer (&rest args)
+ "Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols."
+ (interactive)
+ (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+ 'utf8 args))
+
+(defun org-export-as-encoding (command interactivep encoding &rest args)
+ (let ((org-export-ascii-entities encoding))
+ (if interactivep
+ (call-interactively command)
+ (apply command args))))
+
+
;;;###autoload
(defun org-export-as-ascii-to-buffer (arg)
"Call `org-export-as-ascii` with output to a temporary buffer.
the file header and footer. When PUB-DIR is set, use this as the
publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
(setq-default org-todo-line-regexp org-todo-line-regexp)
(let* ((opt-plist (org-combine-plists (org-default-export-plist)
ext-plist
(if subtree-p
(org-export-add-subtree-options opt-plist rbeg)
opt-plist)))
+ ;; The following two are dynamically scoped into other
+ ;; routines below.
+ (org-current-export-dir
+ (or pub-dir (org-export-directory :html opt-plist)))
+ (org-current-export-file buffer-file-name)
(custom-times org-display-custom-times)
(org-ascii-current-indentation '(0 . 0))
(level 0) line txt
(and (not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
- (file-name-sans-extension
- (file-name-nondirectory bfname))))
+ (and (buffer-file-name)
+ (file-name-sans-extension
+ (file-name-nondirectory bfname)))
+ "UNTITLED"))
(email (plist-get opt-plist :email))
(language (plist-get opt-plist :language))
(quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
(if (and (or author email)
org-export-author-info)
(insert(concat (nth 1 lang-words) ": " (or author "")
- (if email (concat " <" email ">") "")
+ (if (and org-export-email-info
+ email (string-match "\\S-" email))
+ (concat " <" email ">") "")
"\n")))
(cond
(defun org-export-ascii-preprocess (parameters)
"Do extra work for ASCII export"
+ ;;
+ ;; Realign tables to get rid of narrowing
+ (when org-export-ascii-table-widen-columns
+ (let ((org-table-do-narrow nil))
+ (goto-char (point-min))
+ (org-ascii-replace-entities)
+ (goto-char (point-min))
+ (org-table-map-tables
+ (lambda ()
+ (org-if-unprotected
+ (org-table-align))))))
;; Put quotes around verbatim text
(goto-char (point-min))
(while (re-search-forward org-verbatim-re nil t)
- (goto-char (match-end 2))
- (backward-delete-char 1) (insert "'")
- (goto-char (match-beginning 2))
- (delete-char 1) (insert "`")
- (goto-char (match-end 2)))
+ (org-if-unprotected-at (match-beginning 4)
+ (goto-char (match-end 2))
+ (backward-delete-char 1) (insert "'")
+ (goto-char (match-beginning 2))
+ (delete-char 1) (insert "`")
+ (goto-char (match-end 2))))
;; Remove target markers
(goto-char (point-min))
(while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
- (replace-match "\\1\\2")))
+ (org-if-unprotected-at (match-beginning 1)
+ (replace-match "\\1\\2"))))
(defun org-html-expand-for-ascii (line)
"Handle quoted HTML for ASCII export."
(setq line (replace-match "" nil nil line))))
line)
+(defun org-ascii-replace-entities ()
+ "Replace entities with the ASCII representation."
+ (let (e)
+ (while (re-search-forward "\\\\\\([a-zA-Z]+[0-9]*\\)" nil t)
+ (org-if-unprotected-at (match-beginning 1)
+ (setq e (org-entity-get-representation (match-string 1)
+ org-export-ascii-entities))
+ (and e (replace-match e t t))))))
+
(defun org-export-ascii-wrap (line where)
"Wrap LINE at or before WHERE."
(let ((ind (org-get-indentation line))
;; Author: John Wiegley <johnw@newartisans.com>
;; Keywords: org data task
-;; Version: 6.33x
+;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
:type 'boolean)
(defcustom org-attach-allow-inheritance t
- "Non-nil means, allow attachment directories be inherited."
+ "Non-nil means allow attachment directories be inherited."
:group 'org-attach
:type 'boolean)
"Commit changes to git if `org-attach-directory' is properly initialized.
This checks for the existence of a \".git\" directory in that directory."
(let ((dir (expand-file-name org-attach-directory)))
- (if (file-exists-p (expand-file-name ".git" dir))
- (shell-command
- (concat "(cd " dir "; "
- " git add .; "
- " git ls-files --deleted -z | xargs -0 git rm; "
- " git commit -m 'Synchronized attachments')")))))
+ (when (file-exists-p (expand-file-name ".git" dir))
+ (with-temp-buffer
+ (cd dir)
+ (shell-command "git add .")
+ (shell-command "git ls-files --deleted" t)
+ (mapc '(lambda (file)
+ (unless (string= file "")
+ (shell-command
+ (concat "git rm \"" file "\""))))
+ (split-string (buffer-string) "\n"))
+ (shell-command "git commit -m 'Synchronized attachments'")))))
(defun org-attach-tag (&optional off)
"Turn the autotag on or (if OFF is set) off."
(setq file (expand-file-name file attach-dir))
(unless (file-exists-p file)
(error "No such attachment: %s" file))
- (delete-file file)))
+ (delete-file file)
+ (org-attach-commit)))
(defun org-attach-delete-all (&optional force)
"Delete all attachments from the current task.
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
--- /dev/null
+;;; org-beamer.el --- Beamer-specific LaTeX export for org-mode
+;;
+;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;;
+;; Version: 6.35i
+;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
+;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
+;; Keywords: org, wp, tex
+
+;; 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:
+;;
+;; This library implement the special treatment needed by using the
+;; beamer class during LaTeX export.
+
+(require 'org)
+(require 'org-exp)
+(defvar org-export-latex-header)
+(defvar org-export-latex-options-plist)
+(defvar org-export-opt-plist)
+
+(defgroup org-beamer nil
+ "Options specific for using the beamer class in LaTeX export."
+ :tag "Org Beamer"
+ :group 'org-export-latex)
+
+(defcustom org-beamer-use-parts nil
+ ""
+ :group 'org-beamer
+ :type 'boolean)
+
+(defcustom org-beamer-frame-level 1
+ "The level that should be interpreted as a frame.
+The levels above this one will be translated into a sectioning structure.
+Setting this to 2 will allow sections, 3 will allow subsections as well.
+You can se this to 4 as well, if you at the same time set
+`org-beamer-use-parts' to make the top levels `\part'."
+ :group 'org-beamer
+ :type '(choice
+ (const :tag "Frames need a BEAMER_env property" nil)
+ (integer :tag "Specific level makes a frame")))
+
+(defcustom org-beamer-frame-default-options ""
+ "Default options string to use for frames, should contains the [brackets].
+And example for this is \"[allowframebreaks]\"."
+ :group 'org-beamer
+ :type '(string :tag "[options]"))
+
+(defcustom org-beamer-column-view-format
+ "%45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)"
+ "Default column view format that should be used to fill the template."
+ :group 'org-beamer
+ :type '(string :tag "Beamer column view format"))
+
+(defcustom org-beamer-themes
+ "\\usetheme{default}\\usecolortheme{default}"
+ "Default string to be used for extra heading stuff in beamer presentations.
+When a beamer template is filled, this will be the default for
+BEAMER_HEADER_EXTRA, which will be inserted just before \\begin{document}."
+ :group 'org-beamer
+ :type '(string :tag "Beamer column view format"))
+
+(defconst org-beamer-column-widths
+ "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
+"The column widths that should be installed as allowed property values.")
+
+(defconst org-beamer-transitions
+ "\transblindsvertical \transblindshorizontal \transboxin \transboxout \transdissolve \transduration \transglitter \transsplithorizontalin \transsplithorizontalout \transsplitverticalin \transsplitverticalout \transwipe :ETC"
+ "Transitions available for beamer.
+These are just a completion help.")
+
+(defconst org-beamer-environments-default
+ '(("frame" "f" "dummy- special handling hard coded" "dummy")
+ ("columns" "C" "\\begin{columns}%o %% %h%x" "\\end{columns}")
+ ("column" "c" "\\begin{column}%o{%h\\textwidth}%x" "\\end{column}")
+ ("block" "b" "\\begin{block}%a{%h}%x" "\\end{block}")
+ ("alertblock" "a" "\\begin{alertblock}%a{%h}%x" "\\end{alertblock}")
+ ("verse" "v" "\\begin{verse}%a %% %h%x" "\\end{verse}")
+ ("quotation" "q" "\\begin{quotation}%a %% %h%x" "\\end{quotation}")
+ ("quote" "Q" "\\begin{quote}%a %% %h%x" "\\end{quote}")
+ ("structureenv" "s" "\\begin{structureenv}%a %% %h%x" "\\end{structureenv}")
+ ("theorem" "t" "\\begin{theorem}%a%U%x" "\\end{theorem}")
+ ("definition" "d" "\\begin{definition}%a%U%x" "\\end{definition}")
+ ("example" "e" "\\begin{example}%a%U%x" "\\end{example}")
+ ("proof" "p" "\\begin{proof}%a%U%x" "\\end{proof}")
+ ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}%x" "\\end{beamercolorbox}")
+ ("normal" "h" "%h" "") ; Emit the heading as normal text
+ ("note" "n" "\\note%o%a{%h" "}")
+ ("noteNH" "N" "\\note%o%a{" "}") ; note, ignore heading
+ ("ignoreheading" "i" "%%%% %h" ""))
+ "Environments triggered by properties in Beamer export.
+These are the defaults - for user definitions, see
+`org-beamer-environments-extra'.
+\"normal\" is a special fake environment, which emite the heading as
+normal text. It is needed when an environment should be surrounded
+by normal text. Since beamer export converts nodes into environments,
+you need to have a node to end the environment.
+For example
+
+ ** a frame
+ some text
+ *** Blocktitle :B_block:
+ inside the block
+ *** After the block :B_normal:
+ continuing here
+ ** next frame")
+
+(defcustom org-beamer-environments-extra nil
+ "Environments triggered by tags in Beamer export.
+Each entry has 4 elements:
+
+name Name of the environment
+key Selection key for `org-beamer-select-environment'
+open The opening template for the environment, with the following excapes
+ %a the action/overlay specification
+ %A the default action/overlay specification
+ %o the options argument of the template
+ %h the headline text
+ %H if there is headline text, that text in {} braces
+ %U if there is headline text, that text in [] brackets
+close The closing string of the environment."
+
+ :group 'org-beamer
+ :type '(repeat
+ (list
+ (string :tag "Environment")
+ (string :tag "Selection key")
+ (string :tag "Begin")
+ (string :tag "End"))))
+
+(defvar org-beamer-frame-level-now nil)
+(defvar org-beamer-header-extra nil)
+(defvar org-beamer-export-is-beamer-p nil)
+(defvar org-beamer-inside-frame-at-level nil)
+(defvar org-beamer-columns-open nil)
+(defvar org-beamer-column-open nil)
+
+(defun org-beamer-cleanup-column-width (width)
+ "Make sure the width is not empty, and that it has a unit."
+ (setq width (org-trim (or width "")))
+ (unless (string-match "\\S-" width) (setq width "0.5"))
+ (if (string-match "\\`[.0-9]+\\'" width)
+ (setq width (concat width "\\textwidth")))
+ width)
+
+(defun org-beamer-open-column (&optional width opt)
+ (org-beamer-close-column-maybe)
+ (setq org-beamer-column-open t)
+ (setq width (org-beamer-cleanup-column-width width))
+ (insert (format "\\begin{column}%s{%s}\n" (or opt "") width)))
+(defun org-beamer-close-column-maybe ()
+ (when org-beamer-column-open
+ (setq org-beamer-column-open nil)
+ (insert "\\end{column}\n")))
+(defun org-beamer-open-columns-maybe (&optional opts)
+ (unless org-beamer-columns-open
+ (setq org-beamer-columns-open t)
+ (insert (format "\\begin{columns}%s\n" (or opts "")))))
+(defun org-beamer-close-columns-maybe ()
+ (org-beamer-close-column-maybe)
+ (when org-beamer-columns-open
+ (setq org-beamer-columns-open nil)
+ (insert "\\end{columns}\n")))
+
+(defun org-beamer-select-environment ()
+ "Select the environment to be used by beamer for this entry.
+While this uses (for convenince) a tag selection interface, the result
+of this command will be that the BEAMER_env *property* of the entry is set.
+
+In addition to this, the command will also set a tag as a visual aid, but
+the tag does not have any semantic meaning."
+ (interactive)
+ (let* ((envs (append org-beamer-environments-extra
+ org-beamer-environments-default))
+ (org-tag-alist
+ (append '((:startgroup))
+ (mapcar (lambda (e) (cons (concat "B_" (car e))
+ (string-to-char (nth 1 e))))
+ envs)
+ '((:endgroup))
+ '(("BMCOL" . ?|))))
+ (org-fast-tag-selection-single-key t))
+ (org-set-tags)
+ (let ((tags (or (ignore-errors (org-get-tags-string)) "")))
+ (cond
+ ((equal org-last-tag-selection-key ?|)
+ (if (string-match ":BMCOL:" tags)
+ (org-set-property "BEAMER_col" (read-string "Column width: "))
+ (org-delete-property "BEAMER_col")))
+ ((string-match (concat ":B_\\("
+ (mapconcat 'car envs "\\|")
+ "\\):")
+ tags)
+ (org-entry-put nil "BEAMER_env" (match-string 1 tags)))
+ (t (org-entry-delete nil "BEAMER_env"))))))
+
+
+(defun org-beamer-sectioning (level text)
+ "Return the sectioning entry for the current headline.
+LEVEL is the reduced level of the headline.
+TEXT is the text of the headline, everything except the leading stars.
+The return value is a cons cell. The car is the headline text, usually
+just TEXT, but possibly modified if options have been extracted from the
+text. The cdr is the sectioning entry, similar to what is given
+in org-export-latex-classes."
+ (let* ((frame-level (or org-beamer-frame-level-now org-beamer-frame-level))
+ (default
+ (if org-beamer-use-parts
+ '((1 . ("\\part{%s}" . "\\part*{%s}"))
+ (2 . ("\\section{%s}" . "\\section*{%s}"))
+ (3 . ("\\subsection{%s}" . "\\subsection*{%s}")))
+ '((1 . ("\\section{%s}" . "\\section*{%s}"))
+ (2 . ("\\subsection{%s}" . "\\subsection*{%s}")))))
+ (envs (append org-beamer-environments-extra
+ org-beamer-environments-default))
+ (props (org-get-text-property-any 0 'org-props text))
+ (in "") (out "") option action defaction environment extra
+ columns-option column-option
+ env have-text ass tmp)
+ (if (= frame-level 0) (setq frame-level nil))
+ (when (and org-beamer-inside-frame-at-level
+ (<= level org-beamer-inside-frame-at-level))
+ (setq org-beamer-inside-frame-at-level nil))
+ (when (setq tmp (org-beamer-assoc-not-empty "BEAMER_col" props))
+ (if (and (string-match "\\`[0-9.]+\\'" tmp)
+ (or (= (string-to-number tmp) 1.0)
+ (= (string-to-number tmp) 0.0)))
+ ;; column width 1 means cloase columns, go back to full width
+ (org-beamer-close-columns-maybe)
+ (when (setq ass (assoc "BEAMER_envargs" props))
+ (let (case-fold-search)
+ (when (string-match "C\\(\\[[^][]*\\]\\)" (cdr ass))
+ (setq columns-option (match-string 1 (cdr ass)))
+ (setcdr ass (replace-match "" t t (cdr ass))))
+ (when (string-match "c\\(\\[[^][]*\\]\\)" (cdr ass))
+ (setq column-option (match-string 1 (cdr ass)))
+ (setcdr ass (replace-match "" t t (cdr ass))))))
+ (org-beamer-open-columns-maybe columns-option)
+ (org-beamer-open-column tmp column-option)))
+ (cond
+ ((or (equal (cdr (assoc "BEAMER_env" props)) "frame")
+ (and frame-level (= level frame-level)))
+ ;; A frame
+ (org-beamer-get-special props)
+
+ (setq in (org-fill-template
+ "\\begin{frame}%a%A%o%T%S%x"
+ (list (cons "a" (or action ""))
+ (cons "A" (or defaction ""))
+ (cons "o" (or option org-beamer-frame-default-options ""))
+ (cons "x" (if extra (concat "\n" extra) ""))
+ (cons "h" "%s")
+ (cons "T" (if (string-match "\\S-" text)
+ "\n\\frametitle{%s}" ""))
+ (cons "S" (if (string-match "\\\\\\\\" text)
+ "\n\\framesubtitle{%s}" ""))))
+ out (copy-sequence "\\end{frame}"))
+ (org-add-props out
+ '(org-insert-hook org-beamer-close-columns-maybe))
+ (setq org-beamer-inside-frame-at-level level)
+ (cons text (list in out in out)))
+ ((and (setq env (cdr (assoc "BEAMER_env" props)))
+ (setq ass (assoc env envs)))
+ ;; A beamer environment selected by the BEAMER_env property
+ (if (string-match "[ \t]+:[ \t]*$" text)
+ (setq text (replace-match "" t t text)))
+ (if (member env '("note" "noteNH"))
+ ;; There should be no labels in a note, so we remove the targets
+ ;; FIXME???
+ (remove-text-properties 0 (length text) '(target nil) text))
+ (org-beamer-get-special props)
+ (setq text (org-trim text))
+ (setq have-text (string-match "\\S-" text))
+ (setq in (org-fill-template
+ (nth 2 ass)
+ (list (cons "a" (or action ""))
+ (cons "A" (or defaction ""))
+ (cons "o" (or option ""))
+ (cons "x" (if extra (concat "\n" extra) ""))
+ (cons "h" "%s")
+ (cons "H" (if have-text (concat "{" text "}") ""))
+ (cons "U" (if have-text (concat "[" text "]") ""))))
+ out (nth 3 ass))
+ (cond
+ ((equal out "\\end{columns}")
+ (setq org-beamer-columns-open t)
+ (setq out (org-add-props (copy-sequence out)
+ '(org-insert-hook
+ (lambda ()
+ (org-beamer-close-column-maybe)
+ (setq org-beamer-columns-open nil))))))
+ ((equal out "\\end{column}")
+ (org-beamer-open-columns-maybe)))
+ (cons text (list in out in out)))
+ ((and (not org-beamer-inside-frame-at-level)
+ (or (not frame-level)
+ (< level frame-level))
+ (assoc level default))
+ ;; Normal sectioning
+ (cons text (cdr (assoc level default))))
+ (t nil))))
+
+(defvar extra)
+(defvar option)
+(defvar action)
+(defvar defaction)
+(defvar environment)
+(defun org-beamer-get-special (props)
+ "Extract an option, action, and default action string from text.
+The variables option, action, defaction, extra are all scoped into
+this function dynamically."
+ (let (tmp)
+ (setq environment (org-beamer-assoc-not-empty "BEAMER_env" props))
+ (setq extra (org-beamer-assoc-not-empty "BEAMER_extra" props))
+ (when extra
+ (setq extra (replace-regexp-in-string "\\\\n" "\n" extra)))
+ (setq tmp (org-beamer-assoc-not-empty "BEAMER_envargs" props))
+ (when tmp
+ (setq tmp (copy-sequence tmp))
+ (if (string-match "\\[<[^][<>]*>\\]" tmp)
+ (setq defaction (match-string 0 tmp)
+ tmp (replace-match "" t t tmp)))
+ (if (string-match "\\[[^][]*\\]" tmp)
+ (setq option (match-string 0 tmp)
+ tmp (replace-match "" t t tmp)))
+ (if (string-match "<[^<>]*>" tmp)
+ (setq action (match-string 0 tmp)
+ tmp (replace-match "" t t tmp))))))
+
+(defun org-beamer-assoc-not-empty (elt list)
+ (let ((tmp (cdr (assoc elt list))))
+ (and tmp (string-match "\\S-" tmp) tmp)))
+
+
+(defvar org-beamer-mode-map (make-sparse-keymap)
+ "The keymap for `org-beamer-mode'.")
+(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment)
+
+(define-minor-mode org-beamer-mode
+ "Special support for editing Org-mode files made to export to beamer."
+ nil " Bm" nil)
+(when (fboundp 'font-lock-add-keywords)
+ (font-lock-add-keywords
+ 'org-mode
+ '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
+ 'prepent))
+
+(defun org-beamer-place-default-actions-for-lists ()
+ "Find default overlay specifications in items, and move them.
+The need to be after the begin statement of the environment."
+ (when org-beamer-export-is-beamer-p
+ (let (dovl)
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^[ \t]*\\\\begin{\\(itemize\\|enumerate\\|desctiption\\)}[ \t\n]*\\\\item\\>\\( ?\\(<[^<>\n]*>\\|\\[[^][\n*]\\]\\)\\)?[ \t]*\\S-" nil t)
+ (if (setq dovl (cdr (assoc "BEAMER_dovl"
+ (get-text-property (match-end 0)
+ 'org-props))))
+ (save-excursion
+ (goto-char (1+ (match-end 1)))
+ (insert dovl)))))))
+
+(defun org-beamer-amend-header ()
+ "Add `org-beamer-header-extra' to the LaTeX herder.
+If the file contains the string BEAMER-HEADER-EXTRA-HERE on a line
+by itself, it will be replaced with `org-beamer-header-extra'. If not,
+the value will be inserted right after the documentclass statement."
+ (when (and org-beamer-export-is-beamer-p
+ org-beamer-header-extra)
+ (goto-char (point-min))
+ (cond
+ ((re-search-forward "^[ \t]*BEAMER-HEADER-EXTRA-HERE[ \t]*$" nil t)
+ (replace-match org-beamer-header-extra t t)
+ (or (bolp) (insert "\n")))
+ ((re-search-forward "^[ \t]*\\\\documentclass\\>" nil t)
+ (beginning-of-line 2)
+ (insert org-beamer-header-extra)
+ (or (bolp) (insert "\n"))))))
+
+(defcustom org-beamer-fragile-re "^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\)}"
+ "If this regexp matches in a frame, the frame is marked as fragile."
+ :group 'org-beamer
+ :type 'regexp)
+
+(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
+ "The special face for beamer tags."
+ :group 'org-beamer)
+
+
+;; Functions to initialize and post-process
+;; These fuctions will be hooked into various places in the export process
+
+(defun org-beamer-initialize-open-trackers ()
+ "Reset variables that track if certain environments are open during export."
+ (setq org-beamer-columns-open nil)
+ (setq org-beamer-column-open nil)
+ (setq org-beamer-inside-frame-at-level nil)
+ (setq org-beamer-export-is-beamer-p nil))
+
+(defun org-beamer-after-initial-vars ()
+ "Find special setings for beamer and store them.
+The effect is that these values will be accessible during export."
+ ;; First verify that we are exporting using the beamer class
+ (setq org-beamer-export-is-beamer-p
+ (string-match "\\\\documentclass\\(\\[[^][]*?\\]\\)?{beamer}"
+ org-export-latex-header))
+ (when org-beamer-export-is-beamer-p
+ ;; Find the frame level
+ (setq org-beamer-frame-level-now
+ (or (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (and (looking-at org-complex-heading-regexp)
+ (org-entry-get nil "BEAMER_FRAME_LEVEL" 'selective))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (and (re-search-forward
+ "^#\\+BEAMER_FRAME_LEVEL:[ \t]*\\(.*?\\)[ \t]*$" nil t)
+ (match-string 1))))
+ (plist-get org-export-latex-options-plist :beamer-frame-level)
+ org-beamer-frame-level))
+ ;; Normalize the value so that the functions can trust the value
+ (cond
+ ((not org-beamer-frame-level-now)
+ (setq org-beamer-frame-level-now nil))
+ ((stringp org-beamer-frame-level-now)
+ (setq org-beamer-frame-level-now
+ (string-to-number org-beamer-frame-level-now))))
+ ;; Find the header additons, most likely theme commands
+ (setq org-beamer-header-extra
+ (or (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (and (looking-at org-complex-heading-regexp)
+ (org-entry-get nil "BEAMER_HEADER_EXTRA"
+ 'selective))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (let ((txt ""))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^#\\+BEAMER_HEADER_EXTRA:[ \t]*\\(.*?\\)[ \t]*$"
+ nil t)
+ (setq txt (concat txt "\n" (match-string 1))))
+ (if (> (length txt) 0) (substring txt 1)))))
+ (plist-get org-export-latex-options-plist
+ :beamer-header-extra)))
+ (let ((inhibit-read-only t)
+ (case-fold-search nil)
+ props)
+ (org-unmodified
+ (remove-text-properties (point-min) (point-max) '(org-props nil))
+ (org-map-entries
+ '(progn
+ (setq props (org-entry-properties nil 'standard))
+ (if (and (not (assoc "BEAMER_env" props))
+ (looking-at ".*?:B_\\(note\\(NH\\)?\\):"))
+ (push (cons "BEAMER_env" (match-string 1)) props))
+ (put-text-property (point-at-bol) (point-at-eol) 'org-props props)))
+ (setq org-export-latex-options-plist
+ (plist-put org-export-latex-options-plist :tags nil))))))
+
+(defun org-beamer-auto-fragile-frames ()
+ "Mark any frames containing verbatim environments as fragile.
+This funcion will run in the final LaTeX document."
+ (when org-beamer-export-is-beamer-p
+ (let (opts)
+ (goto-char (point-min))
+ ;; Find something that might be fragile
+ (while (re-search-forward org-beamer-fragile-re nil t)
+ (save-excursion
+ ;; Are we inside a frame here?
+ (when (and (re-search-backward "^[ \t]*\\\\\\(begin\\|end\\){frame}"
+ nil t)
+ (equal (match-string 1) "begin"))
+ ;; yes, inside a frame, make sure "fragile" is one of the options
+ (goto-char (match-end 0))
+ (if (not (looking-at "\\[.*?\\]"))
+ (insert "[fragile]")
+ (setq opts (substring (match-string 0) 1 -1))
+ (delete-region (match-beginning 0) (match-end 0))
+ (setq opts (org-split-string opts ","))
+ (add-to-list 'opts "fragile")
+ (insert "[" (mapconcat 'identity opts ",") "]"))))))))
+
+(defcustom org-beamer-outline-frame-title "Outline"
+ "Default title of a frame containing an outline."
+ :group 'org-beamer
+ :type '(string :tag "Outline frame title")
+)
+
+(defcustom org-beamer-outline-frame-options nil
+ "Outline frame options appended after \\begin{frame}. You might
+want to put e.g. [allowframebreaks=0.9] here. Remember to include
+square brackets."
+ :group 'org-beamer
+ :type '(string :tag "Outline frame options")
+)
+
+(defun org-beamer-fix-toc ()
+ "Fix the table of contents by removing the vspace line."
+ (when org-beamer-export-is-beamer-p
+ (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward "\\(\\\\setcounter{tocdepth.*\n\\\\tableofcontents.*\n\\)\\(\\\\vspace\\*.*\\)"
+ nil t)
+ (replace-match
+ (concat "\\\\begin{frame}" org-beamer-outline-frame-options
+ "\n\\\\frametitle{"
+ org-beamer-outline-frame-title
+ "}\n\\1\\\\end{frame}")
+ t nil)))))
+
+(defun org-beamer-property-changed (property value)
+ "Track the BEAMER_env property with tags."
+ (cond
+ ((equal property "BEAMER_env")
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((tags (org-get-tags)))
+ (setq tags (delq nil (mapcar (lambda (x)
+ (if (string-match "^B_" x) nil x))
+ tags)))
+ (org-set-tags-to tags))
+ (when (and value (stringp value) (string-match "\\S-" value))
+ (org-toggle-tag (concat "B_" value) 'on))))
+ ((equal property "BEAMER_col")
+ (org-toggle-tag "BMCOL" (if (and value (string-match "\\S-" value))
+ 'on 'off)))))
+
+(defun org-beamer-select-beamer-code ()
+ "Take code marked for BEAMER and turn it into marked for LaTeX."
+ (when org-beamer-export-is-beamer-p
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^\\([ \]*#\\+\\(begin_\\|end_\\)?\\)\\(beamer\\)\\>" nil t)
+ (replace-match "\\1latex"))))
+
+;; OK, hook all these functions into appropriate places
+(add-hook 'org-export-first-hook
+ 'org-beamer-initialize-open-trackers)
+(add-hook 'org-property-changed-functions
+ 'org-beamer-property-changed)
+(add-hook 'org-export-latex-after-initial-vars-hook
+ 'org-beamer-after-initial-vars)
+(add-hook 'org-export-latex-final-hook
+ 'org-beamer-place-default-actions-for-lists)
+(add-hook 'org-export-latex-final-hook
+ 'org-beamer-auto-fragile-frames)
+(add-hook 'org-export-latex-final-hook
+ 'org-beamer-fix-toc)
+(add-hook 'org-export-latex-final-hook
+ 'org-beamer-amend-header)
+(add-hook 'org-export-preprocess-before-selecting-backend-code-hook
+ 'org-beamer-select-beamer-code)
+
+(defun org-beamer-settings-template (kind)
+ "Insert a settings template, to make sure users do this right."
+ (interactive (progn
+ (message "Current [s]ubtree or [g]lobal?")
+ (if (equal (read-char-exclusive) ?g)
+ (list 'global)
+ (list 'subtree))))
+ (if (eq kind 'subtree)
+ (progn
+ (org-back-to-heading t)
+ (org-reveal)
+ (org-entry-put nil "LaTeX_CLASS" "beamer")
+ (org-entry-put nil "LaTeX_CLASS_OPTIONS" "[presentation]")
+ (org-entry-put nil "EXPORT_FILE_NAME" "presentation.pdf")
+ (org-entry-put nil "BEAMER_FRAME_LEVEL" (number-to-string
+ org-beamer-frame-level))
+ (org-entry-put nil "BEAMER_HEADER_EXTRA" org-beamer-themes)
+ (org-entry-put nil "COLUMNS" org-beamer-column-view-format)
+ (org-entry-put nil "BEAMER_col_ALL" "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC"))
+ (insert "#+LaTeX_CLASS: beamer\n")
+ (insert "#+LaTeX_CLASS_OPTIONS: [presentation]\n")
+ (insert (format "#+BEAMER_FRAME_LEVEL: %d\n" org-beamer-frame-level) "\n")
+ (insert "#+BEAMER_HEADER_EXTRA: " org-beamer-themes "\n")
+ (insert "#+COLUMNS: " org-beamer-column-view-format "\n")
+ (insert "#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC\n")))
+
+
+(defun org-beamer-allowed-property-values (property)
+ "Supply allowed values for BEAMER properties."
+ (cond
+ ((and (equal property "BEAMER_env")
+ (not (org-entry-get nil (concat property "_ALL") 'inherit)))
+ ;; If no allowed values for BEAMER_env have been defined,
+ ;; supply all defined environments
+ (mapcar 'car (append org-beamer-environments-extra
+ org-beamer-environments-default)))
+ ((and (equal property "BEAMER_col")
+ (not (org-entry-get nil (concat property "_ALL") 'inherit)))
+ ;; If no allowed values for BEAMER_col have been defined,
+ ;; supply some
+ '("0.1" "0.2" "0.3" "0.4" "0.5" "0.6" "0.7" "0.8" "0.9" "" ":ETC"))
+ (t nil)))
+
+(add-hook 'org-property-allowed-value-functions
+ 'org-beamer-allowed-property-values)
+
+(provide 'org-beamer)
+
+;; arch-tag: 68bac91a-a946-43a3-8173-a9269306f67c
+
+;;; org-beamer.el ends here
;; Author: Bastien Guerry <bzg at altern dot org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
;; Keywords: org, wp, remember
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defcustom org-clock-out-when-done t
"When non-nil, clock will be stopped when the clocked entry is marked DONE.
-A nil value means, clock will keep running until stopped explicitly with
-`C-c C-x C-o', or until the clock is started in a different item."
+DONE here means any DONE-like state.
+A nil value means clock will keep running until stopped explicitly with
+`C-c C-x C-o', or until the clock is started in a different item.
+Instead of t, this can also be a list of TODO states that should trigger
+clocking out."
:group 'org-clock
- :type 'boolean)
+ :type '(choice
+ (const :tag "No" nil)
+ (const :tag "Yes, when done" t)
+ (repeat :tag "State list"
+ (string :tag "TODO keyword"))))
(defcustom org-clock-out-remove-zero-time-clocks nil
- "Non-nil means, remove the clock line when the resulting time is zero."
+ "Non-nil means remove the clock line when the resulting time is zero."
:group 'org-clock
:type 'boolean)
:type 'integer)
(defcustom org-clock-goto-may-find-recent-task t
- "Non-nil means, `org-clock-goto' can go to recent task if no active clock."
+ "Non-nil means `org-clock-goto' can go to recent task if no active clock."
:group 'org-clock
:type 'boolean)
(const :tag "All task time" all)
(const :tag "Automatically, `all' or since `repeat'" auto)))
+(defcustom org-task-overrun-text nil
+ "The extra modeline text that should indicate that the clock is overrun.
+The can be nil to indicate that instead of adding text, the clock time
+should get a different face (`org-mode-line-clock-overrun').
+When this is a string, it is prepended to the clock string as an indication,
+also using the face `org-mode-line-clock-overrun'."
+ :group 'org-clock
+ :type '(choice
+ (const :tag "Just mark the time string" nil)
+ (string :tag "Text to prepend")))
+
(defcustom org-show-notification-handler nil
"Function or program to send notification with.
The function or program will be called with the notification
(const :tag "Always" t)
(const :tag "When no clock is running" when-no-clock-is-running)))
+(defcustom org-clock-report-include-clocking-task nil
+ "When non-nil, include the current clocking task time in clock reports."
+ :group 'org-clock
+ :type 'boolean)
+
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
This hook is run before anything happens to the task that
(defvar org-clock-heading-for-remember "")
(defvar org-clock-start-time "")
-(defvar org-clock-left-over-time nil
+(defvar org-clock-leftover-time nil
"If non-nil, user cancelled a clock; this is when leftover time started.")
(defvar org-clock-effort ""
(mapc (lambda (m) (org-check-and-save-marker m beg end))
org-clock-history))
+(defun org-clocking-buffer ()
+ "Returns clocking buffer if we are currently clocking a task or nil"
+ (marker-buffer org-clock-marker))
+
+(defun org-clocking-p ()
+ "Returns t when clocking a task"
+ (not (equal (org-clocking-buffer) nil)))
+
(defun org-clock-select-task (&optional prompt)
"Select a task that recently was associated with clocking."
(interactive)
(insert (org-add-props "The task interrupted by starting the last one\n" nil 'face 'bold))
(setq s (org-clock-insert-selection-line ?i org-clock-interrupted-task))
(push s sel-list))
- (when (marker-buffer org-clock-marker)
+ (when (org-clocking-p)
(insert (org-add-props "Current Clocking Task\n" nil 'face 'bold))
(setq s (org-clock-insert-selection-line ?c org-clock-marker))
(push s sel-list))
(if (< i 10)
(+ i ?0)
(+ i (- ?A 10))) m))
+ (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
(push s sel-list)))
org-clock-history)
(org-fit-window-to-buffer)
(save-excursion
(save-restriction
(widen)
- (goto-char marker)
- (setq file (buffer-file-name (marker-buffer marker))
- cat (or (org-get-category)
- (progn (org-refresh-category-properties)
- (org-get-category)))
- heading (org-get-heading 'notags)
- prefix (save-excursion
- (org-back-to-heading t)
- (looking-at "\\*+ ")
- (match-string 0))
- task (substring
- (org-fontify-like-in-org-mode
- (concat prefix heading)
- org-odd-levels-only)
- (length prefix))))))
+ (ignore-errors
+ (goto-char marker)
+ (setq file (buffer-file-name (marker-buffer marker))
+ cat (or (org-get-category)
+ (progn (org-refresh-category-properties)
+ (org-get-category)))
+ heading (org-get-heading 'notags)
+ prefix (save-excursion
+ (org-back-to-heading t)
+ (looking-at "\\*+ ")
+ (match-string 0))
+ task (substring
+ (org-fontify-like-in-org-mode
+ (concat prefix heading)
+ org-odd-levels-only)
+ (length prefix)))))))
(when (and cat task)
(insert (format "[%c] %-15s %s\n" i cat task))
(cons i marker)))))
+(defvar org-task-overrun nil
+ "Internal flag indicating if the clock has overrun the planned time.")
+(defvar org-clock-update-period 60
+ "Number of seconds between mode line clock string updates.")
+
(defun org-clock-get-clock-string ()
- "Form a clock-string, that will be show in the mode line.
-If an effort estimate was defined for current item, use
+ "Form a clock-string, that will be shown in the mode line.
+If an effort estimate was defined for the current item, use
01:30/01:50 format (clocked/estimated).
If not, show simply the clocked time like 01:50."
(let* ((clocked-time (org-clock-get-clocked-time))
(h (floor clocked-time 60))
(m (- clocked-time (* 60 h))))
- (if (and org-clock-effort)
- (let* ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock-effort))
+ (if org-clock-effort
+ (let* ((effort-in-minutes
+ (org-hh:mm-string-to-minutes org-clock-effort))
(effort-h (floor effort-in-minutes 60))
- (effort-m (- effort-in-minutes (* effort-h 60))))
- (format (concat "-[" org-time-clocksum-format "/" org-time-clocksum-format " (%s)]")
- h m effort-h effort-m org-clock-heading))
- (format (concat "-[" org-time-clocksum-format " (%s)]")
- h m org-clock-heading))))
+ (effort-m (- effort-in-minutes (* effort-h 60)))
+ (work-done-str
+ (org-propertize
+ (format org-time-clocksum-format h m)
+ 'face (if (and org-task-overrun (not org-task-overrun-text))
+ 'org-mode-line-clock-overrun 'org-mode-line-clock)))
+ (effort-str (format org-time-clocksum-format effort-h effort-m))
+ (clockstr (org-propertize
+ (concat "[%s/" effort-str
+ "] (" (replace-regexp-in-string "%" "%%" org-clock-heading) ")")
+ 'face 'org-mode-line-clock)))
+ (format clockstr work-done-str))
+ (org-propertize (format
+ (concat "[" org-time-clocksum-format " (%s)]")
+ h m org-clock-heading)
+ 'face 'org-mode-line-clock))))
(defun org-clock-update-mode-line ()
+ (if org-clock-effort
+ (org-clock-notify-once-if-expired)
+ (setq org-task-overrun nil))
(setq org-mode-line-string
(org-propertize
(let ((clock-string (org-clock-get-clock-string))
(help-text "Org-mode clock is running.\nmouse-1 shows a menu\nmouse-2 will jump to task"))
(if (and (> org-clock-string-limit 0)
(> (length clock-string) org-clock-string-limit))
- (org-propertize (substring clock-string 0 org-clock-string-limit)
- 'help-echo (concat help-text ": " org-clock-heading))
+ (org-propertize
+ (substring clock-string 0 org-clock-string-limit)
+ 'help-echo (concat help-text ": " org-clock-heading))
(org-propertize clock-string 'help-echo help-text)))
'local-map org-clock-mode-line-map
'mouse-face (if (featurep 'xemacs) 'highlight 'mode-line-highlight)
- 'face 'org-mode-line-clock))
- (if org-clock-effort (org-clock-notify-once-if-expired))
+ ))
+ (if (and org-task-overrun org-task-overrun-text)
+ (setq org-mode-line-string
+ (concat (org-propertize
+ org-task-overrun-text
+ 'face 'org-mode-line-clock-overrun) org-mode-line-string)))
(force-mode-line-update))
(defun org-clock-get-clocked-time ()
(defun org-clock-notify-once-if-expired ()
"Show notification if we spent more time than we estimated before.
Notification is shown only once."
- (when (marker-buffer org-clock-marker)
+ (when (org-clocking-p)
(let ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock-effort))
(clocked-time (org-clock-get-clocked-time)))
- (if (>= clocked-time effort-in-minutes)
+ (if (setq org-task-overrun
+ (if (or (null effort-in-minutes) (zerop effort-in-minutes))
+ nil
+ (>= clocked-time effort-in-minutes)))
(unless org-clock-notification-was-shown
(setq org-clock-notification-was-shown t)
(org-notify
(org-clock-clock-out clock fail-quietly resolve-to)
(unless org-clock-clocking-in
(if close-p
- (setq org-clock-left-over-time resolve-to)
+ (setq org-clock-leftover-time resolve-to)
(org-clock-clock-in clock)))))))
(defun org-clock-resolve (clock &optional prompt-fn last-valid fail-quietly)
(goto-char (match-end 0)))
nil))))))
(let (char-pressed)
- (while (null char-pressed)
+ (if (featurep 'xemacs)
+ (progn
+ (message (concat (funcall prompt-fn clock)
+ " [(kK)eep (sS)ubtract (C)ancel]? "))
+ (setq char-pressed (read-char-exclusive)))
+ (while (or (null char-pressed)
+ (and (not (memq char-pressed '(?k ?K ?s ?S ?C ?i)))
+ (or (ding) t)))
(setq char-pressed
(read-char (concat (funcall prompt-fn clock)
- " [(kK)eep (sS)ubtract (C)ancel]? ")
+ " [(kK)p (sS)ub (C)ncl (i)gn]? ")
nil 45)))
- char-pressed))))
+ (and (not (eq char-pressed ?i)) char-pressed))))))
(default (floor (/ (org-float-time
(time-subtract (current-time) last-valid)) 60)))
(keep (and (memq ch '(?k ?K))
(defun org-user-idle-seconds ()
"Return the number of seconds the user has been idle for.
This routine returns a floating point number."
- (if (or (eq system-type 'darwin) (eq window-system 'x))
- (let ((emacs-idle (org-emacs-idle-seconds)))
- ;; If Emacs has been idle for longer than the user's
- ;; `org-clock-idle-time' value, check whether the whole system has
- ;; really been idle for that long.
- (if (> emacs-idle (* 60 org-clock-idle-time))
- (min emacs-idle (if (eq system-type 'darwin)
- (org-mac-idle-seconds)
- (org-x11-idle-seconds)))
- emacs-idle))
- (org-emacs-idle-seconds)))
+ (cond
+ ((eq system-type 'darwin)
+ (org-mac-idle-seconds))
+ ((eq window-system 'x)
+ (org-x11-idle-seconds))
+ (t
+ (org-emacs-idle-seconds))))
(defvar org-clock-user-idle-seconds)
so long."
(when (and org-clock-idle-time (not org-clock-resolving-clocks)
org-clock-marker)
- (let ((org-clock-user-idle-seconds (org-user-idle-seconds))
- (org-clock-user-idle-start
- (time-subtract (current-time)
- (seconds-to-time org-clock-user-idle-seconds)))
- (org-clock-resolving-clocks-due-to-idleness t))
+ (let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
+ (org-clock-user-idle-start
+ (time-subtract (current-time)
+ (seconds-to-time org-clock-user-idle-seconds)))
+ (org-clock-resolving-clocks-due-to-idleness t))
(if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
(org-clock-resolve
(cons org-clock-marker
(setq org-clock-notification-was-shown nil)
(catch 'abort
(let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
- (marker-buffer org-clock-marker)))
+ (org-clocking-p)))
ts selected-task target-pos (msg-extra "")
- (left-over (and (not org-clock-resolving-clocks)
- org-clock-left-over-time)))
+ (leftover (and (not org-clock-resolving-clocks)
+ org-clock-leftover-time)))
(when (and org-clock-auto-clock-resolution
(or (not interrupting)
(eq t org-clock-auto-clock-resolution))
(not org-clock-clocking-in)
(not org-clock-resolving-clocks))
- (setq org-clock-left-over-time nil)
+ (setq org-clock-leftover-time nil)
(let ((org-clock-clocking-in t))
(org-resolve-clocks))) ; check if any clocks are dangling
(when (equal select '(4))
(when interrupting
;; We are interrupting the clocking of a different task.
;; Save a marker to this task, so that we can go back.
- (move-marker org-clock-interrupted-task
- (marker-position org-clock-marker)
- (marker-buffer org-clock-marker))
- (org-clock-out t))
-
+ ;; First check if we are trying to clock into the same task!
+ (if (save-excursion
+ (unless selected-task
+ (org-back-to-heading t))
+ (and (equal (marker-buffer org-clock-hd-marker)
+ (if selected-task
+ (marker-buffer selected-task)
+ (current-buffer)))
+ (= (marker-position org-clock-hd-marker)
+ (if selected-task
+ (marker-position selected-task)
+ (point)))))
+ (message "Clock continues in \"%s\"" org-clock-heading)
+ (progn
+ (move-marker org-clock-interrupted-task
+ (marker-position org-clock-marker)
+ (org-clocking-buffer))
+ (org-clock-out t))))
+
(when (equal select '(16))
;; Mark as default clocking task
(org-clock-mark-default-task))
-
+
;; Clock in at which position?
(setq target-pos
(if (and (eobp) (not (org-on-heading-p)))
(org-back-to-heading t)
(or interrupting (move-marker org-clock-interrupted-task nil))
(org-clock-history-push)
+ (org-clock-set-current)
(cond ((functionp org-clock-in-switch-to-state)
(looking-at org-complex-heading-regexp)
(let ((newstate (funcall org-clock-in-switch-to-state
(functionp org-clock-heading-function))
(funcall org-clock-heading-function))
((looking-at org-complex-heading-regexp)
- (match-string 4))
+ (replace-regexp-in-string
+ "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
+ (match-string 4)))
(t "???")))
(setq org-clock-heading (org-propertize org-clock-heading
'face nil))
(setq org-clock-total-time (org-clock-sum-current-item
(org-clock-get-sum-start)))
(setq org-clock-start-time
- (or (and left-over
+ (or (and leftover
(y-or-n-p
(format
"You stopped another clock %d mins ago; start this one from then? "
(/ (- (org-float-time (current-time))
- (org-float-time left-over)) 60)))
- left-over)
+ (org-float-time leftover)) 60)))
+ leftover)
(current-time)))
(setq ts (org-insert-time-stamp org-clock-start-time
'with-hm 'inactive))))
(cancel-timer org-clock-mode-line-timer)
(setq org-clock-mode-line-timer nil))
(setq org-clock-mode-line-timer
- (run-with-timer 60 60 'org-clock-update-mode-line))
+ (run-with-timer org-clock-update-period
+ org-clock-update-period
+ 'org-clock-update-mode-line))
(when org-clock-idle-timer
(cancel-timer org-clock-idle-timer)
(setq org-clock-idle-timer nil))
(message "Clock starts at %s - %s" ts msg-extra)
(run-hooks 'org-clock-in-hook)))))))
+(defvar org-clock-current-task nil
+ "Task currently clocked in.")
+(defun org-clock-set-current ()
+ "Set `org-clock-current-task' to the task currently clocked in."
+ (setq org-clock-current-task (org-get-heading)))
+(defun org-clock-delete-current ()
+ "Reset `org-clock-current-task' to nil."
+ (setq org-clock-current-task nil))
+
(defun org-clock-mark-default-task ()
"Mark current task as default task."
(interactive)
If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(interactive)
(catch 'exit
- (if (not (marker-buffer org-clock-marker))
+ (if (not (org-clocking-p))
(if fail-quietly (throw 'exit t) (error "No active clock")))
(let (ts te s h m remove)
(save-excursion
- (set-buffer (marker-buffer org-clock-marker))
+ (set-buffer (org-clocking-buffer))
(save-restriction
(widen)
(goto-char org-clock-marker)
(when org-clock-out-switch-to-state
(save-excursion
(org-back-to-heading t)
- (let ((org-inhibit-logging t))
+ (let ((org-inhibit-logging t)
+ (org-clock-out-when-done nil))
(cond
((functionp org-clock-out-switch-to-state)
(looking-at org-complex-heading-regexp)
(force-mode-line-update)
(message (concat "Clock stopped at %s after HH:MM = " org-time-clocksum-format "%s") te h m
(if remove " => LINE REMOVED" ""))
- (run-hooks 'org-clock-out-hook))))))
+ (run-hooks 'org-clock-out-hook)
+ (org-clock-delete-current))))))
(defun org-clock-cancel ()
"Cancel the running clock be removing the start timestamp."
(interactive)
- (if (not (marker-buffer org-clock-marker))
+ (if (not (org-clocking-p))
(error "No active clock"))
(save-excursion
- (set-buffer (marker-buffer org-clock-marker))
+ (set-buffer (org-clocking-buffer))
(goto-char org-clock-marker)
(delete-region (1- (point-at-bol)) (point-at-eol))
;; Just in case, remove any empty LOGBOOK left over
(select
(or (org-clock-select-task "Select task to go to: ")
(error "No task selected")))
- ((marker-buffer org-clock-marker) org-clock-marker)
+ ((org-clocking-p) org-clock-marker)
((and org-clock-goto-may-find-recent-task
(car org-clock-history)
(marker-buffer (car org-clock-history)))
(org-back-to-heading t)
(org-cycle-hide-drawers 'children)
(recenter)
+ (org-reveal)
(if recent
(message "No running clock, this is the most recently clocked task"))
(run-hooks 'org-clock-goto-hook)))
(setq t1 (+ t1 (string-to-number (match-string 5))
(* 60 (string-to-number (match-string 4))))))
(t ;; A headline
+ ;; Add the currently clocking item time to the total
+ (when (and org-clock-report-include-clocking-task
+ (equal (org-clocking-buffer) (current-buffer))
+ (equal (marker-position org-clock-hd-marker) (point)))
+ (let ((time (floor (- (org-float-time)
+ (org-float-time org-clock-start-time)) 60)))
+ (setq t1 (+ t1 time))))
(setq level (- (match-end 1) (match-beginning 1)))
(when (or (> t1 0) (> (aref ltimes level) 0))
(loop for l from 0 to level do
This is used to stop the clock after a TODO entry is marked DONE,
and is only done if the variable `org-clock-out-when-done' is not nil."
(when (and org-clock-out-when-done
- (member state org-done-keywords)
- (equal (or (buffer-base-buffer (marker-buffer org-clock-marker))
- (marker-buffer org-clock-marker))
+ (or (and (eq t org-clock-out-when-done)
+ (member state org-done-keywords))
+ (and (listp org-clock-out-when-done)
+ (member state org-clock-out-when-done)))
+ (equal (or (buffer-base-buffer (org-clocking-buffer))
+ (org-clocking-buffer))
(or (buffer-base-buffer (current-buffer))
(current-buffer)))
(< (point) org-clock-marker)
(> (save-excursion (outline-next-heading) (point))
org-clock-marker))
;; Clock out, but don't accept a logging message for this.
- (let ((org-log-note-clock-out nil))
+ (let ((org-log-note-clock-out nil)
+ (org-clock-out-switch-to-state nil))
(org-clock-out))))
(add-hook 'org-after-todo-state-change-hook
system-name (format-time-string
(cdr org-time-stamp-formats))))
(if (and (memq org-clock-persist '(t clock))
- (setq b (marker-buffer org-clock-marker))
+ (setq b (org-clocking-buffer))
(setq b (or (buffer-base-buffer b) b))
(buffer-live-p b)
(buffer-file-name b)
(substring-no-properties org-clock-heading)
") "))))
(insert "(setq resume-clock '(\""
- (buffer-file-name (marker-buffer org-clock-marker))
+ (buffer-file-name (org-clocking-buffer))
"\" . " (int-to-string (marker-position org-clock-marker))
"))\n"))
;; Store clocked task history. Tasks are stored reversed to make
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
((equal key "SCHEDULED")
(setq eval '(org-with-point-at pom
(call-interactively 'org-schedule))))
+ ((equal key "BEAMER_env")
+ (setq eval '(org-with-point-at pom
+ (call-interactively 'org-beamer-set-environment-tag))))
(t
(setq allowed (org-property-get-allowed-values pom key 'table))
(if allowed
- (setq nval (org-icompleting-read "Value: " allowed nil t))
+ (setq nval (org-icompleting-read
+ "Value: " allowed nil
+ (not (get-text-property 0 'org-unrestricted
+ (caar allowed)))))
(setq nval (read-string "Edit: " value)))
(setq nval (org-trim nval))
(when (not (equal nval value))
This will add overlays to the date lines, to show the summary for each day."
(let* ((fmt (mapcar (lambda (x)
(if (equal (car x) "CLOCKSUM")
- (list "CLOCKSUM" (nth 2 x) nil 'add_times nil '+ 'identity)
- (cdr x)))
+ (list "CLOCKSUM" (nth 1 x) (nth 2 x) ":" 'add_times
+ nil '+ nil)
+ x))
org-columns-current-fmt-compiled))
- line c c1 stype calc sumfunc props lsum entries prop v)
+ line c c1 stype calc sumfunc props lsum entries prop v title)
(catch 'exit
(when (delq nil (mapcar 'cadr fmt))
;; OK, at least one summation column, it makes sense to try this
(mapcar
(lambda (f)
(setq prop (car f)
- stype (nth 3 f)
- sumfunc (nth 5 f)
- calc (or (nth 6 f) 'identity))
+ title (nth 1 f)
+ stype (nth 4 f)
+ sumfunc (nth 6 f)
+ calc (or (nth 7 f) 'identity))
(cond
((equal prop "ITEM")
(cons prop (buffer-substring (point-at-bol)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(time-to-seconds (or time (current-time)))
(float-time time)))
+; XEmacs does not have `looking-back'.
+(if (fboundp 'looking-back)
+ (defalias 'org-looking-back 'looking-back)
+ (defun org-looking-back (regexp &optional limit greedy)
+ "Return non-nil if text before point matches regular expression REGEXP.
+Like `looking-at' except matches before point, and is slower.
+LIMIT if non-nil speeds up the search by specifying a minimum
+starting position, to avoid checking matches that would start
+before LIMIT.
+
+If GREEDY is non-nil, extend the match backwards as far as
+possible, stopping when a single additional previous character
+cannot be part of a match for REGEXP. When the match is
+extended, its starting position is allowed to occur before
+LIMIT."
+ (let ((start (point))
+ (pos
+ (save-excursion
+ (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
+ (point)))))
+ (if (and greedy pos)
+ (save-restriction
+ (narrow-to-region (point-min) start)
+ (while (and (> pos (point-min))
+ (save-excursion
+ (goto-char pos)
+ (backward-char 1)
+ (looking-at (concat "\\(?:" regexp "\\)\\'"))))
+ (setq pos (1- pos)))
+ (save-excursion
+ (goto-char pos)
+ (looking-at (concat "\\(?:" regexp "\\)\\'")))))
+ (not (null pos)))))
+
(provide 'org-compat)
;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe
;; Emacs Lisp Archive Entry
;; Filename: org-crypt.el
-;; Version: 6.33x
+;; Version: 6.35i
;; Keywords: org-mode
;; Author: John Wiegley <johnw@gnu.org>
;; Maintainer: Peter Jones <pjones@pmade.com>
"Returns the encryption key for the current heading."
(save-excursion
(org-back-to-heading t)
- (or (org-entry-get nil "CRYPTKEY" 'selective)
+ (or (org-entry-get nil "CRYPTKEY" 'selective)
org-crypt-key
(and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to)
(error "No crypt key set"))))
(org-back-over-empty-lines)
(setq end (point)
encrypted-text
- (epg-encrypt-string
+ (epg-encrypt-string
epg-context
(buffer-substring-no-properties beg end)
(epg-list-keys epg-context crypt-key)))
nil))))
(defun org-decrypt-entry ()
+ "Decrypt the content of the current headline."
(interactive)
(require 'epg)
(save-excursion
(forward-line)
(when (looking-at "-----BEGIN PGP MESSAGE-----")
(let* ((beg (point))
- (end (save-excursion
+ (end (save-excursion
(search-forward "-----END PGP MESSAGE-----")
(forward-line)
(point)))
(epg-context (epg-make-context nil t t))
- (decrypted-text
+ (decrypted-text
(decode-coding-string
(epg-decrypt-string
epg-context
nil))))
(defun org-encrypt-entries ()
+ "Encrypt all top-level entries in the current buffer."
(interactive)
(org-scan-tags
'org-encrypt-entry
(cdr (org-make-tags-matcher org-crypt-tag-matcher))))
(defun org-decrypt-entries ()
+ "Decrypt all entries in the current buffer."
(interactive)
- (org-scan-tags
+ (org-scan-tags
'org-decrypt-entry
(cdr (org-make-tags-matcher org-crypt-tag-matcher))))
(defun org-crypt-use-before-save-magic ()
"Adds a hook that will automatically encrypt entries before a
file is saved to disk."
- (add-hook
- 'org-mode-hook
+ (add-hook
+ 'org-mode-hook
(lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
-
+
+(add-hook 'org-reveal-start-hook 'org-decrypt-entry)
+
(provide 'org-crypt)
;; arch-tag: 8202ed2c-221e-4001-9e4b-54674a7e846e
--- /dev/null
+;;; org-ctags.el - Integrate Emacs "tags" facility with org mode.
+;;
+;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+;; Author: Paul Sexton <eeeickythump@gmail.com>
+;; Version: 1.0
+
+;; Keywords: org, wp
+;; Version: 6.35i
+;;
+;; 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/>.
+
+;;
+;; Synopsis
+;; ========
+;;
+;; Allows org-mode to make use of the Emacs `etags' system. Defines tag
+;; destinations in org-mode files as any text between <<double angled
+;; brackets>>. This allows the tags-generation program `exuberant ctags' to
+;; parse these files and create tag tables that record where these
+;; destinations are found. Plain [[links]] in org mode files which do not have
+;; <<matching destinations>> within the same file will then be interpreted as
+;; links to these 'tagged' destinations, allowing seamless navigation between
+;; multiple org-mode files. Topics can be created in any org mode file and
+;; will always be found by plain links from other files. Other file types
+;; recognised by ctags (source code files, latex files, etc) will also be
+;; available as destinations for plain links, and similarly, org-mode links
+;; will be available as tags from source files. Finally, the function
+;; `org-ctags-find-tag-interactive' lets you choose any known tag, using
+;; autocompletion, and quickly jump to it.
+;;
+;; Installation
+;; ============
+;;
+;; Install org mode
+;; Ensure org-ctags.el is somewhere in your emacs load path.
+;; Download and install Exuberant ctags -- "http://ctags.sourceforge.net/"
+;; Edit your .emacs file (see next section) and load emacs.
+
+;; To put in your init file (.emacs):
+;; ==================================
+;;
+;; Assuming you already have org mode installed and set up:
+;;
+;; (setq org-ctags-path-to-ctags "/path/to/ctags/executable")
+;; (add-hook 'org-mode-hook
+;; (lambda ()
+;; (define-key org-mode-map "\C-co" 'org-ctags-find-tag-interactive)))
+;;
+;; By default, with org-ctags loaded, org will first try and visit the tag
+;; with the same name as the link; then, if unsuccessful, ask the user if
+;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
+;; the user wishes to append 'tag' as a new toplevel heading at the end of
+;; the buffer; and finally, defer to org's default behaviour which is to
+;; search the entire text of the current buffer for 'tag'.
+;;
+;; This behaviour can be modified by changing the value of
+;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
+;; .emacs, which describes the same behaviour as the above paragraph with
+;; one difference:
+;;
+;; (setq org-ctags-open-link-functions
+;; '(org-ctags-find-tag
+;; org-ctags-ask-rebuild-tags-file-then-find-tag
+;; org-ctags-ask-append-topic
+;; org-ctags-fail-silently)) ; <-- prevents org default behaviour
+;;
+;;
+;; Usage
+;; =====
+;;
+;; When you click on a link "[[foo]]" and org cannot find a matching "<<foo>>"
+;; in the current buffer, the tags facility will take over. The file TAGS in
+;; the active directory is examined to see if the tags facility knows about
+;; "<<foo>>" in any other files. If it does, the matching file will be opened
+;; and the cursor will jump to the position of "<<foo>>" in that file.
+;;
+;; User-visible functions:
+;; - `org-ctags-find-tag-interactive': type a tag (plain link) name and visit
+;; it. With autocompletion. Bound to ctrl-O in the above setup.
+;; - All the etags functions should work. These include:
+;;
+;; M-. `find-tag' -- finds the tag at point
+;;
+;; C-M-. find-tag based on regular expression
+;;
+;; M-x tags-search RET -- like C-M-. but searches through ENTIRE TEXT
+;; of ALL the files referenced in the TAGS file. A quick way to
+;; search through an entire 'project'.
+;;
+;; M-* "go back" from a tag jump. Like `org-mark-ring-goto'.
+;; You may need to bind this key yourself with (eg)
+;; (global-set-key (kbd "<M-kp-multiply>") 'pop-tag-mark)
+;;
+;; (see etags chapter in Emacs manual for more)
+;;
+;;
+;; Keeping the TAGS file up to date
+;; ================================
+;;
+;; Tags mode has no way of knowing that you have created new tags by typing in
+;; your org-mode buffer. New tags make it into the TAGS file in 3 ways:
+;;
+;; 1. You re-run (org-ctags-create-tags "directory") to rebuild the file.
+;; 2. You put the function `org-ctags-ask-rebuild-tags-file-then-find-tag' in
+;; your `org-open-link-functions' list, as is done in the setup
+;; above. This will cause the TAGS file to be rebuilt whenever a link
+;; cannot be found. This may be slow with large file collections however.
+;; 3. You run the following from the command line (all 1 line):
+;;
+;; ctags --langdef=orgmode --langmap=orgmode:.org
+;; --regex-orgmode="/<<([^>]+)>>/\1/d,definition/"
+;; -f /your/path/TAGS -e -R /your/path/*.org
+;;
+;; If you are paranoid, you might want to run (org-ctags-create-tags
+;; "/path/to/org/files") at startup, by including the following toplevel form
+;; in .emacs. However this can cause a pause of several seconds if ctags has
+;; to scan lots of files.
+;;
+;; (progn
+;; (message "-- rebuilding tags tables...")
+;; (mapc 'org-create-tags tags-table-list))
+
+(eval-when-compile (require 'cl))
+(require 'org)
+
+(defgroup org-ctags nil
+ "Options concerning use of ctags within org mode."
+ :tag "Org-Ctags"
+ :group 'org-link)
+
+(defvar org-ctags-enabled-p t
+ "Activate ctags support in org mode?")
+
+(defvar org-ctags-tag-regexp "/<<([^>]+)>>/\\1/d,definition/"
+ "Regexp expression used by ctags external program, that matches
+tag destinations in org-mode files.
+Format is: /REGEXP/TAGNAME/FLAGS,TAGTYPE/
+See the ctags documentation for more information.")
+
+(defcustom org-ctags-path-to-ctags
+ (case system-type
+ (windows-nt "ctags.exe")
+ (darwin "ctags-exuberant")
+ (t "ctags-exuberant"))
+ "Full path to the ctags executable file."
+ :group 'org-ctags
+ :type 'file)
+
+(defcustom org-ctags-open-link-functions
+ '(org-ctags-find-tag
+ org-ctags-ask-rebuild-tags-file-then-find-tag
+ org-ctags-ask-append-topic)
+ "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS when
+ORG-CTAGS is active."
+ :group 'org-ctags
+ :type 'hook
+ :options '(org-ctags-find-tag
+ org-ctags-ask-rebuild-tags-file-then-find-tag
+ org-ctags-rebuild-tags-file-then-find-tag
+ org-ctags-ask-append-topic
+ org-ctags-append-topic
+ org-ctags-ask-visit-buffer-or-file
+ org-ctags-visit-buffer-or-file
+ org-ctags-fail-silently))
+
+
+(defvar org-ctags-tag-list nil
+ "List of all tags in the active TAGS file. Created as a local
+variable in each buffer.")
+
+(defcustom org-ctags-new-topic-template
+ "* <<%t>>\n\n\n\n\n\n"
+ "Text to insert when creating a new org file via opening a hyperlink.
+The following patterns are replaced in the string:
+ `%t' - replaced with the capitalized title of the hyperlink"
+ :group 'org-ctags
+ :type 'string)
+
+
+(add-hook 'org-mode-hook
+ (lambda ()
+ (when (and org-ctags-enabled-p
+ (buffer-file-name))
+ ;; Make sure this file's directory is added to default
+ ;; directories in which to search for tags.
+ (let ((tags-filename
+ (expand-file-name
+ (concat (file-name-directory (buffer-file-name))
+ "/TAGS"))))
+ (when (file-exists-p tags-filename)
+ (visit-tags-table tags-filename))))))
+
+
+(defadvice visit-tags-table (after org-ctags-load-tag-list activate compile)
+ (when (and org-ctags-enabled-p tags-file-name)
+ (set (make-local-variable 'org-ctags-tag-list)
+ (org-ctags-all-tags-in-current-tags-table))))
+
+
+(defun org-ctags-enable ()
+ (put 'org-mode 'find-tag-default-function 'org-ctags-find-tag-at-point)
+ (setq org-ctags-enabled-p t)
+ (dolist (fn org-ctags-open-link-functions)
+ (add-hook 'org-open-link-functions fn t)))
+
+
+;;; General utility functions. ===============================================
+;; These work outside org-ctags mode.
+
+(defun org-ctags-get-filename-for-tag (tag)
+ "TAG is a string. Search the active TAGS file for a matching tag,
+and if found, return a list containing the filename, line number, and
+buffer position where the tag is found."
+ (interactive "sTag: ")
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (save-excursion
+ (visit-tags-table-buffer 'same)
+ (when tags-file-name
+ (with-current-buffer (get-file-buffer tags-file-name)
+ (goto-char (point-min))
+ (cond
+ ((re-search-forward (format "^.*\7f%s\ 1\\([0-9]+\\),\\([0-9]+\\)$"
+ (regexp-quote tag)) nil t)
+ (let ((line (string-to-number (match-string 1)))
+ (pos (string-to-number (match-string 2))))
+ (cond
+ ((re-search-backward "\f\n\\(.*\\),[0-9]+\n")
+ (list (match-string 1) line pos))
+ (t ; can't find a file name preceding the matched
+ ; tag??
+ (error "Malformed TAGS file: %s" (buffer-name))))))
+ (t ; tag not found
+ nil))))))
+
+
+(defun org-ctags-all-tags-in-current-tags-table ()
+ "Read all tags defined in the active TAGS file, into a list of strings.
+Return the list."
+ (interactive)
+ (let ((taglist nil))
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (save-excursion
+ (visit-tags-table-buffer 'same)
+ (with-current-buffer (get-file-buffer tags-file-name)
+ (goto-char (point-min))
+ (while (re-search-forward "^.*\7f\\(.*\\)\ 1\\([0-9]+\\),\\([0-9]+\\)$"
+ nil t)
+ (push (substring-no-properties (match-string 1)) taglist)))
+ taglist)))
+
+
+(defun org-ctags-string-search-and-replace (search replace string)
+ "Replace all instances of SEARCH with REPLACE in STRING."
+ (replace-regexp-in-string (regexp-quote search) replace string t t))
+
+
+(defun y-or-n-minibuffer (prompt)
+ (let ((use-dialog-box nil))
+ (y-or-n-p prompt)))
+
+
+;;; Internal functions =======================================================
+
+
+(defun org-ctags-open-file (name &optional title)
+ "Visit or create a file called `NAME.org', and insert a new topic titled
+NAME (or TITLE if supplied)."
+ (interactive "sFile name: ")
+ (let ((filename (substitute-in-file-name (expand-file-name name))))
+ (condition-case v
+ (progn
+ (org-open-file name t)
+ (message "Opened file OK")
+ (goto-char (point-max))
+ (insert (org-ctags-string-search-and-replace
+ "%t" (capitalize (or title name))
+ org-ctags-new-topic-template))
+ (message "Inserted new file text OK")
+ (org-mode-restart))
+ (error (error "Error %S in org-ctags-open-file" v)))))
+
+
+;;;; Misc interoperability with etags system =================================
+
+
+(defadvice find-tag (before org-ctags-set-org-mark-before-finding-tag
+ activate compile)
+ "Before trying to find a tag, save our current position on org mark ring."
+ (save-excursion
+ (if (and (org-mode-p) org-ctags-enabled-p)
+ (org-mark-ring-push))))
+
+
+
+(defun org-ctags-find-tag-at-point ()
+ "Determine default tag to search for, based on text at point.
+If there is no plausible default, return nil."
+ (let (from to bound)
+ (when (or (ignore-errors
+ ;; Look for hyperlink around `point'.
+ (save-excursion
+ (search-backward "[[") (setq from (+ 2 (point))))
+ (save-excursion
+ (goto-char from)
+ (search-forward "]") (setq to (- (point) 1)))
+ (and (> to from) (>= (point) from) (<= (point) to)))
+ (progn
+ ;; Look at text around `point'.
+ (save-excursion
+ (skip-syntax-backward "w_") (setq from (point)))
+ (save-excursion
+ (skip-syntax-forward "w_") (setq to (point)))
+ (> to from))
+ ;; Look between `line-beginning-position' and `point'.
+ (save-excursion
+ (and (setq bound (line-beginning-position))
+ (skip-syntax-backward "^w_" bound)
+ (> (setq to (point)) bound)
+ (skip-syntax-backward "w_")
+ (setq from (point))))
+ ;; Look between `point' and `line-end-position'.
+ (save-excursion
+ (and (setq bound (line-end-position))
+ (skip-syntax-forward "^w_" bound)
+ (< (setq from (point)) bound)
+ (skip-syntax-forward "w_")
+ (setq to (point)))))
+ (buffer-substring-no-properties from to))))
+
+
+;;; Functions for use with 'org-open-link-functions' hook =================
+
+
+(defun org-ctags-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Look for a tag called `NAME' in the current TAGS table. If it is found,
+visit the file and location where the tag is found."
+ (interactive "sTag: ")
+ (let ((old-buf (current-buffer))
+ (old-pnt (point-marker))
+ (old-mark (copy-marker (mark-marker))))
+ (condition-case nil
+ (progn (find-tag name)
+ t)
+ (error
+ ;; only restore old location if find-tag raises error
+ (set-buffer old-buf)
+ (goto-char old-pnt)
+ (set-marker (mark-marker) old-mark)
+ nil))))
+
+
+(defun org-ctags-visit-buffer-or-file (name &optional create)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Visit buffer named `NAME.org'. If there is no such buffer, visit the file
+with the same name if it exists. If the file does not exist, then behaviour
+depends on the value of CREATE.
+
+If CREATE is nil (default), then return nil. Do not create a new file.
+If CREATE is t, create the new file and visit it.
+If CREATE is the symbol `ask', then ask the user if they wish to create
+the new file."
+ (interactive)
+ (let ((filename (concat (substitute-in-file-name
+ (expand-file-name name))
+ ".org")))
+ (cond
+ ((get-buffer (concat name ".org"))
+ ;; Buffer is already open
+ (switch-to-buffer (get-buffer (concat name ".org"))))
+ ((file-exists-p filename)
+ ;; File exists but is not open --> open it
+ (message "Opening existing org file `%S'..."
+ filename)
+ (org-open-file filename t))
+ ((or (eql create t)
+ (and (eql create 'ask)
+ (y-or-n-p (format "File `%s.org' not found; create?" name))))
+ (org-ctags-open-file filename name))
+ (t ;; File does not exist, and we don't want to create it.
+ nil))))
+
+
+(defun org-ctags-ask-visit-buffer-or-file (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-visit-buffer-or-file, which ensures the user is
+asked before creating a new file."
+ (org-ctags-visit-buffer-or-file name 'ask))
+
+
+(defun org-ctags-append-topic (name &optional narrowp)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Append a new toplevel heading to the end of the current buffer. The
+heading contains NAME surrounded by <<angular brackets>>, thus making
+the heading a destination for the tag `NAME'."
+ (interactive "sTopic: ")
+ (widen)
+ (goto-char (point-max))
+ (newline 2)
+ (message "Adding topic in buffer %s" (buffer-name))
+ (insert (org-ctags-string-search-and-replace
+ "%t" (capitalize name) org-ctags-new-topic-template))
+ (backward-char 4)
+ (org-update-radio-target-regexp)
+ (end-of-line)
+ (forward-line 2)
+ (when narrowp
+ ;;(org-tree-to-indirect-buffer 1) ;; opens new frame
+ (org-narrow-to-subtree))
+ t)
+
+
+(defun org-ctags-ask-append-topic (name &optional narrowp)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-append-topic, which first asks the user if they want
+to append a new topic."
+ (if (y-or-n-p (format "Topic `%s' not found; append to end of buffer?"
+ name))
+ (org-ctags-append-topic name narrowp)
+ nil))
+
+
+(defun org-ctags-rebuild-tags-file-then-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Like ORG-CTAGS-FIND-TAG, but calls the external ctags program first,
+to rebuild (update) the TAGS file."
+ (unless tags-file-name
+ (call-interactively (visit-tags-table)))
+ (when (buffer-file-name)
+ (org-ctags-create-tags))
+ (org-ctags-find-tag name))
+
+
+(defun org-ctags-ask-rebuild-tags-file-then-find-tag (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
+ (if (and (buffer-file-name)
+ (y-or-n-p
+ (format
+ "Tag `%s' not found. Rebuild table `%s/TAGS' and look again?"
+ name
+ (file-name-directory (buffer-file-name)))))
+ (org-ctags-rebuild-tags-file-then-find-tag name)
+ nil))
+
+
+(defun org-ctags-fail-silently (name)
+ "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
+Put as the last function in the list if you want to prevent org's default
+behaviour of free text search."
+ t)
+
+
+;;; User-visible functions ===================================================
+
+
+(defun org-ctags-create-tags (&optional directory-name)
+ "(Re)create tags file in the directory of the active buffer,
+containing tag definitions for all the files in the directory and its
+subdirectories which are recognised by ctags. This will include
+files ending in `.org' as well as most other source files (.C,
+.H, .EL, .LISP, etc). All the resulting tags end up in one file,
+called TAGS, located in the directory. This function
+may take several seconds to finish if the directory or its
+subdirectories contain large numbers of taggable files."
+ (interactive)
+ (assert (buffer-file-name))
+ (let ((dir-name (or directory-name
+ (file-name-directory (buffer-file-name))))
+ (exitcode nil))
+ (save-excursion
+ (setq exitcode
+ (shell-command
+ (format (concat "%s --langdef=orgmode --langmap=orgmode:.org "
+ "--regex-orgmode=\"%s\" -f \"%s\" -e -R \"%s\"")
+ org-ctags-path-to-ctags
+ org-ctags-tag-regexp
+ (expand-file-name (concat dir-name "/TAGS"))
+ (expand-file-name (concat dir-name "/*")))))
+ (cond
+ ((eql 0 exitcode)
+ (set (make-local-variable 'org-ctags-tag-list)
+ (org-ctags-all-tags-in-current-tags-table)))
+ (t
+ ;; This seems to behave differently on Linux, so just ignore
+ ;; error codes for now
+ ;;(error "Calling ctags executable resulted in error code: %s"
+ ;; exitcode)
+ nil)))))
+
+
+(defvar org-ctags-find-tag-history nil
+ "History of tags visited by org-ctags-find-tag-interactive.")
+
+(defun org-ctags-find-tag-interactive ()
+ "Prompt for the name of a tag, with autocompletion, then visit
+the named tag. Uses ido-mode if available.
+If the user enters a string that does not match an existing tag, create
+a new topic."
+ (interactive)
+ (let* ((completing-read-fn (if (fboundp 'ido-completing-read)
+ 'ido-completing-read
+ 'completing-read))
+ (tag (funcall completing-read-fn "Topic: " org-ctags-tag-list
+ nil 'confirm nil 'org-ctags-find-tag-history)))
+ (when tag
+ (cond
+ ((member tag org-ctags-tag-list)
+ ;; Existing tag
+ (push tag org-ctags-find-tag-history)
+ (find-tag tag))
+ (t
+ ;; New tag
+ (run-hook-with-args-until-success
+ 'org-open-link-functions tag))))))
+
+
+(org-ctags-enable)
+
+(provide 'org-ctags)
+
+;; arch-tag: 4b1ddd5a-8529-4b17-bcde-96a922d26343
+;;; org-ctags.el ends here
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
property, the date tree will become a subtree under that entry, so the
base level will be properly adjusted.")
+;;;###autoload
(defun org-datetree-find-date-create (date &optional keep-restriction)
"Find or create an entry for DATE.
If KEEP-RESTRICTION is non-nil, do not widen the buffer.
-When it is nit, the buffer will be widened to make sure an existing date
+When it is nil, the buffer will be widened to make sure an existing date
tree can be found."
(let ((year (nth 2 date))
(month (car date))
;;
;; Emacs Lisp Archive Entry
;; Filename: org-docbook.el
-;; Version: 6.33x
+;; Version: 6.35i
;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
;; Keywords: org, wp, docbook
top-level sections). When PUB-DIR is set, use this as the
publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
+
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(not buffer-file-name))
</info>\n"
(org-docbook-expand title)
firstname othername surname
- (if email (concat "<email>" email "</email>") "")
+ (if (and org-export-email-info
+ email (string-match "\\S-" email))
+ (concat "<email>" email "</email>") "")
)))
(org-init-section-numbers)
;; End of quote section?
(when (and inquote (string-match "^\\*+ " line))
- (insert "]]>\n</programlisting>\n")
+ (insert "]]></programlisting>\n")
(org-export-docbook-open-para)
(setq inquote nil))
;; Inside a quote section?
(not (string-match "^[ \t]*\\(:.*\\)"
(car lines))))
(setq infixed nil)
- (insert "]]>\n</programlisting>\n")
+ (insert "]]></programlisting>\n")
(org-export-docbook-open-para))
(throw 'nextline nil))
(while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line start)
(if (get-text-property (match-beginning 2) 'org-protected line)
(setq start (match-end 2))
- (let ((num (match-string 2 line)))
+ (let* ((num (match-string 2 line))
+ (footnote-def (assoc num footnote-list)))
(if (assoc num footref-seen)
(setq line (replace-match
(format "%s<footnoteref linkend=\"%s%s\"/>"
(match-string 1 line)
org-export-docbook-footnote-id-prefix
num
- (save-match-data
- (org-docbook-expand
- (cdr (assoc num footnote-list)))))
+ (if footnote-def
+ (save-match-data
+ (org-docbook-expand (cdr footnote-def)))
+ (format "FOOTNOTE DEFINITION NOT FOUND: %s" num)))
t t line))
(push (cons num 1) footref-seen))))))
;; Properly close all local lists and other lists
(when inquote
- (insert "]]>\n</programlisting>\n")
+ (insert "]]></programlisting>\n")
(org-export-docbook-open-para))
(when in-local-list
;; Close any local lists before inserting a new header line
"[ \r\n\t]*\\(<para>\\)[ \r\n\t]*</para>[ \r\n\t]*" nil t)
(when (not (get-text-property (match-beginning 1) 'org-protected))
(replace-match "\n")
+ ;; Avoid empty <listitem></listitem> caused by inline tasks.
+ ;; We should add an empty para to make everything valid.
+ (when (and (looking-at "</listitem>")
+ (save-excursion
+ (backward-char (length "<listitem>\n"))
+ (looking-at "<listitem>")))
+ (insert "<para></para>"))
(backward-char 1)))
;; Fill empty sections with <para></para>. This is to make sure
;; that the DocBook document generated is valid and well-formed.
(if org-export-with-sub-superscripts
(setq s (org-export-docbook-convert-sub-super s)))
(if org-export-with-TeX-macros
- (let ((start 0) wd ass)
+ (let ((start 0) wd rep)
(while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?"
s start))
(if (get-text-property (match-beginning 0) 'org-protected s)
(setq start (match-end 0))
(setq wd (match-string 1 s))
- (if (setq ass (assoc wd org-html-entities))
- (setq s (replace-match (or (cdr ass)
- (concat "&" (car ass) ";"))
- t t s))
+ (if (setq rep (org-entity-get-representation wd 'html))
+ (setq s (replace-match rep t t s))
(setq start (+ start (length wd))))))))
s)
(label (org-find-text-property-in-string 'org-label src))
(default-attr org-export-docbook-default-image-attributes)
tmp)
+ (setq caption (and caption (org-html-do-expand caption)))
(while (setq tmp (pop default-attr))
(if (not (string-match (concat (car tmp) "=") attr))
(setq attr (concat attr " " (car tmp) "=" (cdr tmp)))))
(replace-match ""))))
(defun org-export-docbook-finalize-table (table)
- "Change TABLE to informaltable if caption does not exist.
+ "Clean up TABLE and turn it into DocBook format.
+This function adds a label to the table if it is available, and
+also changes TABLE to informaltable if caption does not exist.
TABLE is a string containing the HTML code generated by
`org-format-table-html' for a table in Org-mode buffer."
- (if (string-match
- "^<table \\(\\(.\\|\n\\)+\\)<caption></caption>\n\\(\\(.\\|\n\\)+\\)</table>"
- table)
- (replace-match (concat "<informaltable "
- (match-string 1 table)
- (match-string 3 table)
- "</informaltable>")
- nil nil table)
- table))
+ (let (table-with-label)
+ ;; Get the label if it exists, and move it into the <table> element.
+ (setq table-with-label
+ (if (string-match
+ "^<table \\(\\(.\\|\n\\)+\\)<a name=\"\\(.+\\)\" id=\".+\"></a>\n\\(\\(.\\|\n\\)+\\)</table>"
+ table)
+ (replace-match (concat "<table xml:id=\"" (match-string 3 table) "\" "
+ (match-string 1 table)
+ (match-string 4 table)
+ "</table>")
+ nil nil table)
+ table))
+ ;; Change <table> into <informaltable> if caption does not exist.
+ (if (string-match
+ "^<table \\(\\(.\\|\n\\)+\\)<caption></caption>\n\\(\\(.\\|\n\\)+\\)</table>"
+ table-with-label)
+ (replace-match (concat "<informaltable "
+ (match-string 1 table-with-label)
+ (match-string 3 table-with-label)
+ "</informaltable>")
+ nil nil table-with-label)
+ table-with-label)))
;; Note: This function is very similar to
;; org-export-html-convert-sub-super. They can be merged in the future.
--- /dev/null
+;;; org-docview.el --- support for links to doc-view-mode buffers
+
+;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+
+;; Author: Jan Böcker <jan.boecker at jboecker dot de>
+;; Keywords: outlines, hypermedia, calendar, wp
+;; Homepage: http://orgmode.org
+;; Version: 6.35i
+;;
+;; 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:
+
+;; This file implements links to open files in doc-view-mode.
+;; Org-mode loads this module by default - if this is not what you want,
+;; configure the variable `org-modules'.
+
+;; The links take the form
+;;
+;; docview:<file path>::<page number>
+;;
+;; for example: [[docview:~/.elisp/org/doc/org.pdf::1][Org-Mode Manual]]
+;;
+;; Autocompletion for inserting links is supported; you will be
+;; prompted for a file and a page number.
+;;
+;; If you use org-store-link in a doc-view mode buffer, the stored
+;; link will point to the current page.
+
+;;; Code:
+
+
+(require 'org)
+
+(declare-function doc-view-goto-page "doc-view" (page))
+(declare-function doc-view-current-page "doc-view" (&optional win))
+
+(org-add-link-type "docview" 'org-docview-open)
+(add-hook 'org-store-link-functions 'org-docview-store-link)
+
+(defun org-docview-open (link)
+ (when (string-match "\\(.*\\)::\\([0-9]+\\)$" link)
+ (let* ((path (match-string 1 link))
+ (page (string-to-number (match-string 2 link))))
+ (org-open-file path 1) ;; let org-mode open the file (in-emacs = 1)
+ ;; to ensure org-link-frame-setup is respected
+ (doc-view-goto-page page)
+ )))
+
+(defun org-docview-store-link ()
+ "Store a link to a docview buffer"
+ (when (eq major-mode 'doc-view-mode)
+ ;; This buffer is in doc-view-mode
+ (let* ((path buffer-file-name)
+ (page (doc-view-current-page))
+ (link (concat "docview:" path "::" (number-to-string page)))
+ (description ""))
+ (org-store-link-props
+ :type "docview"
+ :link link
+ :description path))))
+
+(defun org-docview-complete-link ()
+ "Use the existing file name completion for file: links to get the file name,
+ then ask the user for the page number and append it."
+ (concat (replace-regexp-in-string "^file:" "docview:" (org-file-complete-link))
+ "::"
+ (read-from-minibuffer "Page:" "1")))
+
+
+(provide 'org-docview)
--- /dev/null
+;;; org-entities.el --- Support for special entities in Org-mode
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Carsten Dominik <carsten at orgmode dot org>,
+;; Ulf Stegemann <ulf at zeitform dot de>
+;; Keywords: outlines, calendar, wp
+;; Homepage: http://orgmode.org
+;; Version: 6.35i
+;;
+;; 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:
+
+(require 'org-macs)
+
+(declare-function org-table-align "org-table" ())
+
+(eval-when-compile
+ (require 'cl))
+
+(defgroup org-entities nil
+ "Options concerning entities in Org-mode."
+ :tag "Org Entities"
+ :group 'org)
+
+(defcustom org-entities-ascii-explanatory nil
+ "Non-nil means replace special entities in ASCII.
+For example, this will replace \"\\nsup\" with \"[not a superset of]\"
+in backends where the corresponding character is not available."
+ :group 'org-entities
+ :type 'boolean)
+
+(defcustom org-entities-user nil
+ "User-defined entities used in Org-mode to preduce special characters.
+Each entry in this list is a list of strings. It associate the name
+of the entity that can be inserted into an Org file as \\name with the
+appropriate replacements for the different export backends. The order
+of the fields is he following
+
+name As a string, without the leading backslash
+LaTeX replacement In ready LaTeX, no further processing will take place
+LaTeX mathp A Boolean, either t or nil. t if this entity needs
+ to be in math mode.
+HTML replacement In ready HTML, no further processing will take place.
+ Usually this will be an &...; entity.
+ASCII replacement Plain ASCII, no extensions. Symbols that cannot be
+ represented will be written out as an explanatory text.
+ But see the variable `org-entities-ascii-keep-macro-form'.
+Latin1 replacement Use the special characters available in latin1.
+utf-8 replacement Use special character available in utf-8.
+
+If you define new entities here that require specific LaTeX packages to be
+loaded, add these packages to `org-export-latex-packages-alist'."
+ :group 'org-entities
+ :type '(repeat
+ (list
+ (string :tag "name ")
+ (string :tag "LaTeX ")
+ (boolean :tag "Require LaTeX math?")
+ (string :tag "HTML ")
+ (string :tag "ASCII ")
+ (string :tag "Latin1")
+ (string :tag "utf-8 "))))
+
+(defconst org-entities
+ '(("nbsp" "~" nil " " " " " " " ")
+ ("iexcl" "!`" nil "¡" "!" "¡" "¡")
+ ("cent" "\\textcent{}" nil "¢" "cent" "¢" "¢")
+ ("pound" "\\pounds{}" nil "£" "pound" "£" "£")
+ ("curren" "\\textcurrency{}" nil "¤" "curr." "¤" "¤")
+ ("yen" "\\textyen{}" nil "¥" "yen" "¥" "¥")
+ ("brvbar" "\\textbrokenbar{}" nil "¦" "|" "¦" "¦")
+ ("vert" "\\vert{}" t "|" "|" "|" "|")
+ ("sect" "\\S" nil "§" "paragraph" "§" "§")
+ ("uml" "\\textasciidieresis{}" nil "¨" "[diaeresis]" "¨" "¨")
+ ("copy" "\\textcopyright{}" nil "©" "(c)" "©" "©")
+ ("ordf" "\\textordfeminine{}" nil "ª" "_a_" "ª" "ª")
+ ("laquo" "\\guillemotleft{}" nil "«" "<<" "«" "«")
+ ("not" "\\textlnot{}" nil "¬" "[angled dash]" "¬" "¬")
+ ("shy" "\\-" nil "­" "" "" "")
+ ("reg" "\\textregistered{}" nil "®" "(r)" "®" "®")
+ ("macr" "\\textasciimacron{}" nil "¯" "[macron]" "¯" "¯")
+ ("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
+ ("pm" "\\textpm{}" nil "±" "+-" "±" "±")
+ ("plusmn" "\\textpm{}" nil "±" "+-" "±" "±")
+ ("sup2" "\\texttwosuperior{}" nil "²" "^2" "²" "²")
+ ("sup3" "\\textthreesuperior{}" nil "³" "^3" "³" "³")
+ ("acutex" "\\acute x" t "´x" "'x" "'x" "𝑥́")
+ ("micro" "\\textmu{}" nil "µ" "micro" "µ" "µ")
+ ("para" "\\P{}" nil "¶" "[pilcrow]" "¶" "¶")
+ ("middot" "\\textperiodcentered{}" nil "·" "." "·" "·")
+ ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
+ ("star" "\\star" t "*" "*" "*" "⋆")
+ ("cedil" "\\c{}" nil "¸" "[cedilla]" "¸" "¸")
+ ("sup1" "\\textonesuperior{}" nil "¹" "^1" "¹" "¹")
+ ("ordm" "\\textordmasculine{}" nil "º" "_o_" "º" "º")
+ ("raquo" "\\guillemotright{}" nil "»" ">>" "»" "»")
+ ("iquest" "?`" nil "¿" "?" "¿" "¿")
+ ("Agrave" "\\`{A}" nil "À" "A" "À" "À")
+ ("Aacute" "\\'{A}" nil "Á" "A" "Á" "Á")
+ ("Acirc" "\\^{A}" nil "Â" "A" "Â" "Â")
+ ("Atilde" "\\~{A}" nil "Ã" "A" "Ã" "Ã")
+ ("Auml" "\\\"{A}" nil "Ä" "Ae" "Ä" "Ä")
+ ("Aring" "\\AA{}" nil "Å" "A" "Å" "Å")
+ ("AA" "\\AA{}" nil "Å" "A" "Å" "Å")
+ ("AElig" "\\AE{}" nil "Æ" "AE" "Æ" "Æ")
+ ("Ccedil" "\\c{C}" nil "Ç" "C" "Ç" "Ç")
+ ("Egrave" "\\`{E}" nil "È" "E" "È" "È")
+ ("Eacute" "\\'{E}" nil "É" "E" "É" "É")
+ ("Ecirc" "\\^{E}" nil "Ê" "E" "Ê" "Ê")
+ ("Euml" "\\\"{E}" nil "Ë" "E" "Ë" "Ë")
+ ("Igrave" "\\`{I}" nil "Ì" "I" "Ì" "Ì")
+ ("Iacute" "\\'{I}" nil "Í" "I" "Í" "Í")
+ ("Icirc" "\\^{I}" nil "Î" "I" "Î" "Î")
+ ("Iuml" "\\\"{I}" nil "Ï" "I" "Ï" "Ï")
+ ("ETH" "\\DH{}" nil "Ð" "D" "Ð" "Ð")
+ ("Ntilde" "\\~{N}" nil "Ñ" "N" "Ñ" "Ñ")
+ ("Ograve" "\\`{O}" nil "Ò" "O" "Ò" "Ò")
+ ("Oacute" "\\'{O}" nil "Ó" "O" "Ó" "Ó")
+ ("Ocirc" "\\^{O}" nil "Ô" "O" "Ô" "Ô")
+ ("Otilde" "\\~{O}" nil "Õ" "O" "Õ" "Õ")
+ ("Ouml" "\\\"{O}" nil "Ö" "Oe" "Ö" "Ö")
+ ("times" "\\texttimes{}" nil "×" "*" "×" "×")
+ ("Oslash" "\\O" nil "Ø" "O" "Ø" "Ø")
+ ("Ugrave" "\\`{U}" nil "Ù" "U" "Ù" "Ù")
+ ("Uacute" "\\'{U}" nil "Ú" "U" "Ú" "Ú")
+ ("Ucirc" "\\^{U}" nil "Û" "U" "Û" "Û")
+ ("Uuml" "\\\"{U}" nil "Ü" "Ue" "Ü" "Ü")
+ ("Yacute" "\\'{Y}" nil "Ý" "Y" "Ý" "Ý")
+ ("THORN" "\\TH{}" nil "Þ" "TH" "Þ" "Þ")
+ ("szlig" "\\ss{}" nil "ß" "ss" "ß" "ß")
+ ("agrave" "\\`{a}" nil "à" "a" "à" "à")
+ ("aacute" "\\'{a}" nil "á" "a" "á" "á")
+ ("acirc" "\\^{a}" nil "â" "a" "â" "â")
+ ("atilde" "\\~{a}" nil "ã" "a" "ã" "ã")
+ ("auml" "\\\"{a}" nil "ä" "ae" "ä" "ä")
+ ("aring" "\\aa{}" nil "å" "a" "å" "å")
+ ("aelig" "\\ae{}" nil "æ" "ae" "æ" "æ")
+ ("ccedil" "\\c{c}" nil "ç" "c" "ç" "ç")
+ ("checkmark" "\\checkmark" t "✓" "[checkmark]" "[checkmark]" "✓")
+ ("egrave" "\\`{e}" nil "è" "e" "è" "è")
+ ("eacute" "\\'{e}" nil "é" "e" "é" "é")
+ ("ecirc" "\\^{e}" nil "ê" "e" "ê" "ê")
+ ("euml" "\\\"{e}" nil "ë" "e" "ë" "ë")
+ ("igrave" "\\`{i}" nil "ì" "i" "ì" "ì")
+ ("iacute" "\\'{i}" nil "í" "i" "í" "í")
+ ("icirc" "\\^{i}" nil "î" "i" "î" "î")
+ ("iuml" "\\\"{i}" nil "ï" "i" "ï" "ï")
+ ("eth" "\\dh{}" nil "ð" "dh" "ð" "ð")
+ ("ntilde" "\\~{n}" nil "ñ" "n" "ñ" "ñ")
+ ("ograve" "\\`{o}" nil "ò" "o" "ò" "ò")
+ ("oacute" "\\'{o}" nil "ó" "o" "ó" "ó")
+ ("ocirc" "\\^{o}" nil "ô" "o" "ô" "ô")
+ ("otilde" "\\~{o}" nil "õ" "o" "õ" "õ")
+ ("ouml" "\\\"{o}" nil "ö" "oe" "ö" "ö")
+ ("oslash" "\\o{}" nil "ø" "o" "ø" "ø")
+ ("ugrave" "\\`{u}" nil "ù" "u" "ù" "ù")
+ ("uacute" "\\'{u}" nil "ú" "u" "ú" "ú")
+ ("ucirc" "\\^{u}" nil "û" "u" "û" "û")
+ ("uuml" "\\\"{u}" nil "ü" "ue" "ü" "ü")
+ ("yacute" "\\'{y}" nil "ý" "y" "ý" "ý")
+ ("thorn" "\\th{}" nil "þ" "th" "þ" "þ")
+ ("yuml" "\\\"{y}" nil "ÿ" "y" "ÿ" "ÿ")
+ ("fnof" "\\textit{f}" nil "ƒ" "f" "f" "ƒ")
+ ("Alpha" "A" nil "Α" "Alpha" "Alpha" "Α")
+ ("Beta" "B" nil "Β" "Beta" "Beta" "Β")
+ ("Gamma" "\\Gamma" t "Γ" "Gamma" "Gamma" "Γ")
+ ("Delta" "\\Delta" t "Δ" "Delta" "Gamma" "Δ")
+ ("Epsilon" "E" nil "Ε" "Epsilon" "Epsilon" "Ε")
+ ("Zeta" "Z" nil "Ζ" "Zeta" "Zeta" "Ζ")
+ ("Eta" "H" nil "Η" "Eta" "Eta" "Η")
+ ("Theta" "\\Theta" t "Θ" "Theta" "Theta" "Θ")
+ ("Iota" "I" nil "Ι" "Iota" "Iota" "Ι")
+ ("Kappa" "K" nil "Κ" "Kappa" "Kappa" "Κ")
+ ("Lambda" "\\Lambda" t "Λ" "Lambda" "Lambda" "Λ")
+ ("Mu" "M" nil "Μ" "Mu" "Mu" "Μ")
+ ("Nu" "N" nil "Ν" "Nu" "Nu" "Ν")
+ ("Xi" "\\Xi" t "Ξ" "Xi" "Xi" "Ξ")
+ ("Omicron" "O" nil "Ο" "Omicron" "Omicron" "Ο")
+ ("Pi" "\\Pi" t "Π" "Pi" "Pi" "Π")
+ ("Rho" "P" nil "Ρ" "Rho" "Rho" "Ρ")
+ ("Sigma" "\\Sigma" t "Σ" "Sigma" "Sigma" "Σ")
+ ("Tau" "T" nil "Τ" "Tau" "Tau" "Τ")
+ ("Upsilon" "\\Upsilon" t "Υ" "Upsilon" "Upsilon" "Υ")
+ ("Phi" "\\Phi" t "Φ" "Phi" "Phi" "Φ")
+ ("Chi" "X" nil "Χ" "Chi" "Chi" "Χ")
+ ("Psi" "\\Psi" t "Ψ" "Psi" "Psi" "Ψ")
+ ("Omega" "\\Omega" t "Ω" "Omega" "Omega" "Ω")
+ ("alpha" "\\alpha" t "α" "alpha" "alpha" "α")
+ ("beta" "\\beta" t "β" "beta" "beta" "β")
+ ("gamma" "\\gamma" t "γ" "gamma" "gamma" "γ")
+ ("delta" "\\delta" t "δ" "delta" "delta" "δ")
+ ("epsilon" "\\epsilon" t "ε" "epsilon" "epsilon" "ε")
+ ("varepsilon" "\\varepsilon" t "ε" "varepsilon" "varepsilon" "ε")
+ ("zeta" "\\zeta" t "ζ" "zeta" "zeta" "ζ")
+ ("eta" "\\eta" t "η" "eta" "eta" "η")
+ ("theta" "\\theta" t "θ" "theta" "theta" "θ")
+ ("iota" "\\iota" t "ι" "iota" "iota" "ι")
+ ("kappa" "\\kappa" t "κ" "kappa" "kappa" "κ")
+ ("lambda" "\\lambda" t "λ" "lambda" "lambda" "λ")
+ ("mu" "\\mu" t "μ" "mu" "mu" "μ")
+ ("nu" "\\nu" t "ν" "nu" "nu" "ν")
+ ("xi" "\\xi" t "ξ" "xi" "xi" "ξ")
+ ("omicron" "\\textit{o}" nil "ο" "omicron" "omicron" "ο")
+ ("pi" "\\pi" t "π" "pi" "pi" "π")
+ ("rho" "\\rho" t "ρ" "rho" "rho" "ρ")
+ ("sigmaf" "\\varsigma" t "ς" "sigmaf" "sigmaf" "ς")
+ ("varsigma" "\\varsigma" t "ς" "varsigma" "varsigma" "ς")
+ ("sigma" "\\sigma" t "σ" "sigma" "sigma" "σ")
+ ("tau" "\\tau" t "τ" "tau" "tau" "τ")
+ ("upsilon" "\\upsilon" t "υ" "upsilon" "upsilon" "υ")
+ ("phi" "\\phi" t "φ" "phi" "phi" "φ")
+ ("chi" "\\chi" t "χ" "chi" "chi" "χ")
+ ("psi" "\\psi" t "ψ" "psi" "psi" "ψ")
+ ("omega" "\\omega" t "ω" "omega" "omega" "ω")
+ ("thetasym" "\\vartheta" t "ϑ" "theta" "theta" "ϑ")
+ ("vartheta" "\\vartheta" t "ϑ" "theta" "theta" "ϑ")
+ ("upsih" "\\Upsilon" t "ϒ" "upsilon" "upsilon" "ϒ")
+ ("piv" "\\varpi" t "ϖ" "omega-pi" "omega-pi" "ϖ")
+ ("bull" "\\textbullet{}" nil "•" "*" "*" "•")
+ ("bullet" "\\textbullet{}" nil "•" "*" "*" "•")
+ ("hellip" "\\dots{}" nil "…" "..." "..." "…")
+ ("dots" "\\dots{}" nil "…" "..." "..." "…")
+ ("prime" "\\prime" t "′" "'" "'" "′")
+ ("Prime" "\\prime{}\\prime" t "″" "''" "''" "″")
+ ("oline" "\\overline{~}" t "‾" "[overline]" "¯" "‾")
+ ("frasl" "/" nil "⁄" "/" "/" "⁄")
+ ("weierp" "\\wp" t "℘" "P" "P" "℘")
+ ("image" "\\Im" t "ℑ" "I" "I" "ℑ")
+ ("real" "\\Re" t "ℜ" "R" "R" "ℜ")
+ ("trade" "\\texttrademark{}" nil "™" "TM" "TM" "™")
+ ("alefsym" "\\aleph" t "ℵ" "aleph" "aleph" "ℵ")
+ ("larr" "\\leftarrow" t "←" "<-" "<-" "←")
+ ("leftarrow" "\\leftarrow" t "←" "<-" "<-" "←")
+ ("gets" "\\gets" t "←" "<-" "<-" "←")
+ ("uarr" "\\uparrow" t "↑" "[uparrow]" "[uparrow]" "↑")
+ ("uparrow" "\\uparrow" t "↑" "[uparrow]" "[uparrow]" "↑")
+ ("rarr" "\\rightarrow" t "→" "->" "->" "→")
+ ("to" "\\to" t "→" "->" "->" "→")
+ ("rightarrow" "\\rightarrow" t "→" "->" "->" "→")
+ ("darr" "\\downarrow" t "↓" "[downarrow]" "[downarrow]" "↓")
+ ("downarrow" "\\downarrow" t "↓" "[downarrow]" "[downarrow]" "↓")
+ ("harr" "\\leftrightarrow" t "↔" "<->" "<->" "↔")
+ ("leftrightarrow" "\\leftrightarrow" t "↔" "<->" "<->" "↔")
+ ("crarr" "\\hookleftarrow" t "↵" "<-'" "<-'" "↵")
+ ("hookleftarrow" "\\hookleftarrow" t "↵" "<-'" "<-'" "↵")
+ ("lArr" "\\Leftarrow" t "⇐" "<=" "<=" "⇐")
+ ("Leftarrow" "\\Leftarrow" t "⇐" "<=" "<=" "⇐")
+ ("uArr" "\\Uparrow" t "⇑" "[dbluparrow]" "[dbluparrow]" "⇑")
+ ("Uparrow" "\\Uparrow" t "⇑" "[dbluparrow]" "[dbluparrow]" "⇑")
+ ("rArr" "\\Rightarrow" t "⇒" "=>" "=>" "⇒")
+ ("Rightarrow" "\\Rightarrow" t "⇒" "=>" "=>" "⇒")
+ ("dArr" "\\Downarrow" t "⇓" "[dbldownarrow]" "[dbldownarrow]" "⇓")
+ ("Downarrow" "\\Downarrow" t "⇓" "[dbldownarrow]" "[dbldownarrow]" "⇓")
+ ("hArr" "\\Leftrightarrow" t "⇔" "<=>" "<=>" "⇔")
+ ("Leftrightarrow" "\\Leftrightarrow" t "⇔" "<=>" "<=>" "⇔")
+ ("forall" "\\forall" t "∀" "[for all]" "[for all]" "∀")
+ ("partial" "\\partial" t "∂" "[partial differential]" "[partial differential]" "∂")
+ ("exist" "\\exists" t "∃" "[there exists]" "[there exists]" "∃")
+ ("exists" "\\exists" t "∃" "[there exists]" "[there exists]" "∃")
+ ("empty" "\\empty" t "∅" "[empty set]" "[empty set]" "∅")
+ ("emptyset" "\\emptyset" t "∅" "[empty set]" "[empty set]" "∅")
+ ("nabla" "\\nabla" t "∇" "[nabla]" "[nabla]" "∇")
+ ("isin" "\\in" t "∈" "[element of]" "[element of]" "∈")
+ ("in" "\\in" t "∈" "[element of]" "[element of]" "∈")
+ ("notin" "\\notin" t "∉" "[not an element of]" "[not an element of]" "∉")
+ ("ni" "\\ni" t "∋" "[contains as member]" "[contains as member]" "∋")
+ ("prod" "\\prod" t "∏" "[product]" "[n-ary product]" "∏")
+ ("sum" "\\sum" t "∑" "[sum]" "[sum]" "∑")
+; ("minus" "\\minus" t "−" "-" "-" "−")
+ ("minus" "-" t "−" "-" "-" "−")
+ ("lowast" "\\ast" t "∗" "*" "*" "∗")
+ ("ast" "\\ast" t "∗" "*" "*" "*")
+ ("radic" "\\sqrt{\\,}" t "√" "[square root]" "[square root]" "√")
+ ("prop" "\\propto" t "∝" "[proportional to]" "[proportional to]" "∝")
+ ("proptp" "\\propto" t "∝" "[proportional to]" "[proportional to]" "∝")
+ ("infin" "\\propto" t "∞" "[infinity]" "[infinity]" "∞")
+ ("infty" "\\infty" t "∞" "[infinity]" "[infinity]" "∞")
+ ("ang" "\\angle" t "∠" "[angle]" "[angle]" "∠")
+ ("angle" "\\angle" t "∠" "[angle]" "[angle]" "∠")
+ ("and" "\\wedge" t "∧" "[logical and]" "[logical and]" "∧")
+ ("wedge" "\\wedge" t "∧" "[logical and]" "[logical and]" "∧")
+ ("or" "\\vee" t "∨" "[logical or]" "[logical or]" "∨")
+ ("vee" "\\vee" t "∨" "[logical or]" "[logical or]" "∨")
+ ("cap" "\\cap" t "∩" "[intersection]" "[intersection]" "∩")
+ ("cup" "\\cup" t "∪" "[union]" "[union]" "∪")
+ ("int" "\\int" t "∫" "[integral]" "[integral]" "∫")
+; ("there4" "\\uptherefore" t "∴" "[therefore]" "[therefore]" "∴")
+ ("there4" "\\therefore" t "∴" "[therefore]" "[therefore]" "∴")
+ ("sim" "\\sim" t "∼" "~" "~" "∼")
+ ("cong" "\\cong" t "≅" "[approx. equal to]" "[approx. equal to]" "≅")
+ ("simeq" "\\simeq" t "≅" "[approx. equal to]" "[approx. equal to]" "≅")
+ ("asymp" "\\asymp" t "≈" "[almost equal to]" "[almost equal to]" "≈")
+ ("approx" "\\approx" t "≈" "[almost equal to]" "[almost equal to]" "≈")
+ ("ne" "\\ne" t "≠" "[not equal to]" "[not equal to]" "≠")
+ ("neq" "\\neq" t "≠" "[not equal to]" "[not equal to]" "≠")
+ ("equiv" "\\equiv" t "≡" "[identical to]" "[identical to]" "≡")
+ ("le" "\\le" t "≤" "<=" "<=" "≤")
+ ("ge" "\\ge" t "≥" ">=" ">=" "≥")
+ ("sub" "\\subset" t "⊂" "[subset of]" "[subset of]" "⊂")
+ ("subset" "\\subset" t "⊂" "[subset of]" "[subset of]" "⊂")
+ ("sup" "\\supset" t "⊃" "[superset of]" "[superset of]" "⊃")
+ ("supset" "\\supset" t "⊃" "[superset of]" "[superset of]" "⊃")
+ ("nsub" "\\not\\subset" t "⊄" "[not a subset of]" "[not a subset of" "⊄")
+ ("sube" "\\subseteq" t "⊆" "[subset of or equal to]" "[subset of or equal to]" "⊆")
+ ("supe" "\\supseteq" t "⊇" "[superset of or equal to]" "[superset of or equal to]" "⊇")
+ ("oplus" "\\oplus" t "⊕" "[circled plus]" "[circled plus]" "⊕")
+ ("otimes" "\\otimes" t "⊗" "[circled times]" "[circled times]" "⊗")
+ ("perp" "\\perp" t "⊥" "[up tack]" "[up tack]" "⊥")
+ ("sdot" "\\cdot" t "⋅" "[dot]" "[dot]" "⋅")
+ ("cdot" "\\cdot" t "⋅" "[dot]" "[dot]" "⋅")
+ ("lceil" "\\lceil" t "⌈" "[left ceiling]" "[left ceiling]" "⌈")
+ ("rceil" "\\rceil" t "⌉" "[right ceiling]" "[right ceiling]" "⌉")
+ ("lfloor" "\\lfloor" t "⌊" "[left floor]" "[left floor]" "⌊")
+ ("rfloor" "\\rfloor" t "⌋" "[right floor]" "[right floor]" "⌋")
+ ("lang" "\\langle" t "⟨" "<" "<" "⟨")
+ ("rang" "\\rangle" t "⟩" ">" ">" "⟩")
+ ("loz" "\\diamond" t "◊" "[lozenge]" "[lozenge]" "◊")
+ ("Diamond" "\\diamond" t "⋄" "[diamond]" "[diamond]" "⋄")
+ ("spades" "\\spadesuit" t "♠" "[spades]" "[spades]" "♠")
+ ("spadesuit" "\\spadesuit" t "♠" "[spades]" "[spades]" "♠")
+ ("clubs" "\\clubsuit" t "♣" "[clubs]" "[clubs]" "♣")
+ ("clubsuit" "\\clubsuit" t "♣" "[clubs]" "[clubs]" "♣")
+ ("hearts" "\\heartsuit" t "♥" "[hearts]" "[hearts]" "♥")
+ ("heartsuit" "\\heartsuit" t "♥" "[hearts]" "[hearts]" "♥")
+ ("diamondsuit" "\\diamondsuit" t "♦" "[diamonds]" "[diamonds]" "♦")
+ ("diams" "\\diamondsuit" t "♦" "[diamonds]" "[diamonds]" "♦")
+ ("smile" "\\smile" t "☺" ":-)" ":-)" "⌣")
+ ("blacksmile" "\\blacksmiley{}" nil "☻" ":-)" ":-)" "☻")
+ ("sad" "\\frownie{}" nil "☹" ":-(" ":-(" "☹")
+ ("quot" "\\textquotedbl{}" nil """ "\"" "\"" "\"")
+ ("amp" "\\&" nil "&" "&" "&" "&")
+ ("lt" "\\textless{}" nil "<" "<" "<" "<")
+ ("gt" "\\textgreater{}" nil ">" ">" ">" ">")
+ ("OElig" "\\OE{}" nil "Œ" "OE" "OE" "Œ")
+ ("oelig" "\\oe{}" nil "œ" "oe" "oe" "œ")
+ ("Scaron" "\\v{S}" nil "Š" "S" "S" "Š")
+ ("scaron" "\\v{s}" nil "š" "s" "s" "š")
+ ("Yuml" "\\\"{Y}" nil "Ÿ" "Y" "Y" "Ÿ")
+ ("circ" "\\circ" t "ˆ" "^" "^" "ˆ")
+ ("tilde" "\\~{}" nil "˜" "~" "~" "~")
+ ("ensp" "\\hspace*{.5em}" nil " " " " " " " ")
+ ("emsp" "\\hspace*{1em}" nil " " " " " " " ")
+ ("thinsp" "\\hspace*{.2em}" nil " " " " " " " ")
+ ("zwnj" "\\/{}" nil "‌" "" "" "")
+ ("zwj" "" nil "‍" "" "" "")
+ ("lrm" "" nil "‎" "" "" "")
+ ("rlm" "" nil "‏" "" "" "")
+ ("ndash" "--" nil "–" "-" "-" "–")
+ ("mdash" "---" nil "—" "--" "--" "—")
+ ("lsquo" "\\textquoteleft{}" nil "‘" "`" "`" "‘")
+ ("rsquo" "\\textquoteright{}" nil "’" "'" "'" "’")
+ ("sbquo" "\\quotesinglbase{}" nil "‚" "," "," "‚")
+ ("ldquo" "\\textquotedblleft{}" nil "“" "\"" "\"" "“")
+ ("rdquo" "\\textquotedblright{}" nil "”" "\"" "\"" "”")
+ ("bdquo" "\\quotedblbase{}" nil "„" "\"" "\"" "„")
+ ("dagger" "\\textdagger{}" nil "†" "[dagger]" "[dagger]" "†")
+ ("Dagger" "\\textdaggerdbl{}" nil "‡" "[doubledagger]" "[doubledagger]" "‡")
+ ("permil" "\\textperthousand{}" nil "‰" "per thousand" "per thousand" "‰")
+ ("lsaquo" "\\guilsinglleft{}" nil "‹" "<" "<" "‹")
+ ("rsaquo" "\\guilsinglright{}" nil "›" ">" ">" "›")
+ ("euro" "\\texteuro{}" nil "€" "EUR" "EUR" "€")
+ ("EUR" "\\EUR{}" nil "€" "EUR" "EUR" "€")
+ ("EURdig" "\\EURdig{}" nil "€" "EUR" "EUR" "€")
+ ("EURhv" "\\EURhv{}" nil "€" "EUR" "EUR" "€")
+ ("EURcr" "\\EURcr{}" nil "€" "EUR" "EUR" "€")
+ ("EURtm" "\\EURtm{}" nil "€" "EUR" "EUR" "€")
+ ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
+ ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
+ ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
+ ("arg" "\\arg" t "arg" "arg" "arg" "arg")
+ ("cos" "\\cos" t "cos" "cos" "cos" "cos")
+ ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
+ ("cot" "\\cot" t "cot" "cot" "cot" "cot")
+ ("coth" "\\coth" t "coth" "coth" "coth" "coth")
+ ("csc" "\\csc" t "csc" "csc" "csc" "csc")
+ ("deg" "\\deg" t "°" "deg" "deg" "deg")
+ ("det" "\\det" t "det" "det" "det" "det")
+ ("dim" "\\dim" t "dim" "dim" "dim" "dim")
+ ("exp" "\\exp" t "exp" "exp" "exp" "exp")
+ ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
+ ("hom" "\\hom" t "hom" "hom" "hom" "hom")
+ ("inf" "\\inf" t "inf" "inf" "inf" "inf")
+ ("ker" "\\ker" t "ker" "ker" "ker" "ker")
+ ("lg" "\\lg" t "lg" "lg" "lg" "lg")
+ ("lim" "\\lim" t "lim" "lim" "lim" "lim")
+ ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
+ ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
+ ("ln" "\\ln" t "ln" "ln" "ln" "ln")
+ ("log" "\\log" t "log" "log" "log" "log")
+ ("max" "\\max" t "max" "max" "max" "max")
+ ("min" "\\min" t "min" "min" "min" "min")
+ ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
+ ("sec" "\\sec" t "sec" "sec" "sec" "sec")
+ ("sin" "\\sin" t "sin" "sin" "sin" "sin")
+ ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
+ ("sup" "\\sup" t "⊃" "sup" "sup" "sup")
+ ("tan" "\\tan" t "tan" "tan" "tan" "tan")
+ ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
+ ("frac12" "\\textonehalf{}" nil "½" "1/2" "½" "½")
+ ("frac14" "\\textonequarter{}" nil "¼" "1/4" "¼" "¼")
+ ("frac34" "\\textthreequarters{}" nil "¾" "3/4" "¾" "¾")
+ ("div" "\\textdiv{}" nil "÷" "/" "÷" "÷")
+ ("acute" "\\textasciiacute{}" nil "´" "'" "´" "´")
+ ("nsup" "\\not\\supset" t "⊅" "[not a superset of]" "[not a superset of]" "⊅")
+ ("smiley" "\\smiley{}" nil "☺" ":-)" ":-)" "☺")
+ )
+ "Default entities used in Org-mode to preduce special characters.
+For details see `org-entities-user'.")
+
+(defsubst org-entity-get (name)
+ "Get the proper association for NAME from the entity lists.
+This first checks the user list, then the built-in list."
+ (or (assoc name org-entities-user)
+ (assoc name org-entities)))
+
+(defun org-entity-get-representation (name kind)
+ "Get the correct representation of entity NAME for export type KIND.
+Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
+ (let* ((e (org-entity-get name))
+ (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
+ (latin1 . 5) (utf8 . 6)))))
+ (r (and e n (nth n e))))
+ (if (and e r
+ (not org-entities-ascii-explanatory)
+ (memq kind '(ascii latin1 utf8))
+ (= (string-to-char r) ?\[))
+ (concat "\\" name)
+ r)))
+
+(defsubst org-entity-latex-math-p (name)
+ "Does entity NAME require math mode in LaTeX?"
+ (nth 2 (org-entity-get name)))
+
+;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
+
+(defun org-entities-create-table ()
+ "Create an org-mode table with all entities."
+ (interactive)
+ (let ((ll org-entities)
+ (pos (point))
+ e latex mathp html latin utf8 name ascii)
+ (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
+ (while ll
+ (setq e (pop ll))
+ (setq name (car e)
+ latex (nth 1 e)
+ mathp (nth 2 e)
+ html (nth 3 e)
+ ascii (nth 4 e)
+ latin (nth 5 e)
+ utf8 (nth 6 e))
+ (if (equal ascii "|") (setq ascii "\\vert"))
+ (if (equal latin "|") (setq latin "\\vert"))
+ (if (equal utf8 "|") (setq utf8 "\\vert"))
+ (if (equal ascii "=>") (setq ascii "= >"))
+ (if (equal latin "=>") (setq latin "= >"))
+ (insert "|" name
+ "|" (format "=%s=" latex)
+ "|" (format (if mathp "$%s$" "$\\mbox{%s}$")
+ latex)
+ "|" (format "=%s=" html) "|" html
+ "|" ascii "|" latin "|" utf8
+ "|\n"))
+ (goto-char pos)
+ (org-table-align)))
+
+(defun replace-amp ()
+ "Postprocess HTML file to unescape the ampersant."
+ (interactive)
+ (while (re-search-forward "<td>&\\([^<;]+;\\)" nil t)
+ (replace-match (concat "<td>&" (match-string 1)) t t)))
+
+(provide 'org-entities)
+
+;; arch-tag: e6bd163f-7419-4009-9c93-a74623016424
+
+;;; org-entities.el ends here
;; Free Software Foundation, Inc.
;; Author: Eric Schulte
+;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
(save-window-excursion
(let ((case-fold-search t)
(types '())
- indentation type func start body headers preserve-indent)
+ indentation type func start body headers preserve-indent progress-marker)
(flet ((interblock (start end)
(mapcar (lambda (pair) (funcall (second pair) start end))
org-export-interblocks)))
(setq body (save-match-data (org-remove-indentation body))))
(unless (memq type types) (setq types (cons type types)))
(save-match-data (interblock start (match-beginning 0)))
- (if (setq func (cadr (assoc type org-export-blocks)))
- (progn
- (replace-match (save-match-data
+ (when (setq func (cadr (assoc type org-export-blocks)))
+ (let ((replacement (save-match-data
(if (memq type org-export-blocks-witheld) ""
- (apply func body headers))) t t)
+ (apply func body headers)))))
+ (when replacement
+ (replace-match replacement t t)
(unless preserve-indent
- (indent-code-rigidly (match-beginning 0) (match-end 0) indentation))))
+ (indent-code-rigidly
+ (match-beginning 0) (match-end 0) indentation)))))
(setq start (match-end 0)))
(interblock start (point-max))))))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:group 'org-export)
(defcustom org-export-allow-BIND 'confirm
- "Non-nil means, allow #+BIND to define local variable values for export.
+ "Non-nil means allow #+BIND to define local variable values for export.
This is a potential security risk, which is why the user must confirm the
use of these lines."
:group 'org-export-general
(defvar org-export-publishing-directory nil)
(defcustom org-export-show-temporary-export-buffer t
- "Non-nil means, show buffer after exporting to temp buffer.
+ "Non-nil means show buffer after exporting to temp buffer.
When Org exports to a file, the buffer visiting that file is ever
shown, but remains buried. However, when exporting to a temporary
buffer, that buffer is popped up in a second window. When this variable
:type 'boolean)
(defcustom org-export-copy-to-kill-ring t
- "Non-nil means, exported stuff will also be pushed onto the kill ring."
+ "Non-nil means exported stuff will also be pushed onto the kill ring."
+ :group 'org-export-general
+ :type 'boolean)
+
+(defcustom org-export-kill-product-buffer-when-displayed nil
+ "Non-nil means kill the product buffer if it is displayed immediately.
+This applied to the commands `org-export-html-and-open' and
+`org-export-as-pdf-and-open'."
:group 'org-export-general
:type 'boolean)
;; FIXME: rename, this is a general variable
(defcustom org-export-html-expand t
- "Non-nil means, for HTML export, treat @<...> as HTML tag.
+ "Non-nil means for HTML export, treat @<...> as HTML tag.
When nil, these tags will be exported as plain text and therefore
not be interpreted by a browser.
:type 'boolean)
(defcustom org-export-with-special-strings t
- "Non-nil means, interpret \"\-\", \"--\" and \"---\" for export.
+ "Non-nil means interpret \"\-\", \"--\" and \"---\" for export.
When this option is turned on, these strings will be exported as:
Org HTML LaTeX
sense to set this globally.")
(defcustom org-export-skip-text-before-1st-heading nil
- "Non-nil means, skip all text before the first headline when exporting.
+ "Non-nil means skip all text before the first headline when exporting.
When nil, that text is exported as well."
:group 'org-export-general
:type 'boolean)
:type 'integer)
(defcustom org-export-with-section-numbers t
- "Non-nil means, add section numbers to headlines when exporting.
+ "Non-nil means add section numbers to headlines when exporting.
This option can also be set with the +OPTIONS line, e.g. \"num:t\"."
:group 'org-export-general
(string :tag "Terminator")))
(defcustom org-export-with-toc t
- "Non-nil means, create a table of contents in exported files.
+ "Non-nil means create a table of contents in exported files.
The TOC contains headlines with levels up to`org-export-headline-levels'.
When an integer, include levels up to N in the toc, this may then be
different from `org-export-headline-levels', but it will not be allowed
(integer :tag "TOC to level")))
(defcustom org-export-mark-todo-in-toc nil
- "Non-nil means, mark TOC lines that contain any open TODO items."
+ "Non-nil means mark TOC lines that contain any open TODO items."
:group 'org-export-general
:type 'boolean)
(defcustom org-export-with-todo-keywords t
- "Non-nil means, include TODO keywords in export.
+ "Non-nil means include TODO keywords in export.
When nil, remove all these keywords from the export."
:group 'org-export-general
:type 'boolean)
(defcustom org-export-with-priority nil
- "Non-nil means, include priority cookies in export.
+ "Non-nil means include priority cookies in export.
When nil, remove priority cookies for export."
:group 'org-export-general
:type 'boolean)
(defcustom org-export-preserve-breaks nil
- "Non-nil means, preserve all line breaks when exporting.
+ "Non-nil means preserve all line breaks when exporting.
Normally, in HTML output paragraphs will be reformatted. In ASCII
export, line breaks will always be preserved, regardless of this variable.
(const :tag "entirely" t)))
(defcustom org-export-author-info t
- "Non-nil means, insert author name and email into the exported file.
+ "Non-nil means insert author name and email into the exported file.
+
+This option can also be set with the +OPTIONS line,
+e.g. \"author:nil\"."
+ :group 'org-export-general
+ :type 'boolean)
+
+(defcustom org-export-email-info nil
+ "Non-nil means insert author name and email into the exported file.
This option can also be set with the +OPTIONS line,
-e.g. \"author-info:nil\"."
+e.g. \"email:t\"."
:group 'org-export-general
:type 'boolean)
(defcustom org-export-creator-info t
- "Non-nil means, the postamble should contain a creator sentence.
+ "Non-nil means the postamble should contain a creator sentence.
This sentence is \"HTML generated by org-mode XX in emacs XXX\"."
:group 'org-export-general
:type 'boolean)
(defcustom org-export-time-stamp-file t
- "Non-nil means, insert a time stamp into the exported file.
+ "Non-nil means insert a time stamp into the exported file.
The time stamp shows when the file was created.
This option can also be set with the +OPTIONS line,
(const :tag "On" t)))
(defcustom org-export-with-drawers nil
- "Non-nil means, export with drawers like the property drawer.
+ "Non-nil means export with drawers like the property drawer.
When t, all drawers are exported. This may also be a list of
drawer names to export."
:group 'org-export-general
(repeat :tag "Selected drawers"
(string :tag "Drawer name"))))
+(defvar org-export-first-hook nil
+ "Hook called as the first thing in each exporter.
+Point will be still in the original buffer.
+Good for general initialization")
+
(defvar org-export-preprocess-hook nil
"Hook for preprocessing an export buffer.
-Pretty much the first thing when exporting is running this hook.")
+Pretty much the first thing when exporting is running this hook.
+Point will be in a temporary buffer that contains a copy of
+the original buffer, or of the section that is being export.
+All the other hooks in the org-export-preprocess... category
+also work in that temporary buffer, already modified by various
+stages of the processing.")
(defvar org-export-preprocess-after-include-files-hook nil
"Hook for preprocessing an export buffer.
This selection includes tags-based selection, as well as removal
of commented and archived trees.")
+(defvar org-export-preprocess-after-headline-targets-hook nil
+ "Hook for preprocessing export buffer.
+This is run just after the headline targets have been defined and
+the target-alist has been set up.")
+
+(defvar org-export-preprocess-before-selecting-backend-code-hook nil
+ "Hook for preprocessing an export buffer.
+This is run just before backend-specific blocks get selected.")
+
(defvar org-export-preprocess-after-blockquote-hook nil
"Hook for preprocessing an export buffer.
This is run after blockquote/quote/verse/center have been marked
with cookies.")
+(defvar org-export-preprocess-before-normalizing-links-hook nil
+ "Hook for preprocessing an export buffer.
+This hook is run before links are normalized.")
+
(defvar org-export-preprocess-before-backend-specifics-hook nil
"Hook run before backend-specific functions are called during preprocessing.")
:group 'org-export)
(defcustom org-export-with-emphasize t
- "Non-nil means, interpret *word*, /word/, and _word_ as emphasized text.
+ "Non-nil means interpret *word*, /word/, and _word_ as emphasized text.
If the export target supports emphasizing text, the word will be
typeset in bold, italic, or underlined, respectively. Works only for
single words, but you can say: I *really* *mean* *this*.
:type 'boolean)
(defcustom org-export-with-sub-superscripts t
- "Non-nil means, interpret \"_\" and \"^\" for export.
+ "Non-nil means interpret \"_\" and \"^\" for export.
When this option is turned on, you can use TeX-like syntax for sub- and
superscripts. Several characters after \"_\" or \"^\" will be
considered as a single item - so grouping with {} is normally not
(const :tag "Never interpret" nil)))
(defcustom org-export-with-TeX-macros t
- "Non-nil means, interpret simple TeX-like macros when exporting.
+ "Non-nil means interpret simple TeX-like macros when exporting.
For example, HTML export converts \\alpha to α and \\AA to Å.
Not only real TeX macros will work here, but the standard HTML entities
for math can be used as macro names as well. For a list of supported
-names in HTML export, see the constant `org-html-entities'.
+names in HTML export, see the constant `org-entities' and the user option
+`org-entities-user'.
Not all export backends support this.
This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
:type 'boolean)
(defcustom org-export-with-LaTeX-fragments nil
- "Non-nil means, convert LaTeX fragments to images when exporting to HTML.
+ "Non-nil means convert LaTeX fragments to images when exporting to HTML.
When set, the exporter will find LaTeX environments if the \\begin line is
the first non-white thing on a line. It will also find the math delimiters
like $a=b$ and \\( a=b \\) for inline math, $$a=b$$ and \\[ a=b \\] for
:type 'boolean)
(defcustom org-export-with-fixed-width t
- "Non-nil means, lines starting with \":\" will be in fixed width font.
+ "Non-nil means lines starting with \":\" will be in fixed width font.
This can be used to have pre-formatted text, fragments of code etc. For
example:
: ;; Some Lisp examples
:type 'boolean)
(defcustom org-export-highlight-first-table-line t
- "Non-nil means, highlight the first table line.
+ "Non-nil means highlight the first table line.
In HTML export, this means use <th> instead of <td>.
In tables created with table.el, this applies to the first table line.
In Org-mode tables, all lines before the first horizontal separator
:type 'boolean)
(defcustom org-export-prefer-native-exporter-for-tables nil
- "Non-nil means, always export tables created with table.el natively.
-Natively means, use the HTML code generator in table.el.
+ "Non-nil means always export tables created with table.el natively.
+Natively means use the HTML code generator in table.el.
When nil, Org-mode's own HTML generator is used when possible (i.e. if
the table does not use row- or column-spanning). This has the
advantage, that the automatic HTML conversions for math symbols and
sub/superscripts can be applied. Org-mode's HTML generator is also
-much faster."
+much faster. The LaTeX exporter always use the native exporter for
+table.el tables."
:group 'org-export-tables
:type 'boolean)
(:fixed-width ":" org-export-with-fixed-width)
(:timestamps "<" org-export-with-timestamps)
(:author-info "author" org-export-author-info)
+ (:email-info "email" org-export-email-info)
(:creator-info "creator" org-export-creator-info)
(:time-stamp-file "timestamp" org-export-time-stamp-file)
(:tables "|" org-export-with-tables)
(defun org-install-letbind ()
"Install the values from #+BIND lines as local variables."
- (let ((letbind (plist-get org-export-opt-plist :let-bind)))
- (while letbind
- (org-set-local (caar letbind) (nth 1 (pop letbind))))))
+ (let ((letbind (plist-get org-export-opt-plist :let-bind))
+ pair)
+ (while (setq pair (pop letbind))
+ (org-set-local (car pair) (nth 1 pair)))))
(defun org-export-add-options-to-plist (p options)
"Parse an OPTIONS line and set values in the property list P."
value of `org-export-run-in-background'."
(interactive "P")
(let* ((bg (org-xor (equal arg '(16)) org-export-run-in-background))
+ subtree-p
(help "[t] insert the export option template
\[v] limit export to visible part of outline tree
+\[1] only export the current subtree
+\[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)
-\[a] export as ASCII [A] to temporary buffer
+\[a/n/u] export as ASCII/Latin-1/UFT-8 [A/N/U] to temporary buffer
-\[h] export as HTML [H] to temporary buffer [R] export region
+\[h] export as HTML [H] to temporary buffer [R] export region
\[b] export as HTML and open in browser
-\[l] export as LaTeX [L] to temporary buffer
-\[p] export as LaTeX and process to PDF
-\[d] export as LaTeX, process to PDF, and open the resulting PDF document
+\[l] export as LaTeX [L] to temporary buffer
+\[p] export as LaTeX and process to PDF [d] ... and open PDF file
-\[D] export as DocBook
-\[V] export as DocBook, process to PDF, and open the resulting PDF document
+\[D] export as DocBook [V] export as DocBook, process to PDF, and open
\[m] export as Freemind mind map
-
\[x] export as XOXO
\[g] export using Wes Hardaker's generic exporter
\[i] export current file as iCalendar file
-\[I] export all agenda files as iCalendar files
-\[c] export agenda files into combined iCalendar file
+\[I] export all agenda files as iCalendar files [c] ...as one combined file
\[F] publish current file [P] publish current project
\[X] publish a project... [E] publish every projects")
(?v org-export-visible nil)
(?a org-export-as-ascii t)
(?A org-export-as-ascii-to-buffer t)
+ (?n org-export-as-latin1 t)
+ (?N org-export-as-latin1-to-buffer t)
+ (?u org-export-as-utf8 t)
+ (?U org-export-as-utf8-to-buffer t)
(?h org-export-as-html t)
(?b org-export-as-html-and-open t)
(?H org-export-as-html-to-buffer nil)
(?P org-publish-current-project t)
(?X org-publish t)
(?E org-publish-all t)))
- r1 r2 ass)
+ r1 r2 ass
+ (cpos (point)) (cbuf (current-buffer)) bpos)
(save-excursion
(save-window-excursion
(delete-other-windows)
(org-fit-window-to-buffer (get-buffer-window
"*Org Export/Publishing Help*"))
(message "Select command: ")
- (setq r1 (read-char-exclusive))))
+ (setq r1 (read-char-exclusive))
+ (when (eq r1 ?1)
+ (setq subtree-p t)
+ (message "Select command (for subtree): ")
+ (setq r1 (read-char-exclusive)))
+ (when (eq r1 ?\ )
+ (let ((case-fold-search t))
+ (if (re-search-backward
+ "^[ \t]+\\(:latex_class:\\|:export_title:\\)[ \t]+\\S-"
+ nil t)
+ (progn
+ (org-back-to-heading t)
+ (setq subtree-p t)
+ (setq bpos (point))
+ (message "Select command (for subtree): ")
+ (setq r1 (read-char-exclusive)))
+ (error "No enclosing node with LaTeX_CLASS or EXPORT_FILE_NAME")
+ )))))
+ (and bpos (goto-char bpos))
(setq r2 (if (< r1 27) (+ r1 96) r1))
(unless (setq ass (assq r2 cmds))
(error "No command associated with key %c" r1))
(set-process-sentinel p 'org-export-process-sentinel)
(message "Background process \"%s\": started" p))
;; background processing not requested, or not possible
- (call-interactively (nth 1 ass)))))
+ (if subtree-p (progn (outline-mark-subtree) (activate-mark)))
+ (call-interactively (nth 1 ass))
+ (when (and bpos (get-buffer-window cbuf))
+ (let ((cw (selected-window)))
+ (select-window (get-buffer-window cbuf))
+ (goto-char cpos)
+ (deactivate-mark)
+ (select-window cw))))))
(defun org-export-process-sentinel (process status)
(if (string-match "\n+\\'" status)
(setq status (substring status 0 -1)))
(message "Background process \"%s\": %s" process status))
-(defconst org-html-entities
- '(("nbsp")
- ("iexcl")
- ("cent")
- ("pound")
- ("curren")
- ("yen")
- ("brvbar")
- ("vert" . "|")
- ("sect")
- ("uml")
- ("copy")
- ("ordf")
- ("laquo")
- ("not")
- ("shy")
- ("reg")
- ("macr")
- ("deg")
- ("pm" . "±")
- ("plusmn")
- ("sup2")
- ("sup3")
- ("acute")
- ("micro")
- ("para")
- ("middot")
- ("odot"."o")
- ("star"."*")
- ("cedil")
- ("sup1")
- ("ordm")
- ("raquo")
- ("frac14")
- ("frac12")
- ("frac34")
- ("iquest")
- ("Agrave")
- ("Aacute")
- ("Acirc")
- ("Atilde")
- ("Auml")
- ("Aring") ("AA"."Å")
- ("AElig")
- ("Ccedil")
- ("Egrave")
- ("Eacute")
- ("Ecirc")
- ("Euml")
- ("Igrave")
- ("Iacute")
- ("Icirc")
- ("Iuml")
- ("ETH")
- ("Ntilde")
- ("Ograve")
- ("Oacute")
- ("Ocirc")
- ("Otilde")
- ("Ouml")
- ("times")
- ("Oslash")
- ("Ugrave")
- ("Uacute")
- ("Ucirc")
- ("Uuml")
- ("Yacute")
- ("THORN")
- ("szlig")
- ("agrave")
- ("aacute")
- ("acirc")
- ("atilde")
- ("auml")
- ("aring")
- ("aelig")
- ("ccedil")
- ("egrave")
- ("eacute")
- ("ecirc")
- ("euml")
- ("igrave")
- ("iacute")
- ("icirc")
- ("iuml")
- ("eth")
- ("ntilde")
- ("ograve")
- ("oacute")
- ("ocirc")
- ("otilde")
- ("ouml")
- ("divide")
- ("oslash")
- ("ugrave")
- ("uacute")
- ("ucirc")
- ("uuml")
- ("yacute")
- ("thorn")
- ("yuml")
- ("fnof")
- ("Alpha")
- ("Beta")
- ("Gamma")
- ("Delta")
- ("Epsilon")
- ("Zeta")
- ("Eta")
- ("Theta")
- ("Iota")
- ("Kappa")
- ("Lambda")
- ("Mu")
- ("Nu")
- ("Xi")
- ("Omicron")
- ("Pi")
- ("Rho")
- ("Sigma")
- ("Tau")
- ("Upsilon")
- ("Phi")
- ("Chi")
- ("Psi")
- ("Omega")
- ("alpha")
- ("beta")
- ("gamma")
- ("delta")
- ("epsilon")
- ("varepsilon"."ε")
- ("zeta")
- ("eta")
- ("theta")
- ("iota")
- ("kappa")
- ("lambda")
- ("mu")
- ("nu")
- ("xi")
- ("omicron")
- ("pi")
- ("rho")
- ("sigmaf") ("varsigma"."ς")
- ("sigma")
- ("tau")
- ("upsilon")
- ("phi")
- ("chi")
- ("psi")
- ("omega")
- ("thetasym") ("vartheta"."ϑ")
- ("upsih")
- ("piv")
- ("bull") ("bullet"."•")
- ("hellip") ("dots"."…")
- ("prime")
- ("Prime")
- ("oline")
- ("frasl")
- ("weierp")
- ("image")
- ("real")
- ("trade")
- ("alefsym")
- ("larr") ("leftarrow"."←") ("gets"."←")
- ("uarr") ("uparrow"."↑")
- ("rarr") ("to"."→") ("rightarrow"."→")
- ("darr")("downarrow"."↓")
- ("harr") ("leftrightarrow"."↔")
- ("crarr") ("hookleftarrow"."↵") ; has round hook, not quite CR
- ("lArr") ("Leftarrow"."⇐")
- ("uArr") ("Uparrow"."⇑")
- ("rArr") ("Rightarrow"."⇒")
- ("dArr") ("Downarrow"."⇓")
- ("hArr") ("Leftrightarrow"."⇔")
- ("forall")
- ("part") ("partial"."∂")
- ("exist") ("exists"."∃")
- ("empty") ("emptyset"."∅")
- ("nabla")
- ("isin") ("in"."∈")
- ("notin")
- ("ni")
- ("prod")
- ("sum")
- ("minus")
- ("lowast") ("ast"."∗")
- ("radic")
- ("prop") ("proptp"."∝")
- ("infin") ("infty"."∞")
- ("ang") ("angle"."∠")
- ("and") ("wedge"."∧")
- ("or") ("vee"."∨")
- ("cap")
- ("cup")
- ("int")
- ("there4")
- ("sim")
- ("cong") ("simeq"."≅")
- ("asymp")("approx"."≈")
- ("ne") ("neq"."≠")
- ("equiv")
- ("le")
- ("ge")
- ("sub") ("subset"."⊂")
- ("sup") ("supset"."⊃")
- ("nsub")
- ("sube")
- ("supe")
- ("oplus")
- ("otimes")
- ("perp")
- ("sdot") ("cdot"."⋅")
- ("lceil")
- ("rceil")
- ("lfloor")
- ("rfloor")
- ("lang")
- ("rang")
- ("loz") ("Diamond"."◊")
- ("spades") ("spadesuit"."♠")
- ("clubs") ("clubsuit"."♣")
- ("hearts") ("diamondsuit"."♥")
- ("diams") ("diamondsuit"."♦")
- ("smile"."☺") ("blacksmile"."☻") ("sad"."☹")
- ("quot")
- ("amp")
- ("lt")
- ("gt")
- ("OElig")
- ("oelig")
- ("Scaron")
- ("scaron")
- ("Yuml")
- ("circ")
- ("tilde")
- ("ensp")
- ("emsp")
- ("thinsp")
- ("zwnj")
- ("zwj")
- ("lrm")
- ("rlm")
- ("ndash")
- ("mdash")
- ("lsquo")
- ("rsquo")
- ("sbquo")
- ("ldquo")
- ("rdquo")
- ("bdquo")
- ("dagger")
- ("Dagger")
- ("permil")
- ("lsaquo")
- ("rsaquo")
- ("euro")
-
- ("arccos"."arccos")
- ("arcsin"."arcsin")
- ("arctan"."arctan")
- ("arg"."arg")
- ("cos"."cos")
- ("cosh"."cosh")
- ("cot"."cot")
- ("coth"."coth")
- ("csc"."csc")
- ("deg"."deg")
- ("det"."det")
- ("dim"."dim")
- ("exp"."exp")
- ("gcd"."gcd")
- ("hom"."hom")
- ("inf"."inf")
- ("ker"."ker")
- ("lg"."lg")
- ("lim"."lim")
- ("liminf"."liminf")
- ("limsup"."limsup")
- ("ln"."ln")
- ("log"."log")
- ("max"."max")
- ("min"."min")
- ("Pr"."Pr")
- ("sec"."sec")
- ("sin"."sin")
- ("sinh"."sinh")
- ("sup"."sup")
- ("tan"."tan")
- ("tanh"."tanh")
- )
- "Entities for TeX->HTML translation.
-Entries can be like (\"ent\"), in which case \"\\ent\" will be translated to
-\"&ent;\". An entry can also be a dotted pair like (\"ent\".\"&other;\").
-In that case, \"\\ent\" will be translated to \"&other;\".
-The list contains HTML entities for Latin-1, Greek and other symbols.
-It is supplemented by a number of commonly used TeX macros with appropriate
-translations. There is currently no way for users to extend this.")
-
;;; General functions for all backends
(defvar org-export-target-aliases nil
"Alist of targets with invisible aliases.")
(defvar org-export-preferred-target-alist nil
"Alist of section id's with preferred aliases.")
+(defvar org-export-id-target-alist nil
+ "Alist of section id's with preferred aliases.")
(defvar org-export-code-refs nil
"Alist of code references and line numbers")
(outline-regexp "\\*+ ")
target-alist rtn)
- (setq org-export-target-aliases nil)
- (setq org-export-preferred-target-alist nil)
- (setq org-export-code-refs nil)
+ (setq org-export-target-aliases nil
+ org-export-preferred-target-alist nil
+ org-export-id-target-alist nil
+ org-export-code-refs nil)
(with-current-buffer (get-buffer-create " org-mode-tmp")
(erase-buffer)
(insert string)
(setq case-fold-search t)
+ (let ((inhibit-read-only t))
+ (remove-text-properties (point-min) (point-max)
+ '(read-only t)))
+
;; Remove license-to-kill stuff
;; The caller marks some stuff for killing, stuff that has been
;; used to create the page title, for example.
;; Find all headings and compute the targets for them
(setq target-alist (org-export-define-heading-targets target-alist))
+ (run-hooks 'org-export-preprocess-after-headline-targets-hook)
+
+ ;; Find HTML special classes for headlines
+ (org-export-remember-html-container-classes)
+
;; Get rid of drawers
(org-export-remove-or-extract-drawers
drawers (plist-get parameters :drawers) backend)
;; Select and protect backend specific stuff, throw away stuff
;; that is specific for other backends
+ (run-hooks 'org-export-preprocess-before-selecting-backend-code-hook)
(org-export-select-backend-specific-text backend)
;; Protect quoted subtrees
;; Normalize links: Convert angle and plain links into bracket links
;; and expand link abbreviations
+ (run-hooks 'org-export-preprocess-before-normalizing-links-hook)
(org-export-normalize-links)
;; Find all internal links. If they have a fuzzy match (i.e. not
(if (not (assoc last-section-target
org-export-preferred-target-alist))
(push (cons last-section-target id)
- org-export-preferred-target-alist))))
+ org-export-preferred-target-alist)))
+ (when (equal (match-string 1) "ID")
+ (if (not (assoc last-section-target
+ org-export-id-target-alist))
+ (push (cons last-section-target (concat "ID-" id))
+ org-export-id-target-alist))))
(setq level (org-reduced-level
(save-excursion (goto-char (point-at-bol))
(org-outline-level))))
the current file."
(goto-char (point-min))
(while (re-search-forward org-bracket-link-regexp nil t)
- (org-if-unprotected
+ (org-if-unprotected-at (1+ (match-beginning 0))
(let* ((md (match-data))
(desc (match-end 2))
(link (org-link-unescape (match-string 1)))
(unless desc (insert "][" link))
(add-text-properties pos (point) props))))))
+(defun org-export-remember-html-container-classes ()
+ "Store the HTML_CONTAINER_CLASS properties in a text property."
+ (goto-char (point-min))
+ (let (class)
+ (while (re-search-forward
+ "^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(\\S-+\\)" nil t)
+ (setq class (match-string 1))
+ (save-excursion
+ (org-back-to-heading t)
+ (put-text-property (point-at-bol) (point-at-eol) 'html-container-class class)))))
+
(defvar org-export-format-drawer-function nil
"Function to be called to format the contents of a drawer.
The function must accept three parameters:
(let ((formatters
'((docbook "DOCBOOK" "BEGIN_DOCBOOK" "END_DOCBOOK")
(html "HTML" "BEGIN_HTML" "END_HTML")
+ (beamer "BEAMER" "BEGIN_BEAMER" "END_BEAMER")
(ascii "ASCII" "BEGIN_ASCII" "END_ASCII")
(latex "LaTeX" "BEGIN_LaTeX" "END_LaTeX")))
(case-fold-search t)
"\\|"
"^[ \t]*#\\+label:[ \t]+\\(.*\\)"
"\\|"
- "^[ \t]*|[^-]"
+ "^[ \t]*\\(|[^-]\\)"
"\\|"
"^[ \t]*\\[\\[.*\\]\\][ \t]*$"))
- cap attr label)
+ cap attr label end)
(while (re-search-forward re nil t)
(cond
((match-end 1)
((match-end 3)
(setq label (org-trim (match-string 3))))
(t
- (add-text-properties (point-at-bol) (point-at-eol)
+ (setq end (if (match-end 4)
+ (let ((ee (org-table-end)))
+ (prog1 (1- (marker-position ee)) (move-marker ee nil)))
+ (point-at-eol)))
+ (add-text-properties (point-at-bol) end
(list 'org-caption cap
'org-attributes attr
'org-label label))
(if label (push (cons label label) target-alist))
+ (goto-char end)
(setq cap nil attr nil label nil)))))
target-alist)
(defun org-export-remove-comment-blocks-and-subtrees ()
"Remove the comment environment, and also commented subtrees."
(let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
- (case-fold-search nil))
+ case-fold-search)
;; Remove comment environment
(goto-char (point-min))
+ (setq case-fold-search t)
(while (re-search-forward
- "^#\\+BEGIN_COMMENT[ \t]*\n[^\000]*?^#\\+END_COMMENT\\>.*" nil t)
+ "^#\\+begin_comment[ \t]*\n[^\000]*?^#\\+end_comment\\>.*" nil t)
(replace-match "" t t))
;; Remove subtrees that are commented
(goto-char (point-min))
+ (setq case-fold-search nil)
(while (re-search-forward re-commented nil t)
(goto-char (match-beginning 0))
(delete-region (point) (org-end-of-subtree t)))))
(unless
(save-match-data
(or (org-in-regexp org-bracket-link-regexp)
- (org-in-regexp org-plain-link-re)))
+ (org-in-regexp org-plain-link-re)
+ (org-in-regexp "<<[^<>]+>>")))
(org-if-unprotected
(replace-match "\\1[[\\2]]")))))))
(while (re-search-forward "^[ \t]*|" nil t)
(beginning-of-line 1)
(if (or (looking-at "[ \t]*| *[!_^] *|")
- (not
+ (not
(memq
nil
(mapcar
can work correctly."
(goto-char (point-min))
(while (re-search-forward "\\(\\(\\[\\|\\]\\)\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\(\\[\\|\\]\\)\\)" nil t)
- (org-if-unprotected
+ (org-if-unprotected-at (match-beginning 1)
(replace-match "\\1 \\3")
(goto-char (match-beginning 0)))))
"Replace source code segments with special code for export."
(setq org-export-last-code-line-counter-value 0)
(let ((case-fold-search t)
- lang code trans opts indent)
+ lang code trans opts indent caption)
(goto-char (point-min))
(while (re-search-forward
- "\\(^\\([ \t]*\\)#\\+BEGIN_SRC:?[ \t]+\\([^ \t\n]+\\)\\(.*\\)\n\\([^\000]+?\n\\)[ \t]*#\\+END_SRC.*\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\\)"
+ "\\(^\\([ \t]*\\)#\\+BEGIN_SRC:?[ \t]+\\([^ \t\n]+\\)\\(.*\\)\n\\([^\000]+?\n\\)[ \t]*#\\+END_SRC.*\n?\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\n?\\)"
nil t)
(if (match-end 1)
;; src segments
(setq lang (match-string 3)
opts (match-string 4)
code (match-string 5)
- indent (length (match-string 2)))
+ indent (length (match-string 2))
+ caption (get-text-property 0 'org-caption (match-string 0)))
(setq lang nil
opts (match-string 8)
code (match-string 9)
- indent (length (match-string 7))))
+ indent (length (match-string 7))
+ caption (get-text-property 0 'org-caption (match-string 0))))
(setq trans (org-export-format-source-code-or-example
- backend lang code opts indent))
+ backend lang code opts indent caption))
(replace-match trans t t))))
(defvar htmlp) ;; dynamically scoped
(defvar org-export-latex-listings-langs) ;; defined in org-latex.el
(defun org-export-format-source-code-or-example
- (backend lang code &optional opts indent)
+ (backend lang code &optional opts indent caption)
"Format CODE from language LANG and return it formatted for export.
If LANG is nil, do not add any fontification.
OPTS contains formatting options, like `-n' for triggering numbering lines,
(concat "\n#+BEGIN_DOCBOOK\n"
(org-add-props (concat "<programlisting><![CDATA["
rtn
- "]]>\n</programlisting>\n")
+ "]]></programlisting>\n")
'(org-protected t))
"#+END_DOCBOOK\n"))
((eq backend 'html)
(org-export-htmlize-region-for-paste
(point-min) (point-max))))
(if (string-match "<pre\\([^>]*\\)>\n*" rtn)
- (setq rtn (replace-match
- (format "<pre class=\"src src-%s\">\n" lang)
- t t rtn))))
+ (setq rtn
+ (concat
+ (if caption
+ (concat
+ "<div class=\"org-src-container\">"
+ (format
+ "<label class=\"org-src-name\">%s</label>"
+ caption))
+ "")
+ (replace-match
+ (format "<pre class=\"src src-%s\">\n" lang)
+ t t rtn)
+ (if caption "</div>" "")))))
(if textareap
(setq rtn (concat
- (format "<p>\n<textarea cols=\"%d\" rows=\"%d\" overflow-x:scroll >\n"
+ (format "<p>\n<textarea cols=\"%d\" rows=\"%d\">"
cols rows)
rtn "</textarea>\n</p>\n"))
(with-temp-buffer
(concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t)) "\n#+END_HTML\n\n"))
((eq backend 'latex)
(setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
- (concat "\n#+BEGIN_LaTeX\n"
+ (concat "#+BEGIN_LaTeX\n"
(org-add-props
(if org-export-latex-listings
(concat
org-export-latex-listings-langs))
lang)))
(format "\\lstset{language=%s}\n" lstlang))
- "")
+ "\n")
+ (when caption
+ (format "\n%s $\\equiv$ \n" caption))
"\\begin{lstlisting}\n"
rtn "\\end{lstlisting}\n")
(concat (car org-export-latex-verbatim-wrap)
rtn (cdr org-export-latex-verbatim-wrap)))
'(org-protected t))
- "#+END_LaTeX\n\n"))
+ "#+END_LaTeX\n"))
((eq backend 'ascii)
;; This is not HTML or LaTeX, so just make it an example.
(setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont rpllbl fmt))
- (concat "#+BEGIN_ASCII\n"
+ (concat caption "\n"
+ "#+BEGIN_ASCII\n"
(org-add-props
(concat
(mapconcat
command."
(interactive
(list (progn
- (message "Export visible: [a]SCII [h]tml [b]rowse HTML [H/R]uffer with HTML [D]ocBook [x]OXO [ ]keep buffer")
+ (message "Export visible: [a]SCII [h]tml [b]rowse HTML [H/R]buffer with HTML [D]ocBook [l]atex [p]df [d]view pdf [L]atex buffer [x]OXO [ ]keep buffer")
(read-char-exclusive))
current-prefix-arg))
- (if (not (member type '(?a ?\C-a ?b ?\C-b ?h ?D ?x ?\ )))
+ (if (not (member type '(?a ?n ?u ?\C-a ?b ?\C-b ?h ?D ?x ?\ ?l ?p ?d ?L)))
(error "Invalid export key"))
(let* ((binding (cdr (assoc type
- '((?a . org-export-as-ascii)
+ '(
+ (?a . org-export-as-ascii)
(?A . org-export-as-ascii-to-buffer)
+ (?n . org-export-as-latin1)
+ (?N . org-export-as-latin1-to-buffer)
+ (?u . org-export-as-utf8)
+ (?U . org-export-as-utf8-to-buffer)
(?\C-a . org-export-as-ascii)
(?b . org-export-as-html-and-open)
(?\C-b . org-export-as-html-and-open)
(?H . org-export-as-html-to-buffer)
(?R . org-export-region-as-html)
(?D . org-export-as-docbook)
+
+ (?l . org-export-as-latex)
+ (?p . org-export-as-pdf)
+ (?d . org-export-as-pdf-and-open)
+ (?L . org-export-as-latex-to-buffer)
+
(?x . org-export-as-xoxo)))))
(keepp (equal type ?\ ))
(file buffer-file-name)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defgroup org-faces nil
"Faces in Org-mode."
:tag "Org Faces"
- :group 'org-font-lock)
+ :group 'org-appearance)
(defface org-hide
'((((background light)) (:foreground "white"))
to the part of the headline after the DONE keyword."
:group 'org-faces)
+(defcustom org-faces-easy-properties
+ '((todo . :foreground) (tag . :foreground) (priority . :foreground))
+ "The property changes by easy faces.
+This is an alist, the keys show the area of application, the values
+can be `:foreground' or `:background'. A color string for special
+keywords will then be interpreted as either foreground or background
+color."
+ :group 'org-faces
+ :group 'org-todo
+ :type '(repeat
+ (cons (choice (const todo) (const tag) (const priority))
+ (choice (const :foreground) (const :background)))))
+
(defcustom org-todo-keyword-faces nil
"Faces for specific TODO keywords.
This is a list of cons cells, with TODO keywords in the car
-and faces in the cdr. The face can be a symbol, or a property
-list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
+and faces in the cdr. The face can be a symbol, a color
+as a string (in which case the rest is inherited from the `org-todo' face),
+or a property list of attributes, like
+ (:foreground \"blue\" :weight bold :underline t).
+If it is a color string, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
:group 'org-faces
:group 'org-todo
:type '(repeat
(cons
- (string :tag "keyword")
- (sexp :tag "face"))))
+ (string :tag "Keyword")
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
(defcustom org-priority-faces nil
"Faces for specific Priorities.
This is a list of cons cells, with priority character in the car
-and faces in the cdr. The face can be a symbol, or a property
-list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
+and faces in the cdr. The face can be a symbol, a color as
+as a string, or a property list of attributes, like
+ (:foreground \"blue\" :weight bold :underline t).
+If it is a color string, the variable `org-faces-easy-properties'
+determines if it is a foreground or a background color."
:group 'org-faces
:group 'org-todo
:type '(repeat
(cons
(character :tag "Priority")
- (sexp :tag "face"))))
+ (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
(defvar org-tags-special-faces-re nil)
(defun org-set-tag-faces (var value)
(org-copy-face 'org-todo 'org-checkbox-statistics-todo
- "Face used for unfinished checkbox statistics.")
+ "Face used for unfinished checkbox statistics.")
(org-copy-face 'org-done 'org-checkbox-statistics-done
- "Face used for finished checkbox statistics.")
+ "Face used for finished checkbox statistics.")
(defcustom org-tag-faces nil
"Faces for specific tags.
This is a list of cons cells, with tags in the car and faces in the cdr.
-The face can be a symbol, or a property list of attributes,
+The face can be a symbol, a foreground color (in which case the rest is
+inherited from the `org-tag' face) or a property list of attributes,
like (:foreground \"blue\" :weight bold :underline t).
If you set this variable through customize, it will immediately be effective
in new buffers and in modified lines.
:set 'org-set-tag-faces
:type '(repeat
(cons
- (string :tag "Tag")
- (sexp :tag "Face"))))
+ (string :tag "Tag ")
+ (choice :tag "Face"
+ (string :tag "Foreground color")
+ (sexp :tag "Face")))))
(defface org-table ;; originally copied from font-lock-function-name-face
(org-compatible-face nil
:group 'org-faces
:version "22.1")
+(defface org-document-title
+ '((((class color) (background light)) (:foreground "midnight blue" :weight bold :height 1.44))
+ (((class color) (background dark)) (:foreground "pale turquoise" :weight bold :height 1.44))
+ (t (:weight bold :height 1.44)))
+ "Face for document title, i.e. that which follows the #+TITLE: keyword."
+ :group 'org-faces)
+
+(defface org-document-info
+ '((((class color) (background light)) (:foreground "midnight blue"))
+ (((class color) (background dark)) (:foreground "pale turquoise"))
+ (t nil))
+ "Face for document date, author and email; i.e. that which
+follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
+ :group 'org-faces)
+
+(defface org-document-info-keyword
+ (org-compatible-face 'shadow
+ '((((class color grayscale) (min-colors 88) (background light))
+ (:foreground "grey50"))
+ (((class color grayscale) (min-colors 88) (background dark))
+ (:foreground "grey70"))
+ (((class color) (min-colors 8) (background light))
+ (:foreground "green"))
+ (((class color) (min-colors 8) (background dark))
+ (:foreground "yellow"))))
+ "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
+ :group 'org-faces)
+
(defface org-block
(org-compatible-face 'shadow
'((((class color grayscale) (min-colors 88) (background light))
(org-copy-face 'org-block 'org-verse
"Face for #+BEGIN_VERSE ... #+END_VERSE blocks.")
+(defcustom org-fontify-quote-and-verse-blocks nil
+ "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
+When nil, format these as normal Org. This is the default, because the
+content of these blocks will still be treated as Org syntax."
+ :group 'org-faces
+ :type 'boolean)
+
(defface org-clock-overlay ;; copied from secondary-selection
(org-compatible-face nil
'((((class color) (min-colors 88) (background light))
:group 'org-faces)
(org-copy-face 'org-agenda-structure 'org-agenda-date
- "Face used in agenda for normal days.")
+ "Face used in agenda for normal days.")
(org-copy-face 'org-agenda-date 'org-agenda-date-today
- "Face used in agenda for today."
- :weight 'bold :italic 't)
+ "Face used in agenda for today."
+ :weight 'bold :italic 't)
(org-copy-face 'secondary-selection 'org-agenda-clocking
- "Face marking the current clock item in the agenda.")
+ "Face marking the current clock item in the agenda.")
(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
- "Face used in agenda for weekend days.
+ "Face used in agenda for weekend days.
See the variable `org-agenda-weekend-days' for a definition of which days
belong to the weekend."
:weight 'bold)
"Face used for time grids."
:group 'org-faces)
+(defface org-agenda-diary
+ (org-compatible-face 'default
+ nil)
+ "Face used for agenda entries that come from the Emacs diary."
+ :group 'org-faces)
+
(defconst org-level-faces
'(org-level-1 org-level-2 org-level-3 org-level-4
org-level-5 org-level-6 org-level-7 org-level-8
:group 'org-faces)
(org-copy-face 'modeline 'org-mode-line-clock
- "Face used for clock display in mode line.")
+ "Face used for clock display in mode line.")
+(org-copy-face 'modeline 'org-mode-line-clock-overrun
+ "Face used for clock display for overrun tasks in mode line."
+ :background "red")
(provide 'org-faces)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:type '(string :tag "Template"))
(defcustom org-feed-save-after-adding t
- "Non-nil means, save buffer after adding new feed items."
+ "Non-nil means save buffer after adding new feed items."
:group 'org-feed
:type 'boolean)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(declare-function org-back-to-heading "org" (&optional invisible-ok))
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
(declare-function org-in-verbatim-emphasis "org" ())
+(declare-function org-inside-latex-macro-p "org" ())
(defvar org-odd-levels-only) ;; defined in org.el
(defconst org-footnote-re
:type 'string)
(defcustom org-footnote-define-inline nil
- "Non-nil means, define footnotes inline, at reference location.
+ "Non-nil means define footnotes inline, at reference location.
When nil, footnotes will be defined in a special section near
the end of the document. When t, the [fn:label:definition] notation
will be used to define the footnote at the reference position."
:type 'boolean)
(defcustom org-footnote-auto-label t
- "Non-nil means, define automatically new labels for footnotes.
+ "Non-nil means define automatically new labels for footnotes.
Possible values are:
nil prompt the user for each label
(const :tag "Create automatic [N]" plain)))
(defcustom org-footnote-auto-adjust nil
- "Non-nil means, automatically adjust footnotes after insert/delete.
+ "Non-nil means automatically adjust footnotes after insert/delete.
When this is t, after each insertion or deletion of a footnote,
simple fn:N footnotes will be renumbered, and all footnotes will be sorted.
If you want to have just sorting or just renumbering, set this variable
(const :tag "Renumber and Sort" t)))
(defcustom org-footnote-fill-after-inline-note-extraction nil
- "Non-nil means, fill paragraphs after extracting footnotes.
+ "Non-nil means fill paragraphs after extracting footnotes.
When extracting inline footnotes, the lengths of lines can change a lot.
When this option is set, paragraphs from which an inline footnote has been
extracted will be filled again."
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
(defun org-footnote-goto-next-reference (label)
- "Find the definition of the footnote with label LABEL."
+ "Find the next reference of the footnote with label LABEL."
(interactive "sLabel: ")
(org-mark-ring-push)
(setq label (org-footnote-normalize-label label))
;; Now find footnote references, and extract the definitions
(goto-char (point-min))
(while (re-search-forward org-footnote-re nil t)
- (unless (or (org-in-commented-line) (org-in-verbatim-emphasis))
+ (unless (or (org-in-commented-line) (org-in-verbatim-emphasis)
+ (org-inside-latex-macro-p))
(org-if-unprotected
(setq def (match-string 4)
idef def
(skip-chars-backward " \t\n\t")
(delete-region (1+ (point)) (match-beginning 0))))))
(unless sort-only
- (replace-match (concat before "[" marker "]"))
+ (replace-match (concat before "[" marker "]") t t)
(and idef
org-footnote-fill-after-inline-note-extraction
(fill-paragraph)))
(if (not a) (push (list ref marker def (if idef t nil))
ref-table)))))
-
+
;; First find and remove the footnote section
(goto-char (point-min))
(cond
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(require 'xml)
(require 'org)
+(require 'rx)
(require 'org-exp)
(eval-when-compile (require 'cl))
;; file is utf-8:
;;
;; (format "&#x%x;" (- cc ;; ?\x800))
- (format "&#x%x" (encode-char cc 'ucs))
+ (format "&#x%x;" (encode-char cc 'ucs))
))))
fm-str))
(num-top2-nodes 0)
num-left-nodes
(unclosed-nodes 0)
+ (odd-only org-odd-levels-only)
(first-time t)
(current-level 1)
base-level
- skipping-odd
- (skipped-odd 0)
prev-node-end
rich-text
unfinished-tag
(setq next-node-start (match-beginning 0))
(setq next-m2 (match-string-no-properties 2))
(setq next-level (length next-m1))
- (when (> next-level current-level)
- (if (not (and org-odd-levels-only
- (/= (mod current-level 2) 0)
- (= next-level (+ 2 current-level))))
- (setq skipping-odd nil)
- (setq skipping-odd t)
- (setq skipped-odd (1+ skipped-odd)))
- (unless (or (= next-level (1+ current-level))
- skipping-odd)
- (if (or org-odd-levels-only
- (/= next-level (+ 2 current-level)))
- (error "Next level step > +1 for node ending at line %s" (line-number-at-pos))
- (error "Next level step = +2 for node ending at line %s, forgot org-odd-levels-only?"
- (line-number-at-pos)))
- ))
(setq next-children-visible
(not (eq 'outline
(get-char-property (line-end-position) 'invisible))))
(while (>= current-level next-level)
(with-current-buffer mm-buffer
(insert "</node>\n")
- (setq current-level (1- current-level))
- (when (< 0 skipped-odd)
- (setq skipped-odd (1- skipped-odd))
- (setq current-level (1- current-level)))
- )))
+ (setq current-level
+ (- current-level (if odd-only 2 1))))))
(setq this-node-end (1+ next-node-end))
(setq this-m2 next-m2)
(setq current-level next-level)
(with-current-buffer mm-buffer
(while (> current-level base-level)
(insert "</node>\n")
- (setq current-level (1- current-level))
+ (setq current-level
+ (- current-level (if odd-only 2 1)))
))
(with-current-buffer mm-buffer
(insert "</map>")
;; Tassilo Horn <tassilo at member dot fsf dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links))
(defcustom org-gnus-prefer-web-links nil
- "Non-nil means, `org-store-link' will create web links to Google groups.
+ "Non-nil means `org-store-link' will create web links to Google groups.
When nil, Gnus will be used for such links.
Using a prefix arg to the command \\[org-store-link] (`org-store-link')
negates this setting for the duration of the command."
(cond ((and group article)
(gnus-activate-group group t)
(condition-case nil
- (let ((articles 1)
- group-opened)
- (while (and (not group-opened)
- ;; stop on integer overflows
- (> articles 0))
- (setq group-opened (gnus-group-read-group articles nil group)
- articles (if (< articles 16)
- (1+ articles)
- (* articles 2))))
- (if group-opened
- (gnus-summary-goto-article article nil t)
- (message "Couldn't follow gnus link. %s"
- "The summary couldn't be opened.")))
+ (let ((backend (car (gnus-find-method-for-group group))))
+ (cond
+ ((eq backend 'nndoc)
+ (if (gnus-group-read-group t nil group)
+ (gnus-summary-goto-article article nil t)
+ (message "Couldn't follow gnus link. %s"
+ "The summary couldn't be opened.")))
+ (t
+ (let ((articles 1)
+ group-opened)
+ (while (and (not group-opened)
+ ;; stop on integer overflows
+ (> articles 0))
+ (setq group-opened (gnus-group-read-group
+ articles nil group)
+ articles (if (< articles 16)
+ (1+ articles)
+ (* articles 2))))
+ (if group-opened
+ (gnus-summary-goto-article article nil t)
+ (message "Couldn't follow gnus link. %s"
+ "The summary couldn't be opened."))))))
(quit (message "Couldn't follow gnus link. %s"
"The linked group is empty."))))
(group (gnus-group-jump-to-group group))))
;; Author: John Wiegley <johnw at gnu dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:type 'boolean)
(defface org-habit-clear-face
- '((((background light)) (:background "slateblue"))
+ '((((background light)) (:background "#8270f9"))
(((background dark)) (:background "blue")))
"Face for days on which a task shouldn't be done yet."
:group 'org-habit
:group 'org-faces)
(defface org-habit-clear-future-face
- '((((background light)) (:background "powderblue"))
+ '((((background light)) (:background "#d6e4fc"))
(((background dark)) (:background "midnightblue")))
"Face for future days on which a task shouldn't be done yet."
:group 'org-habit
:group 'org-faces)
(defface org-habit-ready-face
- '((((background light)) (:background "green"))
+ '((((background light)) (:background "#4df946"))
(((background dark)) (:background "forestgreen")))
"Face for days on which a task should start to be done."
:group 'org-habit
:group 'org-faces)
(defface org-habit-ready-future-face
- '((((background light)) (:background "palegreen"))
+ '((((background light)) (:background "#acfca9"))
(((background dark)) (:background "darkgreen")))
"Face for days on which a task should start to be done."
:group 'org-habit
:group 'org-faces)
(defface org-habit-alert-face
- '((((background light)) (:background "yellow"))
+ '((((background light)) (:background "#f5f946"))
(((background dark)) (:background "gold")))
"Face for days on which a task is due."
:group 'org-habit
:group 'org-faces)
(defface org-habit-alert-future-face
- '((((background light)) (:background "palegoldenrod"))
+ '((((background light)) (:background "#fafca9"))
(((background dark)) (:background "darkgoldenrod")))
"Face for days on which a task is due."
:group 'org-habit
:group 'org-faces)
(defface org-habit-overdue-face
- '((((background light)) (:background "red"))
+ '((((background light)) (:background "#f9372d"))
(((background dark)) (:background "firebrick")))
"Face for days on which a task is overdue."
:group 'org-habit
:group 'org-faces)
(defface org-habit-overdue-future-face
- '((((background light)) (:background "mistyrose"))
+ '((((background light)) (:background "#fc9590"))
(((background dark)) (:background "darkred")))
"Face for days on which a task is overdue."
:group 'org-habit
(defun org-habit-insert-consistency-graphs (&optional line)
"Insert consistency graph for any habitual tasks."
(let ((inhibit-read-only t) l c
+ (buffer-invisibility-spec '(org-link))
(moment (time-subtract (current-time)
(list 0 (* 3600 org-extend-today-until) 0))))
(save-excursion
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(string :tag "Declaration")))))
(defcustom org-export-html-style-include-scripts t
- "Non-nil means, include the javascript snippets in exported HTML files.
+ "Non-nil means include the javascript snippets in exported HTML files.
The actual script is defined in `org-export-html-scripts' and should
not be modified."
:group 'org-export-html
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
+ textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
`org-export-html-style-include-default'.")
(defcustom org-export-html-style-include-default t
- "Non-nil means, include the default style in exported HTML files.
+ "Non-nil means include the default style in exported HTML files.
The actual style is defined in `org-export-html-style-default' and should
not be modified. Use the variables `org-export-html-style' to add
your own style information."
:type 'string)
(defcustom org-export-html-link-org-files-as-html t
- "Non-nil means, make file links to `file.org' point to `file.html'.
+ "Non-nil means make file links to `file.org' point to `file.html'.
When org-mode is exporting an org-mode file to HTML, links to
non-html files are directly put into a href tag in HTML.
However, links to other Org-mode files (recognized by the
:type 'boolean)
(defcustom org-export-html-inline-images 'maybe
- "Non-nil means, inline images into exported HTML pages.
+ "Non-nil means inline images into exported HTML pages.
This is done using an <img> tag. When nil, an anchor with href is used to
link to the image. If this option is `maybe', then images in links with
an empty description will be inlined, while images with a description will
(defcustom org-export-html-table-use-header-tags-for-first-column nil
- "Non-nil means, format column one in tables with header tags.
+ "Non-nil means format column one in tables with header tags.
When nil, also column one will use data tags."
:group 'org-export-tables
:type 'boolean)
(defcustom org-export-html-validation-link nil
- "Non-nil means, add validationlink to postamble of HTML exported files."
+ "Non-nil means add validationlink to postamble of HTML exported files."
:group 'org-export-html
:type '(choice
(const :tag "Nothing" nil)
"Hook run during HTML export, after blockquote, verse, center are done.")
(defvar org-export-html-final-hook nil
- "Hook run during HTML export, after blockquote, verse, center are done.")
+ "Hook run at the end of HTML export, in the new buffer.")
;;; HTML export
(file-name-nondirectory
org-current-export-file)))
org-current-export-dir nil "Creating LaTeX image %s"))
- (message "Exporting..."))
+ (goto-char (point-min))
+ (let (label l1)
+ (while (re-search-forward "\\\\ref{\\([^{}\n]+\\)}" nil t)
+ (org-if-unprotected-at (match-beginning 1)
+ (setq label (match-string 1))
+ (save-match-data
+ (if (string-match "\\`[a-z]\\{1,10\\}:\\(.+\\)" label)
+ (setq l1 (substring label (match-beginning 1)))
+ (setq l1 label)))
+ (replace-match (format "[[#%s][%s]]" label l1) t t)))))
;;;###autoload
(defun org-export-as-html-and-open (arg)
headlines. The default is 3. Lower levels will become bulleted lists."
(interactive "P")
(org-export-as-html arg 'hidden)
- (org-open-file buffer-file-name))
+ (org-open-file buffer-file-name)
+ (when org-export-kill-product-buffer-when-displayed
+ (kill-buffer)))
;;;###autoload
(defun org-export-as-html-batch ()
<body>...</body>, without even the body tags themselves. When
PUB-DIR is set, use this as the publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(author (plist-get opt-plist :author))
(title (or (and subtree-p (org-export-get-title-from-subtree))
(plist-get opt-plist :title)
- (and (not
+ (and (not body-only)
+ (not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
(and buffer-file-name
(push "<ul>\n<li>" thetoc)
(setq lines
(mapcar '(lambda (line)
- (if (string-match org-todo-line-regexp line)
+ (if (and (string-match org-todo-line-regexp line)
+ (not (get-text-property 0 'org-protected line)))
;; This is a headline
(progn
(setq have-headings t)
"\" class=\"target\">" (match-string 1 line)
"@</a> ")
t t line)))))
-
+
(setq line (org-html-handle-time-stamps line))
;; replace "&" by "&", "<" and ">" by "<" and ">"
(not (string-match "^[0-9]*$" search))
(not (string-match "^\\*" search))
(not (string-match "^/.*/$" search)))
- (setq thefile (concat thefile "#"
- (org-solidify-link-text
- (org-link-unescape search)))))
+ (setq thefile
+ (concat thefile
+ (if (= (string-to-char search) ?#) "" "#")
+ (org-solidify-link-text
+ (org-link-unescape search)))))
(when (string-match "^file:" desc)
(setq desc (replace-match "" t t desc))
(if (string-match "\\.org$" desc)
(when (and org-export-author-info author)
(insert "<p class=\"author\"> "
(nth 1 lang-words) ": " author "\n")
- (when email
+ (when (and org-export-email-info email (string-match "\\S-" email))
(if (listp (split-string email ",+ *"))
(mapc (lambda(e)
(insert "<a href=\"mailto:" e "\"><"
(delete-region beg end)
(insert (format "<span style=\"visibility:hidden;\">%s</span>"
(make-string n ?x)))))
+ ;; Remove empty lines at the beginning of the file.
+ (goto-char (point-min))
+ (when (looking-at "\\s-+\n") (replace-match ""))
+ ;; Remove display properties
+ (remove-text-properties (point-min) (point-max) '(display t))
+ ;; Run the hook
(run-hooks 'org-export-html-final-hook)
(or to-buffer (save-buffer))
(goto-char (point-min))
"Create image tag with source and attributes."
(save-match-data
(if (string-match "^ltxpng/" src)
- (format "<img src=\"%s\"/>" src)
+ (format "<img src=\"%s\" alt=\"%s\"/>"
+ src (org-find-text-property-in-string 'org-latex-src src))
(let* ((caption (org-find-text-property-in-string 'org-caption src))
(attr (org-find-text-property-in-string 'org-attributes src))
(label (org-find-text-property-in-string 'org-label src)))
+ (setq caption (and caption (org-html-do-expand caption)))
(concat
(if caption
(format "%s<div %sclass=\"figure\">
;; column and the special lines
(setq lines (org-table-clean-before-export lines)))
- (let* ((caption (or (get-text-property 0 'org-caption (car lines))
- (get-text-property (or (next-single-property-change
- 0 'org-caption (car lines))
- 0)
- 'org-caption (car lines))))
- (attributes (or (get-text-property 0 'org-attributes (car lines))
- (get-text-property (or (next-single-property-change
- 0 'org-attributes (car lines))
- 0)
- 'org-attributes (car lines))))
+ (let* ((caption (org-find-text-property-in-string 'org-caption (car lines)))
+ (label (org-find-text-property-in-string 'org-label (car lines)))
+ (attributes (org-find-text-property-in-string 'org-attributes
+ (car lines)))
(html-table-tag (org-export-splice-attributes
html-table-tag attributes))
(head (and org-export-highlight-first-table-line
(nline 0) fnum i
tbopen line fields html gr colgropen rowstart rowend)
+ (setq caption (and caption (org-html-do-expand caption)))
(if splice (setq head nil))
(unless splice (push (if head "<thead>" "<tbody>") html))
(setq tbopen t)
;; DocBook document, we want to always include the caption to make
;; DocBook XML file valid.
(push (format "<caption>%s</caption>" (or caption "")) html)
+ (when label (push (format "<a name=\"%s\" id=\"%s\"></a>" label label)
+ html))
(push html-table-tag html))
(concat (mapconcat 'identity html "\n") "\n")))
(let* ((re (concat org-bracket-link-regexp "\\|"
(org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
m s l res)
- (while (setq m (string-match re string))
- (setq s (substring string 0 m)
- l (match-string 0 string)
- string (substring string (match-end 0)))
- (push (org-html-do-expand s) res)
- (push l res))
- (push (org-html-do-expand string) res)
- (apply 'concat (nreverse res))))
+ (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
+ string
+ (while (setq m (string-match re string))
+ (setq s (substring string 0 m)
+ l (match-string 0 string)
+ string (substring string (match-end 0)))
+ (push (org-html-do-expand s) res)
+ (push l res))
+ (push (org-html-do-expand string) res)
+ (apply 'concat (nreverse res)))))
(defun org-html-do-expand (s)
"Apply all active conversions to translate special ASCII to HTML."
(if org-export-with-sub-superscripts
(setq s (org-export-html-convert-sub-super s)))
(if org-export-with-TeX-macros
- (let ((start 0) wd ass)
- (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?"
+ (let ((start 0) wd rep)
+ (while (setq start (string-match "\\\\\\([a-zA-Z]+[0-9]*\\)\\({}\\)?"
s start))
(if (get-text-property (match-beginning 0) 'org-protected s)
(setq start (match-end 0))
(setq wd (match-string 1 s))
- (if (setq ass (assoc wd org-html-entities))
- (setq s (replace-match (or (cdr ass)
- (concat "&" (car ass) ";"))
- t t s))
+ (if (setq rep (org-entity-get-representation wd 'html))
+ (setq s (replace-match rep t t s))
(setq start (+ start (length wd))))))))
s)
When TITLE is nil, just close all open levels."
(org-close-par-maybe)
(let* ((target (and title (org-get-text-property-any 0 'target title)))
- (extra-targets (assoc target org-export-target-aliases))
- (preferred (cdr (assoc target org-export-preferred-target-alist)))
+ (extra-targets (and target
+ (assoc target org-export-target-aliases)))
+ (extra-class (and title (org-get-text-property-any 0 'html-container-class title)))
+ (preferred (and target
+ (cdr (assoc target org-export-preferred-target-alist))))
(remove (or preferred target))
(l org-level-max)
snumber href suffix)
(setq href (cdr (assoc (concat "sec-" snumber) org-export-preferred-target-alist)))
(setq suffix (or href snumber))
(setq href (or href (concat "sec-" snumber)))
- (insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
- suffix level level href
+ (insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d%s\">\n<h%d id=\"%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
+ suffix level (if extra-class (concat " " extra-class) "")
+ level href
extra-targets
title level level suffix))
(org-open-par)))))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:type 'string)
(defcustom org-icalendar-use-plain-timestamp t
- "Non-nil means, make an event from every plain time stamp."
+ "Non-nil means make an event from every plain time stamp."
:group 'org-export-icalendar
:type 'boolean)
(const :tag "All tags, including inherited ones" all-tags))))
(defcustom org-icalendar-include-todo nil
- "Non-nil means, export to iCalendar files should also cover TODO items.
+ "Non-nil means export to iCalendar files should also cover TODO items.
Valid values are:
nil don't include any TODO items
t include all TODO items that are not in a DONE state
for whatever you need.")
(defcustom org-icalendar-include-bbdb-anniversaries nil
- "Non-nil means, a combined iCalendar files should include anniversaries.
+ "Non-nil means a combined iCalendar files should include anniversaries.
The anniversaries are define in the BBDB database."
:group 'org-export-icalendar
:type 'boolean)
(defcustom org-icalendar-include-sexps t
- "Non-nil means, export to iCalendar files should also cover sexp entries.
+ "Non-nil means export to iCalendar files should also cover sexp entries.
These are entries like in the diary, but directly in an Org-mode file."
:group 'org-export-icalendar
:type 'boolean)
(integer :tag "Max characters")))
(defcustom org-icalendar-store-UID nil
- "Non-nil means, store any created UIDs in properties.
+ "Non-nil means store any created UIDs in properties.
The iCalendar standard requires that all entries have a unique identifier.
Org will create these identifiers as needed. When this variable is non-nil,
the created UIDs will be stored in the ID property of the entry. Then the
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(string :tag "Prefix")))
(defcustom org-id-include-domain nil
- "Non-nil means, add the domain name to new IDs.
+ "Non-nil means add the domain name to new IDs.
This ensures global uniqueness of IDs, and is also suggested by
RFC 2445 in combination with RFC 822. This is only relevant if
`org-id-method' is `org'. When uuidgen is used, the domain will never
:type 'boolean)
(defcustom org-id-track-globally t
- "Non-nil means, track IDs through files, so that links work globally.
+ "Non-nil means track IDs through files, so that links work globally.
This work by maintaining a hash table for IDs and writing this table
to disk when exiting Emacs. Because of this, it works best if you use
a single Emacs process, not many.
(file))))
(defcustom org-id-search-archives t
- "Non-nil means, search also the archive files of agenda files for entries.
+ "Non-nil means search also the archive files of agenda files for entries.
This is a possibility to reduce overhead, but it means that entries moved
to the archives can no longer be found by ID.
This variable is only relevant when `org-id-track-globally' is set."
(defun org-id-locations-save ()
"Save `org-id-locations' in `org-id-locations-file'."
- (when org-id-track-globally
+ (when (and org-id-track-globally org-id-locations)
(let ((out (if (hash-table-p org-id-locations)
(org-id-hash-to-alist org-id-locations)
org-id-locations)))
(defun org-id-find-id-file (id)
"Query the id database for the file in which this ID is located."
(unless org-id-locations (org-id-locations-load))
- (or (gethash id org-id-locations)
+ (or (and org-id-locations
+ (hash-table-p org-id-locations)
+ (gethash id org-id-locations))
;; ball back on current buffer
(buffer-file-name (or (buffer-base-buffer (current-buffer))
(current-buffer)))))
"Store a link to the current entry, using its ID."
(interactive)
(let* ((link (org-make-link "id:" (org-id-get-create)))
+ (case-fold-search nil)
(desc (save-excursion
(org-back-to-heading t)
(or (and (looking-at org-complex-heading-regexp)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defgroup org-indent nil
"Options concerning dynamic virtual outline indentation."
- :tag "Org Structure"
+ :tag "Org Indent"
:group 'org)
(defconst org-indent-max 40
:type 'character)
(defcustom org-indent-mode-turns-off-org-adapt-indentation t
- "Non-nil means, turning on org-indent-mode turns off indentation adaptation.
+ "Non-nil means turning on `org-indent-mode' turns off indentation adaptation.
For details see the variable `org-adapt-indentation'."
:group 'org-indent
:type 'boolean)
(defcustom org-indent-mode-turns-on-hiding-stars t
- "Non-nil means, turning on org-indent-mode turns on `org-hide-leading-stars'."
+ "Non-nil means turning on `org-indent-mode' turns on `org-hide-leading-stars'."
:group 'org-indent
:type 'boolean)
b e (list 'line-prefix (aref org-indent-strings n)
'wrap-prefix (aref org-indent-strings n))))
(setq b (1+ (point-at-eol))
- n (* level org-indent-indentation-per-level))))))))
+ n (* (or level 0) org-indent-indentation-per-level))))))))
(defun org-indent-refresh-section ()
"Refresh indentation properties in the current outline section.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;; This file is part of GNU Emacs.
:type 'boolean)
(defcustom org-inlinetask-export t
- "Non-nil means, export inline tasks.
+ "Non-nil means export inline tasks.
When nil, they will not be exported."
:group 'org-inlinetask
:type 'boolean)
(when (string-match org-complex-heading-regexp headline)
(setq headline (concat
(if (match-end 2)
- (concat (match-string 2 headline) " ") "")
+ (concat
+ (org-add-props
+ (format
+ "@<span class=\"%s %s\"> %s@</span>"
+ (if (member (match-string 2 headline)
+ org-done-keywords)
+ "done" "todo")
+ (match-string 2 headline)
+ (match-string 2 headline))
+ nil 'org-protected t)
+ " ") "")
(match-string 4 headline)))
(when content
(if (not (string-match "\\S-" content))
(provide 'org-inlinetask)
-;; arch-tag: 59fdac51-8bcc-469e-a21e-6897dd6697bb
;;; org-inlinetask.el ends here
;;
;; Author: Philip Jackson <emacs@shellarchive.co.uk>
;; Keywords: erc, irc, link, org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;;
;; Emacs Lisp Archive Entry
;; Filename: org-latex.el
-;; Version: 6.33x
+;; Version: 6.35i
;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
;; Keywords: org, wp, tex
(require 'org)
(require 'org-exp)
(require 'org-macs)
+(require 'org-beamer)
;;; Variables:
(defvar org-export-latex-class nil)
+(defvar org-export-latex-class-options nil)
(defvar org-export-latex-header nil)
(defvar org-export-latex-append-header nil)
(defvar org-export-latex-options-plist nil)
(defcustom org-export-latex-classes
'(("article"
- "\\documentclass[11pt]{article}
-\\usepackage[utf8]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{graphicx}
-\\usepackage{longtable}
-\\usepackage{float}
-\\usepackage{wrapfig}
-\\usepackage{soul}
-\\usepackage{amssymb}
-\\usepackage{hyperref}"
+ "\\documentclass[11pt]{article}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("report"
- "\\documentclass[11pt]{report}
-\\usepackage[utf8]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{graphicx}
-\\usepackage{longtable}
-\\usepackage{float}
-\\usepackage{wrapfig}
-\\usepackage{soul}
-\\usepackage{amssymb}
-\\usepackage{hyperref}"
+ "\\documentclass[11pt]{report}"
("\\part{%s}" . "\\part*{%s}")
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("book"
- "\\documentclass[11pt]{book}
-\\usepackage[utf8]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{graphicx}
-\\usepackage{longtable}
-\\usepackage{float}
-\\usepackage{wrapfig}
-\\usepackage{soul}
-\\usepackage{amssymb}
-\\usepackage{hyperref}"
+ "\\documentclass[11pt]{book}"
("\\part{%s}" . "\\part*{%s}")
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
+ ("beamer"
+ "\\documentclass{beamer}"
+ org-beamer-sectioning
+ ))
"Alist of LaTeX classes and associated header and structure.
If #+LaTeX_CLASS is set in the buffer, use its value and the
associated information. Here is the structure of each cell:
(numbered-section . unnumbered-section\)
...\)
-A %s formatter is mandatory in each section string and will be
-replaced by the title of the section.
+The header string
+-----------------
+
+The HEADER-STRING is the header that will be inserted into the LaTeX file.
+It should contain the \\documentclass macro, and anything else that is needed
+for this setup. To this header, the following commands will be added:
+
+- Calls to \\usepackage for all packages mentioned in the variables
+ `org-export-latex-default-packages-alist' and
+ `org-export-latex-packages-alist'. Thus, your header definitions should
+ avoid to also request these packages.
+
+- Lines specified via \"#+LaTeX_HEADER:\"
+
+If you need more control about the sequence in which the header is built
+up, or if you want to exclude one of these building blocks for a particular
+class, you can use the following macro-like placeholders.
+
+ [DEFAULT-PACKAGES] \\usepackage statements for default packages
+ [NO-DEFAULT-PACKAGES] do not include any of the default packages
+ [PACKAGES] \\usepackage statements for packages
+ [NO-PACKAGES] do not include the packages
+ [EXTRA] the stuff from #+LaTeX_HEADER
+ [NO-EXTRA] do not include #+LaTeX_HEADER stuff
+
+So a header like
+
+ \\documentclass{article}
+ [NO-DEFAULT-PACKAGES]
+ [EXTRA]
+ \\providecommand{\\alert}[1]{\\textbf{#1}}
+ [PACKAGES]
+
+will omit the default packages, and will include the #+LaTeX_HEADER lines,
+then have a call to \\providecommand, and then place \\usepackage commands
+based on the content of `org-export-latex-packages-alist'.
+
+If your header or `org-export-latex-default-packages-alist' inserts
+\"\\usepackage[AUTO]{inputenc}\", AUTO will automatically be replaced with
+a coding system derived from `buffer-file-coding-system'. See also the
+variable `org-export-latex-inputenc-alist' for a way to influence this
+mechanism.
+
+The sectioning structure
+------------------------
+
+The sectioning structure of the class is given by the elements following
+the header string. For each sectioning level, a number of strings is
+specified. A %s formatter is mandatory in each section string and will
+be replaced by the title of the section.
Instead of a cons cell (numbered . unnumbered), you can also provide a list
-of 2-4 elements,
+of 2 or 4 elements,
(numbered-open numbered-close)
(numbered-open numbered-close unnumbered-open unnumbered-close)
-providing opening and closing strings for an environment that should
+providing opening and closing strings for a LaTeX environment that should
represent the document section. The opening clause should have a %s
-to represent the section title."
+to represent the section title.
+
+Instead of a list of sectioning commands, you can also specify a
+function name. That function will be called with two parameters,
+the (reduced) level of the headline, and the headline text. The function
+must return a cons cell with the (possibly modified) headline text, and the
+sectioning list in the cdr."
:group 'org-export-latex
:type '(repeat
(list (string :tag "LaTeX class")
(repeat :tag "Levels" :inline t
(choice
(cons :tag "Heading"
- (string :tag "numbered")
- (string :tag "unnumbered)"))
+ (string :tag " numbered")
+ (string :tag "unnumbered"))
(list :tag "Environment"
- (string :tag "Opening (numbered) ")
- (string :tag "Closing (numbered) ")
+ (string :tag "Opening (numbered)")
+ (string :tag "Closing (numbered)")
(string :tag "Opening (unnumbered)")
- (string :tag "Closing (unnumbered)")))))))
+ (string :tag "Closing (unnumbered)"))
+ (function :tag "Hook computing sectioning"))))))
+
+(defcustom org-export-latex-inputenc-alist nil
+ "Alist of inputenc coding system names, and what should really be used.
+For example, adding an entry
+
+ (\"utf8\" . \"utf8x\")
+
+will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
+are written as utf8 files."
+ :group 'org-export-latex
+ :type '(repeat
+ (cons
+ (string :tag "Derived from buffer")
+ (string :tag "Use this instead"))))
+
(defcustom org-export-latex-emphasis-alist
'(("*" "\\textbf{%s}" nil)
:group 'org-export-latex
:type 'string)
+(defcustom org-export-latex-hyperref-format "\\href{%s}{%s}"
+ "A printf format string to be applied to hyperref links.
+The format must contain two %s instances. The first will be filled with
+the link, the second with the link description."
+ :group 'org-export-latex
+ :type 'string)
+
(defcustom org-export-latex-tables-verbatim nil
"When non-nil, tables are exported verbatim."
:group 'org-export-latex
(string :tag "Close")))
(defcustom org-export-latex-listings nil
- "Non-nil means, export source code using the listings package.
+ "Non-nil means export source code using the listings package.
This package will fontify source code, possibly even with color.
If you want to use this, you also need to make LaTeX use the
listings package, and if you want to have color, the color
(defgroup org-export-pdf nil
"Options for exporting Org-mode files to PDF, via LaTeX."
- :tag "Org Export LaTeX"
+ :tag "Org Export PDF"
:group 'org-export-latex
:group 'org-export)
Alternatively, this may be a Lisp function that does the processing, so you
could use this to apply the machinery of AUCTeX or the Emacs LaTeX mode.
This function should accept the file name as its single argument."
- :group 'org-export-latex
+ :group 'org-export-pdf
:type '(choice (repeat :tag "Shell command sequence"
(string :tag "Shell command"))
(function)))
+(defcustom org-export-pdf-logfiles
+ '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
+ "The list of file extensions to consider as LaTeX logfiles."
+ :group 'org-export-pdf
+ :type '(repeat (string :tag "Extension")))
+
(defcustom org-export-pdf-remove-logfiles t
- "Non-nil means, remove the logfiles produced by PDF production.
+ "Non-nil means remove the logfiles produced by PDF production.
These are the .aux, .log, .out, and .toc files."
:group 'org-export-pdf
:type 'boolean)
;;; Hooks
+(defvar org-export-latex-after-initial-vars-hook nil
+ "Hook run before LaTeX export.
+The exact moment is after the initial variables like org-export-latex-class
+have been determined from the environment.")
+
(defvar org-export-latex-after-blockquotes-hook nil
"Hook run during LaTeX export, after blockquote, verse, center are done.")
(defvar org-export-latex-final-hook nil
"Hook run in the finalized LaTeX buffer.")
+(defvar org-export-latex-after-save-hook nil
+ "Hook run in the finalized LaTeX buffer, after it has been saved.")
+
;;; Autoload functions:
;;;###autoload
without even the \begin{document} and \end{document} commands.
when PUB-DIR is set, use this as the publishing directory."
(interactive "P")
+ (run-hooks 'org-export-first-hook)
+
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(not buffer-file-name))
(message "Exporting to LaTeX...")
(org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill nil)))
+ (let ((inhibit-read-only t))
+ (remove-text-properties (point-min) (point-max)
+ '(:org-license-to-kill nil))))
(org-update-radio-target-regexp)
(org-export-latex-set-initial-vars ext-plist arg)
+ (setq org-export-opt-plist org-export-latex-options-plist)
+ (org-install-letbind)
+ (run-hooks 'org-export-latex-after-initial-vars-hook)
(let* ((wcf (current-window-configuration))
(opt-plist org-export-latex-options-plist)
(region-p (org-region-active-p))
(org-export-add-subtree-options opt-plist rbeg)
opt-plist)))
;; Make sure the variable contains the updated values.
- (org-export-latex-options-plist opt-plist)
+ (org-export-latex-options-plist (setq org-export-opt-plist opt-plist))
+ ;; The following two are dynamically scoped into other
+ ;; routines below.
+ (org-current-export-dir
+ (or pub-dir (org-export-directory :html opt-plist)))
+ (org-current-export-file buffer-file-name)
(title (or (and subtree-p (org-export-get-title-from-subtree))
(plist-get opt-plist :title)
(and (not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))))
- (filename (concat (file-name-as-directory
- (or pub-dir
- (org-export-directory :LaTeX ext-plist)))
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get rbeg "EXPORT_FILE_NAME" t))
- (file-name-nondirectory ;sans-extension
- buffer-file-name)))
- ".tex"))
- (filename (if (equal (file-truename filename)
- (file-truename buffer-file-name))
- (concat filename ".tex")
- filename))
+ (and buffer-file-name
+ (file-name-sans-extension
+ (file-name-nondirectory buffer-file-name)))
+ "No Title"))
+ (filename
+ (and (not to-buffer)
+ (concat
+ (file-name-as-directory
+ (or pub-dir
+ (org-export-directory :LaTeX ext-plist)))
+ (file-name-sans-extension
+ (or (and subtree-p
+ (org-entry-get rbeg "EXPORT_FILE_NAME" t))
+ (file-name-nondirectory ;sans-extension
+ (or buffer-file-name
+ (error "Don't know which export file to use.")))))
+ ".tex")))
+ (filename
+ (and filename
+ (if (equal (file-truename filename)
+ (file-truename (or buffer-file-name "dummy.org")))
+ (concat filename ".tex")
+ filename)))
(buffer (if to-buffer
(cond
((eq to-buffer 'string) (get-buffer-create
(region (buffer-substring
(if region-p (region-beginning) (point-min))
(if region-p (region-end) (point-max))))
+ (text
+ (and text (string-match "\\S-" text)
+ (org-export-preprocess-string
+ text
+ :emph-multiline t
+ :for-LaTeX t
+ :comments nil
+ :tags (plist-get opt-plist :tags)
+ :priority (plist-get opt-plist :priority)
+ :footnotes (plist-get opt-plist :footnotes)
+ :drawers (plist-get opt-plist :drawers)
+ :timestamps (plist-get opt-plist :timestamps)
+ :todo-keywords (plist-get opt-plist :todo-keywords)
+ :add-text nil
+ :skip-before-1st-heading skip
+ :select-tags nil
+ :exclude-tags nil
+ :LaTeX-fragments nil)))
(string-for-export
(org-export-preprocess-string
region
;; finalization
(unless body-only (insert "\n\\end{document}"))
+ ;; Attach description terms to the \item macro
+ (goto-char (point-min))
+ (while (re-search-forward "^[ \t]*\\\\item\\([ \t]+\\)\\[" nil t)
+ (delete-region (match-beginning 1) (match-end 1)))
+
;; Relocate the table of contents
(goto-char (point-min))
(when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
(and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
(replace-match "\\tableofcontents" t t)))
+ ;; Cleanup forced line ends in items where they are not needed
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*\n\\\\begin"
+ nil t)
+ (delete-region (match-beginning 1) (match-end 1)))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*"
+ nil t)
+ (if (looking-at "[\n \t]+")
+ (replace-match "\n")))
+
(run-hooks 'org-export-latex-final-hook)
(or to-buffer (save-buffer))
+ (org-export-latex-fix-inputenc)
+ (run-hooks 'org-export-latex-after-save-hook)
(goto-char (point-min))
(or (org-export-push-to-kill-ring "LaTeX")
(message "Exporting to LaTeX...done"))
(re-search-forward "\\\\bibliography{" nil t))))
cmd)
(with-current-buffer outbuf (erase-buffer))
- (and (file-exists-p pdffile) (delete-file pdffile))
(message "Processing LaTeX file...")
(if (and cmds (symbolp cmds))
(funcall cmds file)
(error "PDF file was not produced")
(set-window-configuration wconfig)
(when org-export-pdf-remove-logfiles
- (dolist (ext '("aux" "log" "out" "toc"))
+ (dolist (ext org-export-pdf-logfiles)
(setq file (concat base "." ext))
(and (file-exists-p file) (delete-file file))))
(message "Exporting to PDF...done")
(interactive "P")
(let ((pdffile (org-export-as-pdf arg)))
(if pdffile
- (org-open-file pdffile)
+ (progn
+ (org-open-file pdffile)
+ (when org-export-kill-product-buffer-when-displayed
+ (kill-buffer (find-buffer-visiting
+ (concat (file-name-sans-extension (buffer-file-name))
+ ".tex")))))
(error "PDF file was not produced"))))
;;; Parsing functions:
(goto-char (point-min))
(let* ((cnt 0) output
(depth org-export-latex-sectioning-depth))
- (while (re-search-forward
+ (while (org-re-search-forward-unprotected
(concat "^\\(\\(?:\\*\\)\\{"
(number-to-string (+ (if odd 2 1) level))
"\\}\\) \\(.*\\)$")
(when (> level 0)
(save-excursion
(save-match-data
- (re-search-forward
+ (org-re-search-forward-unprotected
(concat "^\\(\\(?:\\*\\)\\{"
(number-to-string level)
"\\}\\) \\(.*\\)$") nil t)))) t)
(narrow-to-region
(point)
(save-match-data
- (if (re-search-forward
+ (if (org-re-search-forward-unprotected
(concat "^\\(\\(?:\\*\\)\\{"
(number-to-string (+ (if odd 2 1) level))
"\\}\\) \\(.*\\)$") nil t)
(defun org-export-latex-parse-content ()
"Extract the content of a section."
(let ((beg (point))
- (end (if (re-search-forward "^\\(\\*\\)+ .*$" nil t)
+ (end (if (org-re-search-forward-unprotected "^\\(\\*\\)+ .*$" nil t)
(progn (beginning-of-line) (point))
(point-max))))
(buffer-substring beg end)))
(defun org-export-latex-parse-subcontent (level odd)
"Extract the subcontent of a section at LEVEL.
If ODD Is non-nil, assume subcontent only contains odd sections."
- (if (not (re-search-forward
+ (if (not (org-re-search-forward-unprotected
(concat "^\\(\\(?:\\*\\)\\{"
(number-to-string (+ (if odd 4 2) level))
"\\}\\) \\(.*\\)$")
(defun org-export-latex-subcontent (subcontent num)
"Export each cell of SUBCONTENT to LaTeX.
If NUM, export sections as numerical sections."
- (let* ((heading (org-export-latex-fontify-headline
- (cdr (assoc 'heading subcontent))))
+ (let* ((heading (cdr (assoc 'heading subcontent)))
(level (- (cdr (assoc 'level subcontent))
org-export-latex-add-level))
(occur (number-to-string (cdr (assoc 'occur subcontent))))
(subcontent (cadr (assoc 'subcontent subcontent)))
(label (org-get-text-property-any 0 'target heading))
(label-list (cons label (cdr (assoc label
- org-export-target-aliases)))))
+ org-export-target-aliases))))
+ (sectioning org-export-latex-sectioning)
+ (depth org-export-latex-sectioning-depth)
+ main-heading sub-heading)
+ (when (symbolp (car sectioning))
+ (setq sectioning (funcall (car sectioning) level heading))
+ (when sectioning
+ (setq heading (car sectioning)
+ sectioning (cdr sectioning)
+ ;; target property migh have changed...
+ label (org-get-text-property-any 0 'target heading)
+ label-list (cons label (cdr (assoc label
+ org-export-target-aliases)))))
+ (if sectioning (setq sectioning (make-list 10 sectioning)))
+ (setq depth (if sectioning 10000 0)))
+ (if (string-match "[ \t]*\\\\\\\\[ \t]*" heading)
+ (setq main-heading (substring heading 0 (match-beginning 0))
+ sub-heading (substring heading (match-end 0))))
+ (setq heading (org-export-latex-fontify-headline heading)
+ sub-heading (and sub-heading
+ (org-export-latex-fontify-headline sub-heading))
+ main-heading (and main-heading
+ (org-export-latex-fontify-headline main-heading)))
(cond
;; Normal conversion
- ((<= level org-export-latex-sectioning-depth)
- (let* ((sec (nth (1- level) org-export-latex-sectioning))
+ ((<= level depth)
+ (let* ((sec (nth (1- level) sectioning))
start end)
(if (consp (cdr sec))
(setq start (nth (if num 0 2) sec)
end (nth (if num 1 3) sec))
(setq start (if num (car sec) (cdr sec))))
- (insert (format start heading) "\n")
+ (insert (format start (if main-heading main-heading heading)
+ (or sub-heading "")))
+ (insert "\n")
(when label
(insert (mapconcat (lambda (l) (format "\\label{%s}" l))
label-list "\n") "\n"))
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent) (org-export-latex-sub subcontent)))
- (if end (insert end "\n"))))
+ ((listp subcontent)
+ (while (org-looking-back "\n\n") (backward-delete-char 1))
+ (org-export-latex-sub subcontent)))
+ (when (and end (string-match "[^ \t]" end))
+ (let ((hook (org-get-text-property-any 0 'org-insert-hook end)))
+ (and (functionp hook) (funcall hook)))
+ (insert end "\n"))))
;; At a level under the hl option: we can drop this subsection
- ((> level org-export-latex-sectioning-depth)
+ ((> level depth)
(cond ((eq org-export-latex-low-levels 'description)
(if (string-match "% ends low level$"
(buffer-substring (point-at-bol 0) (point)))
(delete-region (point-at-bol 0) (point))
(insert "\\begin{description}\n"))
- (insert (format "\n\\item[%s]%s~\n\n"
+ (insert (format "\n\\item[%s]%s~\n"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
(delete-region (point-at-bol 0) (point))
(insert (format "\\begin{%s}\n"
(symbol-name org-export-latex-low-levels))))
- (insert (format "\n\\item %s\\\\\n%s\n"
+ (insert (format "\n\\item %s\\\\\n%s%%"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
(match-string 1))))
(plist-get org-export-latex-options-plist :latex-class)
org-export-latex-default-class)
+ org-export-latex-class-options
+ (or (and (org-region-active-p)
+ (save-excursion
+ (goto-char (region-beginning))
+ (and (looking-at org-complex-heading-regexp)
+ (org-entry-get nil "LaTeX_CLASS_OPTIONS" 'selective))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (and (re-search-forward "^#\\+LaTeX_CLASS_OPTIONS:[ \t]*\\(.*?\\)[ \t]*$" nil t)
+ (match-string 1))))
+ (plist-get org-export-latex-options-plist :latex-class-options))
org-export-latex-class
(or (car (assoc org-export-latex-class org-export-latex-classes))
(error "No definition for class `%s' in `org-export-latex-classes'"
(let ((hl-levels
(plist-get org-export-latex-options-plist :headline-levels))
(sec-depth (length org-export-latex-sectioning)))
- (if (> hl-levels sec-depth) sec-depth hl-levels)))))
+ (if (> hl-levels sec-depth) sec-depth hl-levels))))
+ (when (and org-export-latex-class-options
+ (string-match "\\S-" org-export-latex-class-options)
+ (string-match "^[ \t]*\\(\\\\documentclass\\)\\(\\[.*?\\]\\)?"
+ org-export-latex-header))
+ (setq org-export-latex-header
+ (concat (substring org-export-latex-header 0 (match-end 1))
+ org-export-latex-class-options
+ (substring org-export-latex-header (match-end 0))))))
+
+(defvar org-export-latex-format-toc-function
+ 'org-export-latex-format-toc-default
+ "The function formatting returning the string to createthe table of contents.
+The function mus take one parameter, the depth of the table of contents.")
(defun org-export-latex-make-header (title opt-plist)
"Make the LaTeX header and return it as a string.
TITLE is the current title from the buffer or region.
OPT-PLIST is the options plist for current buffer."
(let ((toc (plist-get opt-plist :table-of-contents))
- (author (plist-get opt-plist :author)))
+ (author (org-export-apply-macros-in-string
+ (plist-get opt-plist :author))))
(concat
(if (plist-get opt-plist :time-stamp-file)
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
- ;; insert LaTeX custom header
- (org-export-apply-macros-in-string org-export-latex-header)
- "\n"
- ;; insert information on LaTeX packages
- (when org-export-latex-packages-alist
- (mapconcat (lambda(p)
- (if (equal "" (car p))
- (format "\\usepackage{%s}" (cadr p))
- (format "\\usepackage[%s]{%s}"
- (car p) (cadr p))))
- org-export-latex-packages-alist "\n"))
- ;; insert additional commands in the header
- (org-export-apply-macros-in-string
- (plist-get opt-plist :latex-header-extra))
+ ;; insert LaTeX custom header and packages from the list
+ (org-splice-latex-header
+ (org-export-apply-macros-in-string org-export-latex-header)
+ org-export-latex-default-packages-alist
+ org-export-latex-packages-alist
+ (org-export-apply-macros-in-string
+ (plist-get opt-plist :latex-header-extra)))
+ ;; append another special variable
(org-export-apply-macros-in-string org-export-latex-append-header)
+ ;; define align if not yet defined
+ "\n\\providecommand{\\alert}[1]{\\textbf{#1}}"
;; insert the title
(format
"\n\n\\title{%s}\n"
(format "\\author{%s}\n"
(org-export-latex-fontify-headline (or author user-full-name)))
(format "%%\\author{%s}\n"
- (or author user-full-name)))
+ (org-export-latex-fontify-headline (or author user-full-name))))
;; insert the date
(format "\\date{%s}\n"
(format-time-string
;; table of contents
(when (and org-export-with-toc
(plist-get opt-plist :section-numbers))
- (cond ((numberp toc)
- (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
- (min toc (plist-get opt-plist :headline-levels))))
- (toc (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
- (plist-get opt-plist :headline-levels)))))
- (when (plist-get opt-plist :preserve-breaks)
- "\\obeylines\n"))))
+ (funcall org-export-latex-format-toc-function
+ (cond ((numberp toc)
+ (min toc (plist-get opt-plist :headline-levels)))
+ (toc (plist-get opt-plist :headline-levels))))))))
+
+(defun org-export-latex-format-toc-default (depth)
+ (when depth
+ (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
+ depth)))
(defun org-export-latex-first-lines (opt-plist &optional beg end)
"Export the first lines before first headline.
:timestamps (plist-get opt-plist :timestamps)
:footnotes (plist-get opt-plist :footnotes)))
(org-unmodified
- (add-text-properties pt (max pt (1- end))
- '(:org-license-to-kill t)))))))
+ (let ((inhibit-read-only t))
+ (add-text-properties pt (max pt (1- end))
+ '(:org-license-to-kill t))))))))
(defvar org-export-latex-header-defs nil
"The header definitions that might be used in the LaTeX body.")
;; the beginning of the buffer - inserting "\n" is safe here though.
(insert "\n" string)
(goto-char (point-min))
- (let ((re (concat "\\\\[a-zA-Z]+\\(?:"
- "\\[.*\\]"
- "\\)?"
- (org-create-multibrace-regexp "{" "}" 3))))
+ (let ((re (concat "\\\\\\([a-zA-Z]+\\)"
+ "\\(?:<[^<>\n]*>\\)*"
+ "\\(?:\\[[^][\n]*?\\]\\)*"
+ "\\(?:<[^<>\n]*>\\)*"
+ "\\("
+ (org-create-multibrace-regexp "{" "}" 3)
+ "\\)\\{1,3\\}")))
(while (re-search-forward re nil t)
- (unless (save-excursion (goto-char (match-beginning 0))
- (equal (char-after (point-at-bol)) ?#))
+ (unless (or
+ ;; check for comment line
+ (save-excursion (goto-char (match-beginning 0))
+ (equal (char-after (point-at-bol)) ?#))
+ ;; Check if this is a defined entity, so that is may need conversion
+ (org-entity-get (match-string 1)))
(add-text-properties (match-beginning 0) (match-end 0)
'(org-protected t)))))
(when (plist-get org-export-latex-options-plist :emphasize)
(if (equal (match-string 1) "\\")
(replace-match (match-string 2) t t)
(replace-match (concat (match-string 1) "\\"
- (match-string 2)) t t)))
+ (match-string 2)) t t)
+ (backward-char 1)))
((equal (match-string 2) "...")
(replace-match
(concat (match-string 1)
(org-export-latex-treat-backslash-char
(match-string 1)
(or (match-string 3) "")))
- "") t t))
+ "") t t)
+ (when (and (get-text-property (1- (point)) 'org-entity)
+ (looking-at "{}"))
+ ;; OK, this was an entity replacement, and the user
+ ;; had terminated the entity with {}. Make sure
+ ;; {} is protected as well, and remove the extra {}
+ ;; inserted by the conversion.
+ (put-text-property (point) (+ 2 (point)) 'org-protected t)
+ (if (save-excursion (goto-char (max (- (point) 2) (point-min)))
+ (looking-at "{}"))
+ (replace-match ""))
+ (forward-char 2))
+ (backward-char 1))
((member (match-string 2) '("_" "^"))
(replace-match (or (save-match-data
(org-export-latex-treat-sub-super-char
(backward-char 1)))))))
'(;"^\\([^\n$]*?\\|^\\)\\(\\\\?\\$\\)\\([^\n$]*\\)$"
"\\(\\(\\\\?\\$\\)\\)"
- "\\([a-za-z0-9]+\\|[ \t\n]\\|\\b\\|\\\\\\)\\(_\\|\\^\\)\\({[^{}]+}\\|[a-za-z0-9]+\\|[ \t\n]\\|[:punct:]\\|)\\|{[a-za-z0-9]+}\\|([a-za-z0-9]+)\\)"
- "\\(.\\|^\\)\\(\\\\\\)\\([ \t\n]\\|[a-zA-Z&#%{}\"]+\\)"
+ "\\([a-zA-Z0-9()]+\\|[ \t\n]\\|\\b\\|\\\\\\)\\(_\\|\\^\\)\\({[^{}]+}\\|[a-zA-Z0-9]+\\|[ \t\n]\\|[:punct:]\\|)\\|{[a-zA-Z0-9]+}\\|([a-zA-Z0-9]+)\\)"
+ "\\(.\\|^\\)\\(\\\\\\)\\([ \t\n]\\|\\([&#%{}\"]\\|[a-zA-Z][a-zA-Z0-9]*\\)\\)"
"\\(.\\|^\\)\\(&\\)"
"\\(.\\|^\\)\\(#\\)"
"\\(.\\|^\\)\\(%\\)"
(defun org-export-latex-treat-backslash-char (string-before string-after)
"Convert the \"$\" special character to LaTeX.
The conversion is made depending of STRING-BEFORE and STRING-AFTER."
- (cond ((member (list string-after) org-html-entities)
- ;; backslash is part of a special entity (like "\alpha")
- (concat string-before "$\\"
- (or (cdar (member (list string-after) org-html-entities))
- string-after) "$"))
- ((and (not (string-match "^[ \n\t]" string-after))
- (not (string-match "[ \t]\\'\\|^" string-before)))
- ;; backslash is inside a word
- (org-export-latex-protect-string
- (concat string-before "\\textbackslash{}" string-after)))
- ((not (or (equal string-after "")
- (string-match "^[ \t\n]" string-after)))
- ;; backslash might escape a character (like \#) or a user TeX
- ;; macro (like \setcounter)
- (org-export-latex-protect-string
- (concat string-before "\\" string-after)))
- ((and (string-match "^[ \t\n]" string-after)
- (string-match "[ \t\n]\\'" string-before))
- ;; backslash is alone, convert it to $\backslash$
- (org-export-latex-protect-string
- (concat string-before "\\textbackslash{}" string-after)))
- (t (org-export-latex-protect-string
- (concat string-before "\\textbackslash{}" string-after)))))
+ (let ((ass (org-entity-get string-after)))
+ (cond
+ (ass (org-add-props
+ (if (nth 2 ass)
+ (concat string-before
+ (org-export-latex-protect-string
+ (concat "$" (nth 1 ass) "$")))
+ (concat string-before (org-export-latex-protect-string
+ (nth 1 ass))))
+ nil 'org-entity t))
+ ((and (not (string-match "^[ \n\t]" string-after))
+ (not (string-match "[ \t]\\'\\|^" string-before)))
+ ;; backslash is inside a word
+ (concat string-before
+ (org-export-latex-protect-string
+ (concat "\\textbackslash{}" string-after))))
+ ((not (or (equal string-after "")
+ (string-match "^[ \t\n]" string-after)))
+ ;; backslash might escape a character (like \#) or a user TeX
+ ;; macro (like \setcounter)
+ (concat string-before
+ (org-export-latex-protect-string (concat "\\" string-after))))
+ ((and (string-match "^[ \t\n]" string-after)
+ (string-match "[ \t\n]\\'" string-before))
+ ;; backslash is alone, convert it to $\backslash$
+ (org-export-latex-protect-string
+ (concat string-before "\\textbackslash{}" string-after)))
+ (t (org-export-latex-protect-string
+ (concat string-before "\\textbackslash{}" string-after))))))
(defun org-export-latex-keywords ()
"Convert special keywords to LaTeX."
(match-string 0)) t t)
(save-excursion
(beginning-of-line 1)
- (unless (looking-at ".*\\\\newline[ \t]*$")
+ (unless (looking-at ".*\n[ \t]*\n")
(end-of-line 1)
- (insert "\\newline")))))
+ (insert "\n")))))
(defun org-export-latex-fixed-width (opt)
"When OPT is non-nil convert fixed-width sections to LaTeX."
(declare-function orgtbl-to-latex "org-table" (table params) t)
(defun org-export-latex-tables (insert)
"Convert tables to LaTeX and INSERT it."
+ ;; First, get the table.el tables
+ (goto-char (point-min))
+ (while (re-search-forward "^[ \t]*\\(\\+-[-+]*\\+\\)[ \t]*\n[ \t]*|" nil t)
+ (org-if-unprotected
+ (require 'table)
+ (org-export-latex-convert-table.el-table)))
+
+ ;; And now the Org-mode tables
(goto-char (point-min))
(while (re-search-forward "^\\([ \t]*\\)|" nil t)
(org-if-unprotected-at (1- (point))
(string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
(match-string 1 attr))
floatp (or caption label))
+ (setq caption (and caption (org-export-latex-fontify-headline caption)))
(setq lines (org-split-string raw-table "\n"))
(apply 'delete-region (list beg end))
(when org-export-table-remove-special-lines
(if longtblp
(concat "\\begin{longtable}{" align "}\n")
(if floatp "\\begin{table}[htb]\n"))
- (if (or floatp longtblp)
+ (if floatp
(format
"\\caption{%s%s}"
(if label (concat "\\\label{" label "}") "")
(or caption "")))
- (if longtblp "\\\\\n" "\n")
+ (if (and longtblp caption) "\\\\\n" "\n")
(if (and org-export-latex-tables-centered (not longtblp))
"\\begin{center}\n")
(if (not longtblp) (concat "\\begin{tabular}{" align "}\n"))
(if floatp "\\end{table}"))))
"\n\n"))))))))
+(defun org-export-latex-convert-table.el-table ()
+ "Replace table.el table at point with LaTeX code."
+ (let (tbl caption label line floatp attr align rmlines)
+ (setq line (buffer-substring (point-at-bol) (point-at-eol))
+ label (org-get-text-property-any 0 'org-label line)
+ caption (org-get-text-property-any 0 'org-caption line)
+ attr (org-get-text-property-any 0 'org-attributes line)
+ align (and attr (stringp attr)
+ (string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
+ (match-string 1 attr))
+ rmlines (and attr (stringp attr)
+ (string-match "\\<rmlines\\>" attr))
+ floatp (or label caption))
+ (and (get-buffer "*org-export-table*")
+ (kill-buffer (get-buffer "*org-export-table*")))
+ (table-generate-source 'latex "*org-export-table*" "caption")
+ (setq tbl (with-current-buffer "*org-export-table*"
+ (buffer-string)))
+ (while (string-match "^%.*\n" tbl)
+ (setq tbl (replace-match "" t t tbl)))
+ ;; fix the hlines
+ (when rmlines
+ (let ((n 0) lines)
+ (setq lines (mapcar (lambda (x)
+ (if (string-match "^\\\\hline$" x)
+ (progn
+ (setq n (1+ n))
+ (if (= n 2) x nil))
+ x))
+ (org-split-string tbl "\n")))
+ (setq tbl (mapconcat 'identity (delq nil lines) "\n"))))
+ (when (and align (string-match "\\\\begin{tabular}{.*}" tbl))
+ (setq tbl (replace-match (concat "\\begin{tabular}{" align "}")
+ t t tbl)))
+ (and (get-buffer "*org-export-table*")
+ (kill-buffer (get-buffer "*org-export-table*")))
+ (beginning-of-line 0)
+ (while (looking-at "[ \t]*\\(|\\|\\+-\\)")
+ (delete-region (point) (1+ (point-at-eol))))
+ (when org-export-latex-tables-centered
+ (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}")))
+ (when floatp
+ (setq tbl (concat "\\begin{table}\n"
+ (format "\\caption{%s%s}\n"
+ (if label (format "\\label{%s}" label) "")
+ (or caption ""))
+ tbl
+ "\n\\end{table}\n")))
+ (insert (org-export-latex-protect-string tbl))))
+
(defun org-export-latex-fontify ()
"Convert fontification to LaTeX."
(goto-char (point-min))
(save-match-data
(and (org-at-table-p)
(string-match
- "[|\n]" (buffer-substring beg end))))))
+ "[|\n]" (buffer-substring beg end)))))
+ (and (equal (match-string 3) "+")
+ (save-match-data
+ (string-match "\\`-+\\'" (match-string 4)))))
(setq s (match-string 4))
(setq rpl (concat (match-string 1)
(org-export-latex-emph-format (cadr emph)
(if (caddr emph)
(setq rpl (org-export-latex-protect-string rpl))
(save-match-data
- (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
+ (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
(progn
(add-text-properties (match-beginning 1) (match-end 1)
'(org-protected t) rpl)
raw-path))))))))
;; process with link inserting
(apply 'delete-region remove)
+ (setq caption (and caption (org-export-latex-fontify-headline caption)))
(cond ((and imgp
(plist-get org-export-latex-options-plist :inline-images))
;; OK, we need to inline an image
(org-remove-initial-hash
(org-solidify-link-text raw-path))
desc)))
- (path
+ (path
(when (org-at-table-p)
;; There is a strange problem when we have a link in a table,
;; ampersands then cause a problem. I think this must be
;; a LaTeX issue, but we here implement a work-around anyway.
(setq path (org-export-latex-protect-amp path)
desc (org-export-latex-protect-amp desc)))
- (insert (format "\\href{%s}{%s}" path desc)))
+ (insert (format org-export-latex-hyperref-format path desc)))
(t (insert "\\texttt{" desc "}")))))))
(defun org-export-latex-format-image (path caption label attr)
"Format the image element, depending on user settings."
- (let (floatp wrapp placement figenv)
+ (let (ind floatp wrapp placement figenv)
(setq floatp (or caption label))
+ (setq ind (org-get-text-property-any 0 'original-indentation path))
(when (and attr (stringp attr))
(if (string-match "[ \t]*\\<wrap\\>" attr)
(setq wrapp t floatp nil attr (replace-match "" t t attr)))
(if (string-match "[ \t]*\\<float\\>" attr)
(setq wrapp nil floatp t attr (replace-match "" t t attr))))
-
+
(setq placement
(cond
(wrapp "{l}{0.5\\textwidth}")
\\end{figure}")
(t "\\includegraphics[%attr]{%path}")))
+
+ (setq figenv (mapconcat 'identity (split-string figenv "\n")
+ (save-excursion (beginning-of-line 1)
+ (looking-at "[ \t]*")
+ (concat "\n" (match-string 0)))))
+
(if (and (not label) (not caption)
(string-match "^\\\\caption{.*\n" figenv))
(setq figenv (replace-match "" t t figenv)))
- (org-fill-template
- figenv
- (list (cons "path"
- (if (file-name-absolute-p path)
- (expand-file-name path)
- path))
- (cons "attr" attr)
- (cons "labelcmd" (if label (format "\\label{%s}"
- label)""))
- (cons "caption" (or caption ""))
- (cons "placement" (or placement ""))))))
+ (org-add-props
+ (org-fill-template
+ figenv
+ (list (cons "path"
+ (if (file-name-absolute-p path)
+ (expand-file-name path)
+ path))
+ (cons "attr" attr)
+ (cons "labelcmd" (if label (format "\\label{%s}"
+ label)""))
+ (cons "caption" (or caption ""))
+ (cons "placement" (or placement ""))))
+ nil 'original-indentation ind)))
(defun org-export-latex-protect-amp (s)
(while (string-match "\\([^\\\\]\\)\\(&\\)" s)
(setq beg (+ (match-beginning 0) off) end (- (match-end 0) 0))
(add-text-properties beg end '(org-protected t org-latex-math t))))))
- ;; Convert LaTeX to \LaTeX{}
+ ;; Convert LaTeX to \LaTeX{} and TeX to \TeX{}
(goto-char (point-min))
(let ((case-fold-search nil))
- (while (re-search-forward "\\([^+_]\\)LaTeX" nil t)
- (org-if-unprotected
- (replace-match (org-export-latex-protect-string
- (concat (match-string 1) "\\LaTeX{}")) t t))))
+ (while (re-search-forward "\\<\\(\\(La\\)?TeX\\)\\>" nil t)
+ (unless (eq (char-before (match-beginning 1)) ?\\)
+ (org-if-unprotected-1
+ (replace-match (org-export-latex-protect-string
+ (concat "\\" (match-string 1)
+ "{}")) t t)))))
;; Convert blockquotes
(goto-char (point-min))
(replace-match (org-export-latex-protect-string "\\hrule") t t)))
;; Protect LaTeX commands like \command[...]{...} or \command{...}
- (let ((re (concat "\\\\[a-zA-Z]+\\(?:"
- "\\[.*\\]"
- "\\)?"
- (org-create-multibrace-regexp "{" "}" 3))))
+ (goto-char (point-min))
+ (let ((re (concat
+ "\\\\\\([a-zA-Z]+\\)"
+ "\\(?:<[^<>\n]*>\\)*"
+ "\\(?:\\[[^][\n]*?\\]\\)*"
+ "\\(?:<[^<>\n]*>\\)*"
+ "\\(" (org-create-multibrace-regexp "{" "}" 3) "\\)\\{1,3\\}")))
(while (re-search-forward re nil t)
- (unless (save-excursion (goto-char (match-beginning 0))
- (equal (char-after (point-at-bol)) ?#))
+ (unless (or
+ ;; check for comment line
+ (save-excursion (goto-char (match-beginning 0))
+ (equal (char-after (point-at-bol)) ?#))
+ ;; Check if this is a defined entity, so that is may need conversion
+ (org-entity-get (match-string 1))
+ )
(add-text-properties (match-beginning 0) (match-end 0)
'(org-protected t)))))
">>>?\\((INVISIBLE)\\)?") nil t)
(org-if-unprotected-at (+ (match-beginning 0) 2)
(replace-match
- (org-export-latex-protect-string
- (format "\\label{%s}%s" (save-match-data (org-solidify-link-text
- (match-string 1)))
- (if (match-string 2) "" (match-string 1)))) t t)))
+ (concat
+ (org-export-latex-protect-string
+ (format "\\label{%s}" (save-match-data (org-solidify-link-text
+ (match-string 1)))))
+ (if (match-string 2) "" (match-string 1)))
+ t t)))
;; Delete @<...> constructs
;; Thanks to Daniel Clemente for this regexp
(add-text-properties (1- (length footnote-rpl))
(length footnote-rpl)
'(org-protected t) footnote-rpl)
+ (if (org-on-heading-p)
+ (setq footnote-rpl
+ (concat (org-export-latex-protect-string "\\protect")
+ footnote-rpl)))
(insert footnote-rpl)))
)))))
(org-if-unprotected
(replace-match "")))))
+(defun org-export-latex-fix-inputenc ()
+ "Set the codingsystem in inputenc to what the buffer is."
+ (let* ((cs buffer-file-coding-system)
+ (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs))
+ "utf8")))
+ (when opt
+ ;; Translate if that is requested
+ (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) opt))
+ ;; find the \usepackage statement and replace the option
+ (goto-char (point-min))
+ (while (re-search-forward "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}"
+ nil t)
+ (goto-char (match-beginning 1))
+ (delete-region (match-beginning 1) (match-end 1))
+ (insert opt))
+ (and buffer-file-name
+ (save-buffer)))))
+
;;; List handling:
(defun org-export-latex-lists ()
;; Bastien Guerry <bzg AT altern DOT org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(regexp)))
(defcustom org-empty-line-terminates-plain-lists nil
- "Non-nil means, an empty line ends all plain list levels.
+ "Non-nil means an empty line ends all plain list levels.
+This is currently effective only during export. It should also have
+an effect for indentation and plain list folding, but it does not.
When nil, empty lines are part of the preceding item."
:group 'org-plain-lists
:type 'boolean)
(defcustom org-auto-renumber-ordered-lists t
- "Non-nil means, automatically renumber ordered plain lists.
+ "Non-nil means automatically renumber ordered plain lists.
Renumbering happens when the sequence have been changed with
\\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands,
use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
:type 'boolean)
(defcustom org-provide-checkbox-statistics t
- "Non-nil means, update checkbox statistics after insert and toggle.
+ "Non-nil means update checkbox statistics after insert and toggle.
When this is set, checkbox statistics is updated each time you
either insert a new checkbox with \\[org-insert-todo-heading] or
toggle a checkbox with \\[org-ctrl-c-ctrl-c]."
:type 'boolean)
(defcustom org-hierarchical-checkbox-statistics t
- "Non-nil means, checkbox statistics counts only the state of direct children.
+ "Non-nil means checkbox statistics counts only the state of direct children.
When nil, all boxes below the cookie are counted.
This can be set to nil on a per-node basis using a COOKIE_DATA property
with the word \"recursive\" in the value."
(recursive
(or (not org-hierarchical-checkbox-statistics)
(string-match "\\<recursive\\>"
- (or (org-entry-get nil "COOKIE_DATA") ""))))
+ (or (ignore-errors
+ (org-entry-get nil "COOKIE_DATA"))
+ ""))))
(cstat 0)
)
(when all
(if (looking-at "[ \t]*$")
nil
(if (<= (setq ind1 (org-get-indentation)) ind)
- (throw 'exit t)))))
+ (throw 'exit t)))
+ (if (bobp) (throw 'exit t))))
(condition-case nil
(if (or (not (org-at-item-p))
(< ind1 (1- ind)))
(interactive)
(unless (org-at-item-p) (error "This is not a list"))
(let ((line (org-current-line))
- (col (current-column))
+ (chars-from-eol (- (point-at-eol) (point)))
(ind (current-indentation))
ind1 bullet oldbullet)
;; find where this list begins
(org-shift-item-indentation (- (length bullet)
(length oldbullet))))))
(org-goto-line line)
- (org-move-to-column col)
+ (goto-char (max (point-at-bol) (- (point-at-eol) chars-from-eol)))
(if (string-match "[0-9]" bullet)
(org-renumber-ordered-list 1))))
(org-adapt-indentation nil))
(cond
((and (looking-at "[ \t]*$")
- (looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
+ (org-looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
(setq this-command 'org-cycle-item-indentation)
(if (eq last-command 'org-cycle-item-indentation)
(condition-case nil
sublevels as a list of strings."
(let* ((item-beginning (org-list-item-beginning))
(start (car item-beginning))
- (end (org-list-end (cdr item-beginning)))
+ (end (save-excursion
+ (goto-char (org-list-end (cdr item-beginning)))
+ (org-back-over-empty-lines)
+ (point)))
output itemsep ltype)
(while (re-search-forward org-list-beginning-re end t)
(goto-char (match-beginning 3))
;; Author: John Wiegley <johnw@gnu.org>
;; Christopher Suckling <suckling at gmail dot com>
-;; Version: 6.33x
+;; Version: 6.35i
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.
(insert "\n" (org-mac-message-get-links "f")))
(goto-char (point-max))
(insert "\n")
- (org-insert-heading)
+ (org-insert-heading nil t)
(insert org-heading "\n" (org-mac-message-get-links "f"))))))
(provide 'org-mac-message)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
(while (string-match "\\[:alpha:\\]" ss)
(setq ss (replace-match "a-zA-Z" t t ss)))
+ (while (string-match "\\[:punct:\\]" ss)
+ (setq ss (replace-match "\001-@[-`{-~" t t ss)))
ss))
s))
,@body))
(put 'org-if-unprotected-at 'lisp-indent-function 1)
+(defun org-re-search-forward-unprotected (&rest args)
+ "Like re-search-forward, but stop only in unprotected places."
+ (catch 'exit
+ (while t
+ (unless (apply 're-search-forward args)
+ (throw 'exit nil))
+ (unless (get-text-property (match-beginning 0) 'org-protected)
+ (throw 'exit (point))))))
(defmacro org-with-remote-undo (_buffer &rest _body)
"Execute BODY while recording undo information in two buffers."
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;; This file is part of GNU Emacs.
;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
In addition to this, the list may also contain the following symbols:
org-agenda-files
- This means, include the complete, unrestricted list of files given in
+ This means include the complete, unrestricted list of files given in
the variable `org-agenda-files'.
org-agenda-text-search-extra-files
Include the files given in the variable
:group 'org-mobile
:type 'directory)
+(defcustom org-mobile-use-encryption nil
+ "Non-nil means keep only encrypted files on the webdav server.
+Encryption uses AES-256, with a password given in
+`org-mobile-encryption-password'.
+When nil, plain files are kept on the server.
+Turning on encryption requires to set the same password in the MobileOrg
+application."
+ :group 'org-mobile
+ :type 'boolean)
+
+(defcustom org-mobile-encryption-tempfile "~/orgtmpcrypt"
+ "File that is being used as a temporary file for encryption.
+This must be local file on your local machine (not on the webdav server).
+You might want to put this file into a directory where only you have access."
+ :group 'org-mobile
+ :type 'directory)
+
+(defcustom org-mobile-encryption-password ""
+ "Password for encrypting files uploaded to the server.
+This is a single password which is used for AES-256 encryption. The same
+password must also be set in the MobileOrg application. All Org files,
+including mobileorg.org will be encrypted using this password.
+Note that, whe Org runs the encryption commands, the password could
+be visible on your system with the `ps' command. So this method is only
+intended to keep the files secure on the server, not on your own machine."
+ :group 'org-mobile
+ :type '(string :tag "Password"))
+
(defcustom org-mobile-inbox-for-pull "~/org/from-mobile.org"
"The file where captured notes and flags will be appended to.
During the execution of `org-mobile-pull', the file
:group 'org-mobile
:type 'file)
+(defcustom org-mobile-agendas 'all
+ "The agendas that should be pushed to MobileOrg.
+Allowed values:
+
+default the weekly agenda and the global TODO list
+custom all custom agendas defined by the user
+all the custom agendas and the default ones
+list a list of selection key(s) as string."
+ :group 'org-mobile
+ :type '(choice
+ (const :tag "Default Agendas" default)
+ (const :tag "Custom Agendas" custom)
+ (const :tag "Default and Custom Agendas" all)
+ (repeat :tag "Selected"
+ (string :tag "Selection Keys"))))
+
(defcustom org-mobile-force-id-on-agenda-items t
"Non-nil means make all agenda items carry and ID."
:group 'org-mobile
:type 'boolean)
(defcustom org-mobile-force-mobile-change nil
- "Non-nil means, force the change made on the mobile device.
+ "Non-nil means force the change made on the mobile device.
So even if there have been changes to the computer version of the entry,
force the new value set on the mobile.
When nil, mark the entry from the mobile with an error message.
(kill-buffer a-buffer)
(let ((cw (selected-window)))
(select-window (get-buffer-window a-buffer))
-
(org-agenda-redo)
(select-window cw)))))
(message "Files for mobile viewer staged"))
-
+
(defvar org-mobile-before-process-capture-hook nil
"Hook that is run after content was moved to `org-mobile-inbox-for-pull'.
-The inbox file is in the current buffer, and the buffer is arrowed to the
-new captured data.")
+The inbox file is visited by the current buffer, and the buffer is
+narrowed to the newly captured data.")
;;;###autoload
(defun org-mobile-pull ()
(file-exists-p
(file-name-directory org-mobile-inbox-for-pull)))
(error
- "Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory")))
+ "Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory"))
+ (when org-mobile-use-encryption
+ (unless (string-match "\\S-" org-mobile-encryption-password)
+ (error
+ "To use encryption, you must set `org-mobile-encryption-password'"))
+ (unless (file-writable-p org-mobile-encryption-tempfile)
+ (error "Cannot write to entryption tempfile %s"
+ org-mobile-encryption-tempfile))
+ (unless (executable-find "openssl")
+ (error "openssl is needed to encrypt files."))))
(defun org-mobile-create-index-file ()
"Write the index file in the WebDAV directory."
(def-todo (default-value 'org-todo-keywords))
(def-tags (default-value 'org-tag-alist))
file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds)
-
+
(org-prepare-agenda-buffers (mapcar 'car files-alist))
(setq done-kwds (org-uniquify org-done-keywords-for-agenda))
(setq todo-kwds (org-delete-all
target-dir (file-name-directory target-path))
(unless (file-directory-p target-dir)
(make-directory target-dir 'parents))
- (copy-file file target-path 'ok-if-exists)
+ (if org-mobile-use-encryption
+ (org-mobile-encrypt-and-move file target-path)
+ (copy-file file target-path 'ok-if-exists))
(setq check (shell-command-to-string
(concat org-mobile-checksum-binary " "
(shell-quote-argument (expand-file-name file)))))
((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
(t (cons (car x) (cons "" (cdr x))))))
org-agenda-custom-commands)))
- new e key desc type match settings cmds gkey gdesc gsettings cnt)
- (while (setq e (pop custom-list))
+ (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo)))
+ thelist new e key desc type match settings cmds gkey gdesc gsettings cnt)
+ (cond
+ ((eq org-mobile-agendas 'custom)
+ (setq thelist custom-list))
+ ((eq org-mobile-agendas 'default)
+ (setq thelist default-list))
+ ((eq org-mobile-agendas 'all)
+ (setq thelist custom-list)
+ (unless (assoc "t" thelist) (push '("t" "ALL TODO" alltodo) thelist))
+ (unless (assoc "a" thelist) (push '("a" "Agenda" agenda) thelist)))
+ ((listp org-mobile-agendas)
+ (setq thelist (append custom-list default-list))
+ (setq thelist (delq nil (mapcar (lambda (k) (assoc k thelist))
+ org-mobile-agendas)))))
+ (while (setq e (pop thelist))
(cond
((stringp (cdr e))
;; this is a description entry - skip it
((memq (nth 2 e) '(todo-tree tags-tree occur-tree))
;; These are trees, not really agenda commands
)
- ((memq (nth 2 e) '(agenda todo tags))
+ ((and (memq (nth 2 e) '(todo tags tags-todo))
+ (or (null (nth 3 e))
+ (not (string-match "\\S-" (nth 3 e)))))
+ ;; These would be interactive because the match string is empty
+ )
+ ((memq (nth 2 e) '(agenda alltodo todo tags tags-todo))
;; a normal command
(setq key (car e) desc (nth 1 e) type (nth 2 e) match (nth 3 e)
settings (nth 4 e))
(interactive)
(let* ((file (expand-file-name "agendas.org"
org-mobile-directory))
+ (file1 (if org-mobile-use-encryption
+ org-mobile-encryption-tempfile
+ file))
(sumo (org-mobile-sumo-agenda-command))
(org-agenda-custom-commands
- (list (append sumo (list (list file)))))
+ (list (append sumo (list (list file1)))))
(org-mobile-creating-agendas t))
- (unless (file-writable-p file)
- (error "Cannot write to file %s" file))
+ (unless (file-writable-p file1)
+ (error "Cannot write to file %s" file1))
(when sumo
- (org-store-agenda-views))))
+ (org-store-agenda-views))
+ (when org-mobile-use-encryption
+ (org-mobile-encrypt-file file1 file)
+ (delete-file file1))))
+
+(defun org-mobile-encrypt-and-move (infile outfile)
+ "Encrypt INFILE locally to INFILE_enc, then move it to OUTFILE.
+We do this in two steps so that remote paths will work, even if the
+encryption program does not understand them."
+ (let ((encfile (concat infile "_enc")))
+ (org-mobile-encrypt-file infile encfile)
+ (when outfile
+ (copy-file encfile outfile 'ok-if-exists)
+ (delete-file encfile))))
+
+(defun org-mobile-encrypt-file (infile outfile)
+ "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
+ (shell-command
+ (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s"
+ (shell-quote-argument (concat "pass:" org-mobile-encryption-password))
+ (shell-quote-argument (expand-file-name infile))
+ (shell-quote-argument (expand-file-name outfile)))))
+
+(defun org-mobile-decrypt-file (infile outfile)
+ "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
+ (shell-command
+ (format "openssl enc -d -aes-256-cbc -salt -pass %s -in %s -out %s"
+ (shell-quote-argument (concat "pass:" org-mobile-encryption-password))
+ (shell-quote-argument (expand-file-name infile))
+ (shell-quote-argument (expand-file-name outfile)))))
(defun org-mobile-move-capture ()
"Move the contents of the capture file to the inbox file.
Return a marker to the location where the new content has been added.
If nothing new has been added, return nil."
(interactive)
- (let ((inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
- (capture-buffer (find-file-noselect
- (expand-file-name org-mobile-capture-file
- org-mobile-directory)))
- (insertion-point (make-marker))
- not-empty content)
+ (let* ((encfile nil)
+ (capture-file (expand-file-name org-mobile-capture-file
+ org-mobile-directory))
+ (inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
+ (capture-buffer
+ (if (not org-mobile-use-encryption)
+ (find-file-noselect capture-file)
+ (delete-file org-mobile-encryption-tempfile)
+ (setq encfile (concat org-mobile-encryption-tempfile "_enc"))
+ (copy-file capture-file encfile)
+ (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile)
+ (find-file-noselect org-mobile-encryption-tempfile)))
+ (insertion-point (make-marker))
+ not-empty content)
(with-current-buffer capture-buffer
(setq content (buffer-string))
(setq not-empty (string-match "\\S-" content))
(save-buffer)
(org-mobile-update-checksum-for-capture-file (buffer-string))))
(kill-buffer capture-buffer)
+ (when org-mobile-use-encryption
+ (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
+ capture-file))
(if not-empty insertion-point)))
(defun org-mobile-update-checksum-for-capture-file (buffer-string)
+ "Find the checksum line and modify it to match BUFFER-STRING."
(let* ((file (expand-file-name "checksums.dat" org-mobile-directory))
(buffer (find-file-noselect file)))
(when buffer
(org-todo (or new 'none)) t)
(t (error "State before change was expected as \"%s\", but is \"%s\""
old current))))
-
+
((eq what 'tags)
(setq current (org-get-tags)
new1 (and new (org-split-string new ":+"))
(org-set-tags-to new1) t)
(t (error "Tags before change were expected as \"%s\", but are \"%s\""
(or old "") (or current "")))))
-
+
((eq what 'priority)
(when (looking-at org-complex-heading-regexp)
(setq current (and (match-end 3) (substring (match-string 3) 2 3)))
(delete-region (point) (+ (point) (length current)))
(org-set-tags nil 'align))
(t (error "Heading changed in MobileOrg and on the computer")))))
-
+
((eq what 'body)
(setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
(save-excursion (outline-next-heading)
(point))))
t)
(t (error "Body was changed in MobileOrg and on the computer")))))))
-
+
(defun org-mobile-tags-same-p (list1 list2)
"Are the two tag lists the same?"
;;
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(interactive)
(end-of-line)
(skip-chars-backward "\t ")
- (when (looking-back ":[A-Za-z]+:")
+ (when (org-looking-back ":[A-Za-z]+:")
(skip-chars-backward ":A-Za-z")
(skip-chars-backward "\t ")))
(:end ; insert text here
(skip-chars-backward " \t")
(kill-region (point) (point-at-eol))
- (unless (looking-back org-mouse-punctuation)
+ (unless (org-looking-back org-mouse-punctuation)
(insert (concat org-mouse-punctuation " ")))))
(insert text)
'org-mode-restart))))
((or (eolp)
(and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
- (looking-back " \\|\t")))
+ (org-looking-back " \\|\t")))
(org-mouse-popup-global-menu))
((get-context :checkbox)
(popup-menu
;; Author: Eric Schulte <schulte dot eric at gmail dot com>
;; Keywords: tables, plotting
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defun org-plot/gnuplot-to-grid-data (table data-file params)
"Export the data in TABLE to DATA-FILE for gnuplot.
-This means, in a format appropriate for grid plotting by gnuplot.
+This means in a format appropriate for grid plotting by gnuplot.
PARAMS specifies which columns of TABLE should be plotted as independent
and dependant variables."
(interactive)
(setf plot-lines
(cons
(format plot-str data-file
- (or (and (not text-ind) ind
- (> ind 0) (format "%d:" ind)) "")
+ (or (and ind (> ind 0)
+ (not text-ind)
+ (format "%d:" ind)) "")
(+ 1 col)
(if text-ind (format ":xticlabel(%d)" ind) "")
with
(setf table (delq 'hline (cdr table)))) ;; clean non-data from table
;; collect options
(save-excursion (while (and (equal 0 (forward-line -1))
- (looking-at "#\\+"))
+ (looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params))))
;; dump table to datafile (very different for grid)
(case (plist-get params :plot-type)
(mapcar (lambda (row) (nth ind row)) table)))) 0)
(plist-put params :timeind t)
;; check for text ind column
-
(if (or (string= (plist-get params :with) "hist")
(> (length
(delq 0 (mapcar
;; Author: Ross Patterson <me AT rpatterson DOT net>
;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
;; Keywords: org, emacsclient, wp
-;; Version: 6.33x
+;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
(url (org-protocol-sanitize-uri (car parts)))
(type (if (string-match "^\\([a-z]+\\):" url)
(match-string 1 url)))
- (title (cadr parts))
- (region (caddr parts))
- (orglink (org-make-link-string url title))
+ (title (or (cadr parts) ""))
+ (region (or (caddr parts) ""))
+ (orglink (org-make-link-string
+ url (if (string-match "[^[:space:]]" title) title url)))
remember-annotation-functions)
(setq org-stored-links
(cons (list url title) org-stored-links))
;;; org-publish.el --- publish related org-mode files as a website
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009, 2010
+;; Free Software Foundation, Inc.
;; Author: David O'Toole <dto@gnu.org>
;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
;; Keywords: hypermedia, outlines, wp
-;; Version: 6.33x
+;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
;; + Publish all one's org-files to HTML or PDF
;; + Upload HTML, images, attachments and other files to a web server
;; + Exclude selected private pages from publishing
-;; + Publish a clickable index of pages
+;; + Publish a clickable sitemap of pages
;; + Manage local timestamps for publishing only changed files
;; + Accept plugin functions to extend range of publishable content
;;
;;; Code:
+
+(defun org-publish-sanitize-plist (plist)
+ (mapcar (lambda (x)
+ (or (cdr (assq x '((:index-filename . :sitemap-filename)
+ (:index-title . :sitemap-title)
+ (:index-function . :sitemap-function)
+ (:index-style . :sitemap-style)
+ (:auto-index . :auto-sitemap))))
+ x))
+ plist))
+
(eval-when-compile
(require 'cl))
(require 'org)
certain makefile, to ensure published files are built up to date.
:preparation-function Function to be called before publishing
- this project.
+ this project. This may also be a list
+ of functions.
:completion-function Function to be called after publishing
- this project.
+ this project. This may also be a list
+ of functions.
Some properties control details of the Org publishing process,
and are equivalent to the corresponding user variables listed in
:author `user-full-name'
:email `user-mail-address'
-The following properties may be used to control publishing of an
-index of files or summary page for a given project.
+The following properties may be used to control publishing of a
+sitemap of files or summary page for a given project.
- :auto-index Whether to publish an index during
+ :auto-sitemap Whether to publish a sitemap during
`org-publish-current-project' or `org-publish-all'.
- :index-filename Filename for output of index. Defaults
+ :sitemap-filename Filename for output of sitemap. Defaults
to 'sitemap.org' (which becomes 'sitemap.html').
- :index-title Title of index page. Defaults to name of file.
- :index-function Plugin function to use for generation of index.
- Defaults to `org-publish-org-index', which
+ :sitemap-title Title of sitemap page. Defaults to name of file.
+ :sitemap-function Plugin function to use for generation of sitemap.
+ Defaults to `org-publish-org-sitemap', which
generates a plain list of links to all files
in the project.
- :index-style Can be `list' (index is just an itemized list
+ :sitemap-style Can be `list' (sitemap is just an itemized list
of the titles of the files involved) or
`tree' (the directory structure of the source
- files is reflected in the index). Defaults to
+ files is reflected in the sitemap). Defaults to
`tree'."
:group 'org-publish
:type 'alist)
:type 'directory)
(defcustom org-publish-list-skipped-files t
- "Non-nil means, show message about files *not* published."
+ "Non-nil means show message about files *not* published."
:group 'org-publish
:type 'boolean)
list))
(declare-function org-publish-delete-dups "org-publish" (list))
+(declare-function find-lisp-find-files "find-lisp" (directory regexp))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Getting project information out of org-publish-project-alist
(buffer-live-p export-buf-or-file))
(set-buffer export-buf-or-file)
;; run hooks after export and save export
- (and (run-hooks 'org-publish-after-export-hook)
- (if (buffer-modified-p) (save-buffer)))
+ (progn (run-hooks 'org-publish-after-export-hook)
+ (if (buffer-modified-p) (save-buffer)))
(kill-buffer export-buf-or-file))
;; maybe restore buffer's content
(set-buffer init-buf)
(unless visiting
(kill-buffer init-buf))))))
+(defmacro org-publish-with-aux-preprocess-maybe (&rest body)
+ "Execute BODY with a modified hook to preprocess for index."
+ `(let ((org-export-preprocess-after-headline-targets-hook
+ (if (plist-get project-plist :makeindex)
+ (cons 'org-publish-aux-preprocess
+ org-export-preprocess-after-headline-targets-hook)
+ org-export-preprocess-after-headline-targets-hook)))
+ ,@body))
+
+(defvar project-plist)
(defun org-publish-org-to-latex (plist filename pub-dir)
"Publish an org file to LaTeX.
See `org-publish-org-to' to the list of arguments."
- (org-publish-org-to "latex" plist filename pub-dir))
+ (org-publish-with-aux-preprocess-maybe
+ (org-publish-org-to "latex" plist filename pub-dir)))
(defun org-publish-org-to-pdf (plist filename pub-dir)
"Publish an org file to PDF (via LaTeX).
See `org-publish-org-to' to the list of arguments."
- (org-publish-org-to "pdf" plist filename pub-dir))
+ (org-publish-with-aux-preprocess-maybe
+ (org-publish-org-to "pdf" plist filename pub-dir)))
(defun org-publish-org-to-html (plist filename pub-dir)
"Publish an org file to HTML.
See `org-publish-org-to' to the list of arguments."
- (org-publish-org-to "html" plist filename pub-dir))
+ (org-publish-with-aux-preprocess-maybe
+ (org-publish-org-to "html" plist filename pub-dir)))
(defun org-publish-org-to-org (plist filename pub-dir)
"Publish an org file to HTML.
(defun org-publish-projects (projects)
"Publish all files belonging to the PROJECTS alist.
-If :auto-index is set, publish the index too."
+If :auto-sitemap is set, publish the sitemap too.
+If :makeindex is set, also produce a file theindex.org."
(mapc
(lambda (project)
(let*
((project-plist (cdr project))
(exclude-regexp (plist-get project-plist :exclude))
- (index-p (plist-get project-plist :auto-index))
- (index-filename (or (plist-get project-plist :index-filename)
- "sitemap.org"))
- (index-function (or (plist-get project-plist :index-function)
- 'org-publish-org-index))
+ (sitemap-p (plist-get project-plist :auto-sitemap))
+ (sitemap-filename (or (plist-get project-plist :sitemap-filename)
+ "sitemap.org"))
+ (sitemap-function (or (plist-get project-plist :sitemap-function)
+ 'org-publish-org-sitemap))
(preparation-function (plist-get project-plist :preparation-function))
(completion-function (plist-get project-plist :completion-function))
(files (org-publish-get-base-files project exclude-regexp)) file)
- (when preparation-function (funcall preparation-function))
- (if index-p (funcall index-function project index-filename))
+ (when preparation-function (run-hooks 'preparation-function))
+ (if sitemap-p (funcall sitemap-function project sitemap-filename))
(while (setq file (pop files))
(org-publish-file file project))
- (when completion-function (funcall completion-function))))
+ (when (plist-get project-plist :makeindex)
+ (org-publish-index-generate-theindex.inc
+ (plist-get project-plist :base-directory))
+ (org-publish-file (expand-file-name
+ "theindex.org"
+ (plist-get project-plist :base-directory))
+ project))
+ (when completion-function (run-hooks 'completion-function))))
(org-publish-expand-projects projects)))
-(defun org-publish-org-index (project &optional index-filename)
- "Create an index of pages in set defined by PROJECT.
-Optionally set the filename of the index with INDEX-FILENAME.
-Default for INDEX-FILENAME is 'sitemap.org'."
+(defun org-publish-org-sitemap (project &optional sitemap-filename)
+ "Create an sitemap of pages in set defined by PROJECT.
+Optionally set the filename of the sitemap with SITEMAP-FILENAME.
+Default for SITEMAP-FILENAME is 'sitemap.org'."
(let* ((project-plist (cdr project))
(dir (file-name-as-directory
(plist-get project-plist :base-directory)))
(indent-str (make-string 2 ?\ ))
(exclude-regexp (plist-get project-plist :exclude))
(files (nreverse (org-publish-get-base-files project exclude-regexp)))
- (index-filename (concat dir (or index-filename "sitemap.org")))
- (index-title (or (plist-get project-plist :index-title)
- (concat "Index for project " (car project))))
- (index-style (or (plist-get project-plist :index-style)
+ (sitemap-filename (concat dir (or sitemap-filename "sitemap.org")))
+ (sitemap-title (or (plist-get project-plist :sitemap-title)
+ (concat "Sitemap for project " (car project))))
+ (sitemap-style (or (plist-get project-plist :sitemap-style)
'tree))
- (visiting (find-buffer-visiting index-filename))
- (ifn (file-name-nondirectory index-filename))
- file index-buffer)
- (with-current-buffer (setq index-buffer
- (or visiting (find-file index-filename)))
+ (visiting (find-buffer-visiting sitemap-filename))
+ (ifn (file-name-nondirectory sitemap-filename))
+ file sitemap-buffer)
+ (with-current-buffer (setq sitemap-buffer
+ (or visiting (find-file sitemap-filename)))
(erase-buffer)
- (insert (concat "#+TITLE: " index-title "\n\n"))
+ (insert (concat "#+TITLE: " sitemap-title "\n\n"))
(while (setq file (pop files))
(let ((fn (file-name-nondirectory file))
(link (file-relative-name file dir))
(oldlocal localdir))
- ;; index shouldn't index itself
- (unless (equal (file-truename index-filename)
+ ;; sitemap shouldn't list itself
+ (unless (equal (file-truename sitemap-filename)
(file-truename file))
- (if (eq index-style 'list)
- (message "Generating list-style index for %s" index-title)
- (message "Generating tree-style index for %s" index-title)
+ (if (eq sitemap-style 'list)
+ (message "Generating list-style sitemap for %s" sitemap-title)
+ (message "Generating tree-style sitemap for %s" sitemap-title)
(setq localdir (concat (file-name-as-directory dir)
(file-name-directory link)))
(unless (string= localdir oldlocal)
(org-publish-find-title file)
"]]\n")))))
(save-buffer))
- (or visiting (kill-buffer index-buffer))))
+ (or visiting (kill-buffer sitemap-buffer))))
(defun org-publish-find-title (file)
"Find the title of file in project."
(interactive "P")
(when force
(org-publish-remove-all-timestamps))
- (org-publish-initialize-files-alist)
+ (org-publish-initialize-files-alist force)
(save-window-excursion
(let ((org-publish-use-timestamps-flag
(if force nil org-publish-use-timestamps-flag)))
(org-publish-projects org-publish-project-alist))))
+
;;;###autoload
(defun org-publish-current-file (&optional force)
"Publish the current file.
With prefix argument, force publish the file."
(interactive "P")
- (org-publish-initialize-files-alist)
+ (org-publish-initialize-files-alist force)
(save-window-excursion
(let ((org-publish-use-timestamps-flag
(if force nil org-publish-use-timestamps-flag)))
With a prefix argument, force publishing of all files in
the project."
(interactive "P")
- (org-publish-initialize-files-alist)
+ (org-publish-initialize-files-alist force)
(save-window-excursion
(let ((project (org-publish-get-project-from-filename (buffer-file-name) 'up))
(org-publish-use-timestamps-flag
(error "File %s is not part of any known project" (buffer-file-name)))
(org-publish project))))
+
+;;; Index generation
+
+(defvar backend) ; dynamically scoped
+(defun org-publish-aux-preprocess ()
+ "Find index entries and write them to an .orgx file."
+ (let ((case-fold-search t)
+ entry index target)
+ (goto-char (point-min))
+ (while
+ (and
+ (re-search-forward "^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$" nil t)
+ (> (match-end 1) (match-beginning 1)))
+ (setq entry (match-string 1))
+ (when (eq backend 'latex)
+ (replace-match (format "\\index{%s}" entry) t t))
+ (save-excursion
+ (org-back-to-heading t)
+ (setq target (get-text-property (point) 'target))
+ (setq target (or (cdr (assoc target org-export-preferred-target-alist))
+ (cdr (assoc target org-export-id-target-alist))
+ target))
+ (push (cons entry target) index)))
+ (with-temp-file
+ (concat (file-name-sans-extension org-current-export-file) ".orgx")
+ (dolist (entry (nreverse index))
+ (insert (format "INDEX: (%s) %s\n" (cdr entry) (car entry)))))))
+
+(defun org-publish-index-generate-theindex.inc (directory)
+ "Generate the index from all .orgx files in the current directory and below."
+ (require 'find-lisp)
+ (let* ((fulldir (file-name-as-directory
+ (expand-file-name directory)))
+ (full-files (find-lisp-find-files directory "\\.orgx\\'"))
+ (re (concat "\\`" fulldir))
+ (files (mapcar (lambda (f) (if (string-match re f)
+ (substring f (match-end 0))
+ f))
+ full-files))
+ (default-directory directory)
+ index origfile buf target entry ibuffer
+ main last-main letter last-letter file sub link)
+ ;; `files' contains the list of relative file names
+ (dolist (file files)
+ (setq origfile (substring file 0 -1))
+ (setq buf (find-file-noselect file))
+ (with-current-buffer buf
+ (goto-char (point-min))
+ (while (re-search-forward "^INDEX: (\\(.*?\\)) \\(.*\\)" nil t)
+ (setq target (match-string 1)
+ entry (match-string 2))
+ (push (list entry origfile target) index)))
+ (kill-buffer buf))
+ (setq index (sort index (lambda (a b) (string< (downcase (car a))
+ (downcase (car b))))))
+ (setq ibuffer (find-file-noselect (expand-file-name "theindex.inc" directory)))
+ (with-current-buffer ibuffer
+ (erase-buffer)
+ (insert "* Index\n")
+ (setq last-letter nil)
+ (dolist (idx index)
+ (setq entry (car idx) file (nth 1 idx) target (nth 2 idx))
+ (setq letter (upcase (substring entry 0 1)))
+ (when (not (equal letter last-letter))
+ (insert "** " letter "\n")
+ (setq last-letter letter))
+ (if (string-match "!" entry)
+ (setq main (substring entry 0 (match-beginning 0))
+ sub (substring entry (match-end 0)))
+ (setq main nil sub nil last-main nil))
+ (when (and main (not (equal main last-main)))
+ (insert " - " main "\n")
+ (setq last-main main))
+ (setq link (concat "[[file:" file "::#" target "]"
+ "[" (or sub entry) "]]"))
+ (if (and main sub)
+ (insert " - " link "\n")
+ (insert " - " link "\n")))
+ (save-buffer))
+ (kill-buffer ibuffer)
+
+ (let ((index-file (expand-file-name "theindex.org" directory)))
+ (unless (file-exists-p index-file)
+ (setq ibuffer (find-file-noselect index-file))
+ (with-current-buffer ibuffer
+ (erase-buffer)
+ (insert "\n\n#+include: \"theindex.inc\"\n\n")
+ (save-buffer))
+ (kill-buffer ibuffer)))))
+
(provide 'org-publish)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:group 'org)
(defcustom org-remember-store-without-prompt t
- "Non-nil means, `C-c C-c' stores remember note without further prompts.
+ "Non-nil means `C-c C-c' stores remember note without further prompts.
It then uses the file and headline specified by the template or (if the
template does not specify them) by the variables `org-default-notes-file'
and `org-remember-default-headline'. To force prompting anyway, use
You may define a prompt like %^{Please specify birthday
%n user name (taken from `user-full-name')
%a annotation, normally the link created with org-store-link
- %i initial content, copied from the active region. If %i is
+ %i initial content, copied from the active region. If %i is
indented, the entire inserted text will be indented as well.
%c current kill ring head
%x content of the X clipboard
(define-key org-remember-mode-map "\C-c\C-k" 'org-remember-kill)
(defcustom org-remember-clock-out-on-exit 'query
- "Non-nil means, stop the clock when exiting a clocking remember buffer.
+ "Non-nil means stop the clock when exiting a clocking remember buffer.
This only applies if the clock is running in the remember buffer. If the
clock is not stopped, it continues to run in the storage location.
Instead of nil or t, this may also be the symbol `query' to prompt the
(directory :tag "Directory")))
(defcustom org-remember-auto-remove-backup-files t
- "Non-nil means, remove remember backup files after successfully storage.
+ "Non-nil means remove remember backup files after successfully storage.
When remember is finished successfully, with storing the note at the
desired target, remove the backup files related to this remember process
and show a message about remaining backup files, from previous, unfinished
org-force-remember-template-char))
(t
(setq msg (format
- "Select template: %s"
+ "Select template: %s%s"
(mapconcat
(lambda (x)
(cond
(format "[%c]%s" (car x)
(substring (nth 1 x) 1)))
(t (format "[%c]%s" (car x) (nth 1 x)))))
- templates " ")))
+ templates " ")
+ (if (assoc ?C templates)
+ ""
+ " [C]customize templates")))
(let ((inhibit-quit t) char0)
(while (not char0)
(message msg)
(setq char0 (read-char-exclusive))
(when (and (not (assoc char0 templates))
- (not (equal char0 ?\C-g)))
+ (not (equal char0 ?\C-g))
+ (not (equal char0 ?C)))
(message "No such template \"%c\"" char0)
(ding) (sit-for 1)
(setq char0 nil)))
(jump-to-register remember-register)
(kill-buffer remember-buffer)
(error "Abort"))
+ (when (not (assoc char0 templates))
+ (jump-to-register remember-register)
+ (kill-buffer remember-buffer)
+ (customize-variable 'org-remember-templates)
+ (error "Customize templates"))
char0))))))
(cddr (assoc char templates)))))
## C-u C-c C-c like C-c C-c, and immediately visit note at target location
## C-0 C-c C-c \"%s\" -> \"* %s\"
## %s to select file and header location interactively.
-## C-2 C-c C-c as child of the currently clocked item
+## C-2 C-c C-c as child (C-3: as sibling) of the currently clocked item
## To switch templates, use `\\[org-remember]'. To abort use `C-c C-k'.\n\n"
(if org-remember-store-without-prompt " C-c C-c" " C-1 C-c C-c")
(abbreviate-file-name (or file org-default-notes-file))
(or (cdr org-remember-previous-location) "???")
(if org-remember-store-without-prompt "C-1 C-c C-c" " C-c C-c"))))
(insert tpl)
- (goto-char (point-min))
+ ;; %[] Insert contents of a file.
+ (goto-char (point-min))
+ (while (re-search-forward "%\\[\\(.+\\)\\]" nil t)
+ (unless (org-remember-escaped-%)
+ (let ((start (match-beginning 0))
+ (end (match-end 0))
+ (filename (expand-file-name (match-string 1))))
+ (goto-char start)
+ (delete-region start end)
+ (condition-case error
+ (insert-file-contents filename)
+ (error (insert (format "%%![Couldn't insert %s: %s]"
+ filename error)))))))
;; Simple %-escapes
+ (goto-char (point-min))
(while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil t)
(unless (org-remember-escaped-%)
(when (and initial (equal (match-string 0) "%i"))
(or (eval (intern (concat "v-" (match-string 1)))) "")
t t)))
- ;; %[] Insert contents of a file.
- (goto-char (point-min))
- (while (re-search-forward "%\\[\\(.+\\)\\]" nil t)
- (unless (org-remember-escaped-%)
- (let ((start (match-beginning 0))
- (end (match-end 0))
- (filename (expand-file-name (match-string 1))))
- (goto-char start)
- (delete-region start end)
- (condition-case error
- (insert-file-contents filename)
- (error (insert (format "%%![Couldn't insert %s: %s]"
- filename error)))))))
;; %() embedded elisp
(goto-char (point-min))
(while (re-search-forward "%\\((.+)\\)" nil t)
(previousp (and (member current-prefix-arg '((16) 0))
org-remember-previous-location))
(clockp (equal current-prefix-arg 2))
+ (clocksp (equal current-prefix-arg 3))
(fastp (org-xor (equal current-prefix-arg 1)
org-remember-store-without-prompt))
(file (cond
visiting (and file (org-find-base-buffer-visiting file))
heading (cdr org-remember-previous-location)
fastp t))
- (when clockp
+ (when (or clockp clocksp)
(setq file (buffer-file-name (marker-buffer org-clock-marker))
visiting (and file (org-find-base-buffer-visiting file))
heading org-clock-heading-for-remember
(beginning-of-line 2)
(end-of-line 1)
(insert "\n"))))
- (org-paste-subtree (org-get-valid-level level 1) txt)
+ (org-paste-subtree (if clocksp
+ level
+ (org-get-valid-level level 1)) txt)
(and org-auto-align-tags (org-set-tags nil t))
(bookmark-set "org-remember-last-stored")
(move-marker org-remember-last-stored-marker (point)))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Dan Davison <davison at stats dot ox dot ac dot uk>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(require 'cl))
(declare-function org-do-remove-indentation "org" (&optional n))
+(declare-function org-at-table.el-p "org" ())
(declare-function org-get-indentation "org" (&optional line))
(declare-function org-switch-to-buffer-other-window "org" (&rest args))
:group 'org-edit-structure
:type 'boolean)
-
(defcustom org-src-window-setup 'reorganize-frame
"How the source code edit buffer should be displayed.
Possible values for this option are:
The example is copied to a separate buffer, and that buffer is switched
to the correct language mode. When done, exit with \\[org-edit-src-exit].
This will remove the original code in the Org buffer, and replace it with
-the edited version. Optional argument CONTEXT is used by
+the edited version. Optional argument CONTEXT is used by
\\[org-edit-src-save] when calling this function."
(interactive)
(unless (eq context 'save)
block-nindent (nth 5 info)
lang-f (intern (concat lang "-mode"))
begline (save-excursion (goto-char beg) (org-current-line)))
+ (if (equal lang-f 'table.el-mode)
+ (setq lang-f (lambda ()
+ (text-mode)
+ (if (org-bound-and-true-p flyspell-mode)
+ (flyspell-mode -1))
+ (table-recognize)
+ (org-set-local 'org-edit-src-content-indentation 0))))
(unless (functionp lang-f)
(error "No such language mode: %s" lang-f))
(org-goto-line line)
(pos (point))
re1 re2 single beg end lang lfmt match-re1 ind entry)
(catch 'exit
+ (when (org-at-table.el-p)
+ (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
+ (setq beg (1+ (point-at-eol)))
+ (goto-char beg)
+ (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
+ (progn (goto-char (point-max)) (newline)))
+ (setq end (point-at-bol))
+ (setq ind (org-edit-src-get-indentation beg))
+ (throw 'exit (list beg end 'table.el nil nil ind)))
(while (setq entry (pop re-list))
(setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
single (nth 3 entry))
(interactive)
(unless org-edit-src-from-org-mode
(error "This is not a sub-editing buffer, something is wrong..."))
+ (widen)
(let* ((beg org-edit-src-beg-marker)
(end org-edit-src-end-marker)
(ovl org-edit-src-overlay)
org-edit-src-content-indentation))
(preserve-indentation org-src-preserve-indentation)
(delta 0) code line col indent)
- (untabify (point-min) (point-max))
+ (unless preserve-indentation (untabify (point-min) (point-max)))
(save-excursion
(goto-char (point-min))
(if (looking-at "[ \t\n]*\n") (replace-match ""))
(insert code)
(goto-char beg)
(if single (just-one-space))
- (org-goto-line (1- (+ (org-current-line) line)))
- (org-move-to-column (if preserve-indentation col (+ col total-nindent delta)))
+ (if (memq t (mapcar (lambda (overlay)
+ (eq (org-overlay-get overlay 'invisible)
+ 'org-hide-block))
+ (org-overlays-at (point))))
+ ;; Block is hidden; put point at start of block
+ (beginning-of-line 0)
+ ;; Block is visible, put point where it was in the code buffer
+ (org-goto-line (1- (+ (org-current-line) line)))
+ (org-move-to-column (if preserve-indentation col (+ col total-nindent delta))))
(move-marker beg nil)
(move-marker end nil))
(unless (eq context 'save)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(defvar constants-unit-system)
(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
- "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
+ "Non-nil means use the optimized table editor version for `orgtbl-mode'.
In the optimized version, the table editor takes over all simple keys that
normally just insert a character. In tables, the characters are inserted
in a way to minimize disturbing the table structure (i.e. in overwrite mode
:group 'org-table)
(defcustom org-table-automatic-realign t
- "Non-nil means, automatically re-align table when pressing TAB or RETURN.
+ "Non-nil means automatically re-align table when pressing TAB or RETURN.
When nil, aligning is only done with \\[org-table-align], or after column
removal/insertion."
:group 'org-table-editing
:type 'boolean)
(defcustom org-table-auto-blank-field t
- "Non-nil means, automatically blank table field when starting to type into it.
+ "Non-nil means automatically blank table field when starting to type into it.
This only happens when typing immediately after a field motion
command (TAB, S-TAB or RET).
Only relevant when `org-enable-table-editor' is equal to `optimized'."
:type 'boolean)
(defcustom org-table-tab-jumps-over-hlines t
- "Non-nil means, tab in the last column of a table with jump over a hline.
+ "Non-nil means tab in the last column of a table with jump over a hline.
If a horizontal separator line is following the current line,
`org-table-next-field' can either create a new row before that line, or jump
over the line. When this option is nil, a new line will be created before
(const :tag "Convert user input, don't offer during editing" 'from)))
(defcustom org-table-copy-increment t
- "Non-nil means, increment when copying current field with \\[org-table-copy-down]."
+ "Non-nil means increment when copying current field with \\[org-table-copy-down]."
:group 'org-table-calculation
:type 'boolean)
:type 'plist)
(defcustom org-table-formula-evaluate-inline t
- "Non-nil means, TAB and RET evaluate a formula in current table field.
+ "Non-nil means TAB and RET evaluate a formula in current table field.
If the current field starts with an equal sign, it is assumed to be a formula
which should be evaluated as described in the manual and in the documentation
string of the command `org-table-eval-formula'. This feature requires the
:type 'boolean)
(defcustom org-table-formula-use-constants t
- "Non-nil means, interpret constants in formulas in tables.
+ "Non-nil means interpret constants in formulas in tables.
A constant looks like `$c' or `$Grav' and will be replaced before evaluation
by the value given in `org-table-formula-constants', or by a value obtained
from the `constants.el' package."
(string :tag "value"))))
(defcustom org-table-allow-automatic-line-recalculation t
- "Non-nil means, lines marked with |#| or |*| will be recomputed automatically.
-Automatically means, when TAB or RET or C-c C-c are pressed in the line."
+ "Non-nil means lines marked with |#| or |*| will be recomputed automatically.
+Automatically means when TAB or RET or C-c C-c are pressed in the line."
:group 'org-table-calculation
:type 'boolean)
:type 'boolean)
(defcustom org-table-relative-ref-may-cross-hline t
- "Non-nil means, relative formula references may cross hlines.
+ "Non-nil means relative formula references may cross hlines.
Here are the allowed values:
nil Relative references may not cross hlines. They will reference the
"List of max width of fields in each column.
This is being used to correctly align a single field after TAB or RET.")
(defvar org-table-formula-debug nil
- "Non-nil means, debug table formulas.
+ "Non-nil means debug table formulas.
When nil, simply write \"#ERROR\" in corrupted fields.")
(make-variable-buffer-local 'org-table-formula-debug)
(defvar org-table-overlay-coordinates nil
(make-variable-buffer-local 'org-table-overlay-coordinates)
(defvar org-last-recalc-line nil)
+(defvar org-table-do-narrow t) ; for dynamic scoping
(defconst org-narrow-column-arrow "=>"
"Used as display property in narrowed table columns.")
;; Check if we are narrowing any columns
(goto-char beg)
- (setq narrow (and org-format-transports-properties-p
+ (setq narrow (and org-table-do-narrow
+ org-format-transports-properties-p
(re-search-forward "<[rl]?[0-9]+>" end t)))
(goto-char beg)
(setq falign (re-search-forward "<[rl][0-9]*>" end t))
(while (< (setq i (1+ i)) maxfields) ;; Loop over all columns
(setq column (mapcar (lambda (x) (or (nth i x) "")) fields))
;; Check if there is an explicit width specified
+ (setq fmax nil)
(when (or narrow falign)
(setq c column fmax nil falign1 nil)
(while c
(setq e (pop c))
(when (and (stringp e) (string-match "^<\\([rl]\\)?\\([0-9]+\\)?>$" e))
(if (match-end 1) (setq falign1 (match-string 1 e)))
- (if (match-end 2)
+ (if (and org-table-do-narrow (match-end 2))
(setq fmax (string-to-number (match-string 2 e)) c nil))))
;; Find fields that are wider than fmax, and shorten them
(when fmax
(list 'display org-narrow-column-arrow)
xx)))))
;; Get the maximum width for each column
- (push (apply 'max 1 (mapcar 'org-string-width column)) lengths)
+ (push (apply 'max (or fmax 1) 1 (mapcar 'org-string-width column))
+ lengths)
;; Get the fraction of numbers, to decide about alignment of the column
(if falign1
(push (equal (downcase falign1) "r") typenums)
(defvar org-table-clip nil
"Clipboard for table regions.")
+(defun org-table-get (line column)
+ "Get the field in table line LINE, column COLUMN.
+If LINE is larger than the number of data lines in the table, the function
+returns nil. However, if COLUMN is too large, we will simply return an
+empty string.
+If LINE is nil, use the current line.
+If column is nil, use the current column."
+ (setq column (or column (org-table-current-column)))
+ (save-excursion
+ (and (or (not line) (org-table-goto-line line))
+ (org-trim (org-table-get-field column)))))
+
+(defun org-table-put (line column value &optional align)
+ "Put VALUE into line LINE, column COLUMN.
+When ALIGN is set, als realign the table."
+ (setq column (or column (org-table-current-column)))
+ (prog1 (save-excursion
+ (and (or (not line) (org-table-goto-line line))
+ (progn (org-table-goto-column column nil 'force) t)
+ (org-table-get-field column value)))
+ (and align (org-table-align))))
+
+(defun org-table-current-line ()
+ "Return the index of the current data line."
+ (let ((pos (point)) (end (org-table-end)) (cnt 0))
+ (save-excursion
+ (goto-char (org-table-begin))
+ (while (and (re-search-forward org-table-dataline-regexp end t)
+ (setq cnt (1+ cnt))
+ (< (point-at-eol) pos))))
+ cnt))
+
+(defun org-table-goto-line (N)
+ "Go to the Nth data line in the current table.
+Return t when the line exists, nil if it does not exist."
+ (goto-char (org-table-begin))
+ (let ((end (org-table-end)) (cnt 0))
+ (while (and (re-search-forward org-table-dataline-regexp end t)
+ (< (setq cnt (1+ cnt)) N)))
+ (= cnt N)))
+
(defun org-table-blank-field ()
"Blank the current table field or active region."
(interactive)
If there are less than N fields, just go to after the last delimiter.
However, when FORCE is non-nil, create new columns if necessary."
(interactive "p")
- (let ((pos (point-at-eol)))
- (beginning-of-line 1)
- (when (> n 0)
- (while (and (> (setq n (1- n)) -1)
- (or (search-forward "|" pos t)
- (and force
- (progn (end-of-line 1)
- (skip-chars-backward "^|")
- (insert " | "))))))
-; (backward-char 2) t)))))
- (when (and force (not (looking-at ".*|")))
- (save-excursion (end-of-line 1) (insert " | ")))
- (if on-delim
- (backward-char 1)
- (if (looking-at " ") (forward-char 1))))))
-
+ (beginning-of-line 1)
+ (when (> n 0)
+ (while (and (> (setq n (1- n)) -1)
+ (or (search-forward "|" (point-at-eol) t)
+ (and force
+ (progn (end-of-line 1)
+ (skip-chars-backward "^|")
+ (insert " | ")
+ t)))))
+ (when (and force (not (looking-at ".*|")))
+ (save-excursion (end-of-line 1) (insert " | ")))
+ (if on-delim
+ (backward-char 1)
+ (if (looking-at " ") (forward-char 1)))))
(defun org-table-insert-column ()
"Insert a new column into the table."
(setq form (copy-sequence formula)
lispp (and (> (length form) 2)(equal (substring form 0 2) "'(")))
(if (and lispp literal) (setq lispp 'literal))
+
+ ;; Insert row and column number of formula result field
+ (while (string-match "[@$]#" form)
+ (setq form
+ (replace-match
+ (format "%d"
+ (save-match-data
+ (if (equal (substring form (match-beginning 0)
+ (1+ (match-beginning 0)))
+ "@")
+ (org-table-current-dline)
+ (org-table-current-column))))
+ t t form)))
+
;; Check for old vertical references
(setq form (org-table-rewrite-old-row-references form))
;; Insert remote references
"Get a calc vector from a column, according to descriptor DESC.
Optional arguments TBEG and COL can give the beginning of the table and
the current column, to avoid unnecessary parsing.
-HIGHLIGHT means, just highlight the range."
+HIGHLIGHT means just highlight the range."
(if (not (equal (string-to-char desc) ?@))
(setq desc (concat "@" desc)))
(save-excursion
(not (equal ?. (aref s (max (- (match-beginning 0) 2) 0)))))
;; 3.e5 or something like this.
(setq start (match-end 0)))
+ ((or (> (- (match-end 1) (match-beginning 1)) 2)
+ ;; (member (match-string 1 s)
+ ;; '("arctan" "exp" "expm" "lnp" "log" "stir"))
+ )
+ ;; function name, just advance
+ (setq start (match-end 0)))
(t
(setq start (match-beginning 0)
s (replace-match
;; active, this binding is ignored inside tables and replaced with a
;; modified self-insert.
-(defvar orgtbl-mode nil
- "Variable controlling `orgtbl-mode', a minor mode enabling the `org-mode'
-table editor in arbitrary modes.")
-(make-variable-buffer-local 'orgtbl-mode)
-
(defvar orgtbl-mode-map (make-keymap)
"Keymap for `orgtbl-mode'.")
0 (quote 'org-table) 'prepend))
"Extra font-lock-keywords to be added when orgtbl-mode is active.")
+;; Install it as a minor mode.
+(put 'orgtbl-mode :included t)
+(put 'orgtbl-mode :menu-tag "Org Table Mode")
;;;###autoload
-(defun orgtbl-mode (&optional arg)
+(define-minor-mode orgtbl-mode
"The `org-mode' table editor as a minor mode for use in other modes."
- (interactive)
+ :lighter " OrgTbl" :keymap orgtbl-mode-map
(org-load-modules-maybe)
- (if (org-mode-p)
- ;; Exit without error, in case some hook functions calls this
- ;; by accident in org-mode.
- (message "Orgtbl-mode is not useful in org-mode, command ignored")
- (setq orgtbl-mode
- (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode)))
- (if orgtbl-mode
- (progn
- (and (orgtbl-setup) (defun orgtbl-setup () nil))
- ;; Make sure we are first in minor-mode-map-alist
- (let ((c (assq 'orgtbl-mode minor-mode-map-alist)))
- (and c (setq minor-mode-map-alist
- (cons c (delq c minor-mode-map-alist)))))
- (org-set-local (quote org-table-may-need-update) t)
- (org-add-hook 'before-change-functions 'org-before-change-function
- nil 'local)
- (org-set-local 'org-old-auto-fill-inhibit-regexp
- auto-fill-inhibit-regexp)
- (org-set-local 'auto-fill-inhibit-regexp
- (if auto-fill-inhibit-regexp
- (concat orgtbl-line-start-regexp "\\|"
- auto-fill-inhibit-regexp)
- orgtbl-line-start-regexp))
- (org-add-to-invisibility-spec '(org-cwidth))
- (when (fboundp 'font-lock-add-keywords)
- (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
- (org-restart-font-lock))
- (easy-menu-add orgtbl-mode-menu)
- (run-hooks 'orgtbl-mode-hook))
- (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
- (org-table-cleanup-narrow-column-properties)
- (org-remove-from-invisibility-spec '(org-cwidth))
- (remove-hook 'before-change-functions 'org-before-change-function t)
- (when (fboundp 'font-lock-remove-keywords)
- (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords)
- (org-restart-font-lock))
- (easy-menu-remove orgtbl-mode-menu)
- (force-mode-line-update 'all))))
+ (cond
+ ((org-mode-p)
+ ;; Exit without error, in case some hook functions calls this
+ ;; by accident in org-mode.
+ (message "Orgtbl-mode is not useful in org-mode, command ignored"))
+ (orgtbl-mode
+ (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?!
+ ;; Make sure we are first in minor-mode-map-alist
+ (let ((c (assq 'orgtbl-mode minor-mode-map-alist)))
+ ;; FIXME: maybe it should use emulation-mode-map-alists?
+ (and c (setq minor-mode-map-alist
+ (cons c (delq c minor-mode-map-alist)))))
+ (org-set-local (quote org-table-may-need-update) t)
+ (org-add-hook 'before-change-functions 'org-before-change-function
+ nil 'local)
+ (org-set-local 'org-old-auto-fill-inhibit-regexp
+ auto-fill-inhibit-regexp)
+ (org-set-local 'auto-fill-inhibit-regexp
+ (if auto-fill-inhibit-regexp
+ (concat orgtbl-line-start-regexp "\\|"
+ auto-fill-inhibit-regexp)
+ orgtbl-line-start-regexp))
+ (org-add-to-invisibility-spec '(org-cwidth))
+ (when (fboundp 'font-lock-add-keywords)
+ (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
+ (org-restart-font-lock))
+ (easy-menu-add orgtbl-mode-menu))
+ (t
+ (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
+ (org-table-cleanup-narrow-column-properties)
+ (org-remove-from-invisibility-spec '(org-cwidth))
+ (remove-hook 'before-change-functions 'org-before-change-function t)
+ (when (fboundp 'font-lock-remove-keywords)
+ (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords)
+ (org-restart-font-lock))
+ (easy-menu-remove orgtbl-mode-menu)
+ (force-mode-line-update 'all))))
(defun org-table-cleanup-narrow-column-properties ()
"Remove all properties related to narrow-column invisibility."
(while (setq s (text-property-any s (point-max) 'invisible 'org-cwidth))
(remove-text-properties s (1+ s) '(invisible t)))))
-;; Install it as a minor mode.
-(put 'orgtbl-mode :included t)
-(put 'orgtbl-mode :menu-tag "Org Table Mode")
-(add-minor-mode 'orgtbl-mode " OrgTbl" orgtbl-mode-map)
-
(defun orgtbl-make-binding (fun n &rest keys)
"Create a function for binding in the table minor mode.
FUN is the command to call inside a table. N is used to create a unique
"Setup orgtbl keymaps."
(let ((nfunc 0)
(bindings
- (list
- '([(meta shift left)] org-table-delete-column)
- '([(meta left)] org-table-move-column-left)
- '([(meta right)] org-table-move-column-right)
- '([(meta shift right)] org-table-insert-column)
- '([(meta shift up)] org-table-kill-row)
- '([(meta shift down)] org-table-insert-row)
- '([(meta up)] org-table-move-row-up)
- '([(meta down)] org-table-move-row-down)
- '("\C-c\C-w" org-table-cut-region)
- '("\C-c\M-w" org-table-copy-region)
- '("\C-c\C-y" org-table-paste-rectangle)
- '("\C-c-" org-table-insert-hline)
- '("\C-c}" org-table-toggle-coordinate-overlays)
- '("\C-c{" org-table-toggle-formula-debugger)
- '("\C-m" org-table-next-row)
- '([(shift return)] org-table-copy-down)
- '("\C-c?" org-table-field-info)
- '("\C-c " org-table-blank-field)
- '("\C-c+" org-table-sum)
- '("\C-c=" org-table-eval-formula)
- '("\C-c'" org-table-edit-formulas)
- '("\C-c`" org-table-edit-field)
- '("\C-c*" org-table-recalculate)
- '("\C-c^" org-table-sort-lines)
- '("\M-a" org-table-beginning-of-field)
- '("\M-e" org-table-end-of-field)
- '([(control ?#)] org-table-rotate-recalc-marks)))
+ '(([(meta shift left)] org-table-delete-column)
+ ([(meta left)] org-table-move-column-left)
+ ([(meta right)] org-table-move-column-right)
+ ([(meta shift right)] org-table-insert-column)
+ ([(meta shift up)] org-table-kill-row)
+ ([(meta shift down)] org-table-insert-row)
+ ([(meta up)] org-table-move-row-up)
+ ([(meta down)] org-table-move-row-down)
+ ("\C-c\C-w" org-table-cut-region)
+ ("\C-c\M-w" org-table-copy-region)
+ ("\C-c\C-y" org-table-paste-rectangle)
+ ("\C-c-" org-table-insert-hline)
+ ("\C-c}" org-table-toggle-coordinate-overlays)
+ ("\C-c{" org-table-toggle-formula-debugger)
+ ("\C-m" org-table-next-row)
+ ([(shift return)] org-table-copy-down)
+ ("\C-c?" org-table-field-info)
+ ("\C-c " org-table-blank-field)
+ ("\C-c+" org-table-sum)
+ ("\C-c=" org-table-eval-formula)
+ ("\C-c'" org-table-edit-formulas)
+ ("\C-c`" org-table-edit-field)
+ ("\C-c*" org-table-recalculate)
+ ("\C-c^" org-table-sort-lines)
+ ("\M-a" org-table-beginning-of-field)
+ ("\M-e" org-table-end-of-field)
+ ([(control ?#)] org-table-rotate-recalc-marks)))
elt key fun cmd)
(while (setq elt (pop bindings))
(setq nfunc (1+ nfunc))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
:group 'org-time
:type 'string)
+(defvar org-timer-start-hook nil
+ "Hook run after relative timer is started.")
+
+(defvar org-timer-stop-hook nil
+ "Hook run before relative timer is stopped.")
+
+(defvar org-timer-pause-hook nil
+ "Hook run before relative timer is paused.")
+
+(defvar org-timer-set-hook nil
+ "Hook run after countdown timer is set.")
+
+(defvar org-timer-done-hook nil
+ "Hook run after countdown timer reaches zero.")
+
+(defvar org-timer-cancel-hook nil
+ "Hook run before countdown timer is canceled.")
+
;;;###autoload
(defun org-timer-start (&optional offset)
"Set the starting time for the relative timer to now.
(org-timer-set-mode-line 'on)
(message "Timer start time set to %s, current value is %s"
(format-time-string "%T" org-timer-start-time)
- (org-timer-secs-to-hms (or delta 0))))))
+ (org-timer-secs-to-hms (or delta 0)))
+ (run-hooks 'org-timer-start-hook))))
(defun org-timer-pause-or-continue (&optional stop)
"Pause or continue the relative timer. With prefix arg, stop it entirely."
(message "Timer continues at %s" (org-timer-value-string)))
(t
;; pause timer
+ (run-hooks 'org-timer-pause-hook)
(setq org-timer-pause-time (current-time))
(org-timer-set-mode-line 'pause)
(message "Timer paused at %s" (org-timer-value-string)))))
(defun org-timer-stop ()
"Stop the relative timer."
(interactive)
+ (run-hooks 'org-timer-stop-hook)
(setq org-timer-start-time nil
org-timer-pause-time nil)
(org-timer-set-mode-line 'off))
(concat " <" (substring (org-timer-value-string) 0 -1) ">"))
(force-mode-line-update)))
-(defvar org-timer-timer1 nil)
-(defvar org-timer-timer2 nil)
-(defvar org-timer-timer3 nil)
-(defvar org-timer-last-timer nil)
-
-(defun org-timer-cancel-timers ()
- "Reset all timers."
+(defvar org-timer-current-timer nil)
+(defun org-timer-cancel-timer ()
+ "Cancel the current timer."
(interactive)
- (mapc (lambda(timer)
- (when (eval timer)
- (cancel-timer timer)
- (setq timer nil)))
- '(org-timer-timer1
- org-timer-timer2
- org-timer-timer3))
- (message "All timers reset"))
+ (when (eval org-timer-current-timer)
+ (run-hooks 'org-timer-cancel-hook)
+ (cancel-timer org-timer-current-timer)
+ (setq org-timer-current-timer nil))
+ (message "Last timer canceled"))
(defun org-timer-show-remaining-time ()
"Display the remaining time before the timer ends."
(interactive)
(require 'time)
- (if (and (not org-timer-timer1)
- (not org-timer-timer2)
- (not org-timer-timer3))
+ (if (not org-timer-current-timer)
(message "No timer set")
(let* ((rtime (decode-time
- (time-subtract (timer--time org-timer-last-timer)
+ (time-subtract (timer--time org-timer-current-timer)
(current-time))))
(rsecs (nth 0 rtime))
(rmins (nth 1 rtime)))
- (message "%d minutes %d seconds left before next time out"
+ (message "%d minute(s) %d seconds left before next time out"
rmins rsecs))))
;;;###autoload
(org-get-heading))
(t (error "Not in an Org buffer"))))
timer-set)
- (mapcar (lambda(timer)
- (when (not (or (eval timer) timer-set))
- (setq timer-set t)
- (setq org-timer-last-timer
- (run-with-timer
- secs nil 'org-notify (format "%s: time out" hl) t))
- (set timer org-timer-last-timer)))
- '(org-timer-timer1
- org-timer-timer2
- org-timer-timer3)))))
+ (if org-timer-current-timer
+ (error "You cannot run several timers at the same time")
+ (setq org-timer-current-timer
+ (run-with-timer
+ secs nil `(lambda ()
+ (setq org-timer-current-timer nil)
+ (org-notify ,(format "%s: time out" hl) t)
+ (run-hooks 'org-timer-done-hook))))
+ (run-hooks 'org-timer-set-hook)))))
(provide 'org-timer)
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(subject (let (wl-thr-indent-string wl-parent-message-entity)
(wl-summary-line-subject)))
desc link)
+ ;; remove text properties of subject string to avoid possible bug
+ ;; when formatting the subject
+ (set-text-properties 0 (length subject) nil subject)
+
(org-store-link-props :type "wl" :from from :to to
:subject subject :message-id message-id)
(setq message-id (org-remove-angle-brackets message-id))
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
"Export the org buffer as XOXO.
The XOXO buffer is named *xoxo-<source buffer name>*"
(interactive (list (current-buffer)))
+ (run-hooks 'org-export-first-hook)
;; A quickie abstraction
;; Output everything as XOXO
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.33x
+;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
(require 'easymenu)
(require 'org-macs)
+(require 'org-entities)
(require 'org-compat)
(require 'org-faces)
(require 'org-list)
;;; Version
-(defconst org-version "6.33x"
+(defconst org-version "6.35i"
"The version number of the file org.el.")
(defun org-version (&optional here)
"Outline-based notes management and organizer."
:tag "Org"
:group 'outlines
- :group 'hypermedia
:group 'calendar)
(defcustom org-mode-hook nil
(let ((a (member 'org-infojs org-modules)))
(and a (setcar a 'org-jsinfo))))
-(defcustom org-modules '(org-bbdb org-bibtex org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl)
+(defcustom org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl)
"Modules that should always be loaded together with org.el.
If a description starts with <C>, the file is not part of Emacs
and loading it will require that you have downloaded and properly installed
(const :tag " bbdb: Links to BBDB entries" org-bbdb)
(const :tag " bibtex: Links to BibTeX entries" org-bibtex)
(const :tag " crypt: Encryption of subtrees" org-crypt)
+ (const :tag " ctags: Access to Emacs tags with links" org-ctags)
+ (const :tag " docview: Links to doc-view buffers" org-docview)
(const :tag " gnus: Links to GNUS folders/messages" org-gnus)
(const :tag " id: Global IDs for identifying entries" org-id)
(const :tag " info: Links to Info nodes" org-info)
(const :tag "C man: Support for links to manpages in Org-mode" org-man)
(const :tag "C mtags: Support for muse-like tags" org-mtags)
(const :tag "C panel: Simple routines for us with bad memory" org-panel)
- (const :tag "C R: Computation using the R language" org-R)
(const :tag "C registry: A registry for Org-mode links" org-registry)
(const :tag "C org2rem: Convert org appointments into reminders" org2rem)
(const :tag "C screen: Visit screen sessions through Org-mode links" org-screen)
+ (const :tag "C secretary: Team management with org-mode" org-secretary)
(const :tag "C special-blocks: Turn blocks into LaTeX envs and HTML divs" org-special-blocks)
(const :tag "C sqlinsert: Convert Org-mode tables to SQL insertions" orgtbl-sqlinsert)
(const :tag "C toc: Table of contents for Org-mode buffer" org-toc)
(repeat :tag "External packages" :inline t (symbol :tag "Package"))))
(defcustom org-support-shift-select nil
- "Non-nil means, make shift-cursor commands select text when possible.
+ "Non-nil means make shift-cursor commands select text when possible.
In Emacs 23, when `shift-select-mode' is on, shifted cursor keys start
selecting a region, or enlarge thusly regions started in this way.
:group 'org)
(defcustom org-startup-folded t
- "Non-nil means, entering Org-mode will switch to OVERVIEW.
+ "Non-nil means entering Org-mode will switch to OVERVIEW.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:
(const :tag "show everything, even drawers" showeverything)))
(defcustom org-startup-truncated t
- "Non-nil means, entering Org-mode will set `truncate-lines'.
+ "Non-nil means entering Org-mode will set `truncate-lines'.
This is useful since some lines containing links can be very long and
uninteresting. Also tables look terrible when wrapped."
:group 'org-startup
:type 'boolean)
(defcustom org-startup-indented nil
- "Non-nil means, turn on `org-indent-mode' on startup.
+ "Non-nil means turn on `org-indent-mode' on startup.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:
(const :tag "Not" nil)
(const :tag "Globally (slow on startup in large files)" t)))
+(defcustom org-startup-with-beamer-mode nil
+ "Non-nil means turn on `org-beamer-mode' on startup.
+This can also be configured on a per-file basis by adding one of
+the following lines anywhere in the buffer:
+
+ #+STARTUP: beamer"
+ :group 'org-startup
+ :type 'boolean)
+
(defcustom org-startup-align-all-tables nil
- "Non-nil means, align all tables when visiting a file.
+ "Non-nil means align all tables when visiting a file.
This is useful when the column width in tables is forced with <N> cookies
in table fields. Such tables will look correct only after the first re-align.
This can also be configured on a per-file basis by adding one of
"Contexts for the reveal options.")
(defcustom org-show-hierarchy-above '((default . t))
- "Non-nil means, show full hierarchy when revealing a location.
+ "Non-nil means show full hierarchy when revealing a location.
Org-mode often shows locations in an org-mode file which might have
been invisible before. When this is set, the hierarchy of headings
above the exposed location is shown.
:type org-context-choice)
(defcustom org-show-following-heading '((default . nil))
- "Non-nil means, show following heading when revealing a location.
+ "Non-nil means show following heading when revealing a location.
Org-mode often shows locations in an org-mode file which might have
been invisible before. When this is set, the heading following the
match is shown.
:type org-context-choice)
(defcustom org-show-siblings '((default . nil) (isearch t))
- "Non-nil means, show all sibling heading when revealing a location.
+ "Non-nil means show all sibling heading when revealing a location.
Org-mode often shows locations in an org-mode file which might have
been invisible before. When this is set, the sibling of the current entry
heading are all made visible. If `org-show-hierarchy-above' is t,
:type org-context-choice)
(defcustom org-show-entry-below '((default . nil))
- "Non-nil means, show the entry below a headline when revealing a location.
+ "Non-nil means show the entry below a headline when revealing a location.
Org-mode often shows locations in an org-mode file which might have
been invisible before. When this is set, the text below the headline that is
exposed is also shown.
(const :tag "One dedicated frame" dedicated-frame)))
(defcustom org-use-speed-commands nil
- "Non-nil means, activate single letter commands at beginning of a headline.
+ "Non-nil means activate single letter commands at beginning of a headline.
This may also be a function to test for appropriate locations where speed
commands should be active."
:group 'org-structure
:group 'org-structure)
(defcustom org-cycle-skip-children-state-if-no-children t
- "Non-nil means, skip CHILDREN state in entries that don't have any."
+ "Non-nil means skip CHILDREN state in entries that don't have any."
:group 'org-cycle
:type 'boolean)
:type '(repeat (string :tag "Drawer Name")))
(defcustom org-hide-block-startup nil
- "Non-nil means, , entering Org-mode will fold all blocks.
+ "Non-nil means entering Org-mode will fold all blocks.
This can also be set in on a per-file basis with
#+STARTUP: hideblocks
:type 'boolean)
(defcustom org-cycle-level-after-item/entry-creation t
- "Non-nil means, cycle entry level or item indentation in new empty entries.
+ "Non-nil means cycle entry level or item indentation in new empty entries.
When the cursor is at the end of an empty headline, i.e with only stars
and maybe a TODO keyword, TAB will then switch the entry to become a child,
headline, this empty line is hidden when the subtree is folded.
Org-mode will leave (exactly) one empty line visible if the number of
empty lines is equal or larger to the number given in this variable.
-So the default 2 means, at least 2 empty lines after the end of a subtree
+So the default 2 means at least 2 empty lines after the end of a subtree
are needed to produce free space between a collapsed subtree and the
following headline.
:group 'org-structure)
(defcustom org-odd-levels-only nil
- "Non-nil means, skip even levels and only use odd levels for the outline.
+ "Non-nil means skip even levels and only use odd levels for the outline.
This has the effect that two stars are being added/taken away in
promotion/demotion commands. It also influences how levels are
handled by the exporters.
#+STARTUP: odd
#+STARTUP: oddeven"
:group 'org-edit-structure
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defcustom org-adapt-indentation t
- "Non-nil means, adapt indentation to outline node level.
+ "Non-nil means adapt indentation to outline node level.
When this variable is set, Org assumes that you write outlines by
indenting text in each node to align with the headline (after the stars).
:type 'boolean)
(defcustom org-yank-folded-subtrees t
- "Non-nil means, when yanking subtrees, fold them.
+ "Non-nil means when yanking subtrees, fold them.
If the kill is a single subtree, or a sequence of subtrees, i.e. if
it starts with a heading and all other headings in it are either children
or siblings, then fold all the subtrees. However, do this only if no
:type 'boolean)
(defcustom org-yank-adjusted-subtrees nil
- "Non-nil means, when yanking subtrees, adjust the level.
+ "Non-nil means when yanking subtrees, adjust the level.
With this setting, `org-paste-subtree' is used to insert the subtree, see
this function for details."
:group 'org-edit-structure
:type 'boolean)
(defcustom org-M-RET-may-split-line '((default . t))
- "Non-nil means, M-RET will split the line at the cursor position.
+ "Non-nil means M-RET will split the line at the cursor position.
When nil, it will go to the end of the line before making a
new line.
You may also set this option in a different way for different
(defcustom org-insert-heading-respect-content nil
- "Non-nil means, insert new headings after the current subtree.
+ "Non-nil means insert new headings after the current subtree.
When nil, the new heading is created directly after the current line.
The commands \\[org-insert-heading-respect-content] and
\\[org-insert-todo-heading-respect-content] turn this variable on
:type 'hook)
(defcustom org-enable-fixed-width-editor t
- "Non-nil means, lines starting with \":\" are treated as fixed-width.
-This currently only means, they are never auto-wrapped.
+ "Non-nil means lines starting with \":\" are treated as fixed-width.
+This currently only means they are never auto-wrapped.
When nil, such lines will be treated like ordinary lines.
See also the QUOTE keyword."
:group 'org-edit-structure
(defcustom org-goto-auto-isearch t
- "Non-nil means, typing characters in org-goto starts incremental search."
+ "Non-nil means typing characters in org-goto starts incremental search."
:group 'org-edit-structure
:type 'boolean)
:group 'org-structure)
(defcustom org-highlight-sparse-tree-matches t
- "Non-nil means, highlight all matches that define a sparse tree.
+ "Non-nil means highlight all matches that define a sparse tree.
The highlights will automatically disappear the next time the buffer is
changed by an edit command."
:group 'org-sparse-trees
:type 'boolean)
(defcustom org-remove-highlights-with-change t
- "Non-nil means, any change to the buffer will remove temporary highlights.
+ "Non-nil means any change to the buffer will remove temporary highlights.
Such highlights are created by `org-occur' and `org-clock-display'.
When nil, `C-c C-c needs to be used to get rid of the highlights.
The highlights created by `org-preview-latex-fragment' always need
:group 'org)
(defcustom org-enable-table-editor 'optimized
- "Non-nil means, lines starting with \"|\" are handled by the table editor.
+ "Non-nil means lines starting with \"|\" are handled by the table editor.
When nil, such lines will be treated like ordinary lines.
When equal to the symbol `optimized', the table editor will be optimized to
:type 'boolean)
(defcustom org-table-tab-recognizes-table.el t
- "Non-nil means, TAB will automatically notice a table.el table.
+ "Non-nil means TAB will automatically notice a table.el table.
When it sees such a table, it moves point into it and - if necessary -
calls `table-recognize-table'."
:group 'org-table-editing
(function)))))
(defcustom org-descriptive-links t
- "Non-nil means, hide link part and only show description of bracket links.
+ "Non-nil means hide link part and only show description of bracket links.
Bracket links are like [[link][description]]. This variable sets the initial
state in new org-mode buffers. The setting can then be toggled on a
per-buffer basis from the Org->Hyperlinks menu."
:type 'regexp)
(defcustom org-link-to-org-use-id 'create-if-interactive-and-no-custom-id
- "Non-nil means, storing a link to an Org file will use entry IDs.
+ "Non-nil means storing a link to an Org file will use entry IDs.
Note that before this variable is even considered, org-id must be loaded,
so please customize `org-modules' and turn it on.
(const :tag "Do not use ID to create link" nil)))
(defcustom org-context-in-file-links t
- "Non-nil means, file links from `org-store-link' contain context.
+ "Non-nil means file links from `org-store-link' contain context.
A search string will be added to the file name with :: as separator and
used to find the context when the link is activated by the command
`org-open-at-point'.
:type 'boolean)
(defcustom org-keep-stored-link-after-insertion nil
- "Non-nil means, keep link in list for entire session.
+ "Non-nil means keep link in list for entire session.
The command `org-store-link' adds a link pointing to the current
location to an internal list. These links accumulate during a session.
:type 'hook)
(defcustom org-tab-follows-link nil
- "Non-nil means, on links TAB will follow the link.
+ "Non-nil means on links TAB will follow the link.
Needs to be set before org.el is loaded.
This really should not be used, it does not make sense, and the
implementation is bad."
:type 'boolean)
(defcustom org-return-follows-link nil
- "Non-nil means, on links RET will follow the link.
+ "Non-nil means on links RET will follow the link.
Needs to be set before org.el is loaded."
:group 'org-link-follow
:type 'boolean)
(defcustom org-mouse-1-follows-link
(if (boundp 'mouse-1-click-follows-link) mouse-1-click-follows-link t)
- "Non-nil means, mouse-1 on a link will follow the link.
+ "Non-nil means mouse-1 on a link will follow the link.
A longer mouse click will still set point. Does not work on XEmacs.
Needs to be set before org.el is loaded."
:group 'org-link-follow
(const find-file-other-frame)))))
(defcustom org-display-internal-link-with-indirect-buffer nil
- "Non-nil means, use indirect buffer to display infile links.
+ "Non-nil means use indirect buffer to display infile links.
Activating internal links (from one location in a file to another location
in the same file) normally just jumps to the location. When the link is
activated with a C-u prefix (or with mouse-3), the link is displayed in
:type 'boolean)
(defcustom org-open-non-existing-files nil
- "Non-nil means, `org-open-file' will open non-existing files.
+ "Non-nil means `org-open-file' will open non-existing files.
When nil, an error will be generated.
This variable applies only to external applications because they
might choke on non-existing files. If the link is to a file that
:type 'boolean)
(defcustom org-open-directory-means-index-dot-org nil
- "Non-nil means, a link to a directory really means to index.org.
+ "Non-nil means a link to a directory really means to index.org.
When nil, following a directory link will run dired or open a finder/explorer
window on that directory."
:group 'org-link-follow
(cons :tag "other" (function) (repeat :tag "argument" sexp))))
(defcustom org-confirm-shell-link-function 'yes-or-no-p
- "Non-nil means, ask for confirmation before executing shell links.
+ "Non-nil means ask for confirmation before executing shell links.
Shell links can be dangerous: just think about a link
[[shell:rm -rf ~/*][Google Search]]
(const :tag "no confirmation (dangerous)" nil)))
(defcustom org-confirm-elisp-link-function 'yes-or-no-p
- "Non-nil means, ask for confirmation before executing Emacs Lisp links.
+ "Non-nil means ask for confirmation before executing Emacs Lisp links.
Elisp links can be dangerous: just think about a link
[[elisp:(shell-command \"rm -rf ~/*\")][Google Search]]
extension. The entries in this list are cons cells where the car identifies
files and the cdr the corresponding command. Possible values for the
file identifier are
- \"regex\" Regular expression matched against the file name. For backward
- compatibility, this can also be a string with only alphanumeric
- characters, which is then interpreted as an extension.
+ \"regex\" Regular expression matched against the file: link. For
+ backward compatibility, this can also be a string with only
+ alphanumeric characters, which is then interpreted as an
+ extension.
`directory' Matches a directory
`remote' Matches a remote file, accessible through tramp or efs.
Remote files most likely should be visited through Emacs
does define this command, but you can overrule/replace it
here.
string A command to be executed by a shell; %s will be replaced
- by the path to the file.
+ by the path to the file. If the file identifier is a regex,
+ %n will be replaced by the match of the nth match group.
sexp A Lisp form which will be evaluated. The file path will
- be available in the Lisp variable `file'.
+ be available in the Lisp variable `file', the link itself
+ in the Lisp variable `link'. If the file identifier is a regex,
+ the original match data will be restored, so subexpression
+ matches are accessible using (match-string n link).
For more examples, see the system specific constants
`org-file-apps-defaults-macosx'
`org-file-apps-defaults-windowsnt'
:type 'integer)
(defcustom org-reverse-note-order nil
- "Non-nil means, store new notes at the beginning of a file or entry.
+ "Non-nil means store new notes at the beginning of a file or entry.
When nil, new notes will be filed to the end of a file or entry.
This can also be a list with cons cells of regular expressions that
are matched against file names, and values."
(repeat :tag "By file name regexp"
(cons regexp boolean))))
+(defcustom org-log-refile nil
+ "Information to record when a task is refiled.
+
+Possible values are:
+
+nil Don't add anything
+time Add a time stamp to the task
+note Prompt for a note and add it with template `org-log-note-headings'
+
+This option can also be set with on a per-file-basis with
+
+ #+STARTUP: nologrefile
+ #+STARTUP: logrefile
+ #+STARTUP: lognoterefile
+
+You can have local logging settings for a subtree by setting the LOGGING
+property to one or more of these keywords.
+
+When bulk-refiling from the agenda, the value `note' is forbidden and
+will temporarily be changed to `time'."
+ :group 'org-refile
+ :group 'org-progress
+ :type '(choice
+ (const :tag "No logging" nil)
+ (const :tag "Record timestamp" time)
+ (const :tag "Record timestamp with note." note)))
+
(defcustom org-refile-targets nil
"Targets for refiling entries with \\[org-refile].
This is list of cons cells. Each cell contains:
- a specification of the files to be considered, either a list of files,
or a symbol whose function or variable value will be used to retrieve
a file name or a list of file names. If you use `org-agenda-files' for
- that, all agenda files will be scanned for targets. Nil means, consider
+ that, all agenda files will be scanned for targets. Nil means consider
headings in the current buffer.
- A specification of how to find candidate refile targets. This may be
any of:
:type 'function)
(defcustom org-refile-use-outline-path nil
- "Non-nil means, provide refile targets as paths.
+ "Non-nil means provide refile targets as paths.
So a level 3 headline will be available as level1/level2/level3.
When the value is `file', also include the file name (without directory)
(const :tag "Start with full file path" full-file-path)))
(defcustom org-outline-path-complete-in-steps t
- "Non-nil means, complete the outline path in hierarchical steps.
+ "Non-nil means complete the outline path in hierarchical steps.
When Org-mode uses the refile interface to select an outline path
\(see variable `org-refile-use-outline-path'), the completion of
the path can be done is a single go, or if can be done in steps down
:type 'boolean)
(defcustom org-refile-allow-creating-parent-nodes nil
- "Non-nil means, allow to create new nodes as refile targets.
+ "Non-nil means allow to create new nodes as refile targets.
New nodes are then created by adding \"/new node name\" to the completion
of an existing node. When the value of this variable is `confirm',
new node creation must be confirmed by the user (recommended)
(const type)))
(defcustom org-use-fast-todo-selection t
- "Non-nil means, use the fast todo selection scheme with C-c C-t.
+ "Non-nil means use the fast todo selection scheme with C-c C-t.
This variable describes if and under what circumstances the cycling
mechanism for TODO keywords will be replaced by a single-key, direct
selection scheme.
(const :tag "Only with C-u C-c C-t" prefix)))
(defcustom org-provide-todo-statistics t
- "Non-nil means, update todo statistics after insert and toggle.
+ "Non-nil means update todo statistics after insert and toggle.
ALL-HEADLINES means update todo statistics by including headlines
with no TODO keyword as well, counting them as not done.
A list of TODO keywords means the same, but skip keywords that are
(other :tag "No TODO statistics" nil)))
(defcustom org-hierarchical-todo-statistics t
- "Non-nil means, TODO statistics covers just direct children.
+ "Non-nil means TODO statistics covers just direct children.
When nil, all entries in the subtree are considered.
This has only an effect if `org-provide-todo-statistics' is set.
To set this to nil for only a single subtree, use a COOKIE_DATA
:to new state, like in :from")
(defcustom org-enforce-todo-dependencies nil
- "Non-nil means, undone TODO entries will block switching the parent to DONE.
+ "Non-nil means undone TODO entries will block switching the parent to DONE.
Also, if a parent has an :ORDERED: property, switching an entry to DONE will
be blocked if any prior sibling is not yet done.
Finally, if the parent is blocked because of ordered siblings of its own,
:type 'boolean)
(defcustom org-enforce-todo-checkbox-dependencies nil
- "Non-nil means, unchecked boxes will block switching the parent to DONE.
+ "Non-nil means unchecked boxes will block switching the parent to DONE.
When this is nil, checkboxes have no influence on switching TODO states.
When non-nil, you first need to check off all check boxes before the TODO
entry can be switched to DONE.
:type 'boolean)
(defcustom org-treat-insert-todo-heading-as-state-change nil
- "Non-nil means, inserting a TODO heading is treated as state change.
+ "Non-nil means inserting a TODO heading is treated as state change.
So when the command \\[org-insert-todo-heading] is used, state change
logging will apply if appropriate. When nil, the new TODO item will
be inserted directly, and no logging will take place."
:type 'boolean)
(defcustom org-treat-S-cursor-todo-selection-as-state-change t
- "Non-nil means, switching TODO states with S-cursor counts as state change.
+ "Non-nil means switching TODO states with S-cursor counts as state change.
This is the default behavior. However, setting this to nil allows a
convenient way to select a TODO state and bypass any logging associated
with that."
(const :tag "Record timestamp with note." note)))
(defcustom org-log-note-clock-out nil
- "Non-nil means, record a note when clocking out of an item.
+ "Non-nil means record a note when clocking out of an item.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:
:type 'boolean)
(defcustom org-log-done-with-time t
- "Non-nil means, the CLOSED time stamp will contain date and time.
+ "Non-nil means the CLOSED time stamp will contain date and time.
When nil, only the date will be recorded."
:group 'org-progress
:type 'boolean)
(state . "State %-12s from %-12S %t")
(note . "Note taken on %t")
(reschedule . "Rescheduled from %S on %t")
+ (delschedule . "Not scheduled, was %S on %t")
(redeadline . "New deadline from %S on %t")
+ (deldeadline . "Removed deadline, was %S on %t")
+ (refile . "Refiled on %t")
(clock-out . ""))
"Headings for notes added to entries.
The value is an alist, with the car being a symbol indicating the note
%s will be replaced by the new TODO state, in double quotes.
%S will be replaced by the old TODO state, in double quotes.
%u will be replaced by the user name.
-%U will be replaced by the full user name."
+%U will be replaced by the full user name.
+
+In fact, it is not a good idea to change the `state' entry, because
+agenda log mode depends on the format of these entries."
:group 'org-todo
:group 'org-progress
:type '(list :greedy t
state) string)
(cons (const :tag "Heading when just taking a note" note) string)
(cons (const :tag "Heading when clocking out" clock-out) string)
+ (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
(cons (const :tag "Heading when rescheduling" reschedule) string)
- (cons (const :tag "Heading when changing deadline" redeadline) string)))
+ (cons (const :tag "Heading when changing deadline" redeadline) string)
+ (cons (const :tag "Heading when deleting a deadline" deldeadline) string)
+ (cons (const :tag "Heading when refiling" refile) string)))
(unless (assq 'note org-log-note-headings)
(push '(note . "%t") org-log-note-headings))
(defcustom org-log-into-drawer nil
- "Non-nil means, insert state change notes and time stamps into a drawer.
+ "Non-nil means insert state change notes and time stamps into a drawer.
When nil, state changes notes will be inserted after the headline and
any scheduling and clock lines, but not inside a drawer.
(t p))))
(defcustom org-log-state-notes-insert-after-drawers nil
- "Non-nil means, insert state change notes after any drawers in entry.
+ "Non-nil means insert state change notes after any drawers in entry.
Only the drawers that *immediately* follow the headline and the
deadline/scheduled line are skipped.
When nil, insert notes right after the heading and perhaps the line
:type 'boolean)
(defcustom org-log-states-order-reversed t
- "Non-nil means, the latest state change note will be directly after heading.
-When nil, the notes will be orderer according to time."
+ "Non-nil means the latest state note will be directly after heading.
+When nil, the state change notes will be ordered according to time."
:group 'org-todo
:group 'org-progress
:type 'boolean)
(defcustom org-log-repeat 'time
- "Non-nil means, record moving through the DONE state when triggering repeat.
+ "Non-nil means record moving through the DONE state when triggering repeat.
An auto-repeating task is immediately switched back to TODO when
marked DONE. If you are not logging state changes (by adding \"@\"
or \"!\" to the TODO keyword definition), or set `org-log-done' to
:group 'org-todo)
(defcustom org-enable-priority-commands t
- "Non-nil means, priority commands are active.
+ "Non-nil means priority commands are active.
When nil, these commands will be disabled, so that you never accidentally
set a priority."
:group 'org-priorities
:type 'character)
(defcustom org-priority-start-cycle-with-default t
- "Non-nil means, start with default priority when starting to cycle.
+ "Non-nil means start with default priority when starting to cycle.
When this is nil, the first step in the cycle will be (depending on the
command used) one higher or lower that the default priority."
:group 'org-priorities
:group 'org)
(defcustom org-insert-labeled-timestamps-at-point nil
- "Non-nil means, SCHEDULED and DEADLINE timestamps are inserted at point.
+ "Non-nil means SCHEDULED and DEADLINE timestamps are inserted at point.
When nil, these labeled time stamps are forces into the second line of an
entry, just after the headline. When scheduling from the global TODO list,
the time stamp will always be forced into the second line."
org-time-stamp-rounding-minutes)))
(defcustom org-display-custom-times nil
- "Non-nil means, overlay custom formats over all time stamps.
+ "Non-nil means overlay custom formats over all time stamps.
The formats are defined through the variable `org-time-stamp-custom-formats'.
To turn this on on a per-file basis, insert anywhere in the file:
#+STARTUP: customtime"
:type 'integer)
(defcustom org-read-date-prefer-future t
- "Non-nil means, assume future for incomplete date input from user.
+ "Non-nil means assume future for incomplete date input from user.
This affects the following situations:
1. The user gives a month but not a year.
For example, if it is april and you enter \"feb 2\", this will be read
(const :tag "Check month, day, and time" time)))
(defcustom org-read-date-display-live t
- "Non-nil means, display current interpretation of date prompt live.
+ "Non-nil means display current interpretation of date prompt live.
This display will be in an overlay, in the minibuffer."
:group 'org-time
:type 'boolean)
(defcustom org-read-date-popup-calendar t
- "Non-nil means, pop up a calendar when prompting for a date.
+ "Non-nil means pop up a calendar when prompting for a date.
In the calendar, the date can be selected with mouse-1. However, the
minibuffer will also be active, and you can simply enter the date as well.
When nil, only the minibuffer will be available."
:type 'integer)
(defcustom org-edit-timestamp-down-means-later nil
- "Non-nil means, S-down will increase the time in a time stamp.
+ "Non-nil means S-down will increase the time in a time stamp.
When nil, S-up will increase."
:group 'org-time
:type 'boolean)
(defcustom org-calendar-follow-timestamp-change t
- "Non-nil means, make the calendar window follow timestamp changes.
+ "Non-nil means make the calendar window follow timestamp changes.
When a timestamp is modified and the calendar window is visible, it will be
moved to the new date."
:group 'org-time
(const :tag "End radio group" (:endgroup))
(const :tag "New line" (:newline)))))
+(defcustom org-complete-tags-always-offer-all-agenda-tags nil
+ "If non-nil, always offer completion for all tags of all agenda files.
+Instead of customizing this variable directly, you might want to
+set it locally for remember buffers, because there no list of
+tags in that file can be created dynamically (there are none).
+
+ (add-hook 'org-remember-mode-hook
+ (lambda ()
+ (set (make-local-variable
+ 'org-complete-tags-always-offer-all-agenda-tags)
+ t)))"
+ :group 'org-tags
+ :type 'boolean)
+
(defvar org-file-tags nil
"List of tags that can be inherited by all entries in the file.
The tags will be inherited if the variable `org-use-tag-inheritance'
This variable is populated from #+FILETAGS lines.")
(defcustom org-use-fast-tag-selection 'auto
- "Non-nil means, use fast tag selection scheme.
+ "Non-nil means use fast tag selection scheme.
This is a special interface to select and deselect tags with single keys.
When nil, fast selection is never used.
When the symbol `auto', fast selection is used if and only if selection
(const :tag "When selection characters are configured" 'auto)))
(defcustom org-fast-tag-selection-single-key nil
- "Non-nil means, fast tag selection exits after first change.
+ "Non-nil means fast tag selection exits after first change.
When nil, you have to press RET to exit it.
During fast tag selection, you can toggle this flag with `C-c'.
This variable can also have the value `expert'. In this case, the window
(const :tag "Expert" expert)))
(defvar org-fast-tag-selection-include-todo nil
- "Non-nil means, fast tags selection interface will also offer TODO states.
+ "Non-nil means fast tags selection interface will also offer TODO states.
This is an undocumented feature, you should not rely on it.")
(defcustom org-tags-column (if (featurep 'xemacs) -76 -77)
:type 'integer)
(defcustom org-auto-align-tags t
- "Non-nil means, realign tags after pro/demotion of TODO state change.
+ "Non-nil means realign tags after pro/demotion of TODO state change.
These operations change the length of a headline and therefore shift
the tags around. With this options turned on, after each such operation
the tags are again aligned to `org-tags-column'."
:type 'boolean)
(defcustom org-use-tag-inheritance t
- "Non-nil means, tags in levels apply also for sublevels.
+ "Non-nil means tags in levels apply also for sublevels.
When nil, only the tags directly given in a specific line apply there.
This may also be a list of tags that should be inherited, or a regexp that
matches tags that should be inherited. Additional control is possible
:type 'string)
(defcustom org-use-property-inheritance nil
- "Non-nil means, properties apply also for sublevels.
+ "Non-nil means properties apply also for sublevels.
This setting is chiefly used during property searches. Turning it on can
cause significant overhead when doing a search, which is why it is not
If the value of the variable is not a list but a single file name, then
the list of agenda files is actually stored and maintained in that file, one
-agenda file per line."
+agenda file per line. In this file paths can be given relative to
+`org-directory'. Tilde expansion and environment variable substitution
+are also made."
:group 'org-agenda
:type '(choice
(repeat :tag "List of files and directories" file)
:group 'org-latex
:type 'plist)
+(defcustom org-format-latex-signal-error t
+ "Non-nil means signal an error when image creation of LaTeX snippets fails.
+When nil, just push out a message."
+ :group 'org-latex
+ :type 'boolean)
+
(defcustom org-format-latex-header "\\documentclass{article}
-\\usepackage{amssymb}
\\usepackage[usenames]{color}
\\usepackage{amsmath}
-\\usepackage{latexsym}
\\usepackage[mathscr]{eucal}
\\pagestyle{empty} % do not remove
+\[PACKAGES]
+\[DEFAULT-PACKAGES]
% The settings below are copied from fullpage.sty
\\setlength{\\textwidth}{\\paperwidth}
\\addtolength{\\textwidth}{-3cm}
\\addtolength{\\topmargin}{-2.54cm}"
"The document header used for processing LaTeX fragments.
It is imperative that this header make sure that no page number
-appears on the page."
+appears on the page. The package defined in the variables
+`org-export-latex-default-packages-alist' and `org-export-latex-packages-alist'
+will either replace the placeholder \"[PACKAGES]\" in this header, or they
+will be appended."
:group 'org-latex
:type 'string)
-;; The following variable is defined here because is it also used
+(defvar org-format-latex-header-extra nil)
+
+;; The following variables are defined here because is it also used
;; when formatting latex fragments. Originally it was part of the
;; LaTeX exporter, which is why the name includes "export".
-(defcustom org-export-latex-packages-alist nil
- "Alist of packages to be inserted in the header.
-Each cell is of the format \( \"option\" . \"package\" \)."
+(defcustom org-export-latex-default-packages-alist
+ '(("AUTO" "inputenc")
+ ("T1" "fontenc")
+ ("" "fixltx2e")
+ ("" "graphicx")
+ ("" "longtable")
+ ("" "float")
+ ("" "wrapfig")
+ ("" "soul")
+ ("" "t1enc")
+ ("" "textcomp")
+ ("" "marvosym")
+ ("" "wasysym")
+ ("" "latexsym")
+ ("" "amssymb")
+ ("" "hyperref")
+ "\\tolerance=1000"
+ )
+ "Alist of default packages to be inserted in the header.
+Change this only if one of the packages here causes an incompatibility
+with another package you are using.
+The packages in this list are needed by one part or another of Org-mode
+to function properly.
+
+- inputenc, fontenc, t1enc: for basic font and character selection
+- textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used
+ for interpreting the entities in `org-entities'. You can skip some of these
+ packages if you don't use any of the symbols in it.
+- graphicx: for including images
+- float, wrapfig: for figure placement
+- longtable: for long tables
+- hyperref: for cross references
+
+Therefore you should not modify this variable unless you know what you
+are doing. The one reason to change it anyway is that you might be loading
+some other package that conflicts with one of the default packages.
+Each cell is of the format \( \"options\" \"package\" \)."
:group 'org-export-latex
:type '(repeat
- (list
- (string :tag "option")
- (string :tag "package"))))
+ (choice
+ (string :tag "A line of LaTeX")
+ (list :tag "options/package pair"
+ (string :tag "options")
+ (string :tag "package")))))
-(defgroup org-font-lock nil
- "Font-lock settings for highlighting in Org-mode."
- :tag "Org Font Lock"
+(defcustom org-export-latex-packages-alist nil
+ "Alist of packages to be inserted in every LaTeX the header.
+These will be inserted after `org-export-latex-default-packages-alist'.
+Each cell is of the format \( \"options\" \"package\" \).
+Make sure that you only lis packages here which:
+- you want in every file
+- do not conflict with the default packages in
+ `org-export-latex-default-packages-alist'
+- do not conflict with the setup in `org-format-latex-header'."
+ :group 'org-export-latex
+ :type '(repeat
+ (choice
+ (string :tag "A line of LaTeX")
+ (list :tag "options/package pair"
+ (string :tag "options")
+ (string :tag "package")))))
+
+(defgroup org-appearance nil
+ "Settings for Org-mode appearance."
+ :tag "Org Appearance"
:group 'org)
(defcustom org-level-color-stars-only nil
When nil, the entire headline is fontified.
Changing it requires restart of `font-lock-mode' to become effective
also in regions already fontified."
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defcustom org-hide-leading-stars nil
- "Non-nil means, hide the first N-1 stars in a headline.
+ "Non-nil means hide the first N-1 stars in a headline.
This works by using the face `org-hide' for these stars. This
face is white for a light background, and black for a dark
background. You may have to customize the face `org-hide' to
#+STARTUP: hidestars
#+STARTUP: showstars"
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
+(defcustom org-hidden-keywords nil
+ "List of keywords that should be hidden when typed in the org buffer.
+For example, add #+TITLE to this list in order to make the
+document title appear in the buffer without the initial #+TITLE:
+keyword."
+ :group 'org-appearance
+ :type '(set (const :tag "#+AUTHOR" author)
+ (const :tag "#+DATE" date)
+ (const :tag "#+EMAIL" email)
+ (const :tag "#+TITLE" title)))
+
(defcustom org-fontify-done-headline nil
- "Non-nil means, change the face of a headline if it is marked DONE.
+ "Non-nil means change the face of a headline if it is marked DONE.
Normally, only the TODO/DONE keyword indicates the state of a headline.
When this is non-nil, the headline after the keyword is set to the
`org-headline-done' as an additional indication."
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defcustom org-fontify-emphasized-text t
"Non-nil means fontify *bold*, /italic/ and _underlined_ text.
Changing this variable requires a restart of Emacs to take effect."
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defcustom org-fontify-whole-heading-line nil
"Non-nil means fontify the whole line for headings.
This is useful when setting a background color for the
org-level-* faces."
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defcustom org-highlight-latex-fragments-and-specials nil
- "Non-nil means, fontify what is treated specially by the exporters."
- :group 'org-font-lock
+ "Non-nil means fontify what is treated specially by the exporters."
+ :group 'org-appearance
:type 'boolean)
(defcustom org-hide-emphasis-markers nil
"Non-nil mean font-lock should hide the emphasis marker characters."
- :group 'org-font-lock
+ :group 'org-appearance
:type 'boolean)
(defvar org-emph-re nil
newline The maximum number of newlines allowed in an emphasis exp.
Use customize to modify this, or restart Emacs after changing it."
- :group 'org-font-lock
+ :group 'org-appearance
:set 'org-set-emph-re
:type '(list
(sexp :tag "Allowed chars in pre ")
Emacs buffers, and the HTML tags to be used for this.
For LaTeX export, see the variable `org-export-latex-emphasis-alist'.
Use customize to modify this, or restart Emacs after changing it."
- :group 'org-font-lock
+ :group 'org-appearance
:set 'org-set-emph-re
:type '(repeat
(list
:group 'org)
(defcustom org-completion-use-ido nil
- "Non-nil means, use ido completion wherever possible.
+ "Non-nil means use ido completion wherever possible.
Note that `ido-mode' must be active for this variable to be relevant.
If you decide to turn this variable on, you might well want to turn off
`org-outline-path-complete-in-steps'.
:type 'boolean)
(defcustom org-completion-use-iswitchb nil
- "Non-nil means, use iswitchb completion wherever possible.
+ "Non-nil means use iswitchb completion wherever possible.
Note that `iswitchb-mode' must be active for this variable to be relevant.
If you decide to turn this variable on, you might well want to turn off
`org-outline-path-complete-in-steps'.
(defcustom org-completion-fallback-command 'hippie-expand
"The expansion command called by \\[org-complete] in normal context.
-Normal means, no org-mode-specific context."
+Normal means no org-mode-specific context."
:group 'org-completion
:type 'function)
'(org-export-as-ascii org-export-ascii-preprocess
org-export-as-ascii-to-buffer org-replace-region-by-ascii
org-export-region-as-ascii))
+ (org-autoload "org-latex"
+ '(org-export-as-latex-batch org-export-as-latex-to-buffer
+ org-replace-region-by-latex org-export-region-as-latex
+ org-export-as-latex org-export-as-pdf
+ org-export-as-pdf-and-open))
(org-autoload "org-html"
'(org-export-as-html-and-open
org-export-as-html-batch org-export-as-html-to-buffer
org-replace-region-by-html org-export-region-as-html
org-export-as-html))
+ (org-autoload "org-docbook"
+ '(org-export-as-docbook-batch org-export-as-docbook-to-buffer
+ org-replace-region-by-docbook org-export-region-as-docbook
+ org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open
+ org-export-as-docbook))
(org-autoload "org-icalendar"
'(org-export-icalendar-this-file
org-export-icalendar-all-agenda-files
org-export-icalendar-combine-agenda-files))
- (org-autoload "org-xoxo" '(org-export-as-xoxo)))
+ (org-autoload "org-xoxo" '(org-export-as-xoxo))
+ (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning)))
;; Declare and autoload functions from org-agenda.el
:type 'string)
(defcustom org-agenda-skip-archived-trees t
- "Non-nil means, the agenda will skip any items located in archived trees.
+ "Non-nil means the agenda will skip any items located in archived trees.
An archived tree is a tree marked with the tag ARCHIVE. The use of this
variable is no longer recommended, you should leave it at the value t.
Instead, use the key `v' to cycle the archives-mode in the agenda."
:type 'boolean)
(defcustom org-columns-skip-archived-trees t
- "Non-nil means, ignore archived trees when creating column view."
+ "Non-nil means ignore archived trees when creating column view."
:group 'org-archive
:group 'org-properties
:type 'boolean)
(defcustom org-cycle-open-archived-trees nil
- "Non-nil means, `org-cycle' will open archived trees.
+ "Non-nil means `org-cycle' will open archived trees.
An archived tree is a tree marked with the tag ARCHIVE.
When nil, archived trees will stay folded. You can still open them with
normal outline commands like `show-all', but not with the cycling commands."
(let* ((re (concat ":" org-archive-tag ":")))
(goto-char beg)
(while (re-search-forward re end t)
- (and (org-on-heading-p) (org-flag-subtree t))
- (org-end-of-subtree t)))))
+ (when (org-on-heading-p)
+ (org-flag-subtree t)
+ (org-end-of-subtree t))))))
(defun org-flag-subtree (flag)
(save-excursion
(defvar org-planning-or-clock-line-re nil
"Matches a line with planning or clock info.")
(make-variable-buffer-local 'org-planning-or-clock-line-re)
+(defvar org-all-time-keywords nil
+ "List of time keywords.")
+(make-variable-buffer-local 'org-all-time-keywords)
(defconst org-plain-time-of-day-regexp
(concat
("logredeadline" org-log-redeadline time)
("lognoteredeadline" org-log-redeadline note)
("nologredeadline" org-log-redeadline nil)
+ ("logrefile" org-log-refile time)
+ ("lognoterefile" org-log-refile note)
+ ("nologrefile" org-log-refile nil)
("fninline" org-footnote-define-inline t)
("nofninline" org-footnote-define-inline nil)
("fnlocal" org-footnote-section nil)
("constSI" constants-unit-system SI)
("noptag" org-tag-persistent-alist nil)
("hideblocks" org-hide-block-startup t)
- ("nohideblocks" org-hide-block-startup nil))
+ ("nohideblocks" org-hide-block-startup nil)
+ ("beamer" org-startup-with-beamer-mode t))
"Variable associated with STARTUP options for org-mode.
Each element is a list of three items: The startup options as written
in the #+STARTUP line, the corresponding variable, and the value to
(let ((re (org-make-options-regexp
'("CATEGORY" "TODO" "COLUMNS"
"STARTUP" "ARCHIVE" "FILETAGS" "TAGS" "LINK" "PRIORITIES"
- "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE")
+ "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE" "LATEX_CLASS")
"\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)"))
(splitre "[ \t]+")
kwds kws0 kwsa key log value cat arch tags const links hw dws
- tail sep kws1 prio props ftags drawers
+ tail sep kws1 prio props ftags drawers beamer-p
ext-setup-or-nil setup-contents (start 0))
(save-excursion
(save-restriction
(setq arch (replace-match "" t t value))
(remove-text-properties 0 (length arch)
'(face t fontified t) arch))
+ ((equal key "LATEX_CLASS")
+ (setq beamer-p (equal value "beamer")))
((equal key "SETUPFILE")
(setq setup-contents (org-file-contents
(expand-file-name
"\\|" org-deadline-string
"\\|" org-closed-string "\\|" org-clock-string
"\\)\\>\\)")
+ org-all-time-keywords
+ (mapcar (lambda (w) (substring w 0 -1))
+ (list org-scheduled-string org-deadline-string
+ org-clock-string org-closed-string))
)
(org-compute-latex-and-specials-regexp)
(org-set-font-lock-defaults))))
x))
list))
-;; FIXME: this could be done much better, using second characters etc.
(defun org-assign-fast-keys (alist)
"Assign fast keys to a keyword-key alist.
Respect keys that are already there."
- (let (new e k c c1 c2 (char ?a))
+ (let (new e (alt ?0))
(while (setq e (pop alist))
- (cond
- ((equal e '(:startgroup)) (push e new))
- ((equal e '(:endgroup)) (push e new))
- ((equal e '(:newline)) (push e new))
- (t
- (setq k (car e) c2 nil)
- (if (cdr e)
- (setq c (cdr e))
- ;; automatically assign a character.
- (setq c1 (string-to-char
- (downcase (substring
- k (if (= (string-to-char k) ?@) 1 0)))))
- (if (or (rassoc c1 new) (rassoc c1 alist))
- (while (or (rassoc char new) (rassoc char alist))
- (setq char (1+ char)))
- (setq c2 c1))
- (setq c (or c2 char)))
- (push (cons k c) new))))
+ (if (or (memq (car e) '(:newline :endgroup :startgroup))
+ (cdr e)) ;; Key already assigned.
+ (push e new)
+ (let ((clist (string-to-list (downcase (car e))))
+ (used (append new alist)))
+ (when (= (car clist) ?@)
+ (pop clist))
+ (while (and clist (rassoc (car clist) used))
+ (pop clist))
+ (unless clist
+ (while (rassoc alt used)
+ (incf alt)))
+ (push (cons (car e) (or (car clist) alt)) new))))
(nreverse new)))
;;; Some variables used in various places
(defvar date)
;; Defined somewhere in this file, but used before definition.
-(defvar org-html-entities)
+(defvar org-entities) ;; defined in org-entities.el
(defvar org-struct-menu)
(defvar org-org-menu)
(defvar org-tbl-menu)
(setq org-table-may-need-update t))
(defvar org-mode-map)
(defvar org-inhibit-startup nil) ; Dynamically-scoped param.
+(defvar org-inhibit-startup-visibility-stuff nil) ; Dynamically-scoped param.
(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param.
(defvar org-inhibit-logging nil) ; Dynamically-scoped param.
(defvar org-inhibit-blocking nil) ; Dynamically-scoped param.
(org-set-local 'outline-isearch-open-invisible-function
(lambda (&rest ignore) (org-show-context 'isearch))))
+ ;; Turn on org-beamer-mode?
+ (and org-startup-with-beamer-mode (org-beamer-mode 1))
+
;; If empty file that did not turn on org-mode automatically, make it to.
(if (and org-insert-mode-line-in-empty-file
(interactive-p)
(= (point-min) (point-max)))
(insert "# -*- mode: org -*-\n\n"))
-
(unless org-inhibit-startup
(when org-startup-align-all-tables
(let ((bmp (buffer-modified-p)))
(when org-startup-indented
(require 'org-indent)
(org-indent-mode 1))
- (org-set-startup-visibility)))
+ (unless org-inhibit-startup-visibility-stuff
+ (org-set-startup-visibility))))
(when (fboundp 'abbrev-table-put)
(abbrev-table-put org-mode-abbrev-table
This should be called after the variable `org-link-types' has changed."
(setq org-link-types-re
(concat
- "\\`\\(" (mapconcat 'identity org-link-types "\\|") "\\):")
+ "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):")
org-link-re-with-space
(concat
- "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^" org-non-link-chars "]*"
"[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space2
(concat
- "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^\t\n\r]*"
"[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space3
(concat
- "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^\t\n\r]*\\)")
org-angle-link-re
(concat
- "<\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
+ "<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
"\\([^" org-non-link-chars " ]"
"[^" org-non-link-chars "]*"
"\\)>")
org-plain-link-re
(concat
- "\\<\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
- "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
+ "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
+ (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
+ ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
org-bracket-link-regexp
"\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
org-bracket-link-analytic-regexp
(concat
"\\[\\["
- "\\(\\(" (mapconcat 'identity org-link-types "\\|") "\\):\\)?"
+ "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^]]+\\)" "\\]\\)?"
org-bracket-link-analytic-regexp++
(concat
"\\[\\["
- "\\(\\(" (mapconcat 'identity (cons "coderef" org-link-types) "\\|") "\\):\\)?"
+ "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^]]+\\)" "\\]\\)?"
(string-match (concat "[" (nth 0 erc) "\n]")
(char-to-string (char-before (point)))))
(insert " "))
- (unless (string-match (concat "[" (nth 1 erc) "\n]")
- (char-to-string (char-after (point))))
+ (unless (or (eobp)
+ (string-match (concat "[" (nth 1 erc) "\n]")
+ (char-to-string (char-after (point)))))
(insert " ") (backward-char 1))
(insert string)
(and move (backward-char 1))))
(cond
(quoting
(add-text-properties beg1 end1 '(face org-block)))
+ ((not org-fontify-quote-and-verse-blocks))
((string= block-type "quote")
(add-text-properties beg1 end1 '(face org-quote)))
((string= block-type "verse")
(add-text-properties beg1 end1 '(face org-verse))))
t))
+ ((member dc1 '("title:" "author:" "email:" "date:"))
+ (add-text-properties
+ beg (match-end 3)
+ (if (member (intern (substring dc1 0 -1)) org-hidden-keywords)
+ '(font-lock-fontified t invisible t)
+ '(font-lock-fontified t face org-document-info-keyword)))
+ (add-text-properties
+ (match-beginning 6) (match-end 6)
+ (if (string-equal dc1 "title:")
+ '(font-lock-fontified t face org-document-title)
+ '(font-lock-fontified t face org-document-info))))
((not (member (char-after beg) '(?\ ?\t)))
;; just any other in-buffer setting, but not indented
(add-text-properties
((matchers (plist-get org-format-latex-options :matchers))
(latexs (delq nil (mapcar (lambda (x) (if (member (car x) matchers) x))
org-latex-regexps)))
+ (org-export-allow-BIND nil)
(options (org-combine-plists (org-default-export-plist)
(org-infile-export-plist)))
(org-export-with-sub-superscripts (plist-get options :sub-superscript))
(if org-export-with-TeX-macros
(list (concat "\\\\"
(regexp-opt
- (append (mapcar 'car org-html-entities)
+ (append (mapcar 'car (append org-entities-user
+ org-entities))
(if (boundp 'org-latex-entities)
(mapcar (lambda (x)
(or (car-safe x) x))
(defun org-activate-tags (limit)
(if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \r\n]") limit t)
(progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
(add-text-properties (match-beginning 1) (match-end 1)
(list 'mouse-face 'highlight
'keymap org-mouse-map))
"Get the right face for a TODO keyword KWD.
If KWD is a number, get the corresponding match group."
(if (numberp kwd) (setq kwd (match-string kwd)))
- (or (cdr (assoc kwd org-todo-keyword-faces))
+ (or (org-face-from-face-or-color
+ 'todo 'org-todo (cdr (assoc kwd org-todo-keyword-faces)))
(and (member kwd org-done-keywords) 'org-done)
'org-todo))
+(defun org-face-from-face-or-color (context inherit face-or-color)
+ "Create a face list that inherits INHERIT, but sets the foreground color.
+When FACE-OR-COLOR is not a string, just return it."
+ (if (stringp face-or-color)
+ (list :inherit inherit
+ (cdr (assoc context org-faces-easy-properties))
+ face-or-color)
+ face-or-color))
+
(defun org-font-lock-add-tag-faces (limit)
"Add the special tag faces."
(when (and org-tag-faces org-tags-special-faces-re)
(while (re-search-forward "\\[#\\([A-Z0-9]\\)\\]" limit t)
(add-text-properties
(match-beginning 0) (match-end 0)
- (list 'face (or (cdr (assoc (char-after (match-beginning 1))
- org-priority-faces))
+ (list 'face (or (org-face-from-face-or-color
+ 'priority 'org-special-keyword
+ (cdr (assoc (char-after (match-beginning 1))
+ org-priority-faces)))
'org-special-keyword)
'font-lock-fontified t))))
"Get the right face for a TODO keyword KWD.
If KWD is a number, get the corresponding match group."
(if (numberp kwd) (setq kwd (match-string kwd)))
- (or (cdr (assoc kwd org-tag-faces))
+ (or (org-face-from-face-or-color
+ 'tag 'org-tag (cdr (assoc kwd org-tag-faces)))
'org-tag))
(defun org-unfontify-region (beg end &optional maybe_loudly)
3. SUBTREE: Show the entire subtree, including body text.
If there is no subtree, switch directly from CHILDREN to FOLDED.
+- When point is at the beginning of an empty headline and the variable
+ `org-cycle-level-after-item/entry-creation' is set, cycle the level
+ of the headline by demoting and promoting it to likely levels. This
+ speeds up creation document structure by presing TAB once or several
+ times right after creating a new headline.
+
- When there is a numeric prefix, go up to a heading with level ARG, do
a `show-subtree' and return to the previous cursor position. If ARG
is negative, go up that many levels.
((org-at-table-p 'any)
;; Enter the table or move to the next field in the table
- (or (org-table-recognize-table.el)
- (progn
- (if arg (org-table-edit-field t)
- (org-table-justify-field-maybe)
- (call-interactively 'org-table-next-field)))))
+ (if (org-at-table.el-p)
+ (message "Use C-c ' to edit table.el tables")
+ (if arg (org-table-edit-field t)
+ (org-table-justify-field-maybe)
+ (call-interactively 'org-table-next-field))))
((run-hook-with-args-until-success
'org-tab-after-check-for-table-hook))
;; Properly fold already folded siblings
(goto-char (point-min))
(while (re-search-forward re nil t)
- (if (save-excursion (goto-char (point-at-eol)) (org-invisible-p))
+ (if (and (not (org-invisible-p))
+ (save-excursion
+ (goto-char (point-at-eol)) (org-invisible-p)))
(hide-entry))))
(org-cycle-show-empty-lines 'overview)
(org-cycle-hide-drawers 'overview)))))
(defun org-first-headline-recenter (&optional N)
"Move cursor to the first headline and recenter the headline.
-Optional argument N means, put the headline into the Nth line of the window."
+Optional argument N means put the headline into the Nth line of the window."
(goto-char (point-min))
(when (re-search-forward (concat "^\\(" outline-regexp "\\)") nil t)
(beginning-of-line)
(recenter (prefix-numeric-value N))))
+;;; Saving and restoring visibility
+
+(defun org-outline-overlay-data (&optional use-markers)
+ "Return a list of the locations of all outline overlays.
+The are overlays with the `invisible' property value `outline'.
+The return valus is a list of cons cells, with start and stop
+positions for each overlay.
+If USE-MARKERS is set, return the positions as markers."
+ (let (beg end)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (delq nil
+ (mapcar (lambda (o)
+ (when (eq (org-overlay-get o 'invisible) 'outline)
+ (setq beg (org-overlay-start o)
+ end (org-overlay-end o))
+ (and beg end (> end beg)
+ (if use-markers
+ (cons (move-marker (make-marker) beg)
+ (move-marker (make-marker) end))
+ (cons beg end)))))
+ (org-overlays-in (point-min) (point-max))))))))
+
+(defun org-set-outline-overlay-data (data)
+ "Create visibility overlays for all positions in DATA.
+DATA should have been made by `org-outline-overlay-data'."
+ (let (o)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (show-all)
+ (mapc (lambda (c)
+ (setq o (org-make-overlay (car c) (cdr c)))
+ (org-overlay-put o 'invisible 'outline))
+ data)))))
+
+(defmacro org-save-outline-visibility (use-markers &rest body)
+ "Save and restore outline visibility around BODY.
+If USE-MARKERS is non-nil, use markers for the positions.
+This means that the buffer may change while running BODY,
+but it also means that the buffer should stay alive
+during the operation, because otherwise all these markers will
+point nowhere."
+ `(let ((data (org-outline-overlay-data ,use-markers)))
+ (unwind-protect
+ (progn
+ ,@body
+ (org-set-outline-overlay-data data))
+ (when ,use-markers
+ (mapc (lambda (c)
+ (and (markerp (car c)) (move-marker (car c) nil))
+ (and (markerp (cdr c)) (move-marker (cdr c) nil)))
+ data)))))
+
+
;;; Folding of blocks
(defconst org-block-regexp
(isearch-hide-immediately nil)
(isearch-search-fun-function
(lambda () 'org-goto-local-search-headings))
- (org-goto-selected-point org-goto-exit-command))
+ (org-goto-selected-point org-goto-exit-command)
+ (pop-up-frames nil)
+ (special-display-buffer-names nil)
+ (special-display-regexps nil)
+ (special-display-function nil))
(save-excursion
(save-window-excursion
(delete-other-windows)
(outline-up-heading 1 t)))
(setq beg (point)
heading (org-get-heading))
- (org-end-of-subtree t t) (setq end (point)))
+ (org-end-of-subtree t t)
+ (if (org-on-heading-p) (backward-char 1))
+ (setq end (point)))
(if (and (buffer-live-p org-last-indirect-buffer)
(not (eq org-indirect-buffer-display 'new-frame))
(not arg))
(save-match-data
(looking-at "[ \t]*$")))))
-(defun org-insert-heading (&optional force-heading)
+(defun org-insert-heading (&optional force-heading invisible-ok)
"Insert a new heading or item with same depth at point.
If point is in a plain list and FORCE-HEADING is nil, create a new list item.
If point is at the beginning of a headline, insert a sibling before the
current headline. If point is not at the beginning, do not split the line,
-but create the new headline after the current line."
+but create the new headline after the current line.
+When INVISIBLE-OK is set, stop at invisible headlines when going back.
+This is important for non-interactive uses of the command."
(interactive "P")
- (if (= (buffer-size) 0)
+ (if (or (= (buffer-size) 0)
+ (and (not (save-excursion (and (ignore-errors (org-back-to-heading invisible-ok))
+ (org-on-heading-p))))
+ (not (org-in-item-p))))
(insert "\n* ")
(when (or force-heading (not (org-insert-item)))
(let* ((empty-line-p nil)
(head (save-excursion
(condition-case nil
(progn
- (org-back-to-heading)
+ (org-back-to-heading invisible-ok)
(setq empty-line-p (org-previous-line-empty-p))
(match-string 0))
(error "*"))))
(setq pos (point-at-bol))
(or split (end-of-line 1))
(delete-horizontal-space)
+ (if (string-match "\\`\\*+\\'"
+ (buffer-substring (point-at-bol) (point)))
+ (insert " "))
(newline (if blank 2 1))
(when tags
(save-excursion
- the tags string, or nil."
(save-excursion
(org-back-to-heading t)
- (if (looking-at org-complex-heading-regexp)
+ (if (let (case-fold-search) (looking-at org-complex-heading-regexp))
(list (length (match-string 1))
(org-reduced-level (length (match-string 1)))
(org-match-string-no-properties 2)
(funcall outline-level))
(error nil))))
+(defun org-get-previous-line-level ()
+ "Return the outline depth of the last headline before the current line.
+Returns 0 for the first headline in the buffer, and nil if before the
+first headline."
+ (let ((current-level (org-current-level))
+ (prev-level (when (> (line-number-at-pos) 1)
+ (save-excursion
+ (beginning-of-line 0)
+ (org-current-level)))))
+ (cond ((null current-level) nil) ; Before first headline
+ ((null prev-level) 0) ; At first headline
+ (prev-level))))
+
(defun org-reduced-level (l)
"Compute the effective level of a heading.
This takes into account the setting of `org-odd-levels-only'."
(if org-odd-levels-only (1+ (floor (/ l 2))) l))
+(defun org-level-increment ()
+ "Return the number of stars that will be added or removed at a
+time to headlines when structure editing, based on the value of
+`org-odd-levels-only'."
+ (if org-odd-levels-only 2 1))
+
(defun org-get-valid-level (level &optional change)
"Rectify a level change under the influence of `org-odd-levels-only'
LEVEL is a current level, CHANGE is by how much the level should be
(if org-adapt-indentation (org-fixup-indentation diff))
(run-hooks 'org-after-demote-entry-hook)))
-(defvar org-tab-ind-state nil)
-
(defun org-cycle-level ()
+ "Cycle the level of an empty headline through possible states.
+This goes first to child, then to parent, level, then up the hierarchy.
+After top level, it switches back to sibling level."
+ (interactive)
(let ((org-adapt-indentation nil))
- (when (and (looking-at "[ \t]*$")
- (looking-back
- (concat "^\\(\\*+\\)[ \t]+\\(" org-todo-regexp "\\)?[ \t]*")))
- (setq this-command 'org-cycle-level)
- (if (eq last-command 'org-cycle-level)
- (condition-case nil
- (progn (org-do-promote)
- (if (equal org-tab-ind-state (org-current-level))
- (org-do-promote)))
- (error
- (progn
- (save-excursion
- (beginning-of-line 1)
- (and (looking-at "\\*+")
- (replace-match
- (make-string org-tab-ind-state ?*))))
- (setq this-command 'org-cycle))))
- (setq org-tab-ind-state (- (match-end 1) (match-beginning 1)))
- (org-do-demote))
- t)))
+ (when (org-point-at-end-of-empty-headline)
+ (setq this-command 'org-cycle-level) ; Only needed for caching
+ (let ((cur-level (org-current-level))
+ (prev-level (org-get-previous-line-level)))
+ (cond
+ ;; If first headline in file, promote to top-level.
+ ((= prev-level 0)
+ (loop repeat (/ (- cur-level 1) (org-level-increment))
+ do (org-do-promote)))
+ ;; If same level as prev, demote one.
+ ((= prev-level cur-level)
+ (org-do-demote))
+ ;; If parent is top-level, promote to top level if not already.
+ ((= prev-level 1)
+ (loop repeat (/ (- cur-level 1) (org-level-increment))
+ do (org-do-promote)))
+ ;; If top-level, return to prev-level.
+ ((= cur-level 1)
+ (loop repeat (/ (- prev-level 1) (org-level-increment))
+ do (org-do-demote)))
+ ;; If less than prev-level, promote one.
+ ((< cur-level prev-level)
+ (org-do-promote))
+ ;; If deeper than prev-level, promote until higher than
+ ;; prev-level.
+ ((> cur-level prev-level)
+ (loop repeat (+ 1 (/ (- cur-level prev-level) (org-level-increment)))
+ do (org-do-promote))))
+ t))))
(defun org-map-tree (fun)
"Call FUN for every heading underneath the current one."
(save-match-data
(narrow-to-region
(progn (org-back-to-heading t) (point))
- (progn (org-end-of-subtree t t) (point))))))
+ (progn (org-end-of-subtree t t)
+ (if (org-on-heading-p) (backward-char 1))
+ (point))))))
(defun org-clone-subtree-with-time-shift (n &optional shift)
"Clone the task (subtree) at point N times.
((eq major-mode 'dired-mode)
;; link to the file in the current line
- (setq cpltxt (concat "file:"
- (abbreviate-file-name
- (expand-file-name
- (dired-get-filename nil t))))
- link (org-make-link cpltxt)))
+ (let ((file (dired-get-filename nil t)))
+ (setq file (if file
+ (abbreviate-file-name
+ (expand-file-name (dired-get-filename nil t)))
+ ;; otherwise, no file so use current directory.
+ default-directory))
+ (setq cpltxt (concat "file:" file)
+ link (org-make-link cpltxt))))
((and buffer-file-name (org-mode-p))
(setq custom-id (ignore-errors (org-entry-get nil "CUSTOM_ID")))
(?\371 . "%F9") ; `u
(?\373 . "%FB") ; ^u
(?\; . "%3B")
- (?? . "%3F")
+;; (?? . "%3F")
(?= . "%3D")
(?+ . "%2B")
)
(defun org-link-escape (text &optional table)
"Escape characters in TEXT that are problematic for links."
- (if org-url-encoding-use-url-hexify
+ (if (and org-url-encoding-use-url-hexify (not table))
(url-hexify-string text)
(setq table (or table org-link-escape-chars))
(when text
(defun org-link-unescape (text &optional table)
"Reverse the action of `org-link-escape'."
- (if org-url-encoding-use-url-hexify
+ (if (and org-url-encoding-use-url-hexify (not table))
(url-unhex-string text)
(setq table (or table org-link-escape-chars))
(when text
- (let ((re (mapconcat (lambda (x) (regexp-quote (cdr x)))
+ (let ((case-fold-search t)
+ (re (mapconcat (lambda (x) (regexp-quote (downcase (cdr x))))
table "\\|")))
(while (string-match re text)
(setq text
(replace-match
- (char-to-string (car (rassoc (match-string 0 text) table)))
+ (char-to-string (car (rassoc (upcase (match-string 0 text))
+ table)))
t t text)))
text))))
(if (nth 1 x) (concat (car x) " (" (nth 1 x) ")") (car x)))
(reverse org-stored-links) "\n"))))
(let ((cw (selected-window)))
- (select-window (get-buffer-window "*Org Links*"))
+ (select-window (get-buffer-window "*Org Links*" 'visible))
(setq truncate-lines t)
(unless (pos-visible-in-window-p (point-max))
(org-fit-window-to-buffer))
nil nil nil
'tmphist
(car (car org-stored-links)))))
+ (if (not (string-match "\\S-" link))
+ (error "No link selected"))
(if (or (member link all-prefixes)
(and (equal ":" (substring link -1))
(member (substring link 0 -1) all-prefixes)
(setq link search)))))
;; Check if we can/should use a relative path. If yes, simplify the link
- (when (string-match "^file:\\(.*\\)" link)
- (let* ((path (match-string 1 link))
+ (when (string-match "^\\(file:\\|docview:\\)\\(.*\\)" link)
+ (let* ((type (match-string 1 link))
+ (path (match-string 2 link))
(origpath path)
(case-fold-search nil))
(cond
(setq path (substring (expand-file-name path)
(match-end 0)))
(setq path (abbreviate-file-name (expand-file-name path)))))))
- (setq link (concat "file:" path))
+ (setq link (concat type path))
(if (equal desc origpath)
(setq desc path))))
(defvar org-link-search-failed nil)
+(defvar org-open-link-functions nil
+ "Hook for functions finding a plain text link.
+These functions must take a single argument, the link content.
+They will be called for links that look like [[link text][description]]
+when LINK TEXT does not have a protocol like \"http:\" and does not look
+like a filename (e.g. \"./blue.png\").
+
+These functions will be called *before* Org attempts to resolve the
+link by doing text searches in the current buffer - so if you want a
+link \"[[target]]\" to still find \"<<target>>\", your function should
+handle this as a special case.
+
+When the function does handle the link, it must return a non-nil value.
+If it decides that it is not responsible for this link, it must return
+nil to indicate that that Org-mode can continue with other options
+like exact and fuzzy text search.")
+
(defun org-next-link ()
"Move forward to the next link.
If the link is in hidden text, expose it."
(org-mode)
(insert s)
(goto-char (point-min))
+ (when reference-buffer
+ (setq org-link-abbrev-alist-local
+ (with-current-buffer reference-buffer
+ org-link-abbrev-alist-local)))
(org-open-at-point arg reference-buffer)))))
(defun org-open-at-point (&optional in-emacs reference-buffer)
(concat org-plain-link-re "\\|"
org-bracket-link-regexp "\\|"
org-angle-link-re "\\|"
- "[ \t]:[^ \t\n]+:[ \t]*$"))))
+ "[ \t]:[^ \t\n]+:[ \t]*$")))
+ (not (get-text-property (point) 'org-linked-text)))
(or (org-offer-links-in-entry in-emacs)
(progn (require 'org-attach) (org-attach-reveal 'if-exists))))
((org-at-timestamp-p t) (org-follow-timestamp-link))
(catch 'match
(save-excursion
(skip-chars-forward "^]\n\r")
- (when (org-in-regexp org-bracket-link-regexp)
+ (when (org-in-regexp org-bracket-link-regexp 1)
(setq link (org-extract-attributes
(org-link-unescape (org-match-string-no-properties 1))))
(while (string-match " *\n *" link)
((string= type "tags")
(org-tags-view in-emacs path))
- ((string= type "thisfile")
- (if in-emacs
- (switch-to-buffer-other-window
- (org-get-buffer-for-internal-link (current-buffer)))
- (org-mark-ring-push))
- (let ((cmd `(org-link-search
- ,path
- ,(cond ((equal in-emacs '(4)) 'occur)
- ((equal in-emacs '(16)) 'org-occur)
- (t nil))
- ,pos)))
- (condition-case nil (eval cmd)
- (error (progn (widen) (eval cmd))))))
((string= type "tree-match")
(org-occur (concat "\\[" (regexp-quote path) "\\]")))
(call-interactively (read cmd))))
(error "Abort"))))
+ ((and (string= type "thisfile")
+ (run-hook-with-args-until-success
+ 'org-open-link-functions path)))
+
+ ((string= type "thisfile")
+ (if in-emacs
+ (switch-to-buffer-other-window
+ (org-get-buffer-for-internal-link (current-buffer)))
+ (org-mark-ring-push))
+ (let ((cmd `(org-link-search
+ ,path
+ ,(cond ((equal in-emacs '(4)) 'occur)
+ ((equal in-emacs '(16)) 'org-occur)
+ (t nil))
+ ,pos)))
+ (condition-case nil (eval cmd)
+ (error (progn (widen) (eval cmd))))))
+
(t
(browse-url-at-point)))))))
(move-marker org-open-link-marker nil)
((null links)
(message "No links"))
((equal (length links) 1)
- (setq link (car links)))
+ (setq link (list (car links))))
((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
(setq link (nth (if have-zero nth (1- nth)) links)))
(t ; we have to select a link
(match-string 1 l))))))
links))
(org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
- (message "Select link to open:")
+ (message "Select link to open, RET to open all:")
(setq c (read-char-exclusive))
(and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
(when (equal c ?q) (error "Abort"))
- (setq nth (- c ?0))
- (if have-zero (setq nth (1+ nth)))
- (unless (and (integerp nth) (>= (length links) nth))
- (error "Invalid link selection"))
- (setq link (nth (1- nth) links))))
+ (if (equal c ?\C-m)
+ (setq link links)
+ (setq nth (- c ?0))
+ (if have-zero (setq nth (1+ nth)))
+ (unless (and (integerp nth) (>= (length links) nth))
+ (error "Invalid link selection"))
+ (setq link (list (nth (1- nth) links))))))
(if link
- (progn (org-open-link-from-string link in-emacs (current-buffer)) t)
+ (let ((buf (current-buffer)))
+ (dolist (l link)
+ (org-open-link-from-string l in-emacs buf))
+ t)
nil)))
+;; Add special file links that specify the way of opening
+
+(org-add-link-type "file+sys" 'org-open-file-with-system)
+(org-add-link-type "file+emacs" 'org-open-file-with-emacs)
+(defun org-open-file-with-system (path)
+ "Open file at PATH using the system way of opeing it."
+ (org-open-file path 'system))
+(defun org-open-file-with-emacs (path)
+ "Open file at PATH in emacs."
+ (org-open-file path 'emacs))
+(defun org-remove-file-link-modifiers ()
+ "Remove the file link modifiers in `file+sys:' and `file+emacs:' links."
+ (goto-char (point-min))
+ (while (re-search-forward "\\<file\\+\\(sys\\|emacs\\):" nil t)
+ (org-if-unprotected
+ (replace-match "file:" t t))))
+(eval-after-load "org-exp"
+ '(add-hook 'org-export-preprocess-before-normalizing-links-hook
+ 'org-remove-file-link-modifiers))
+
;;;; Time estimates
(defun org-get-effort (&optional pom)
With optional prefix argument IN-EMACS, Emacs will visit the file.
With a double C-c C-u prefix arg, Org tries to avoid opening in Emacs
-and o use an external application to visit the file.
+and to use an external application to visit the file.
Optional LINE specifies a line to go to, optional SEARCH a string to
-search for. If LINE or SEARCH is given, the file will always be
-opened in Emacs.
+search for. If LINE or SEARCH is given, but IN-EMACS is nil, it will
+be assumed that org-open-file was called to open a file: link, and the
+original link to match against org-file-apps will be reconstructed
+from PATH and whichever of LINE or SEARCH is given.
+
If the file does not exist, an error is thrown."
- (setq in-emacs (or in-emacs line search))
(let* ((file (if (equal path "")
buffer-file-name
(substitute-in-file-name (expand-file-name path))))
file))
(a-m-a-p (assq 'auto-mode apps))
(dfile (downcase file))
+ ;; reconstruct the original file: link from the PATH, LINE and SEARCH args
+ (link (cond ((and (eq line nil)
+ (eq search nil))
+ file)
+ (line
+ (concat file "::" (number-to-string line)))
+ (search
+ (concat file "::" search))))
+ (dlink (downcase link))
(old-buffer (current-buffer))
(old-pos (point))
(old-mode major-mode)
- ext cmd)
+ ext cmd link-match-data)
(if (string-match "^.*\\.\\([a-zA-Z0-9]+\\.gz\\)$" dfile)
(setq ext (match-string 1 dfile))
(if (string-match "^.*\\.\\([a-zA-Z0-9]+\\)$" dfile)
(setq ext (match-string 1 dfile))))
(cond
- ((equal in-emacs '(16))
+ ((member in-emacs '((16) system))
(setq cmd (cdr (assoc 'system apps))))
(in-emacs (setq cmd 'emacs))
(t
(setq cmd (or (and remp (cdr (assoc 'remote apps)))
(and dirp (cdr (assoc 'directory apps)))
- (assoc-default dfile (org-apps-regexp-alist apps a-m-a-p)
- 'string-match)
+ ;; if we find a match in org-file-apps, store the match
+ ;; data for later
+ (let* ((re-list1 (org-apps-regexp-alist apps nil))
+ (re-list2
+ (if a-m-a-p
+ (org-apps-regexp-alist apps a-m-a-p)
+ re-list1))
+ (private-match
+ (assoc-default dlink re-list1 'string-match))
+ (general-match
+ (assoc-default dfile re-list2 'string-match)))
+ (if private-match
+ (progn (setq link-match-data (match-data))
+ private-match)
+ general-match))
(cdr (assoc ext apps))
(cdr (assoc t apps))))))
(when (eq cmd 'system)
(shell-quote-argument
(convert-standard-filename file)))
t t cmd)))
+ ;; Replace "%1", "%2" etc. in command with group matches from regex
+ (save-match-data
+ (let ((match-index 1)
+ (number-of-groups (- (/ (length link-match-data) 2) 1)))
+ (set-match-data link-match-data)
+ (while (<= match-index number-of-groups)
+ (let ((regex (concat "%" (number-to-string match-index)))
+ (replace-with (match-string match-index dlink)))
+ (while (string-match regex cmd)
+ (setq cmd (replace-match replace-with t t cmd))))
+ (setq match-index (+ match-index 1)))))
+
(save-window-excursion
(start-process-shell-command cmd nil cmd)
(and (boundp 'org-wait) (numberp org-wait) (sit-for org-wait))
(if search (org-link-search search))))
((consp cmd)
(let ((file (convert-standard-filename file)))
- (eval cmd)))
+ (save-match-data
+ (set-match-data link-match-data)
+ (eval cmd))))
(t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
(and (org-mode-p) (eq old-mode 'org-mode)
(or (not (equal old-buffer (current-buffer)))
nil
(if (string-match "\\W" (car x))
x
- (cons (concat "\\." (car x) "\\'") (cdr x)))))
+ (cons (concat "\\." (car x) "\\(::.*\\)?\\'")
+ (cdr x)))))
list))
(if add-auto-mode
(mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist))))
(with-current-buffer
(if (bufferp f) f (org-get-agenda-file-buffer f))
(if (bufferp f) (setq f (buffer-file-name (buffer-base-buffer f))))
- (setq f (expand-file-name f))
+ (setq f (and f (expand-file-name f)))
(if (eq org-refile-use-outline-path 'file)
(push (list (file-name-nondirectory f) f nil nil) targets))
(save-excursion
(if fastp
(progn
(if (> level 19)
- (error "Outline path failure, more than 19 levels"))
+ (error "Outline path failure, more than 19 levels."))
(loop for i from level upto 19 do
(aset org-olpa i nil))
(prog1
(delq nil (append org-olpa nil))
(aset org-olpa level heading)))
- (let (rtn)
+ (let (rtn case-fold-search)
(save-excursion
(save-restriction
(widen)
(defun org-display-outline-path (&optional file current)
"Display the current outline path in the echo area."
(interactive "P")
- (let ((bfn (buffer-file-name (buffer-base-buffer)))
- (path (and (org-mode-p) (org-get-outline-path))))
+ (let* ((bfn (buffer-file-name (buffer-base-buffer)))
+ (case-fold-search nil)
+ (path (and (org-mode-p) (org-get-outline-path))))
(if current (setq path (append path
(save-excursion
(org-back-to-heading t)
(goto-char (point-min))
(or (outline-next-heading) (goto-char (point-max)))))
(if (not (bolp)) (newline))
- (bookmark-set "org-refile-last-stored")
(org-paste-subtree level)
+ (when org-log-refile
+ (org-add-log-setup 'refile nil nil 'findpos
+ org-log-refile)
+ (unless (eq org-log-refile 'note)
+ (save-excursion (org-add-log-note))))
+ (and org-auto-align-tags (org-set-tags nil t))
+ (bookmark-set "org-refile-last-stored")
(if (fboundp 'deactivate-mark) (deactivate-mark))
(run-hooks 'org-after-refile-insert-hook))))
(if regionp
(if (equal (car org-refile-history) (nth 1 org-refile-history))
(pop org-refile-history)))
pa)
- (when (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
- (setq parent (match-string 1 answ)
- child (match-string 2 answ))
- (setq parent-target (or (assoc parent tbl) (assoc (concat parent "/") tbl)))
- (when (and parent-target
- (or (eq new-nodes t)
- (and (eq new-nodes 'confirm)
- (y-or-n-p (format "Create new node \"%s\"? " child)))))
- (org-refile-new-child parent-target child))))))
+ (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
+ (progn
+ (setq parent (match-string 1 answ)
+ child (match-string 2 answ))
+ (setq parent-target (or (assoc parent tbl)
+ (assoc (concat parent "/") tbl)))
+ (when (and parent-target
+ (or (eq new-nodes t)
+ (and (eq new-nodes 'confirm)
+ (y-or-n-p (format "Create new node \"%s\"? "
+ child)))))
+ (org-refile-new-child parent-target child)))
+ (error "Invalid target location")))))
(defun org-refile-new-child (parent-target child)
"Use refile target PARENT-TARGET to add new CHILD below it."
(defun org-map-dblocks (&optional command)
"Apply COMMAND to all dynamic blocks in the current buffer.
If COMMAND is not given, use `org-update-dblock'."
- (let ((cmd (or command 'org-update-dblock))
- pos)
+ (let ((cmd (or command 'org-update-dblock)))
(save-excursion
(goto-char (point-min))
(while (re-search-forward org-dblock-start-re nil t)
- (goto-char (setq pos (match-beginning 0)))
- (condition-case nil
- (funcall cmd)
- (error (message "Error during update of dynamic block")))
- (goto-char pos)
+ (goto-char (match-beginning 0))
+ (save-excursion
+ (condition-case nil
+ (funcall cmd)
+ (error (message "Error during update of dynamic block"))))
(unless (re-search-forward org-dblock-end-re nil t)
(error "Dynamic block not terminated"))))))
(defconst org-additional-option-like-keywords
'("BEGIN_HTML" "END_HTML" "HTML:" "ATTR_HTML"
"BEGIN_DocBook" "END_DocBook" "DocBook:" "ATTR_DocBook"
- "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:" "LATEX_CLASS:" "ATTR_LaTeX"
+ "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:"
+ "LATEX_CLASS:" "LATEX_CLASS_OPTIONS:" "ATTR_LaTeX"
"BEGIN:" "END:"
"ORGTBL" "TBLFM:" "TBLNAME:"
"BEGIN_EXAMPLE" "END_EXAMPLE"
org-link-abbrev-alist))
(texp
(setq type :tex)
- org-html-entities)
+ (append org-entities-user org-entities))
((string-match "\\`\\*+[ \t]+\\'"
(buffer-substring (point-at-bol) beg))
(setq type :todo)
3. The parent of the task is blocked because it has siblings that should
be done first, or is child of a block grandparent TODO entry."
- (catch 'dont-block
- ;; If this is not a todo state change, or if this entry is already DONE,
- ;; do not block
- (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
- (member (plist-get change-plist :from)
- (cons 'done org-done-keywords))
- (member (plist-get change-plist :to)
- (cons 'todo org-not-done-keywords))
- (not (plist-get change-plist :to)))
- (throw 'dont-block t))
- ;; If this task has children, and any are undone, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let ((this-level (funcall outline-level)))
- (outline-next-heading)
- (let ((child-level (funcall outline-level)))
- (while (and (not (eobp))
- (> child-level this-level))
- ;; this todo has children, check whether they are all
- ;; completed
- (if (and (not (org-entry-is-done-p))
- (org-entry-is-todo-p))
- (throw 'dont-block nil))
- (outline-next-heading)
- (setq child-level (funcall outline-level))))))
- ;; Otherwise, if the task's parent has the :ORDERED: property, and
- ;; any previous siblings are undone, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let* ((pos (point))
- (parent-pos (and (org-up-heading-safe) (point))))
- (if (not parent-pos) (throw 'dont-block t)) ; no parent
- (when (and (org-entry-get (point) "ORDERED")
- (forward-line 1)
- (re-search-forward org-not-done-heading-regexp pos t))
- (throw 'dont-block nil)) ; block, there is an older sibling not done.
- ;; Search further up the hierarchy, to see if an anchestor is blocked
- (while t
- (goto-char parent-pos)
- (if (not (looking-at org-not-done-heading-regexp))
- (throw 'dont-block t)) ; do not block, parent is not a TODO
- (setq pos (point))
- (setq parent-pos (and (org-up-heading-safe) (point)))
+ (if (not org-enforce-todo-dependencies)
+ t ; if locally turned off don't block
+ (catch 'dont-block
+ ;; If this is not a todo state change, or if this entry is already DONE,
+ ;; do not block
+ (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
+ (member (plist-get change-plist :from)
+ (cons 'done org-done-keywords))
+ (member (plist-get change-plist :to)
+ (cons 'todo org-not-done-keywords))
+ (not (plist-get change-plist :to)))
+ (throw 'dont-block t))
+ ;; If this task has children, and any are undone, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((this-level (funcall outline-level)))
+ (outline-next-heading)
+ (let ((child-level (funcall outline-level)))
+ (while (and (not (eobp))
+ (> child-level this-level))
+ ;; this todo has children, check whether they are all
+ ;; completed
+ (if (and (not (org-entry-is-done-p))
+ (org-entry-is-todo-p))
+ (throw 'dont-block nil))
+ (outline-next-heading)
+ (setq child-level (funcall outline-level))))))
+ ;; Otherwise, if the task's parent has the :ORDERED: property, and
+ ;; any previous siblings are undone, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let* ((pos (point))
+ (parent-pos (and (org-up-heading-safe) (point))))
(if (not parent-pos) (throw 'dont-block t)) ; no parent
(when (and (org-entry-get (point) "ORDERED")
(forward-line 1)
(re-search-forward org-not-done-heading-regexp pos t))
- (throw 'dont-block nil))))))) ; block, older sibling not done.
+ (throw 'dont-block nil)) ; block, there is an older sibling not done.
+ ;; Search further up the hierarchy, to see if an anchestor is blocked
+ (while t
+ (goto-char parent-pos)
+ (if (not (looking-at org-not-done-heading-regexp))
+ (throw 'dont-block t)) ; do not block, parent is not a TODO
+ (setq pos (point))
+ (setq parent-pos (and (org-up-heading-safe) (point)))
+ (if (not parent-pos) (throw 'dont-block t)) ; no parent
+ (when (and (org-entry-get (point) "ORDERED")
+ (forward-line 1)
+ (re-search-forward org-not-done-heading-regexp pos t))
+ (throw 'dont-block nil)))))))) ; block, older sibling not done.
(defcustom org-track-ordered-property-with-tag nil
"Should the ORDERED property also be shown as a tag?
"Block turning an entry into a TODO, using checkboxes.
This checks whether the current task should be blocked from state
changes because there are unchecked boxes in this entry."
- (catch 'dont-block
- ;; If this is not a todo state change, or if this entry is already DONE,
- ;; do not block
- (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
- (member (plist-get change-plist :from)
- (cons 'done org-done-keywords))
- (member (plist-get change-plist :to)
- (cons 'todo org-not-done-keywords))
- (not (plist-get change-plist :to)))
- (throw 'dont-block t))
- ;; If this task has checkboxes that are not checked, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let ((beg (point)) end)
- (outline-next-heading)
- (setq end (point))
- (goto-char beg)
- (if (re-search-forward "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\[[- ]\\]"
- end t)
- (progn
- (if (boundp 'org-blocked-by-checkboxes)
- (setq org-blocked-by-checkboxes t))
- (throw 'dont-block nil)))))
- t)) ; do not block
+ (if (not org-enforce-todo-checkbox-dependencies)
+ t ; if locally turned off don't block
+ (catch 'dont-block
+ ;; If this is not a todo state change, or if this entry is already DONE,
+ ;; do not block
+ (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
+ (member (plist-get change-plist :from)
+ (cons 'done org-done-keywords))
+ (member (plist-get change-plist :to)
+ (cons 'todo org-not-done-keywords))
+ (not (plist-get change-plist :to)))
+ (throw 'dont-block t))
+ ;; If this task has checkboxes that are not checked, it's blocked
+ (save-excursion
+ (org-back-to-heading t)
+ (let ((beg (point)) end)
+ (outline-next-heading)
+ (setq end (point))
+ (goto-char beg)
+ (if (re-search-forward "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\[[- ]\\]"
+ end t)
+ (progn
+ (if (boundp 'org-blocked-by-checkboxes)
+ (setq org-blocked-by-checkboxes t))
+ (throw 'dont-block nil)))))
+ t))) ; do not block
+
+(defun org-entry-blocked-p ()
+ "Is the current entry blocked?"
+ (if (org-entry-get nil "NOBLOCKING")
+ nil ;; Never block this entry
+ (not
+ (run-hook-with-args-until-failure
+ 'org-blocker-hook
+ (list :type 'todo-state-change
+ :position (point)
+ :from 'todo
+ :to 'done)))))
(defun org-update-statistics-cookies (all)
"Update the statistics cookie, either from TODO or from checkboxes.
(outline-next-heading)
(if (org-on-heading-p) (setq l2 (org-outline-level)))
(point)))
- (if (and (save-excursion (re-search-forward
- "^[ \t]*[-+*] \\[[- X]\\]" end t))
+ (if (and (save-excursion
+ (re-search-forward
+ "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t))
(not (save-excursion (re-search-forward
":COOKIE_DATA:.*\\<todo\\>" end t))))
(org-update-checkbox-count)
(progn
(goto-char end)
(org-update-parent-todo-statistics))
- (error "No data for statistics cookie"))))
+ (goto-char pos)
+ (beginning-of-line 1)
+ (while (re-search-forward
+ "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
+ (point-at-eol) t)
+ (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
(goto-char pos)
(move-marker pos nil)))))
When TIME is set, it should be an internal time specification, and the
scheduling will use the corresponding date."
(interactive "P")
- (let ((old-date (org-entry-get nil "DEADLINE")))
+ (let* ((old-date (org-entry-get nil "DEADLINE"))
+ (repeater (and old-date
+ (string-match "\\([.+]+[0-9]+[dwmy]\\) ?" old-date)
+ (match-string 1 old-date))))
(if remove
(progn
+ (when (and old-date org-log-redeadline)
+ (org-add-log-setup 'deldeadline nil old-date 'findpos
+ org-log-redeadline))
(org-remove-timestamp-with-keyword org-deadline-string)
(message "Item no longer has a deadline."))
- (if (org-get-repeat)
- (error "Cannot change deadline on task with repeater, please do that by hand")
- (org-add-planning-info 'deadline time 'closed)
- (when (and old-date org-log-redeadline
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'redeadline nil old-date 'findpos
- org-log-redeadline))
- (message "Deadline on %s" org-last-inserted-timestamp)))))
+ (org-add-planning-info 'deadline time 'closed)
+ (when (and old-date org-log-redeadline
+ (not (equal old-date
+ (substring org-last-inserted-timestamp 1 -1))))
+ (org-add-log-setup 'redeadline nil old-date 'findpos
+ org-log-redeadline))
+ (when repeater
+ (save-excursion
+ (org-back-to-heading t)
+ (when (re-search-forward (concat org-deadline-string " "
+ org-last-inserted-timestamp)
+ (save-excursion
+ (outline-next-heading) (point)) t)
+ (goto-char (1- (match-end 0)))
+ (insert " " repeater)
+ (setq org-last-inserted-timestamp
+ (concat (substring org-last-inserted-timestamp 0 -1)
+ " " repeater
+ (substring org-last-inserted-timestamp -1))))))
+ (message "Deadline on %s" org-last-inserted-timestamp))))
(defun org-schedule (&optional remove time)
"Insert the SCHEDULED: string with a timestamp to schedule a TODO item.
When TIME is set, it should be an internal time specification, and the
scheduling will use the corresponding date."
(interactive "P")
- (let ((old-date (org-entry-get nil "SCHEDULED")))
+ (let* ((old-date (org-entry-get nil "SCHEDULED"))
+ (repeater (and old-date
+ (string-match "\\([.+]+[0-9]+[dwmy]\\) ?" old-date)
+ (match-string 1 old-date))))
(if remove
(progn
+ (when (and old-date org-log-reschedule)
+ (org-add-log-setup 'delschedule nil old-date 'findpos
+ org-log-reschedule))
(org-remove-timestamp-with-keyword org-scheduled-string)
(message "Item is no longer scheduled."))
- (if (org-get-repeat)
- (error "Cannot reschedule task with repeater, please do that by hand")
- (org-add-planning-info 'scheduled time 'closed)
- (when (and old-date org-log-reschedule
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'reschedule nil old-date 'findpos
- org-log-reschedule))
- (message "Scheduled to %s" org-last-inserted-timestamp)))))
+ (org-add-planning-info 'scheduled time 'closed)
+ (when (and old-date org-log-reschedule
+ (not (equal old-date
+ (substring org-last-inserted-timestamp 1 -1))))
+ (org-add-log-setup 'reschedule nil old-date 'findpos
+ org-log-reschedule))
+ (when repeater
+ (save-excursion
+ (org-back-to-heading t)
+ (when (re-search-forward (concat org-scheduled-string " "
+ org-last-inserted-timestamp)
+ (save-excursion
+ (outline-next-heading) (point)) t)
+ (goto-char (1- (match-end 0)))
+ (insert " " repeater)
+ (setq org-last-inserted-timestamp
+ (concat (substring org-last-inserted-timestamp 0 -1)
+ " " repeater
+ (substring org-last-inserted-timestamp -1))))))
+ (message "Scheduled to %s" org-last-inserted-timestamp))))
(defun org-get-scheduled-time (pom &optional inherit)
"Get the scheduled time as a time tuple, of a format suitable
(or org-log-note-state "")))
((eq org-log-note-purpose 'reschedule)
"rescheduling")
+ ((eq org-log-note-purpose 'delschedule)
+ "no longer scheduled")
((eq org-log-note-purpose 'redeadline)
"changing deadline")
+ ((eq org-log-note-purpose 'deldeadline)
+ "removing deadline")
+ ((eq org-log-note-purpose 'refile)
+ "refiling")
((eq org-log-note-purpose 'note)
"this entry")
(t (error "This should not happen")))))
(org-flag-heading nil)
(when siblings-p (org-show-siblings))))))))
+(defvar org-reveal-start-hook nil
+ "Hook run before revealing a location.")
+
(defun org-reveal (&optional siblings)
"Show current entry, hierarchy above it, and the following headline.
This can be used to show a consistent set of context around locations
With optional argument SIBLINGS, on each level of the hierarchy all
siblings are shown. This repairs the tree structure to what it would
-look like when opened with hierarchical calls to `org-cycle'."
+look like when opened with hierarchical calls to `org-cycle'.
+With double optional argument `C-u C-u', go to the parent and show the
+entire tree."
(interactive "P")
+ (run-hooks 'org-reveal-start-hook)
(let ((org-show-hierarchy-above t)
(org-show-following-heading t)
(org-show-siblings (if siblings t org-show-siblings)))
- (org-show-context nil)))
+ (org-show-context nil))
+ (when (equal siblings '(16))
+ (save-excursion
+ (when (org-up-heading-safe)
+ (org-show-subtree)
+ (run-hook-with-args 'org-cycle-hook 'subtree)))))
(defun org-highlight-new-match (beg end)
"Highlight from BEG to END and mark the highlight is an occur headline."
;; Get a new set of tags from the user
(save-excursion
(setq table (append org-tag-persistent-alist
- (or org-tag-alist (org-get-buffer-tags)))
+ (or org-tag-alist (org-get-buffer-tags))
+ (and org-complete-tags-always-offer-all-agenda-tags
+ (org-global-tags-completion-table (org-agenda-files))))
org-last-tags-completion-table table
current-tags (org-split-string current ":")
inherited-tags (nreverse
(if (equal tags "")
(setq rpl "")
(goto-char (match-beginning 0))
- (setq c0 (current-column) p0 (point)
+ (setq c0 (current-column) p0 (if (equal (char-before) ?*)
+ (1+ (point)) (point))
c1 (max (1+ c0) (if (> org-tags-column 0)
org-tags-column
(- (- org-tags-column) (length tags))))
(put-text-property 0 (length s) 'face '(secondary-selection org-tag) s)
(org-overlay-display org-tags-overlay (concat prefix s)))))
+(defvar org-last-tag-selection-key nil)
(defun org-fast-tag-selection (current inherited table &optional todo-table)
"Fast tag selection with single keys.
CURRENT is the current list of tags in the headline, INHERITED is the
(if (not groups) "no " "")
(if expert " [C-c]:window" (if exit-after-next " [C-c]:single" " [C-c]:multi")))
(setq c (let ((inhibit-quit t)) (read-char-exclusive)))
+ (setq org-last-tag-selection-key c)
(cond
((= c ?\r) (throw 'exit t))
((= c ?!)
(defconst org-special-properties
'("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED" "CLOCK" "CLOSED" "PRIORITY"
- "TIMESTAMP" "TIMESTAMP_IA")
+ "TIMESTAMP" "TIMESTAMP_IA" "BLOCKED")
"The special properties valid in Org-mode.
These are properties that are not defined in the property drawer,
"TABLE_EXPORT_FORMAT" "TABLE_EXPORT_FILE"
"EXPORT_FILE_NAME" "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE"
"ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER"
- "CLOCK_MODELINE_TOTAL" "STYLE")
+ "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS")
"Some properties that are used by Org-mode for various purposes.
Being in this list makes sure that they are offered for completion.")
"Regular expression matching the first line of a property drawer.")
(defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
- "Regular expression matching the first line of a property drawer.")
+ "Regular expression matching the last line of a property drawer.")
(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$"
"Regular expression matching the first line of a property drawer.")
(message "%s is now %s" prop val)))
(defun org-at-property-p ()
- "Is the cursor in a property line?"
- ;; FIXME: Does not check if we are actually in the drawer.
- ;; FIXME: also returns true on any drawers.....
- ;; This is used by C-c C-c for property action.
+ "Is cursor inside a property drawer?"
(save-excursion
(beginning-of-line 1)
- (looking-at (org-re "^[ \t]*\\(:\\([[:alpha:]][[:alnum:]_-]*\\):\\)[ \t]*\\(.*\\)"))))
+ (when (looking-at (org-re "^[ \t]*\\(:\\([[:alpha:]][[:alnum:]_-]*\\):\\)[ \t]*\\(.*\\)"))
+ (let ((match (match-data)) ;; Keep match-data for use by calling
+ (p (point)) ;; procedures.
+ (range (unless (org-before-first-heading-p)
+ (org-get-property-block))))
+ (prog1 (and range (<= (car range) p) (< p (cdr range)))
+ (set-match-data match))))))
(defun org-get-property-block (&optional beg end force)
"Return the (beg . end) range of the body of the property drawer.
(insert ":END:\n"))
(cons beg end)))))
-(defun org-entry-properties (&optional pom which)
+(defun org-entry-properties (&optional pom which specific)
"Get all properties of the entry at point-or-marker POM.
This includes the TODO keyword, the tags, time strings for deadline,
scheduled, and clocking, and any additional properties defined in the
if the property key was used several times.
POM may also be nil, in which case the current entry is used.
If WHICH is nil or `all', get all properties. If WHICH is
-`special' or `standard', only get that subclass."
+`special' or `standard', only get that subclass. If WHICH
+is a string only get exactly this property. Specific can be a string, the
+specific property we are interested in. Specifying it can speed
+things up because then unnecessary parsing is avoided."
(setq which (or which 'all))
(org-with-point-at pom
(let ((clockstr (substring org-clock-string 0 -1))
- (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY"))
+ (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
+ (case-fold-search nil)
beg end range props sum-props key value string clocksum)
(save-excursion
(when (condition-case nil
(when (memq which '(all special))
;; Get the special properties, like TODO and tags
(goto-char beg)
- (when (and (looking-at org-todo-line-regexp) (match-end 2))
+ (when (and (or (not specific) (string= specific "TODO"))
+ (looking-at org-todo-line-regexp) (match-end 2))
(push (cons "TODO" (org-match-string-no-properties 2)) props))
- (when (looking-at org-priority-regexp)
+ (when (and (or (not specific) (string= specific "PRIORITY"))
+ (looking-at org-priority-regexp))
(push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
- (when (and (setq value (org-get-tags-string))
+ (when (and (or (not specific) (string= specific "TAGS"))
+ (setq value (org-get-tags-string))
(string-match "\\S-" value))
(push (cons "TAGS" value) props))
- (when (setq value (org-get-tags-at))
- (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":") ":"))
+ (when (and (or (not specific) (string= specific "ALLTAGS"))
+ (setq value (org-get-tags-at)))
+ (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":")
+ ":"))
props))
- (while (re-search-forward org-maybe-keyword-time-regexp end t)
- (setq key (if (match-end 1) (substring (org-match-string-no-properties 1) 0 -1))
- string (if (equal key clockstr)
- (org-no-properties
- (org-trim
+ (when (or (not specific) (string= specific "BLOCKED"))
+ (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
+ (when (or (not specific)
+ (member specific org-all-time-keywords)
+ (member specific '("TIMESTAMP" "TIMESTAMP_IA")))
+ (while (re-search-forward org-maybe-keyword-time-regexp end t)
+ (setq key (if (match-end 1) (substring (org-match-string-no-properties 1) 0 -1))
+ string (if (equal key clockstr)
+ (org-no-properties
+ (org-trim
(buffer-substring
(match-beginning 3) (goto-char (point-at-eol)))))
- (substring (org-match-string-no-properties 3) 1 -1)))
- (unless key
- (if (= (char-after (match-beginning 3)) ?\[)
- (setq key "TIMESTAMP_IA")
- (setq key "TIMESTAMP")))
- (when (or (equal key clockstr) (not (assoc key props)))
- (push (cons key string) props)))
+ (substring (org-match-string-no-properties 3) 1 -1)))
+ (unless key
+ (if (= (char-after (match-beginning 3)) ?\[)
+ (setq key "TIMESTAMP_IA")
+ (setq key "TIMESTAMP")))
+ (when (or (equal key clockstr) (not (assoc key props)))
+ (push (cons key string) props))))
)
t))
(org-entry-get-with-inheritance property)
(if (member property org-special-properties)
- ;; We need a special property. Use brute force, get all properties.
- (cdr (assoc property (org-entry-properties nil 'special)))
+ ;; We need a special property. Use `org-entry-properties' to
+ ;; retrieve it, but specify the wanted property
+ (cdr (assoc property (org-entry-properties nil 'special property)))
(let ((range (org-get-property-block)))
(if (and range
(goto-char (car range))
(cdr (assoc property org-global-properties))
(cdr (assoc property org-global-properties-fixed))))))
+(defvar org-property-changed-functions nil
+ "Hook called when the value of a property has changed.
+Each hook function should accept two arguments, the name of the property
+and the new value.")
+
(defun org-entry-put (pom property value)
"Set PROPERTY to VALUE for entry at point-or-marker POM."
(org-with-point-at pom
(org-indent-line-function)
(insert ":" property ":"))
(and value (insert " " value))
- (org-indent-line-function)))))))
+ (org-indent-line-function)))))
+ (run-hook-with-args 'org-property-changed-functions property value)))
(defun org-buffer-property-keys (&optional include-specials include-defaults include-columns)
"Get all property keys in the current buffer.
keys)))
prop0)))
(cur (org-entry-get nil prop))
+ (prompt (concat prop " value"
+ (if (and cur (string-match "\\S-" cur))
+ (concat " [" cur "]") "") ": "))
(allowed (org-property-get-allowed-values nil prop 'table))
(existing (mapcar 'list (org-property-values prop)))
(val (if allowed
- (org-completing-read "Value: " allowed nil 'req-match)
+ (org-completing-read prompt allowed nil
+ (not (get-text-property 0 'org-unrestricted
+ (caar allowed))))
(let (org-completion-use-ido org-completion-use-iswitchb)
- (org-completing-read
- (concat "Value " (if (and cur (string-match "\\S-" cur))
- (concat "[" cur "]") "")
- ": ")
- existing nil nil "" nil cur)))))
+ (org-completing-read prompt existing nil nil "" nil cur)))))
(list prop (if (equal val "") cur val))))
(unless (equal (org-entry-get nil property) value)
(org-entry-put nil property value)))
"In the current entry, delete PROPERTY."
(interactive
(let* ((completion-ignore-case t)
- (prop (org-icompleting-read
- "Property: " (org-entry-properties nil 'standard))))
+ (prop (org-icompleting-read "Property: " (org-entry-properties nil 'standard))))
(list prop)))
(message "Property %s %s" property
(if (org-entry-delete nil property)
(error "No operator defined for property %s" prop))
(org-columns-compute prop)))
+(defvar org-property-allowed-value-functions nil
+ "Hook for functions supplying allowed values for a specific property.
+The functions must take a single argument, the name of the property, and
+return a flat list of allowed values. If \":ETC\" is one of
+the values, this means that these values are intended as defaults for
+completion, but that other values should be allowed too.
+The functions must return nil if they are not responsible for this
+property.")
+
(defun org-property-get-allowed-values (pom property &optional table)
"Get allowed values for the property PROPERTY.
When TABLE is non-nil, return an alist that can directly be used for
(push (char-to-string n) vals)
(setq n (1- n)))))
((member property org-special-properties))
+ ((setq vals (run-hook-with-args-until-success
+ 'org-property-allowed-value-functions property)))
(t
(setq vals (org-entry-get pom (concat property "_ALL") 'inherit))
-
(when (and vals (string-match "\\S-" vals))
(setq vals (car (read-from-string (concat "(" vals ")"))))
(setq vals (mapcar (lambda (x)
((symbolp x) (symbol-name x))
(t "???")))
vals)))))
+ (when (member ":ETC" vals)
+ (setq vals (remove ":ETC" vals))
+ (org-add-props (car vals) '(org-unrestricted t)))
(if table (mapcar 'list vals) vals)))
(defun org-property-previous-allowed-value (&optional previous)
(replace-match (concat " :" key ": " nval) t t)
(org-indent-line-function)
(beginning-of-line 1)
- (skip-chars-forward " \t")))
+ (skip-chars-forward " \t")
+ (run-hook-with-args 'org-property-changed-functions key nval)))
(defun org-find-entry-with-id (ident)
"Locate the entry that contains the ID property with exact value IDENT.
(defun org-read-date-analyze (ans def defdecode)
"Analyse the combined answer of the date prompt."
;; FIXME: cleanup and comment
- (let (delta deltan deltaw deltadef year month day
- hour minute second wday pm h2 m2 tl wday1
- iso-year iso-weekday iso-week iso-year iso-date futurep)
+ (let ((nowdecode (decode-time (current-time)))
+ delta deltan deltaw deltadef year month day
+ hour minute second wday pm h2 m2 tl wday1
+ iso-year iso-weekday iso-week iso-year iso-date futurep kill-year)
(setq org-read-date-analyze-futurep nil)
(when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans)
(setq ans "+0"))
;; If yes, store the info and postpone interpreting it until the rest
;; of the parsing is done
(when (string-match "\\<\\(?:\\([0-9]+\\)-\\)?[wW]\\([0-9]\\{1,2\\}\\)\\(?:-\\([0-6]\\)\\)?\\([ \t]\\|$\\)" ans)
- (setq iso-year (if (match-end 1) (org-small-year-to-year (string-to-number (match-string 1 ans))))
- iso-weekday (if (match-end 3) (string-to-number (match-string 3 ans)))
+ (setq iso-year (if (match-end 1)
+ (org-small-year-to-year
+ (string-to-number (match-string 1 ans))))
+ iso-weekday (if (match-end 3)
+ (string-to-number (match-string 3 ans)))
iso-week (string-to-number (match-string 2 ans)))
(setq ans (replace-match "" t t ans)))
- ;; Help matching ISO dates with single digit month ot day, like 2006-8-11.
+ ;; Help matching ISO dates with single digit month or day, like 2006-8-11.
(when (string-match
"^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
(setq year (if (match-end 2)
(string-to-number (match-string 2 ans))
- (string-to-number (format-time-string "%Y")))
+ (progn (setq kill-year t)
+ (string-to-number (format-time-string "%Y"))))
month (string-to-number (match-string 3 ans))
day (string-to-number (match-string 4 ans)))
(if (< year 100) (setq year (+ 2000 year)))
(setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
t nil ans)))
+ ;; Help matching american dates, like 5/30 or 5/30/7
+ (when (string-match
+ "^ *\\([0-3]?[0-9]\\)/\\([0-1]?[0-9]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
+ (setq year (if (match-end 4)
+ (string-to-number (match-string 4 ans))
+ (progn (setq kill-year t)
+ (string-to-number (format-time-string "%Y"))))
+ month (string-to-number (match-string 1 ans))
+ day (string-to-number (match-string 2 ans)))
+ (if (< year 100) (setq year (+ 2000 year)))
+ (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
+ t nil ans)))
;; Help matching am/pm times, because `parse-time-string' does not do that.
;; If there is a time with am/pm, and *no* time without it, we convert
;; so that matching will be successful.
day (or (nth 3 tl) (nth 3 defdecode))
month (or (nth 4 tl)
(if (and org-read-date-prefer-future
- (nth 3 tl) (< (nth 3 tl) (nth 3 defdecode)))
- (prog1 (1+ (nth 4 defdecode)) (setq futurep t))
+ (nth 3 tl) (< (nth 3 tl) (nth 3 nowdecode)))
+ (prog1 (1+ (nth 4 nowdecode)) (setq futurep t))
(nth 4 defdecode)))
- year (or (nth 5 tl)
+ year (or (and (not kill-year) (nth 5 tl))
(if (and org-read-date-prefer-future
- (nth 4 tl) (< (nth 4 tl) (nth 4 defdecode)))
- (prog1 (1+ (nth 5 defdecode)) (setq futurep t))
+ (nth 4 tl) (< (nth 4 tl) (nth 4 nowdecode)))
+ (prog1 (1+ (nth 5 nowdecode)) (setq futurep t))
(nth 5 defdecode)))
hour (or (nth 2 tl) (nth 2 defdecode))
minute (or (nth 1 tl) (nth 1 defdecode))
(when (and (eq org-read-date-prefer-future 'time)
(not (nth 3 tl)) (not (nth 4 tl)) (not (nth 5 tl))
- (equal day (nth 3 defdecode))
- (equal month (nth 4 defdecode))
- (equal year (nth 5 defdecode))
+ (equal day (nth 3 nowdecode))
+ (equal month (nth 4 nowdecode))
+ (equal year (nth 5 nowdecode))
(nth 2 tl)
- (or (< (nth 2 tl) (nth 2 defdecode))
- (and (= (nth 2 tl) (nth 2 defdecode))
+ (or (< (nth 2 tl) (nth 2 nowdecode))
+ (and (= (nth 2 tl) (nth 2 nowdecode))
(nth 1 tl)
- (< (nth 1 tl) (nth 1 defdecode)))))
+ (< (nth 1 tl) (nth 1 nowdecode)))))
(setq day (1+ day)
futurep t))
(cond
(iso-week
;; There was an iso week
+ (require 'cal-iso)
(setq futurep nil)
(setq year (or iso-year year)
day (or iso-weekday wday 1)
(list delta "d" rel))
(list (* n (if (= dir ?-) -1 1)) what rel)))))
+(defun org-order-calendar-date-args (arg1 arg2 arg3)
+ "Turn a user-specified date into the internal representation.
+The internal representation needed by the calendar is (month day year).
+This is a wrapper to handle the brain-dead convention in calendar that
+user function argument order change dependent on argument order."
+ (if (boundp 'calendar-date-style)
+ (cond
+ ((eq calendar-date-style 'american)
+ (list arg1 arg2 arg3))
+ ((eq calendar-date-style 'european)
+ (list arg2 arg1 arg3))
+ ((eq calendar-date-style 'iso)
+ (list arg2 arg3 arg1)))
+ (if (org-bound-and-true-p european-calendar-style)
+ (list arg2 arg1 arg3)
+ (list arg1 arg2 arg3))))
+
(defun org-eval-in-calendar (form &optional keepdate)
"Eval FORM in the calendar window and return to current window.
Also, store the cursor date in variable org-ans2."
(defun org-insert-time-stamp (time &optional with-hm inactive pre post extra)
"Insert a date stamp for the date given by the internal TIME.
-WITH-HM means, use the stamp format that includes the time of the day.
+WITH-HM means use the stamp format that includes the time of the day.
INACTIVE means use square brackets instead of angular ones, so that the
stamp will not contribute to the agenda.
PRE and POST are optional strings to be inserted before and after the
"Get the list of agenda files.
Optional UNRESTRICTED means return the full list even if a restriction
is currently in place.
-When ARCHIVES is t, include all archive files hat are really being
+When ARCHIVES is t, include all archive files that are really being
used by the agenda files. If ARCHIVE is `ifmode', do this only if
`org-agenda-archives-mode' is t."
(let ((files
(defun org-store-new-agenda-file-list (list)
"Set new value for the agenda file list and save it correctly."
(if (stringp org-agenda-files)
- (let ((f org-agenda-files) b)
- (while (setq b (find-buffer-visiting f)) (kill-buffer b))
- (with-temp-file f
- (insert (mapconcat 'identity list "\n") "\n")))
+ (let ((fe (org-read-agenda-file-list t)) b u)
+ (while (setq b (find-buffer-visiting org-agenda-files))
+ (kill-buffer b))
+ (with-temp-file org-agenda-files
+ (insert
+ (mapconcat
+ (lambda (f) ;; Keep un-expanded entries.
+ (if (setq u (assoc f fe))
+ (cdr u)
+ f))
+ list "\n")
+ "\n")))
(let ((org-mode-hook nil) (org-inhibit-startup t)
(org-insert-mode-line-in-empty-file nil))
(setq org-agenda-files list)
(customize-save-variable 'org-agenda-files org-agenda-files))))
-(defun org-read-agenda-file-list ()
- "Read the list of agenda files from a file."
+(defun org-read-agenda-file-list (&optional pair-with-expansion)
+ "Read the list of agenda files from a file.
+If PAIR-WITH-EXPANSION is t return pairs with un-expanded
+filenames, used by `org-store-new-agenda-file-list' to write back
+un-expanded file names."
(when (file-directory-p org-agenda-files)
(error "`org-agenda-files' cannot be a single directory"))
(when (stringp org-agenda-files)
(with-temp-buffer
(insert-file-contents org-agenda-files)
- (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*"))))
-
+ (mapcar
+ (lambda (f)
+ (let ((e (expand-file-name (substitute-in-file-name f)
+ org-directory)))
+ (if pair-with-expansion
+ (cons e f)
+ e)))
+ (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*")))))
;;;###autoload
(defun org-cycle-agenda-files ()
(defun org-remove-file (&optional file)
"Remove current file from the list of files in variable `org-agenda-files'.
These are the files which are being checked for agenda entries.
-Optional argument FILE means, use this file instead of the current."
+Optional argument FILE means use this file instead of the current."
(interactive)
(let* ((org-agenda-skip-unavailable-files nil)
(file (or file buffer-file-name))
(add-text-properties
(match-beginning 0) (org-end-of-subtree t) pc)))
(set-buffer-modified-p bmp)))))
+ (setq org-todo-keywords-for-agenda
+ (org-uniquify org-todo-keywords-for-agenda))
(setq org-todo-keyword-alist-for-agenda
(org-uniquify org-todo-keyword-alist-for-agenda)
org-tag-alist-for-agenda (org-uniquify org-tag-alist-for-agenda))))
(goto-char pos)
(if dd-on (cons "$$" m))))))
+(defun org-inside-latex-macro-p ()
+ "Is point inside a LaTeX macro or its arguments?"
+ (save-match-data
+ (org-in-regexp
+ "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*")))
+
+(defun test ()
+ (interactive)
+ (message "%s" (org-inside-latex-macro-p)))
(defun org-try-cdlatex-tab ()
"Check if it makes sense to execute `cdlatex-tab', and do it if yes.
(opt org-format-latex-options)
(matchers (plist-get opt :matchers))
(re-list org-latex-regexps)
+ (org-format-latex-header-extra
+ (plist-get (org-infile-export-plist) :latex-header-extra))
(cnt 0) txt hash link beg end re e checkdir
executables-checked
m n block linkfile movefile ov)
'org-latex-overlay))))
(setq txt (match-string n)
beg (match-beginning n) end (match-end n)
- cnt (1+ cnt)
- link (concat block "[[file:" linkfile "]]" block))
+ cnt (1+ cnt))
(let (print-length print-level) ; make sure full list is printed
(setq hash (sha1 (prin1-to-string
(list org-format-latex-header
+ org-format-latex-header-extra
+ org-export-latex-default-packages-alist
org-export-latex-packages-alist
org-format-latex-options
forbuffer txt)))
linkfile (format "%s_%s.png" prefix hash)
movefile (format "%s_%s.png" absprefix hash)))
+ (setq link (concat block "[[file:" linkfile "]]" block))
(if msg (message msg cnt))
(goto-char beg)
(unless checkdir ; make sure the directory exists
(push ov org-latex-fragment-image-overlays)
(goto-char end))
(delete-region beg end)
- (insert link))))))))
+ (insert (org-add-props link
+ (list 'org-latex-src
+ (replace-regexp-in-string "\"" "" txt)))))))))))
;; This function borrows from Ganesh Swami's latex2png.el
(defun org-create-formula-image (string tofile options buffer)
(if (eq fg 'default) (setq fg (org-dvipng-color :foreground)))
(if (eq bg 'default) (setq bg (org-dvipng-color :background)))
(with-temp-file texfile
- (insert org-format-latex-header
- (if org-export-latex-packages-alist
- (concat "\n"
- (mapconcat (lambda(p)
- (if (equal "" (car p))
- (format "\\usepackage{%s}" (cadr p))
- (format "\\usepackage[%s]{%s}"
- (car p) (cadr p))))
- org-export-latex-packages-alist "\n"))
- "")
- "\n\\begin{document}\n" string "\n\\end{document}\n"))
+ (insert (org-splice-latex-header
+ org-format-latex-header
+ org-export-latex-default-packages-alist
+ org-export-latex-packages-alist
+ org-format-latex-header-extra))
+ (insert "\n\\begin{document}\n" string "\n\\end{document}\n")
+ (require 'org-latex)
+ (org-export-latex-fix-inputenc))
(let ((dir default-directory))
(condition-case nil
(progn
dvifile)
(error nil))
(if (not (file-exists-p pngfile))
- (progn (message "Failed to create png file from %s" texfile) nil)
+ (if org-format-latex-signal-error
+ (error "Failed to create png file from %s" texfile)
+ (message "Failed to create png file from %s" texfile)
+ nil)
;; Use the requested file name and clean up
(copy-file pngfile tofile 'replace)
(loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
(delete-file (concat texfilebase e)))
pngfile))))
+(defun org-splice-latex-header (tpl def-pkg pkg &optional extra)
+ "Fill a LaTeX header template TPL.
+In the template, the following place holders will be recognized:
+
+ [DEFAULT-PACKAGES] \\usepackage statements for DEF-PKG
+ [NO-DEFAULT-PACKAGES] do not include DEF-PKG
+ [PACKAGES] \\usepackage statements for PKG
+ [NO-PACKAGES] do not include PKG
+ [EXTRA] the string EXTRA
+ [NO-EXTRA] do not include EXTRA
+
+For backward compatibility, if both the positive and the negative place
+holder is missing, the positive one (without the \"NO-\") will be
+assumed to be present at the end of the template.
+DEF-PKG and PKG are assumed to be alists of options/packagename lists.
+EXTRA is a string."
+ (let (rpl (end ""))
+ (if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not def-pkg))
+ "" (org-latex-packages-to-string def-pkg t))
+ tpl (replace-match rpl t t tpl))
+ (if def-pkg (setq end (org-latex-packages-to-string def-pkg))))
+
+ (if (string-match "\\[\\(NO-\\)?PACKAGES\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not pkg))
+ "" (org-latex-packages-to-string pkg t))
+ tpl (replace-match rpl t t tpl))
+ (if pkg (setq end (concat end "\n" (org-latex-packages-to-string pkg)))))
+
+ (if (string-match "\\[\\(NO-\\)?EXTRA\\][ \t]*\n?" tpl)
+ (setq rpl (if (or (match-end 1) (not extra))
+ "" (concat extra "\n"))
+ tpl (replace-match rpl t t tpl))
+ (if (and extra (string-match "\\S-" extra))
+ (setq end (concat end "\n" extra))))
+
+ (if (string-match "\\S-" end)
+ (concat tpl "\n" end)
+ tpl)))
+
+(defun org-latex-packages-to-string (pkg &optional newline)
+ "Turn an alist of packages into a string with the \\usepackage macros."
+ (setq pkg (mapconcat (lambda(p)
+ (cond
+ ((stringp p) p)
+ ((equal "" (car p))
+ (format "\\usepackage{%s}" (cadr p)))
+ (t
+ (format "\\usepackage[%s]{%s}"
+ (car p) (cadr p)))))
+ pkg
+ "\n"))
+ (if newline (concat pkg "\n") pkg))
+
(defun org-dvipng-color (attr)
"Return an rgb color specification for dvipng."
(apply 'format "rgb %s %s %s"
"Show the available speed commands."
(interactive)
(if (not org-use-speed-commands)
- (error "Speed commands are not activated, customize `org-use-speed-commands'")
+ (error "Speed commands are not activated, customize `org-use-speed-commands'.")
(with-output-to-temp-buffer "*Help*"
(princ "User-defined Speed commands\n===========================\n")
(mapc 'org-print-speed-command org-speed-commands-user)
`ffap' to visit the file at point."
(interactive)
(cond
+ ((org-at-table.el-p)
+ (org-edit-src-code))
((org-at-table-p)
(call-interactively 'org-table-edit-formulas))
((save-excursion
- If the cursor is a the beginning of a dynamic block, update it.
-- If the cursor is inside a table created by the table.el package,
- activate that table.
-
- If the current buffer is a remember buffer, close note and file
it. A prefix argument of 1 files to the default location
without further interaction. A prefix argument of 2 files to
(fboundp org-finish-function))
(funcall org-finish-function))
((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook))
- ((org-at-property-p)
+ ((or (looking-at org-property-start-re)
+ (org-at-property-p))
(call-interactively 'org-property-action))
((org-on-target-p) (call-interactively 'org-update-radio-target-regexp))
((and (org-in-regexp "\\[\\([0-9]*%\\|[0-9]*/[0-9]*\\)\\]")
(call-interactively 'org-update-statistics-cookies))
((org-on-heading-p) (call-interactively 'org-set-tags))
((org-at-table.el-p)
- (require 'table)
- (beginning-of-line 1)
- (re-search-forward "|" (save-excursion (end-of-line 2) (point)))
- (call-interactively 'table-recognize-table))
+ (message "Use C-c ' to edit table.el tables"))
((org-at-table-p)
(org-table-maybe-eval-formula)
(if arg
(if (org-at-table-p)
(org-call-with-arg 'org-table-recalculate (or arg t)))))
(t
-; (org-set-regexps-and-options)
-; (org-restart-font-lock)
- (let ((org-inhibit-startup t)) (org-mode-restart))
+ (let ((org-inhibit-startup-visibility-stuff t)
+ (org-startup-align-all-tables nil))
+ (org-save-outline-visibility 'use-markers (org-mode-restart)))
(message "Local setup has been refreshed"))))
((org-clock-update-time-maybe))
(t (error "C-c C-c can do nothing useful at this location")))))
(not org-export-with-LaTeX-fragments))
(require 'org-exp))
:style toggle :selected (and (boundp 'org-export-with-LaTeX-fragments)
- org-export-with-LaTeX-fragments)])
+ org-export-with-LaTeX-fragments)]
+ "--"
+ ["Template for BEAMER" org-beamer-settings-template t])
"--"
("MobileOrg"
["Push Files and Views" org-mobile-push t]
(defun org-fill-template (template alist)
"Find each %key of ALIST in TEMPLATE and replace it."
- (let (entry key value)
+ (let ((case-fold-search nil)
+ entry key value)
(setq alist (sort (copy-sequence alist)
(lambda (a b) (< (length (car a)) (length (car b))))))
(while (setq entry (pop alist))
(throw 'exit t)))
nil))))
+(defun org-in-regexps-block-p (start-re end-re)
+ "Returns t if the current point is between matches of START-RE and END-RE.
+This will also return to if point is on one of the two matches."
+ (interactive)
+ (let ((p (point)))
+ (save-excursion
+ (and (or (org-at-regexp-p start-re)
+ (re-search-backward start-re nil t))
+ (re-search-forward end-re nil t)
+ (>= (point) p)))))
+
(defun org-occur-in-agenda-files (regexp &optional nlines)
"Call `multi-occur' with buffers for all agenda files."
(interactive "sOrg-files matching: \np")
t t))
(org-move-to-column column)))
+(defvar org-adaptive-fill-regexp-backup adaptive-fill-regexp
+ "Variable to store copy of `adaptive-fill-regexp'.
+Since `adaptive-fill-regexp' is set to never match, we need to
+store a backup of its value before entering `org-mode' so that
+the functionality can be provided as a fall-back.")
+
(defun org-set-autofill-regexps ()
(interactive)
;; In the paragraph separator we include headlines, because filling
;; and fixed-width regions are not wrapped. That function will pass
;; through to `fill-paragraph' when appropriate.
(org-set-local 'fill-paragraph-function 'org-fill-paragraph)
- ; Adaptive filling: To get full control, first make sure that
+ ;; Adaptive filling: To get full control, first make sure that
;; `adaptive-fill-regexp' never matches. Then install our own matcher.
+ (unless (local-variable-p 'adaptive-fill-regexp)
+ (org-set-local 'org-adaptive-fill-regexp-backup
+ adaptive-fill-regexp))
(org-set-local 'adaptive-fill-regexp "\000")
(org-set-local 'adaptive-fill-function
'org-adaptive-fill-function)
"Return a fill prefix for org-mode files.
In particular, this makes sure hanging paragraphs for hand-formatted lists
work correctly."
- (cond ((looking-at "#[ \t]+")
- (match-string 0))
+ (cond
+ ;; Comment line
+ ((looking-at "#[ \t]+")
+ (match-string-no-properties 0))
+ ;; Description list
((looking-at "[ \t]*\\([-*+] .*? :: \\)")
(save-excursion
(if (> (match-end 1) (+ (match-beginning 1)
(goto-char (+ (match-beginning 1) 5))
(goto-char (match-end 0)))
(make-string (current-column) ?\ )))
- ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] ?\\)?")
+ ;; Ordered or unordered list
+ ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] ?\\)")
(save-excursion
(goto-char (match-end 0))
(make-string (current-column) ?\ )))
- (t nil)))
+ ;; Other text
+ ((looking-at org-adaptive-fill-regexp-backup)
+ (match-string-no-properties 0))))
;;; Other stuff.
(defun org-at-heading-p (&optional ignored)
(outline-on-heading-p t))
+(defun org-point-at-end-of-empty-headline ()
+ "If point is at the end of an empty headline, return t, else nil.
+If the heading only contains a TODO keyword, it is still still considered
+empty."
+ (and (looking-at "[ \t]*$")
+ (save-excursion
+ (beginning-of-line 1)
+ (looking-at (concat "^\\(\\*+\\)[ \t]+\\(" org-todo-regexp
+ "\\)?[ \t]*$")))))
(defun org-at-heading-or-item-p ()
(or (org-on-heading-p) (org-at-item-p)))
(setq l (- (match-end 0) (match-beginning 0) 1))
(= l level)
(not invisible-ok)
- (org-invisible-p))
+ (progn (backward-char 1) (org-invisible-p)))
(if (< l level) (setq arg 1)))
(setq arg (1- arg)))
(beginning-of-line 1)))
;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
;;; org.el ends here
-
(defgroup outlines nil
"Support for hierarchical outlining."
:prefix "outline-"
- :group 'editing)
+ :group 'wp)
(defcustom outline-regexp "[*\^L]+"
"Regular expression to match the beginning of a heading.
(lambda ()
(if (<= (funcall outline-level) levels)
(outline-show-heading)))
- beg end)))
+ beg end)
+ ;; Finally unhide any trailing newline.
+ (goto-char (point-max))
+ (if (and (bolp) (not (bobp)) (outline-invisible-p (1- (point))))
+ (outline-flag-region (1- (point)) (point) nil))))
(run-hooks 'outline-view-change-hook))
(defun hide-other ()
;;; password-cache.el --- Read passwords, possibly using a password cache.
-;; Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Created: 2003-12-21
;;; Code:
+;; Options are autoloaded since they are used by eg mml-sec.el.
+
+;;;###autoload
(defcustom password-cache t
"Whether to cache passwords."
:group 'password
:type 'boolean)
+;;;###autoload
(defcustom password-cache-expiry 16
"How many seconds passwords are cached, or nil to disable expiring.
Whether passwords are cached at all is controlled by `password-cache'."
(defun password-cache-remove (key)
"Remove password indexed by KEY from password cache.
-This is typically run be a timer setup from `password-cache-add',
+This is typically run by a timer setup from `password-cache-add',
but can be invoked at any time to forcefully remove passwords
from the cache. This may be useful when it has been detected
that a password is invalid, so that `password-read' query the
;; I don't think such commands are usable before first setting up buffer-local
;; variables to parse args, so there's no point autoloading it.
;; ;;;###autoload
-(defun pcomplete-std-complete ()
+(defun pcomplete-completions-at-point ()
"Provide standard completion using pcomplete's completion tables.
Same as `pcomplete' but using the standard completion UI."
- (interactive)
;; FIXME: it only completes the text before point, whereas the
;; standard UI may also consider text after point.
+ ;; FIXME: the `pcomplete' UI may be used internally during
+ ;; pcomplete-completions and then throw to `pcompleted', thus
+ ;; imposing the pcomplete UI over the standard UI.
(catch 'pcompleted
(let* ((pcomplete-stub)
pcomplete-seen pcomplete-norm-func
(directory-file-name f))
pcomplete-seen))))))
- (completion-in-region
+ (list
beg (point)
;; Add a space at the end of completion. Use a terminator-regexp
;; that never matches since the terminator cannot appear
(cons pcomplete-termination-string
"\\`a\\`")
table))
- pred))))
+ :predicate pred))))
+
+ ;; I don't think such commands are usable before first setting up buffer-local
+ ;; variables to parse args, so there's no point autoloading it.
+ ;; ;;;###autoload
+(defun pcomplete-std-complete ()
+ (let ((completion-at-point-functions '(pcomplete-completions-at-point)))
+ (completion-at-point)))
;;; Pcomplete's native UI.
(defmacro pcomplete-here* (&optional form stub form-only)
"An alternate form which does not participate in argument paring."
(declare (debug t))
- `(pcomplete-here (lambda () ,form) ,stub t ,form-only))
+ `(pcomplete-here ,form ,stub t ,form-only))
;; display support
(defun pgg-parse-armor (string)
(with-temp-buffer
(buffer-disable-undo)
- (if (fboundp 'set-buffer-multibyte)
- (set-buffer-multibyte nil))
+ (unless (featurep 'xemacs)
+ (set-buffer-multibyte nil))
(insert string)
(pgg-decode-armor-region (point-min)(point))))
(if (null signature) nil
(with-temp-buffer
(buffer-disable-undo)
- (if (fboundp 'set-buffer-multibyte)
- (set-buffer-multibyte nil))
+ (unless (featurep 'xemacs)
+ (set-buffer-multibyte nil))
(insert-file-contents signature)
(cdr (assq 2 (pgg-decode-armor-region
(point-min)(point-max)))))))
"*Number of lines between the Gomoku board and the top of the window.")
-(defvar gomoku-mode-map nil
+(defvar gomoku-mode-map
+ (let ((map (make-sparse-keymap)))
+
+ ;; Key bindings for cursor motion.
+ (define-key map "y" 'gomoku-move-nw) ; y
+ (define-key map "u" 'gomoku-move-ne) ; u
+ (define-key map "b" 'gomoku-move-sw) ; b
+ (define-key map "n" 'gomoku-move-se) ; n
+ (define-key map "h" 'backward-char) ; h
+ (define-key map "l" 'forward-char) ; l
+ (define-key map "j" 'gomoku-move-down) ; j
+ (define-key map "k" 'gomoku-move-up) ; k
+
+ (define-key map [kp-7] 'gomoku-move-nw)
+ (define-key map [kp-9] 'gomoku-move-ne)
+ (define-key map [kp-1] 'gomoku-move-sw)
+ (define-key map [kp-3] 'gomoku-move-se)
+ (define-key map [kp-4] 'backward-char)
+ (define-key map [kp-6] 'forward-char)
+ (define-key map [kp-2] 'gomoku-move-down)
+ (define-key map [kp-8] 'gomoku-move-up)
+
+ (define-key map "\C-n" 'gomoku-move-down) ; C-n
+ (define-key map "\C-p" 'gomoku-move-up) ; C-p
+
+ ;; Key bindings for entering Human moves.
+ (define-key map "X" 'gomoku-human-plays) ; X
+ (define-key map "x" 'gomoku-human-plays) ; x
+ (define-key map " " 'gomoku-human-plays) ; SPC
+ (define-key map "\C-m" 'gomoku-human-plays) ; RET
+ (define-key map "\C-c\C-p" 'gomoku-human-plays) ; C-c C-p
+ (define-key map "\C-c\C-b" 'gomoku-human-takes-back) ; C-c C-b
+ (define-key map "\C-c\C-r" 'gomoku-human-resigns) ; C-c C-r
+ (define-key map "\C-c\C-e" 'gomoku-emacs-plays) ; C-c C-e
+
+ (define-key map [kp-enter] 'gomoku-human-plays)
+ (define-key map [insert] 'gomoku-human-plays)
+ (define-key map [down-mouse-1] 'gomoku-click)
+ (define-key map [drag-mouse-1] 'gomoku-click)
+ (define-key map [mouse-1] 'gomoku-click)
+ (define-key map [down-mouse-2] 'gomoku-click)
+ (define-key map [mouse-2] 'gomoku-mouse-play)
+ (define-key map [drag-mouse-2] 'gomoku-mouse-play)
+
+ (define-key map [remap previous-line] 'gomoku-move-up)
+ (define-key map [remap next-line] 'gomoku-move-down)
+ (define-key map [remap move-beginning-of-line] 'gomoku-beginning-of-line)
+ (define-key map [remap move-end-of-line] 'gomoku-end-of-line)
+ (define-key map [remap undo] 'gomoku-human-takes-back)
+ (define-key map [remap advertised-undo] 'gomoku-human-takes-back)
+ map)
+
"Local keymap to use in Gomoku mode.")
-(if gomoku-mode-map nil
- (setq gomoku-mode-map (make-sparse-keymap))
-
- ;; Key bindings for cursor motion.
- (define-key gomoku-mode-map "y" 'gomoku-move-nw) ; y
- (define-key gomoku-mode-map "u" 'gomoku-move-ne) ; u
- (define-key gomoku-mode-map "b" 'gomoku-move-sw) ; b
- (define-key gomoku-mode-map "n" 'gomoku-move-se) ; n
- (define-key gomoku-mode-map "h" 'backward-char) ; h
- (define-key gomoku-mode-map "l" 'forward-char) ; l
- (define-key gomoku-mode-map "j" 'gomoku-move-down) ; j
- (define-key gomoku-mode-map "k" 'gomoku-move-up) ; k
-
- (define-key gomoku-mode-map [kp-7] 'gomoku-move-nw)
- (define-key gomoku-mode-map [kp-9] 'gomoku-move-ne)
- (define-key gomoku-mode-map [kp-1] 'gomoku-move-sw)
- (define-key gomoku-mode-map [kp-3] 'gomoku-move-se)
- (define-key gomoku-mode-map [kp-4] 'backward-char)
- (define-key gomoku-mode-map [kp-6] 'forward-char)
- (define-key gomoku-mode-map [kp-2] 'gomoku-move-down)
- (define-key gomoku-mode-map [kp-8] 'gomoku-move-up)
-
- (define-key gomoku-mode-map "\C-n" 'gomoku-move-down) ; C-n
- (define-key gomoku-mode-map "\C-p" 'gomoku-move-up) ; C-p
-
- ;; Key bindings for entering Human moves.
- (define-key gomoku-mode-map "X" 'gomoku-human-plays) ; X
- (define-key gomoku-mode-map "x" 'gomoku-human-plays) ; x
- (define-key gomoku-mode-map " " 'gomoku-human-plays) ; SPC
- (define-key gomoku-mode-map "\C-m" 'gomoku-human-plays) ; RET
- (define-key gomoku-mode-map "\C-c\C-p" 'gomoku-human-plays) ; C-c C-p
- (define-key gomoku-mode-map "\C-c\C-b" 'gomoku-human-takes-back) ; C-c C-b
- (define-key gomoku-mode-map "\C-c\C-r" 'gomoku-human-resigns) ; C-c C-r
- (define-key gomoku-mode-map "\C-c\C-e" 'gomoku-emacs-plays) ; C-c C-e
-
- (define-key gomoku-mode-map [kp-enter] 'gomoku-human-plays)
- (define-key gomoku-mode-map [insert] 'gomoku-human-plays)
- (define-key gomoku-mode-map [down-mouse-1] 'gomoku-click)
- (define-key gomoku-mode-map [drag-mouse-1] 'gomoku-click)
- (define-key gomoku-mode-map [mouse-1] 'gomoku-click)
- (define-key gomoku-mode-map [down-mouse-2] 'gomoku-click)
- (define-key gomoku-mode-map [mouse-2] 'gomoku-mouse-play)
- (define-key gomoku-mode-map [drag-mouse-2] 'gomoku-mouse-play)
-
- (define-key gomoku-mode-map [remap previous-line] 'gomoku-move-up)
- (define-key gomoku-mode-map [remap next-line] 'gomoku-move-down)
- (define-key gomoku-mode-map [remap move-beginning-of-line] 'gomoku-beginning-of-line)
- (define-key gomoku-mode-map [remap move-end-of-line] 'gomoku-end-of-line)
- (define-key gomoku-mode-map [remap undo] 'gomoku-human-takes-back)
- (define-key gomoku-mode-map [remap advertised-undo] 'gomoku-human-takes-back))
(defvar gomoku-emacs-won ()
"For making font-lock use the winner's face for the line.")
;; allow View Mode to be activated in its buffer.
(put 'gomoku-mode 'mode-class 'special)
-(defun gomoku-mode ()
+(define-derived-mode gomoku-mode nil "Gomoku"
"Major mode for playing Gomoku against Emacs.
You and Emacs play in turn by marking a free square. You mark it with X
and Emacs marks it with O. The winner is the first to get five contiguous
marks horizontally, vertically or in diagonal.
-
+\\<gomoku-mode-map>
You play by moving the cursor over the square you choose and hitting \\[gomoku-human-plays].
-Other useful commands:
-\\{gomoku-mode-map}
-Entry to this mode calls the value of `gomoku-mode-hook' if that value
-is non-nil."
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'gomoku-mode
- mode-name "Gomoku")
+Other useful commands:\n
+\\{gomoku-mode-map}"
(gomoku-display-statistics)
- (use-local-map gomoku-mode-map)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(gomoku-font-lock-keywords t))
- (toggle-read-only t)
- (run-mode-hooks 'gomoku-mode-hook))
+ (toggle-read-only t))
\f
;;;
;;; THE BOARD.
;; ;;;;;;;;;;;;; customization variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgroup tetris nil
- "Play a game of tetris."
+ "Play a game of Tetris."
:prefix "tetris-"
:group 'games)
(defcustom tetris-update-speed-function
'tetris-default-update-speed-function
- "Function run whenever the Tetris score changes
+ "Function run whenever the Tetris score changes.
Called with two arguments: (SHAPES ROWS)
-SHAPES is the number of shapes which have been dropped
-ROWS is the number of rows which have been completed
+SHAPES is the number of shapes which have been dropped.
+ROWS is the number of rows which have been completed.
If the return value is a number, it is used as the timer period."
:group 'tetris
(defcustom tetris-tty-colors
[nil "blue" "white" "yellow" "magenta" "cyan" "green" "red"]
- "Vector of colors of the various shapes in text mode
+ "Vector of colors of the various shapes in text mode.
Element 0 is ignored."
:group 'tetris
:type (let ((names `("Shape 1" "Shape 2" "Shape 3"
(defcustom tetris-x-colors
[nil [0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]]
- "Vector of colors of the various shapes
+ "Vector of colors of the various shapes.
Element 0 is ignored."
:group 'tetris
:type 'sexp)
;; ;;;;;;;;;;;;; keymaps ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar tetris-mode-map
- (make-sparse-keymap 'tetris-mode-map))
-
-(define-key tetris-mode-map "n" 'tetris-start-game)
-(define-key tetris-mode-map "q" 'tetris-end-game)
-(define-key tetris-mode-map "p" 'tetris-pause-game)
-
-(define-key tetris-mode-map " " 'tetris-move-bottom)
-(define-key tetris-mode-map [left] 'tetris-move-left)
-(define-key tetris-mode-map [right] 'tetris-move-right)
-(define-key tetris-mode-map [up] 'tetris-rotate-prev)
-(define-key tetris-mode-map [down] 'tetris-rotate-next)
+ (let ((map (make-sparse-keymap 'tetris-mode-map)))
+ (define-key map "n" 'tetris-start-game)
+ (define-key map "q" 'tetris-end-game)
+ (define-key map "p" 'tetris-pause-game)
+
+ (define-key map " " 'tetris-move-bottom)
+ (define-key map [left] 'tetris-move-left)
+ (define-key map [right] 'tetris-move-right)
+ (define-key map [up] 'tetris-rotate-prev)
+ (define-key map [down] 'tetris-rotate-next)
+ map))
(defvar tetris-null-map
- (make-sparse-keymap 'tetris-null-map))
-
-(define-key tetris-null-map "n" 'tetris-start-game)
+ (let ((map (make-sparse-keymap 'tetris-null-map)))
+ (define-key map "n" 'tetris-start-game)
+ map))
;; ;;;;;;;;;;;;;;;; game functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tetris-shape-done)))))
(defun tetris-move-bottom ()
- "Drops the shape to the bottom of the playing area"
+ "Drop the shape to the bottom of the playing area."
(interactive)
(if (not tetris-paused)
(let ((hit nil))
(tetris-shape-done))))
(defun tetris-move-left ()
- "Moves the shape one square to the left"
+ "Move the shape one square to the left."
(interactive)
(unless (or (= tetris-pos-x 0)
tetris-paused)
(tetris-draw-shape)))
(defun tetris-move-right ()
- "Moves the shape one square to the right"
+ "Move the shape one square to the right."
(interactive)
(unless (or (= (+ tetris-pos-x (tetris-shape-width))
tetris-width)
(tetris-draw-shape)))
(defun tetris-rotate-prev ()
- "Rotates the shape clockwise"
+ "Rotate the shape clockwise."
(interactive)
(if (not tetris-paused)
(progn (tetris-erase-shape)
(tetris-draw-shape))))
(defun tetris-rotate-next ()
- "Rotates the shape anticlockwise"
+ "Rotate the shape anticlockwise."
(interactive)
(if (not tetris-paused)
(progn
(tetris-draw-shape))))
(defun tetris-end-game ()
- "Terminates the current game"
+ "Terminate the current game."
(interactive)
(gamegrid-kill-timer)
(use-local-map tetris-null-map)
(gamegrid-add-score tetris-score-file tetris-score))
(defun tetris-start-game ()
- "Starts a new game of Tetris"
+ "Start a new game of Tetris."
(interactive)
(tetris-reset-game)
(use-local-map tetris-mode-map)
(gamegrid-start-timer period 'tetris-update-game)))
(defun tetris-pause-game ()
- "Pauses (or resumes) the current game"
+ "Pause (or resume) the current game."
(interactive)
(setq tetris-paused (not tetris-paused))
(message (and tetris-paused "Game paused (press p to resume)")))
(put 'tetris-mode 'mode-class 'special)
-(defun tetris-mode ()
- "A mode for playing Tetris.
-
-tetris-mode keybindings:
- \\{tetris-mode-map}
-"
- (kill-all-local-variables)
+(define-derived-mode tetris-mode nil "Tetris"
+ "A mode for playing Tetris."
(add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t)
(use-local-map tetris-null-map)
- (setq major-mode 'tetris-mode)
- (setq mode-name "Tetris")
-
(unless (featurep 'emacs)
(setq mode-popup-menu
'("Tetris Commands"
["Resume" tetris-pause-game
(and (tetris-active-p) tetris-paused)])))
+ (setq show-trailing-whitespace nil)
+
(setq gamegrid-use-glyphs tetris-use-glyphs)
(setq gamegrid-use-color tetris-use-color)
- (gamegrid-init (tetris-display-options))
-
- (run-mode-hooks 'tetris-mode-hook))
+ (gamegrid-init (tetris-display-options)))
;;;###autoload
(defun tetris ()
"
(interactive)
+ (select-window (or (get-buffer-window tetris-buffer-name)
+ (selected-window)))
(switch-to-buffer tetris-buffer-name)
(gamegrid-kill-timer)
(tetris-mode)
"Additional expressions to highlight in Assembler mode.")
;;;###autoload
-(defun asm-mode ()
+(define-derived-mode asm-mode prog-mode "Assembler"
"Major mode for editing typical assembler code.
Features a private abbrev table and the following bindings:
Special commands:
\\{asm-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq mode-name "Assembler")
- (setq major-mode 'asm-mode)
(setq local-abbrev-table asm-mode-abbrev-table)
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults '(asm-font-lock-keywords))
+ (set (make-local-variable 'font-lock-defaults) '(asm-font-lock-keywords))
(set (make-local-variable 'indent-line-function) 'asm-indent-line)
;; Stay closer to the old TAB behavior (was tab-to-tab-stop).
(set (make-local-variable 'tab-always-indent) nil)
(setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
(make-local-variable 'comment-end)
(setq comment-end "")
- (setq fill-prefix "\t")
- (run-mode-hooks 'asm-mode-hook))
+ (setq fill-prefix "\t"))
(defun asm-indent-line ()
"Auto-indent the current line."
(defvar bug-reference-url-format nil
"Format used to turn a bug number into a URL.
The bug number is supplied as a string, so this should have a single %s.
-There is no default setting for this, it must be set per file.")
+This can also be a function designator; it is called without arguments
+ and should return a string.
+It can use `match-string' to get parts matched against
+`bug-reference-bug-regexp', specifically:
+ 1. issue kind (bug, patch, rfe &c)
+ 2. issue number.
+
+There is no default setting for this, it must be set per file.
+If you set it to a symbol in the file Local Variables section,
+you need to add a `bug-reference-url-format' property to it:
+\(put 'my-bug-reference-url-format 'bug-reference-url-format t)
+so that it is considered safe, see `enable-local-variables'.")
;;;###autoload
-(put 'bug-reference-url-format 'safe-local-variable 'stringp)
+(put 'bug-reference-url-format 'safe-local-variable
+ (lambda (s)
+ (or (stringp s)
+ (and (symbolp s)
+ (get s 'bug-reference-url-format)))))
(defconst bug-reference-bug-regexp
- "\\(?:[Bb]ug ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\)"
+ "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\)"
"Regular expression which matches bug references.")
(defun bug-reference-set-overlay-properties ()
(overlay-put overlay 'category 'bug-reference)
;; Don't put a link if format is undefined
(when bug-reference-url-format
- (overlay-put overlay 'bug-reference-url
- (format bug-reference-url-format
- (match-string-no-properties 1))))))))))
+ (overlay-put overlay 'bug-reference-url
+ (if (stringp bug-reference-url-format)
+ (format bug-reference-url-format
+ (match-string-no-properties 2))
+ (funcall bug-reference-url-format))))))))))
;; Taken from button.el.
(defun bug-reference-push-button (&optional pos use-mouse-action)
(interactive "*P")
(let ((c-echo-syntactic-information-p nil)
- final-pos close-paren-inserted)
+ final-pos close-paren-inserted found-delim)
(self-insert-command (prefix-numeric-value arg))
(setq final-pos (point))
- (c-save-buffer-state (c-parse-and-markup-<>-arglists
- c-restricted-<>-arglists
- <-pos)
+;;;; 2010-01-31: There used to be code here to put a syntax-table text
+;;;; property on the new < or > and its mate (if any) when they are template
+;;;; parens. This is now done in an after-change function.
- (when c-recognize-<>-arglists
- (if (eq last-command-event ?<)
- (when (and (progn
- (backward-char)
- (= (point)
- (progn
- (c-beginning-of-current-token)
- (point))))
+ ;; Indent the line if appropriate.
+ (when (and c-electric-flag c-syntactic-indentation c-recognize-<>-arglists)
+ (setq found-delim
+ (if (eq last-command-event ?<)
+ ;; If a <, basically see if it's got "template" before it .....
+ (or (and (progn
+ (backward-char)
+ (= (point)
+ (progn (c-beginning-of-current-token) (point))))
+ (progn
+ (c-backward-token-2)
+ (looking-at c-opt-<>-sexp-key)))
+ ;; ..... or is a C++ << operator.
+ (and (c-major-mode-is 'c++-mode)
+ (progn
+ (goto-char (1- final-pos))
+ (c-beginning-of-current-token)
+ (looking-at "<<"))
+ (>= (match-end 0) final-pos)))
+
+ ;; It's a >. Either a C++ >> operator. ......
+ (or (and (c-major-mode-is 'c++-mode)
(progn
- (c-backward-token-2)
- (looking-at c-opt-<>-sexp-key)))
- (c-mark-<-as-paren (1- final-pos)))
-
- ;; It's a ">". Check if there's an earlier "<" which either has
- ;; open paren syntax already or that can be recognized as an arglist
- ;; together with this ">". Note that this won't work in cases like
- ;; "template <x, a < b, y>" but they ought to be rare.
-
- (save-restriction
- ;; Narrow to avoid that `c-forward-<>-arglist' below searches past
- ;; our position.
- (narrow-to-region (point-min) final-pos)
-
- (while (and
- (progn
- (goto-char final-pos)
- (c-syntactic-skip-backward "^<;}" nil t)
- (eq (char-before) ?<))
- (progn
- (backward-char)
- ;; If the "<" already got open paren syntax we know we
- ;; have the matching closer. Handle it and exit the
- ;; loop.
- (if (looking-at "\\s\(")
- (progn
- (c-mark->-as-paren (1- final-pos))
- (setq close-paren-inserted t)
- nil)
- t))
+ (goto-char (1- final-pos))
+ (c-beginning-of-current-token)
+ (looking-at ">>"))
+ (>= (match-end 0) final-pos))
+ ;; ...., or search back for a < which isn't already marked as an
+ ;; opening template delimiter.
+ (save-restriction
+ (widen)
+ ;; Narrow to avoid `c-forward-<>-arglist' below searching past
+ ;; our position.
+ (narrow-to-region (point-min) final-pos)
+ (goto-char final-pos)
+ (while
+ (and
+ (progn
+ (c-syntactic-skip-backward "^<;}" nil t)
+ (eq (char-before) ?<))
+ (progn
+ (backward-char)
+ (looking-at "\\s\("))))
+ (and (eq (char-after) ?<)
+ (not (looking-at "\\s\("))
+ (progn (c-backward-syntactic-ws)
+ (c-simple-skip-symbol-backward))
+ (or (looking-at c-opt-<>-sexp-key)
+ (not (looking-at c-keywords-regexp)))))))))
- (progn
- (setq <-pos (point))
- (c-backward-syntactic-ws)
- (c-simple-skip-symbol-backward))
- (or (looking-at c-opt-<>-sexp-key)
- (not (looking-at c-keywords-regexp)))
-
- (let ((c-parse-and-markup-<>-arglists t)
- c-restricted-<>-arglists
- (containing-sexp
- (c-most-enclosing-brace (c-parse-state))))
- (when (and containing-sexp
- (progn (goto-char containing-sexp)
- (eq (char-after) ?\())
- (not (eq (get-text-property (point) 'c-type)
- 'c-decl-arg-start)))
- (setq c-restricted-<>-arglists t))
- (goto-char <-pos)
- (c-forward-<>-arglist nil))
-
- ;; Loop here if the "<" we found above belongs to a nested
- ;; angle bracket sexp. When we start over we'll find the
- ;; previous or surrounding sexp.
- (if (< (point) final-pos)
- t
- (setq close-paren-inserted t)
- nil)))))))
(goto-char final-pos)
-
- ;; Indent the line if appropriate.
- (when (and c-electric-flag c-syntactic-indentation)
- (backward-char)
- (when (prog1 (or (looking-at "\\s\(\\|\\s\)")
- (and (c-major-mode-is 'c++-mode)
- (progn
- (c-beginning-of-current-token)
- (looking-at "<<\\|>>"))
- (= (match-end 0) final-pos)))
- (goto-char final-pos))
- (indent-according-to-mode)))
-
- (when (and close-paren-inserted
- (not executing-kbd-macro)
- blink-paren-function)
- ;; Note: Most paren blink functions, such as the standard
- ;; `blink-matching-open', currently doesn't handle paren chars
- ;; marked with text properties very well. Maybe we should avoid
- ;; this call for the time being?
- (funcall blink-paren-function))))
+ (when found-delim
+ (indent-according-to-mode)
+ (when (and (eq (char-before) ?>)
+ (not executing-kbd-macro)
+ blink-paren-function)
+ ;; Note: Most paren blink functions, such as the standard
+ ;; `blink-matching-open', currently doesn't handle paren chars
+ ;; marked with text properties very well. Maybe we should avoid
+ ;; this call for the time being?
+ (funcall blink-paren-function)))))
(defun c-electric-paren (arg)
"Insert a parenthesis.
(interactive "p")
(or arg (setq arg 1))
+ (or (not (eq this-command 'c-beginning-of-defun))
+ (eq last-command 'c-beginning-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
+
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
(start (point))
(interactive "p")
(or arg (setq arg 1))
+ (or (not (eq this-command 'c-end-of-defun))
+ (eq last-command 'c-end-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
+
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
(start (point))
;; Emacs.
`(remove-text-properties ,from ,to '(,property nil))))
+(defmacro c-search-forward-char-property (property value &optional limit)
+ "Search forward for a text-property PROPERTY having value VALUE.
+LIMIT bounds the search. The comparison is done with `equal'.
+
+Leave point just after the character, and set the match data on
+this character, and return point. If VALUE isn't found, Return
+nil; point is then left undefined."
+ `(let ((place (point)))
+ (while
+ (and
+ (< place ,(or limit '(point-max)))
+ (not (equal (get-text-property place ,property) ,value)))
+ (setq place (next-single-property-change
+ place ,property nil ,(or limit '(point-max)))))
+ (when (< place ,(or limit '(point-max)))
+ (goto-char place)
+ (search-forward-regexp ".") ; to set the match-data.
+ (point))))
+
+(defmacro c-search-backward-char-property (property value &optional limit)
+ "Search backward for a text-property PROPERTY having value VALUE.
+LIMIT bounds the search. The comparison is done with `equal'.
+
+Leave point just before the character, set the match data on this
+character, and return point. If VALUE isn't found, Return nil;
+point is then left undefined."
+ `(let ((place (point)))
+ (while
+ (and
+ (> place ,(or limit '(point-min)))
+ (not (equal (get-text-property (1- place) ,property) ,value)))
+ (setq place (previous-single-property-change
+ place ,property nil ,(or limit '(point-min)))))
+ (when (> place ,(or limit '(point-max)))
+ (goto-char place)
+ (search-backward-regexp ".") ; to set the match-data.
+ (point))))
+
(defun c-clear-char-property-with-value-function (from to property value)
"Remove all text-properties PROPERTY from the region (FROM, TO)
which have the value VALUE, as tested by `equal'. These
(goto-char (point-max)))))
(defconst c-<-as-paren-syntax '(4 . ?>))
+(put 'c-<-as-paren-syntax 'syntax-table c-<-as-paren-syntax)
(defsubst c-mark-<-as-paren (pos)
- ;; Mark the "<" character at POS as an sexp list opener using the
- ;; syntax-table property.
+ ;; Mark the "<" character at POS as a template opener using the
+ ;; `syntax-table' property via the `category' property.
;;
- ;; This function does a hidden buffer change.
- (c-put-char-property pos 'syntax-table c-<-as-paren-syntax))
+ ;; This function does a hidden buffer change. Note that we use
+ ;; indirection through the `category' text property. This allows us to
+ ;; toggle the property in all template brackets simultaneously and
+ ;; cheaply. We use this, for instance, in `c-parse-state'.
+ (c-put-char-property pos 'category 'c-<-as-paren-syntax))
(defconst c->-as-paren-syntax '(5 . ?<))
+(put 'c->-as-paren-syntax 'syntax-table c->-as-paren-syntax)
(defsubst c-mark->-as-paren (pos)
;; Mark the ">" character at POS as an sexp list closer using the
;; syntax-table property.
;;
- ;; This function does a hidden buffer change.
- (c-put-char-property pos 'syntax-table c->-as-paren-syntax))
-
+ ;; This function does a hidden buffer change. Note that we use
+ ;; indirection through the `category' text property. This allows us to
+ ;; toggle the property in all template brackets simultaneously and
+ ;; cheaply. We use this, for instance, in `c-parse-state'.
+ (c-put-char-property pos 'category 'c->-as-paren-syntax))
+
+(defsubst c-unmark-<->-as-paren (pos)
+ ;; Unmark the "<" or "<" character at POS as an sexp list opener using
+ ;; the syntax-table property indirectly through the `category' text
+ ;; property.
+ ;;
+ ;; This function does a hidden buffer change. Note that we use
+ ;; indirection through the `category' text property. This allows us to
+ ;; toggle the property in all template brackets simultaneously and
+ ;; cheaply. We use this, for instance, in `c-parse-state'.
+ (c-clear-char-property pos 'category))
+
+(defsubst c-suppress-<->-as-parens ()
+ ;; Suppress the syntactic effect of all marked < and > as parens. Note
+ ;; that this effect is NOT buffer local. You should probably not use
+ ;; this directly, but only through the macro
+ ;; `c-with-<->-as-parens-suppressed'
+ (put 'c-<-as-paren-syntax 'syntax-table nil)
+ (put 'c->-as-paren-syntax 'syntax-table nil))
+
+(defsubst c-restore-<->-as-parens ()
+ ;; Restore the syntactic effect of all marked <s and >s as parens. This
+ ;; has no effect on unmarked <s and >s
+ (put 'c-<-as-paren-syntax 'syntax-table c-<-as-paren-syntax)
+ (put 'c->-as-paren-syntax 'syntax-table c->-as-paren-syntax))
+
+(defmacro c-with-<->-as-parens-suppressed (&rest forms)
+ ;; Like progn, except that the paren property is suppressed on all
+ ;; template brackets whilst they are running. This macro does a hidden
+ ;; buffer change.
+ `(unwind-protect
+ (progn
+ (c-suppress-<->-as-parens)
+ ,@forms)
+ (c-restore-<->-as-parens)))
+
+;;;;;;;;;;;;;;;
+
+(defconst c-cpp-delimiter '(14)) ; generic comment syntax
+;; This is the value of the `category' text property placed on every #
+;; which introduces a CPP construct and every EOL (or EOB, or character
+;; preceding //, etc.) which terminates it. We can instantly "comment
+;; out" all CPP constructs by giving `c-cpp-delimiter' a syntax-table
+;; propery '(14) (generic comment delimiter).
+(defmacro c-set-cpp-delimiters (beg end)
+ ;; This macro does a hidden buffer change.
+ `(progn
+ (c-put-char-property ,beg 'category 'c-cpp-delimiter)
+ (if (< ,end (point-max))
+ (c-put-char-property ,end 'category 'c-cpp-delimiter))))
+(defmacro c-clear-cpp-delimiters (beg end)
+ ;; This macro does a hidden buffer change.
+ `(progn
+ (c-clear-char-property ,beg 'category)
+ (if (< ,end (point-max))
+ (c-clear-char-property ,end 'category))))
+
+(defsubst c-comment-out-cpps ()
+ ;; Render all preprocessor constructs syntactically commented out.
+ (put 'c-cpp-delimiter 'syntax-table c-cpp-delimiter))
+(defsubst c-uncomment-out-cpps ()
+ ;; Restore the syntactic visibility of preprocessor constructs.
+ (put 'c-cpp-delimiter 'syntax-table nil))
+
+(defmacro c-with-cpps-commented-out (&rest forms)
+ ;; Execute FORMS... whilst the syntactic effect of all characters in
+ ;; all CPP regions is suppressed. In particular, this is to suppress
+ ;; the syntactic significance of parens/braces/brackets to functions
+ ;; such as `scan-lists' and `parse-partial-sexp'.
+ `(unwind-protect
+ (c-save-buffer-state ()
+ (c-comment-out-cpps)
+ ,@forms)
+ (c-save-buffer-state ()
+ (c-uncomment-out-cpps))))
+
+(defmacro c-with-all-but-one-cpps-commented-out (beg end &rest forms)
+ ;; Execute FORMS... whilst the syntactic effect of all characters in
+ ;; every CPP region APART FROM THE ONE BETWEEN BEG and END is
+ ;; suppressed.
+ `(unwind-protect
+ (c-save-buffer-state ()
+ (c-clear-cpp-delimiters ,beg ,end)
+ ,`(c-with-cpps-commented-out ,@forms))
+ (c-save-buffer-state ()
+ (c-set-cpp-delimiters ,beg ,end))))
+\f
(defsubst c-intersect-lists (list alist)
;; return the element of ALIST that matches the first element found
;; in LIST. Uses assq.
;; Note: This doc is for internal use only. Other packages should not
;; assume that these text properties are used as described here.
;;
+;; 'category
+;; Used for "indirection". With its help, some other property can
+;; be cheaply and easily switched on or off everywhere it occurs.
+;;
;; 'syntax-table
;; Used to modify the syntax of some characters. It is used to
;; mark the "<" and ">" of angle bracket parens with paren syntax, and
(forward-char)
t))))
+(defun c-syntactic-end-of-macro ()
+ ;; Go to the end of a CPP directive, or a "safe" pos just before.
+ ;;
+ ;; This is normally the end of the next non-escaped line. A "safe"
+ ;; position is one not within a string or comment. (The EOL on a line
+ ;; comment is NOT "safe").
+ ;;
+ ;; This function must only be called from the beginning of a CPP construct.
+ ;;
+ ;; Note that this function might do hidden buffer changes. See the comment
+ ;; at the start of cc-engine.el for more info.
+ (let* ((here (point))
+ (there (progn (c-end-of-macro) (point)))
+ (s (parse-partial-sexp here there)))
+ (while (and (or (nth 3 s) ; in a string
+ (nth 4 s)) ; in a comment (maybe at end of line comment)
+ (> there here)) ; No infinite loops, please.
+ (setq there (1- (nth 8 s)))
+ (setq s (parse-partial-sexp here there)))
+ (point)))
+
(defun c-forward-over-cpp-define-id ()
;; Assuming point is at the "#" that introduces a preprocessor
;; directive, it's moved forward to the end of the identifier which is
\f
;; A system for finding noteworthy parens before the point.
+(defconst c-state-cache-too-far 5000)
+;; A maximum comfortable scanning distance, e.g. between
+;; `c-state-cache-good-pos' and "HERE" (where we call c-parse-state). When
+;; this distance is exceeded, we take "emergency meausures", e.g. by clearing
+;; the cache and starting again from point-min or a beginning of defun. This
+;; value can be tuned for efficiency or set to a lower value for testing.
+
(defvar c-state-cache nil)
(make-variable-buffer-local 'c-state-cache)
;; The state cache used by `c-parse-state' to cut down the amount of
-;; searching. It's the result from some earlier `c-parse-state' call.
+;; searching. It's the result from some earlier `c-parse-state' call. See
+;; `c-parse-state''s doc string for details of its structure.
;;
;; The use of the cached info is more effective if the next
;; `c-parse-state' call is on a line close by the one the cached state
;; most effective if `c-parse-state' is used on each line while moving
;; forward.
-(defvar c-state-cache-start 1)
-(make-variable-buffer-local 'c-state-cache-start)
-;; This is (point-min) when `c-state-cache' was calculated, since a
-;; change of narrowing is likely to affect the parens that are visible
-;; before the point.
-
(defvar c-state-cache-good-pos 1)
(make-variable-buffer-local 'c-state-cache-good-pos)
-;; This is a position where `c-state-cache' is known to be correct.
-;; It's a position inside one of the recorded unclosed parens or the
-;; top level, but not further nested inside any literal or subparen
-;; that is closed before the last recorded position.
+;; This is a position where `c-state-cache' is known to be correct, or
+;; nil (see below). It's a position inside one of the recorded unclosed
+;; parens or the top level, but not further nested inside any literal or
+;; subparen that is closed before the last recorded position.
;;
;; The exact position is chosen to try to be close to yet earlier than
;; the position where `c-state-cache' will be called next. Right now
;; closing paren (of any type) before the line on which
;; `c-parse-state' was called. That is chosen primarily to work well
;; with refontification of the current line.
+;;
+;; 2009-07-28: When `c-state-point-min' and the last position where
+;; `c-parse-state' or for which `c-invalidate-state-cache' was called, are
+;; both in the same literal, there is no such "good position", and
+;; c-state-cache-good-pos is then nil. This is the ONLY circumstance in which
+;; it can be nil. In this case, `c-state-point-min-literal' will be non-nil.
+;;
+;; 2009-06-12: In a brace desert, c-state-cache-good-pos may also be in
+;; the middle of the desert, as long as it is not within a brace pair
+;; recorded in `c-state-cache' or a paren/bracket pair.
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; We maintain a simple cache of positions which aren't in a literal, so as to
+;; speed up testing for non-literality.
+(defconst c-state-nonlit-pos-interval 10000)
+;; The approximate interval between entries in `c-state-nonlit-pos-cache'.
+
+(defvar c-state-nonlit-pos-cache nil)
+(make-variable-buffer-local 'c-state-nonlit-pos-cache)
+;; A list of buffer positions which are known not to be in a literal. This is
+;; ordered with higher positions at the front of the list. Only those which
+;; are less than `c-state-nonlit-pos-cache-limit' are valid.
+
+(defvar c-state-nonlit-pos-cache-limit 1)
+(make-variable-buffer-local 'c-state-nonlit-pos-cache-limit)
+;; An upper limit on valid entries in `c-state-nonlit-pos-cache'. This is
+;; reduced by buffer changes, and increased by invocations of
+;; `c-state-literal-at'.
+
+(defsubst c-state-pp-to-literal (from to)
+ ;; Do a parse-partial-sexp from FROM to TO, returning the bounds of any
+ ;; literal at TO as a cons, otherwise NIL.
+ ;; FROM must not be in a literal, and the buffer should already be wide
+ ;; enough.
+ (save-excursion
+ (let ((s (parse-partial-sexp from to)))
+ (when (or (nth 3 s) (nth 4 s)) ; in a string or comment
+ (parse-partial-sexp (point) (point-max)
+ nil ; TARGETDEPTH
+ nil ; STOPBEFORE
+ s ; OLDSTATE
+ 'syntax-table) ; stop at end of literal
+ (cons (nth 8 s) (point))))))
+
+(defun c-state-literal-at (here)
+ ;; If position HERE is inside a literal, return (START . END), the
+ ;; boundaries of the literal (which may be outside the accessible bit of the
+ ;; buffer). Otherwise, return nil.
+ ;;
+ ;; This function is almost the same as `c-literal-limits'. It differs in
+ ;; that it is a lower level function, and that it rigourously follows the
+ ;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe position.
+ (save-restriction
+ (widen)
+ (save-excursion
+ (let ((c c-state-nonlit-pos-cache)
+ pos npos lit)
+ ;; Trim the cache to take account of buffer changes.
+ (while (and c (> (car c) c-state-nonlit-pos-cache-limit))
+ (setq c (cdr c)))
+ (setq c-state-nonlit-pos-cache c)
+
+ (while (and c (> (car c) here))
+ (setq c (cdr c)))
+ (setq pos (or (car c) (point-min)))
+
+ (while (<= (setq npos (+ pos c-state-nonlit-pos-interval))
+ here)
+ (setq lit (c-state-pp-to-literal pos npos))
+ (setq pos (or (cdr lit) npos)) ; end of literal containing npos.
+ (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
+
+ (if (> pos c-state-nonlit-pos-cache-limit)
+ (setq c-state-nonlit-pos-cache-limit pos))
+ (if (< pos here)
+ (setq lit (c-state-pp-to-literal pos here)))
+ lit))))
+
+(defsubst c-state-lit-beg (pos)
+ ;; Return the start of the literal containing POS, or POS itself.
+ (or (car (c-state-literal-at pos))
+ pos))
+
+(defsubst c-state-cache-non-literal-place (pos state)
+ ;; Return a position outside of a string/comment at or before POS.
+ ;; STATE is the parse-partial-sexp state at POS.
+ (if (or (nth 3 state) ; in a string?
+ (nth 4 state)) ; in a comment?
+ (nth 8 state)
+ pos))
-(defsubst c-invalidate-state-cache (pos)
- ;; Invalidate all info on `c-state-cache' that applies to the buffer
- ;; at POS or higher. This is much like `c-whack-state-after', but
- ;; it never changes a paren pair element into an open paren element.
- ;; Doing that would mean that the new open paren wouldn't have the
- ;; required preceding paren pair element.
- (while (and (or c-state-cache
- (when (< pos c-state-cache-good-pos)
- (setq c-state-cache-good-pos 1)
- nil))
- (let ((elem (car c-state-cache)))
- (if (consp elem)
- (or (< pos (cdr elem))
- (when (< pos c-state-cache-good-pos)
- (setq c-state-cache-good-pos (cdr elem))
- nil))
- (or (<= pos elem)
- (when (< pos c-state-cache-good-pos)
- (setq c-state-cache-good-pos (1+ elem))
- nil)))))
- (setq c-state-cache (cdr c-state-cache))))
-
-(defun c-get-fallback-start-pos (here)
- ;; Return the start position for building `c-state-cache' from
- ;; scratch.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Stuff to do with point-min, and coping with any literal there.
+(defvar c-state-point-min 1)
+(make-variable-buffer-local 'c-state-point-min)
+;; This is (point-min) when `c-state-cache' was last calculated. A change of
+;; narrowing is likely to affect the parens that are visible before the point.
+
+(defvar c-state-point-min-lit-type nil)
+(make-variable-buffer-local 'c-state-point-min-lit-type)
+(defvar c-state-point-min-lit-start nil)
+(make-variable-buffer-local 'c-state-point-min-lit-start)
+;; These two variables define the literal, if any, containing point-min.
+;; Their values are, respectively, 'string, c, or c++, and the start of the
+;; literal. If there's no literal there, they're both nil.
+
+(defvar c-state-min-scan-pos 1)
+(make-variable-buffer-local 'c-state-min-scan-pos)
+;; This is the earliest buffer-pos from which scanning can be done. It is
+;; either the end of the literal containing point-min, or point-min itself.
+;; It becomes nil if the buffer is changed earlier than this point.
+(defun c-state-get-min-scan-pos ()
+ ;; Return the lowest valid scanning pos. This will be the end of the
+ ;; literal enclosing point-min, or point-min itself.
+ (or c-state-min-scan-pos
+ (save-restriction
+ (save-excursion
+ (widen)
+ (goto-char c-state-point-min-lit-start)
+ (if (eq c-state-point-min-lit-type 'string)
+ (forward-sexp)
+ (forward-comment 1))
+ (setq c-state-min-scan-pos (point))))))
+
+(defun c-state-mark-point-min-literal ()
+ ;; Determine the properties of any literal containing POINT-MIN, setting the
+ ;; variables `c-state-point-min-lit-type', `c-state-point-min-lit-start',
+ ;; and `c-state-min-scan-pos' accordingly. The return value is meaningless.
+ (let ((p-min (point-min))
+ lit)
+ (save-restriction
+ (widen)
+ (setq lit (c-state-literal-at p-min))
+ (if lit
+ (setq c-state-point-min-lit-type
+ (save-excursion
+ (goto-char (car lit))
+ (cond
+ ((looking-at c-block-comment-start-regexp) 'c)
+ ((looking-at c-line-comment-starter) 'c++)
+ (t 'string)))
+ c-state-point-min-lit-start (car lit)
+ c-state-min-scan-pos (cdr lit))
+ (setq c-state-point-min-lit-type nil
+ c-state-point-min-lit-start nil
+ c-state-min-scan-pos p-min)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; A variable which signals a brace dessert - helpful for reducing the number
+;; of fruitless backward scans.
+(defvar c-state-brace-pair-desert nil)
+(make-variable-buffer-local 'c-state-brace-pair-desert)
+;; Used only in `c-append-lower-brace-pair-to-state-cache'. It is set when an
+;; that defun has searched backwards for a brace pair and not found one. Its
+;; value is either nil or a cons (PA . FROM), where PA is the position of the
+;; enclosing opening paren/brace/bracket which bounds the backwards search (or
+;; nil when at top level) and FROM is where the backward search started. It
+;; is reset to nil in `c-invalidate-state-cache'.
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Lowish level functions/macros which work directly on `c-state-cache', or a
+;; list of like structure.
+(defmacro c-state-cache-top-lparen (&optional cache)
+ ;; Return the address of the top left brace/bracket/paren recorded in CACHE
+ ;; (default `c-state-cache') (or nil).
+ (let ((cash (or cache 'c-state-cache)))
+ `(if (consp (car ,cash))
+ (caar ,cash)
+ (car ,cash))))
+
+(defmacro c-state-cache-top-paren (&optional cache)
+ ;; Return the address of the latest brace/bracket/paren (whether left or
+ ;; right) recorded in CACHE (default `c-state-cache') or nil.
+ (let ((cash (or cache 'c-state-cache)))
+ `(if (consp (car ,cash))
+ (cdar ,cash)
+ (car ,cash))))
+
+(defmacro c-state-cache-after-top-paren (&optional cache)
+ ;; Return the position just after the latest brace/bracket/paren (whether
+ ;; left or right) recorded in CACHE (default `c-state-cache') or nil.
+ (let ((cash (or cache 'c-state-cache)))
+ `(if (consp (car ,cash))
+ (cdar ,cash)
+ (and (car ,cash)
+ (1+ (car ,cash))))))
+
+(defun c-get-cache-scan-pos (here)
+ ;; From the state-cache, determine the buffer position from which we might
+ ;; scan forward to HERE to update this cache. This position will be just
+ ;; after a paren/brace/bracket recorded in the cache, if possible, otherwise
+ ;; return the earliest position in the accessible region which isn't within
+ ;; a literal. If the visible portion of the buffer is entirely within a
+ ;; literal, return NIL.
+ (let ((c c-state-cache) elt)
+ ;(while (>= (or (c-state-cache-top-lparen c) 1) here)
+ (while (and c
+ (>= (c-state-cache-top-lparen c) here))
+ (setq c (cdr c)))
+
+ (setq elt (car c))
+ (cond
+ ((consp elt)
+ (if (> (cdr elt) here)
+ (1+ (car elt))
+ (cdr elt)))
+ (elt (1+ elt))
+ ((<= (c-state-get-min-scan-pos) here)
+ (c-state-get-min-scan-pos))
+ (t nil))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Variables which keep track of preprocessor constructs.
+(defvar c-state-old-cpp-beg nil)
+(make-variable-buffer-local 'c-state-old-cpp-beg)
+(defvar c-state-old-cpp-end nil)
+(make-variable-buffer-local 'c-state-old-cpp-end)
+;; These are the limits of the macro containing point at the previous call of
+;; `c-parse-state', or nil.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Defuns which analyse the buffer, yet don't change `c-state-cache'.
+(defun c-get-fallback-scan-pos (here)
+ ;; Return a start position for building `c-state-cache' from
+ ;; scratch. This will be at the top level, 2 defuns back.
(save-excursion
;; Go back 2 bods, but ignore any bogus positions returned by
;; beginning-of-defun (i.e. open paren in column zero).
(goto-char here)
(let ((cnt 2))
(while (not (or (bobp) (zerop cnt)))
- (c-beginning-of-defun-1)
+ (c-beginning-of-defun-1) ; Pure elisp BOD.
(if (eq (char-after) ?\{)
(setq cnt (1- cnt)))))
(point)))
-(defun c-parse-state ()
- ;; Find and record all noteworthy parens between some good point
- ;; earlier in the file and point. That good point is at least the
- ;; beginning of the top-level construct we are in, or the beginning
- ;; of the preceding top-level construct if we aren't in one.
- ;;
- ;; The returned value is a list of the noteworthy parens with the
- ;; last one first. If an element in the list is an integer, it's
- ;; the position of an open paren which has not been closed before
- ;; the point. If an element is a cons, it gives the position of a
- ;; closed brace paren pair; the car is the start paren position and
- ;; the cdr is the position following the closing paren. Only the
- ;; last closed brace paren pair before each open paren and before
- ;; the point is recorded, and thus the state never contains two cons
- ;; elements in succession.
+(defun c-state-balance-parens-backwards (here- here+ top)
+ ;; Return the position of the opening paren/brace/bracket before HERE- which
+ ;; matches the outermost close p/b/b between HERE+ and TOP. Except when
+ ;; there's a macro, HERE- and HERE+ are the same. Like this:
+ ;;
+ ;; ............................................
+ ;; | |
+ ;; ( [ ( .........#macro.. ) ( ) ] )
+ ;; ^ ^ ^ ^
+ ;; | | | |
+ ;; return HERE- HERE+ TOP
+ ;;
+ ;; If there aren't enough opening paren/brace/brackets, return the position
+ ;; of the outermost one found, or HERE- if there are none. If there are no
+ ;; closeing p/b/bs between HERE+ and TOP, return HERE-. HERE-/+ and TOP
+ ;; must not be inside literals. Only the accessible portion of the buffer
+ ;; will be scanned.
+
+ ;; PART 1: scan from `here+' up to `top', accumulating ")"s which enclose
+ ;; `here'. Go round the next loop each time we pass over such a ")". These
+ ;; probably match "("s before `here-'.
+ (let (pos pa ren+1 lonely-rens)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (point-min) top) ; This can move point, sometimes.
+ (setq pos here+)
+ (c-safe
+ (while
+ (setq ren+1 (scan-lists pos 1 1)) ; might signal
+ (setq lonely-rens (cons ren+1 lonely-rens)
+ pos ren+1)))))
+
+ ;; PART 2: Scan back before `here-' searching for the "("s
+ ;; matching/mismatching the ")"s found above. We only need to direct the
+ ;; caller to scan when we've encountered unmatched right parens.
+ (setq pos here-)
+ (when lonely-rens
+ (c-safe
+ (while
+ (and lonely-rens ; actual values aren't used.
+ (setq pa (scan-lists pos -1 1)))
+ (setq pos pa)
+ (setq lonely-rens (cdr lonely-rens)))))
+ pos))
+
+(defun c-parse-state-get-strategy (here good-pos)
+ ;; Determine the scanning strategy for adjusting `c-parse-state', attempting
+ ;; to minimise the amount of scanning. HERE is the pertinent position in
+ ;; the buffer, GOOD-POS is a position where `c-state-cache' (possibly with
+ ;; its head trimmed) is known to be good, or nil if there is no such
+ ;; position.
+ ;;
+ ;; The return value is a list, one of the following:
+ ;;
+ ;; o - ('forward CACHE-POS START-POINT) - scan forward from START-POINT,
+ ;; which is not less than CACHE-POS.
+ ;; o - ('backward CACHE-POS nil) - scan backwards (from HERE).
+ ;; o - ('BOD nil START-POINT) - scan forwards from START-POINT, which is at the
+ ;; top level.
+ ;; o - ('IN-LIT nil nil) - point is inside the literal containing point-min.
+ ;; , where CACHE-POS is the highest position recorded in `c-state-cache' at
+ ;; or below HERE.
+ (let ((cache-pos (c-get-cache-scan-pos here)) ; highest position below HERE in cache (or 1)
+ BOD-pos ; position of 2nd BOD before HERE.
+ strategy ; 'forward, 'backward, 'BOD, or 'IN-LIT.
+ start-point
+ how-far) ; putative scanning distance.
+ (setq good-pos (or good-pos (c-state-get-min-scan-pos)))
+ (cond
+ ((< here (c-state-get-min-scan-pos))
+ (setq strategy 'IN-LIT
+ start-point nil
+ cache-pos nil
+ how-far 0))
+ ((<= good-pos here)
+ (setq strategy 'forward
+ start-point (max good-pos cache-pos)
+ how-far (- here start-point)))
+ ((< (- good-pos here) (- here cache-pos)) ; FIXME!!! ; apply some sort of weighting.
+ (setq strategy 'backward
+ how-far (- good-pos here)))
+ (t
+ (setq strategy 'forward
+ how-far (- here cache-pos)
+ start-point cache-pos)))
+
+ ;; Might we be better off starting from the top level, two defuns back,
+ ;; instead?
+ (when (> how-far c-state-cache-too-far)
+ (setq BOD-pos (c-get-fallback-scan-pos here)) ; somewhat EXPENSIVE!!!
+ (if (< (- here BOD-pos) how-far)
+ (setq strategy 'BOD
+ start-point BOD-pos)))
+
+ (list
+ strategy
+ (and (memq strategy '(forward backward)) cache-pos)
+ (and (memq strategy '(forward BOD)) start-point))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Routines which change `c-state-cache' and associated values.
+(defun c-renarrow-state-cache ()
+ ;; The region (more precisely, point-min) has changed since we
+ ;; calculated `c-state-cache'. Amend `c-state-cache' accordingly.
+ (if (< (point-min) c-state-point-min)
+ ;; If point-min has MOVED BACKWARDS then we drop the state completely.
+ ;; It would be possible to do a better job here and recalculate the top
+ ;; only.
+ (progn
+ (c-state-mark-point-min-literal)
+ (setq c-state-cache nil
+ c-state-cache-good-pos c-state-min-scan-pos
+ c-state-brace-pair-desert nil))
+
+ ;; point-min has MOVED FORWARD.
+
+ ;; Is the new point-min inside a (different) literal?
+ (unless (and c-state-point-min-lit-start ; at prev. point-min
+ (< (point-min) (c-state-get-min-scan-pos)))
+ (c-state-mark-point-min-literal))
+
+ ;; Cut off a bit of the tail from `c-state-cache'.
+ (let ((ptr (cons nil c-state-cache))
+ pa)
+ (while (and (setq pa (c-state-cache-top-lparen (cdr ptr)))
+ (>= pa (point-min)))
+ (setq ptr (cdr ptr)))
+
+ (when (consp ptr)
+ (if (eq (cdr ptr) c-state-cache)
+ (setq c-state-cache nil
+ c-state-cache-good-pos c-state-min-scan-pos)
+ (setcdr ptr nil)
+ (setq c-state-cache-good-pos (1+ (c-state-cache-top-lparen))))
+ )))
+
+ (setq c-state-point-min (point-min)))
+
+(defun c-append-lower-brace-pair-to-state-cache (from &optional upper-lim)
+ ;; If there is a brace pair preceding FROM in the buffer (not necessarily
+ ;; immediately preceding), push a cons onto `c-state-cache' to represent it.
+ ;; FROM must not be inside a literal. If UPPER-LIM is non-nil, we append
+ ;; the highest brace pair whose "}" is below UPPER-LIM.
+ ;;
+ ;; Return non-nil when this has been done.
+ ;;
+ ;; This routine should be fast. Since it can get called a LOT, we maintain
+ ;; `c-state-brace-pair-desert', a small cache of "failures", such that we
+ ;; reduce the time wasted in repeated fruitless searches in brace deserts.
+ (save-excursion
+ (save-restriction
+ (let ((bra from) ce ; Positions of "{" and "}".
+ new-cons
+ (cache-pos (c-state-cache-top-lparen)) ; might be nil.
+ (macro-start-or-from
+ (progn (goto-char from)
+ (c-beginning-of-macro)
+ (point))))
+ (or upper-lim (setq upper-lim from))
+
+ ;; If we're essentially repeating a fruitless search, just give up.
+ (unless (and c-state-brace-pair-desert
+ (eq cache-pos (car c-state-brace-pair-desert))
+ (<= from (cdr c-state-brace-pair-desert)))
+ ;; Only search what we absolutely need to:
+ (if (and c-state-brace-pair-desert
+ (> from (cdr c-state-brace-pair-desert)))
+ (narrow-to-region (cdr c-state-brace-pair-desert) (point-max)))
+
+ ;; In the next pair of nested loops, the inner one moves back past a
+ ;; pair of (mis-)matching parens or brackets; the outer one moves
+ ;; back over a sequence of unmatched close brace/paren/bracket each
+ ;; time round.
+ (while
+ (progn
+ (c-safe
+ (while
+ (and (setq ce (scan-lists bra -1 -1)) ; back past )/]/}; might signal
+ (setq bra (scan-lists ce -1 1)) ; back past (/[/{; might signal
+ (or (> ce upper-lim)
+ (not (eq (char-after bra) ?\{))
+ (and (goto-char bra)
+ (c-beginning-of-macro)
+ (< (point) macro-start-or-from))))))
+ (and ce (< ce bra)))
+ (setq bra ce)) ; If we just backed over an unbalanced closing
+ ; brace, ignore it.
+
+ (if (and ce (< bra ce) (eq (char-after bra) ?\{))
+ ;; We've found the desired brace-pair.
+ (progn
+ (setq new-cons (cons bra (1+ ce)))
+ (cond
+ ((consp (car c-state-cache))
+ (setcar c-state-cache new-cons))
+ ((and (numberp (car c-state-cache)) ; probably never happens
+ (< ce (car c-state-cache)))
+ (setcdr c-state-cache
+ (cons new-cons (cdr c-state-cache))))
+ (t (setq c-state-cache (cons new-cons c-state-cache)))))
+
+ ;; We haven't found a brace pair. Record this.
+ (setq c-state-brace-pair-desert (cons cache-pos from))))))))
+
+(defsubst c-state-push-any-brace-pair (bra+1 macro-start-or-here)
+ ;; If BRA+1 is nil, do nothing. Otherwise, BRA+1 is the buffer position
+ ;; following a {, and that brace has a (mis-)matching } (or ]), and we
+ ;; "push" "a" brace pair onto `c-state-cache'.
+ ;;
+ ;; Here "push" means overwrite the top element if it's itself a brace-pair,
+ ;; otherwise push it normally.
+ ;;
+ ;; The brace pair we push is normally the one surrounding BRA+1, but if the
+ ;; latter is inside a macro, not being a macro containing
+ ;; MACRO-START-OR-HERE, we scan backwards through the buffer for a non-macro
+ ;; base pair. This latter case is assumed to be rare.
+ ;;
+ ;; Note: POINT is not preserved in this routine.
+ (if bra+1
+ (if (or (> bra+1 macro-start-or-here)
+ (progn (goto-char bra+1)
+ (not (c-beginning-of-macro))))
+ (setq c-state-cache
+ (cons (cons (1- bra+1)
+ (scan-lists bra+1 1 1))
+ (if (consp (car c-state-cache))
+ (cdr c-state-cache)
+ c-state-cache)))
+ ;; N.B. This defsubst codes one method for the simple, normal case,
+ ;; and a more sophisticated, slower way for the general case. Don't
+ ;; eliminate this defsubst - it's a speed optimisation.
+ (c-append-lower-brace-pair-to-state-cache (1- bra+1)))))
+
+(defun c-append-to-state-cache (from)
+ ;; Scan the buffer from FROM to (point-max), adding elements into
+ ;; `c-state-cache' for braces etc. Return a candidate for
+ ;; `c-state-cache-good-pos'.
+ ;;
+ ;; FROM must be after the latest brace/paren/bracket in `c-state-cache', if
+ ;; any. Typically, it is immediately after it. It must not be inside a
+ ;; literal.
+ (let ((here-bol (c-point 'bol (point-max)))
+ (macro-start-or-here
+ (save-excursion (goto-char (point-max))
+ (if (c-beginning-of-macro)
+ (point)
+ (point-max))))
+ pa+1 ; pos just after an opening PAren (or brace).
+ (ren+1 from) ; usually a pos just after an closing paREN etc.
+ ; Is actually the pos. to scan for a (/{/[ from,
+ ; which sometimes is after a silly )/}/].
+ paren+1 ; Pos after some opening or closing paren.
+ paren+1s ; A list of `paren+1's; used to determine a
+ ; good-pos.
+ bra+1 ce+1 ; just after L/R bra-ces.
+ bra+1s ; list of OLD values of bra+1.
+ mstart) ; start of a macro.
+
+ (save-excursion
+ ;; Each time round the following loop, we enter a succesively deeper
+ ;; level of brace/paren nesting. (Except sometimes we "continue at
+ ;; the existing level".) `pa+1' is a pos inside an opening
+ ;; brace/paren/bracket, usually just after it.
+ (while
+ (progn
+ ;; Each time round the next loop moves forward over an opening then
+ ;; a closing brace/bracket/paren. This loop is white hot, so it
+ ;; plays ugly tricks to go fast. DON'T PUT ANYTHING INTO THIS
+ ;; LOOP WHICH ISN'T ABSOLUTELY NECESSARY!!! It terminates when a
+ ;; call of `scan-lists' signals an error, which happens when there
+ ;; are no more b/b/p's to scan.
+ (c-safe
+ (while t
+ (setq pa+1 (scan-lists ren+1 1 -1) ; Into (/{/[; might signal
+ paren+1s (cons pa+1 paren+1s))
+ (setq ren+1 (scan-lists pa+1 1 1)) ; Out of )/}/]; might signal
+ (if (and (eq (char-before pa+1) ?{)) ; Check for a macro later.
+ (setq bra+1 pa+1))
+ (setcar paren+1s ren+1)))
+
+ (if (and pa+1 (> pa+1 ren+1))
+ ;; We've just entered a deeper nesting level.
+ (progn
+ ;; Insert the brace pair (if present) and the single open
+ ;; paren/brace/bracket into `c-state-cache' It cannot be
+ ;; inside a macro, except one around point, because of what
+ ;; `c-neutralize-syntax-in-CPP' has done.
+ (c-state-push-any-brace-pair bra+1 macro-start-or-here)
+ ;; Insert the opening brace/bracket/paren position.
+ (setq c-state-cache (cons (1- pa+1) c-state-cache))
+ ;; Clear admin stuff for the next more nested part of the scan.
+ (setq ren+1 pa+1 pa+1 nil bra+1 nil bra+1s nil)
+ t) ; Carry on the loop
+
+ ;; All open p/b/b's at this nesting level, if any, have probably
+ ;; been closed by matching/mismatching ones. We're probably
+ ;; finished - we just need to check for having found an
+ ;; unmatched )/}/], which we ignore. Such a )/}/] can't be in a
+ ;; macro, due the action of `c-neutralize-syntax-in-CPP'.
+ (c-safe (setq ren+1 (scan-lists ren+1 1 1)))))) ; acts as loop control.
+
+ ;; Record the final, innermost, brace-pair if there is one.
+ (c-state-push-any-brace-pair bra+1 macro-start-or-here)
+
+ ;; Determine a good pos
+ (while (and (setq paren+1 (car paren+1s))
+ (> (if (> paren+1 macro-start-or-here)
+ paren+1
+ (goto-char paren+1)
+ (setq mstart (and (c-beginning-of-macro)
+ (point)))
+ (or mstart paren+1))
+ here-bol))
+ (setq paren+1s (cdr paren+1s)))
+ (cond
+ ((and paren+1 mstart)
+ (min paren+1 mstart))
+ (paren+1)
+ (t from)))))
+
+(defun c-remove-stale-state-cache (good-pos pps-point)
+ ;; Remove stale entries from the `c-cache-state', i.e. those which will
+ ;; not be in it when it is amended for position (point-max).
+ ;; Additionally, the "outermost" open-brace entry before (point-max)
+ ;; will be converted to a cons if the matching close-brace is scanned.
+ ;;
+ ;; GOOD-POS is a "maximal" "safe position" - there must be no open
+ ;; parens/braces/brackets between GOOD-POS and (point-max).
+ ;;
+ ;; As a second thing, calculate the result of parse-partial-sexp at
+ ;; PPS-POINT, w.r.t. GOOD-POS. The motivation here is that
+ ;; `c-state-cache-good-pos' may become PPS-POINT, but the caller may need to
+ ;; adjust it to get outside a string/comment. (Sorry about this! The code
+ ;; needs to be FAST).
+ ;;
+ ;; Return a list (GOOD-POS SCAN-BACK-POS PPS-STATE), where
+ ;; o - GOOD-POS is a position where the new value `c-state-cache' is known
+ ;; to be good (we aim for this to be as high as possible);
+ ;; o - SCAN-BACK-POS, if not nil, indicates there may be a brace pair
+ ;; preceding POS which needs to be recorded in `c-state-cache'. It is a
+ ;; position to scan backwards from.
+ ;; o - PPS-STATE is the parse-partial-sexp state at PPS-POINT.
+ (save-restriction
+ (narrow-to-region 1 (point-max))
+ (save-excursion
+ (let* ((in-macro-start ; start of macro containing (point-max) or nil.
+ (save-excursion
+ (goto-char (point-max))
+ (and (c-beginning-of-macro)
+ (point))))
+ (good-pos-actual-macro-start ; Start of macro containing good-pos
+ ; or nil
+ (and (< good-pos (point-max))
+ (save-excursion
+ (goto-char good-pos)
+ (and (c-beginning-of-macro)
+ (point)))))
+ (good-pos-actual-macro-end ; End of this macro, (maybe
+ ; (point-max)), or nil.
+ (and good-pos-actual-macro-start
+ (save-excursion
+ (goto-char good-pos-actual-macro-start)
+ (c-end-of-macro)
+ (point))))
+ pps-state ; Will be 9 or 10 elements long.
+ pos
+ upper-lim ; ,beyond which `c-state-cache' entries are removed
+ scan-back-pos
+ pair-beg pps-point-state target-depth)
+
+ ;; Remove entries beyond (point-max). Also remove any entries inside
+ ;; a macro, unless (point-max) is in the same macro.
+ (setq upper-lim
+ (if (or (null c-state-old-cpp-beg)
+ (and (> (point-max) c-state-old-cpp-beg)
+ (< (point-max) c-state-old-cpp-end)))
+ (point-max)
+ (min (point-max) c-state-old-cpp-beg)))
+ (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim))
+ (setq c-state-cache (cdr c-state-cache)))
+ ;; If `upper-lim' is inside the last recorded brace pair, remove its
+ ;; RBrace and indicate we'll need to search backwards for a previous
+ ;; brace pair.
+ (when (and c-state-cache
+ (consp (car c-state-cache))
+ (> (cdar c-state-cache) upper-lim))
+ (setcar c-state-cache (caar c-state-cache))
+ (setq scan-back-pos (car c-state-cache)))
+
+ ;; The next loop jumps forward out of a nested level of parens each
+ ;; time round; the corresponding elements in `c-state-cache' are
+ ;; removed. `pos' is just after the brace-pair or the open paren at
+ ;; (car c-state-cache). There can be no open parens/braces/brackets
+ ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max),
+ ;; due to the interface spec to this function.
+ (setq pos (if (and good-pos-actual-macro-end
+ (not (eq good-pos-actual-macro-start
+ in-macro-start)))
+ (1+ good-pos-actual-macro-end) ; get outside the macro as
+ ; marked by a `category' text property.
+ good-pos))
+ (goto-char pos)
+ (while (and c-state-cache
+ (< (point) (point-max)))
+ (cond
+ ((null pps-state) ; first time through
+ (setq target-depth -1))
+ ((eq (car pps-state) target-depth) ; found closing ),},]
+ (setq target-depth (1- (car pps-state))))
+ ;; Do nothing when we've merely reached pps-point.
+ )
+
+ ;; Scan!
+ (setq pps-state
+ (parse-partial-sexp
+ (point) (if (< (point) pps-point) pps-point (point-max))
+ target-depth
+ nil pps-state))
+
+ (if (= (point) pps-point)
+ (setq pps-point-state pps-state))
+
+ (when (eq (car pps-state) target-depth)
+ (setq pos (point)) ; POS is now just after an R-paren/brace.
+ (cond
+ ((and (consp (car c-state-cache))
+ (eq (point) (cdar c-state-cache)))
+ ;; We've just moved out of the paren pair containing the brace-pair
+ ;; at (car c-state-cache). `pair-beg' is where the open paren is,
+ ;; and is potentially where the open brace of a cons in
+ ;; c-state-cache will be.
+ (setq pair-beg (car-safe (cdr c-state-cache))
+ c-state-cache (cdr-safe (cdr c-state-cache)))) ; remove {}pair + containing Lparen.
+ ((numberp (car c-state-cache))
+ (setq pair-beg (car c-state-cache)
+ c-state-cache (cdr c-state-cache))) ; remove this
+ ; containing Lparen
+ ((numberp (cadr c-state-cache))
+ (setq pair-beg (cadr c-state-cache)
+ c-state-cache (cddr c-state-cache))) ; Remove a paren pair
+ ; together with enclosed brace pair.
+ ;; (t nil) ; Ignore an unmated Rparen.
+ )))
+
+ (if (< (point) pps-point)
+ (setq pps-state (parse-partial-sexp (point) pps-point
+ nil nil ; TARGETDEPTH, STOPBEFORE
+ pps-state)))
+
+ ;; If the last paren pair we moved out of was actually a brace pair,
+ ;; insert it into `c-state-cache'.
+ (when (and pair-beg (eq (char-after pair-beg) ?{))
+ (if (consp (car-safe c-state-cache))
+ (setq c-state-cache (cdr c-state-cache)))
+ (setq c-state-cache (cons (cons pair-beg pos)
+ c-state-cache)))
+
+ (list pos scan-back-pos pps-state)))))
+
+(defun c-remove-stale-state-cache-backwards (here cache-pos)
+ ;; Strip stale elements of `c-state-cache' by moving backwards through the
+ ;; buffer, and inform the caller of the scenario detected.
+ ;;
+ ;; HERE is the position we're setting `c-state-cache' for.
+ ;; CACHE-POS is just after the latest recorded position in `c-state-cache'
+ ;; before HERE, or a position at or near point-min which isn't in a
+ ;; literal.
+ ;;
+ ;; This function must only be called only when (> `c-state-cache-good-pos'
+ ;; HERE). Usually the gap between CACHE-POS and HERE is large. It is thus
+ ;; optimised to eliminate (or minimise) scanning between these two
+ ;; positions.
+ ;;
+ ;; Return a three element list (GOOD-POS SCAN-BACK-POS FWD-FLAG), where:
+ ;; o - GOOD-POS is a "good position", where `c-state-cache' is valid, or
+ ;; could become so after missing elements are inserted into
+ ;; `c-state-cache'. This is JUST AFTER an opening or closing
+ ;; brace/paren/bracket which is already in `c-state-cache' or just before
+ ;; one otherwise. exceptionally (when there's no such b/p/b handy) the BOL
+ ;; before `here''s line, or the start of the literal containing it.
+ ;; o - SCAN-BACK-POS, if non-nil, indicates there may be a brace pair
+ ;; preceding POS which isn't recorded in `c-state-cache'. It is a position
+ ;; to scan backwards from.
+ ;; o - FWD-FLAG, if non-nil, indicates there may be parens/braces between
+ ;; POS and HERE which aren't recorded in `c-state-cache'.
+ ;;
+ ;; The comments in this defun use "paren" to mean parenthesis or square
+ ;; bracket (as contrasted with a brace), and "(" and ")" likewise.
+ ;;
+ ;; . {..} (..) (..) ( .. { } ) (...) ( .... . ..)
+ ;; | | | | | |
+ ;; CP E here D C good
+ (let ((pos c-state-cache-good-pos)
+ pa ren ; positions of "(" and ")"
+ dropped-cons ; whether the last element dropped from `c-state-cache'
+ ; was a cons (representing a brace-pair)
+ good-pos ; see above.
+ lit ; (START . END) of a literal containing some point.
+ here-lit-start here-lit-end ; bounds of literal containing `here'
+ ; or `here' itself.
+ here- here+ ; start/end of macro around HERE, or HERE
+ (here-bol (c-point 'bol here))
+ (too-far-back (max (- here c-state-cache-too-far) 1)))
+
+ ;; Remove completely irrelevant entries from `c-state-cache'.
+ (while (and c-state-cache
+ (>= (setq pa (c-state-cache-top-lparen)) here))
+ (setq dropped-cons (consp (car c-state-cache)))
+ (setq c-state-cache (cdr c-state-cache))
+ (setq pos pa))
+ ;; At this stage, (> pos here);
+ ;; (< (c-state-cache-top-lparen) here) (or is nil).
+
+ (cond
+ ((and (consp (car c-state-cache))
+ (> (cdar c-state-cache) here))
+ ;; CASE 1: The top of the cache is a brace pair which now encloses
+ ;; `here'. As good-pos, return the address. of the "{". Since we've no
+ ;; knowledge of what's inside these braces, we have no alternative but
+ ;; to direct the caller to scan the buffer from the opening brace.
+ (setq pos (caar c-state-cache))
+ (setcar c-state-cache pos)
+ (list (1+ pos) pos t)) ; return value. We've just converted a brace pair
+ ; entry into a { entry, so the caller needs to
+ ; search for a brace pair before the {.
+
+ ;; `here' might be inside a literal. Check for this.
+ ((progn
+ (setq lit (c-state-literal-at here)
+ here-lit-start (or (car lit) here)
+ here-lit-end (or (cdr lit) here))
+ ;; Has `here' just "newly entered" a macro?
+ (save-excursion
+ (goto-char here-lit-start)
+ (if (and (c-beginning-of-macro)
+ (or (null c-state-old-cpp-beg)
+ (not (= (point) c-state-old-cpp-beg))))
+ (progn
+ (setq here- (point))
+ (c-end-of-macro)
+ (setq here+ (point)))
+ (setq here- here-lit-start
+ here+ here-lit-end)))
+
+ ;; `here' might be nested inside any depth of parens (or brackets but
+ ;; not braces). Scan backwards to find the outermost such opening
+ ;; paren, if there is one. This will be the scan position to return.
+ (save-restriction
+ (narrow-to-region cache-pos (point-max))
+ (setq pos (c-state-balance-parens-backwards here- here+ pos)))
+ nil)) ; for the cond
+
+ ((< pos here-lit-start)
+ ;; CASE 2: Address of outermost ( or [ which now encloses `here', but
+ ;; didn't enclose the (previous) `c-state-cache-good-pos'. If there is
+ ;; a brace pair preceding this, it will already be in `c-state-cache',
+ ;; unless there was a brace pair after it, i.e. there'll only be one to
+ ;; scan for if we've just deleted one.
+ (list pos (and dropped-cons pos) t)) ; Return value.
+
+ ;; `here' isn't enclosed in a (previously unrecorded) bracket/paren.
+ ;; Further forward scanning isn't needed, but we still need to find a
+ ;; GOOD-POS. Step out of all enclosing "("s on HERE's line.
+ ((progn
+ (save-restriction
+ (narrow-to-region here-bol (point-max))
+ (setq pos here-lit-start)
+ (c-safe (while (setq pa (scan-lists pos -1 1))
+ (setq pos pa)))) ; might signal
+ nil)) ; for the cond
+
+ ((setq ren (c-safe-scan-lists pos -1 -1 too-far-back))
+ ;; CASE 3: After a }/)/] before `here''s BOL.
+ (list (1+ ren) (and dropped-cons pos) nil)) ; Return value
+
+ (t
+ ;; CASE 4; Best of a bad job: BOL before `here-bol', or beginning of
+ ;; literal containing it.
+ (setq good-pos (c-state-lit-beg (c-point 'bopl here-bol)))
+ (list good-pos (and dropped-cons good-pos) nil)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Externally visible routines.
+
+(defun c-state-cache-init ()
+ (setq c-state-cache nil
+ c-state-cache-good-pos 1
+ c-state-nonlit-pos-cache nil
+ c-state-nonlit-pos-cache-limit 1
+ c-state-brace-pair-desert nil
+ c-state-point-min 1
+ c-state-point-min-lit-type nil
+ c-state-point-min-lit-start nil
+ c-state-min-scan-pos 1
+ c-state-old-cpp-beg nil
+ c-state-old-cpp-end nil)
+ (c-state-mark-point-min-literal))
+
+(defun c-invalidate-state-cache-1 (here)
+ ;; Invalidate all info on `c-state-cache' that applies to the buffer at HERE
+ ;; or higher and set `c-state-cache-good-pos' accordingly. The cache is
+ ;; left in a consistent state.
+ ;;
+ ;; This is much like `c-whack-state-after', but it never changes a paren
+ ;; pair element into an open paren element. Doing that would mean that the
+ ;; new open paren wouldn't have the required preceding paren pair element.
+ ;;
+ ;; This function is called from c-after-change.
+
+ ;; The cache of non-literals:
+ (if (< here c-state-nonlit-pos-cache-limit)
+ (setq c-state-nonlit-pos-cache-limit here))
+
+ ;; `c-state-cache':
+ ;; Case 1: if `here' is in a literal containing point-min, everything
+ ;; becomes (or is already) nil.
+ (if (or (null c-state-cache-good-pos)
+ (< here (c-state-get-min-scan-pos)))
+ (setq c-state-cache nil
+ c-state-cache-good-pos nil
+ c-state-min-scan-pos nil)
+
+;;; Truncate `c-state-cache' and set `c-state-cache-good-pos' to a value below
+;;; `here'. To maintain its consistency, we may need to insert a new brace
+;;; pair.
+ (let ((here-bol (c-point 'bol here))
+ too-high-pa ; recorded {/(/[ next above here, or nil.
+ dropped-cons ; was the last removed element a brace pair?
+ pa)
+ ;; The easy bit - knock over-the-top bits off `c-state-cache'.
+ (while (and c-state-cache
+ (>= (setq pa (c-state-cache-top-paren)) here))
+ (setq dropped-cons (consp (car c-state-cache))
+ too-high-pa (c-state-cache-top-lparen)
+ c-state-cache (cdr c-state-cache)))
+
+ ;; Do we need to add in an earlier brace pair, having lopped one off?
+ (if (and dropped-cons
+ (< too-high-pa (+ here c-state-cache-too-far)))
+ (c-append-lower-brace-pair-to-state-cache too-high-pa here-bol))
+ (setq c-state-cache-good-pos (or (c-state-cache-after-top-paren)
+ (c-state-get-min-scan-pos)))))
+
+ ;; The brace-pair desert marker:
+ (when (car c-state-brace-pair-desert)
+ (if (< here (car c-state-brace-pair-desert))
+ (setq c-state-brace-pair-desert nil)
+ (if (< here (cdr c-state-brace-pair-desert))
+ (setcdr c-state-brace-pair-desert here)))))
+
+(defun c-parse-state-1 ()
+ ;; Find and record all noteworthy parens between some good point earlier in
+ ;; the file and point. That good point is at least the beginning of the
+ ;; top-level construct we are in, or the beginning of the preceding
+ ;; top-level construct if we aren't in one.
+ ;;
+ ;; The returned value is a list of the noteworthy parens with the last one
+ ;; first. If an element in the list is an integer, it's the position of an
+ ;; open paren (of any type) which has not been closed before the point. If
+ ;; an element is a cons, it gives the position of a closed BRACE paren
+ ;; pair[*]; the car is the start brace position and the cdr is the position
+ ;; following the closing brace. Only the last closed brace paren pair
+ ;; before each open paren and before the point is recorded, and thus the
+ ;; state never contains two cons elements in succession. When a close brace
+ ;; has no matching open brace (e.g., the matching brace is outside the
+ ;; visible region), it is not represented in the returned value.
+ ;;
+ ;; [*] N.B. The close "brace" might be a mismatching close bracket or paren.
+ ;; This defun explicitly treats mismatching parens/braces/brackets as
+ ;; matching. It is the open brace which makes it a "brace" pair.
+ ;;
+ ;; If POINT is within a macro, open parens and brace pairs within
+ ;; THIS macro MIGHT be recorded. This depends on whether their
+ ;; syntactic properties have been suppressed by
+ ;; `c-neutralize-syntax-in-CPP'. This might need fixing (2008-12-11).
;;
;; Currently no characters which are given paren syntax with the
;; syntax-table property are recorded, i.e. angle bracket arglist
;; parens are never present here. Note that this might change.
;;
;; BUG: This function doesn't cope entirely well with unbalanced
- ;; parens in macros. E.g. in the following case the brace before
- ;; the macro isn't balanced with the one after it:
+ ;; parens in macros. (2008-12-11: this has probably been resolved
+ ;; by the function `c-neutralize-syntax-in-CPP'.) E.g. in the
+ ;; following case the brace before the macro isn't balanced with the
+ ;; one after it:
;;
;; {
;; #define X {
;; }
;;
+ ;; Note to maintainers: this function DOES get called with point
+ ;; within comments and strings, so don't assume it doesn't!
+ ;;
;; This function might do hidden buffer changes.
+ (let* ((here (point))
+ (here-bopl (c-point 'bopl))
+ strategy ; 'forward, 'backward etc..
+ ;; Candidate positions to start scanning from:
+ cache-pos ; highest position below HERE already existing in
+ ; cache (or 1).
+ good-pos
+ start-point
+ bopl-state
+ res
+ scan-backward-pos scan-forward-p) ; used for 'backward.
+ ;; If POINT-MIN has changed, adjust the cache
+ (unless (= (point-min) c-state-point-min)
+ (c-renarrow-state-cache))
+
+ ;; Strategy?
+ (setq res (c-parse-state-get-strategy here c-state-cache-good-pos)
+ strategy (car res)
+ cache-pos (cadr res)
+ start-point (nth 2 res))
+
+ (when (eq strategy 'BOD)
+ (setq c-state-cache nil
+ c-state-cache-good-pos start-point))
+
+ ;; SCAN!
+ (save-restriction
+ (cond
+ ((memq strategy '(forward BOD))
+ (narrow-to-region (point-min) here)
+ (setq res (c-remove-stale-state-cache start-point here-bopl))
+ (setq cache-pos (car res)
+ scan-backward-pos (cadr res)
+ bopl-state (car (cddr res))) ; will be nil if (< here-bopl
+ ; start-point)
+ (if scan-backward-pos
+ (c-append-lower-brace-pair-to-state-cache scan-backward-pos))
+ (setq good-pos
+ (c-append-to-state-cache cache-pos))
+ (setq c-state-cache-good-pos
+ (if (and bopl-state
+ (< good-pos (- here c-state-cache-too-far)))
+ (c-state-cache-non-literal-place here-bopl bopl-state)
+ good-pos)))
+
+ ((eq strategy 'backward)
+ (setq res (c-remove-stale-state-cache-backwards here cache-pos)
+ good-pos (car res)
+ scan-backward-pos (cadr res)
+ scan-forward-p (car (cddr res)))
+ (if scan-backward-pos
+ (c-append-lower-brace-pair-to-state-cache
+ scan-backward-pos))
+ (setq c-state-cache-good-pos
+ (if scan-forward-p
+ (progn (narrow-to-region (point-min) here)
+ (c-append-to-state-cache good-pos))
+
+ (c-get-cache-scan-pos good-pos))))
+
+ (t ; (eq strategy 'IN-LIT)
+ (setq c-state-cache nil
+ c-state-cache-good-pos nil)))))
+
+ c-state-cache)
+
+(defun c-invalidate-state-cache (here)
+ ;; This is a wrapper over `c-invalidate-state-cache-1'.
+ ;;
+ ;; It suppresses the syntactic effect of the < and > (template) brackets and
+ ;; of all parens in preprocessor constructs, except for any such construct
+ ;; containing point. We can then call `c-invalidate-state-cache-1' without
+ ;; worrying further about macros and template delimiters.
+ (c-with-<->-as-parens-suppressed
+ (if (and c-state-old-cpp-beg
+ (< c-state-old-cpp-beg here))
+ (c-with-all-but-one-cpps-commented-out
+ c-state-old-cpp-beg
+ (min c-state-old-cpp-end here)
+ (c-invalidate-state-cache-1 here))
+ (c-with-cpps-commented-out
+ (c-invalidate-state-cache-1 here)))))
- (save-restriction
- (let* ((here (point))
- (here-bol (c-point 'bol))
- (c-macro-start (c-query-macro-start))
- (in-macro-start (or c-macro-start (point)))
- old-state last-pos brace-pair-open brace-pair-close
- pos save-pos)
- (c-invalidate-state-cache here)
-
- ;; If the minimum position has changed due to narrowing then we
- ;; have to fix the tail of `c-state-cache' accordingly.
- (unless (= c-state-cache-start (point-min))
- (if (> (point-min) c-state-cache-start)
- ;; If point-min has moved forward then we just need to cut
- ;; off a bit of the tail.
- (let ((ptr (cons nil c-state-cache)) elem)
- (while (and (setq elem (car-safe (cdr ptr)))
- (>= (if (consp elem) (car elem) elem)
- (point-min)))
- (setq ptr (cdr ptr)))
- (when (consp ptr)
- (if (eq (cdr ptr) c-state-cache)
- (setq c-state-cache nil
- c-state-cache-good-pos 1)
- (setcdr ptr nil))))
- ;; If point-min has moved backward then we drop the state
- ;; completely. It's possible to do a better job here and
- ;; recalculate the top only.
- (setq c-state-cache nil
- c-state-cache-good-pos 1))
- (setq c-state-cache-start (point-min)))
-
- ;; Get the latest position we know are directly inside the
- ;; closest containing paren of the cached state.
- (setq last-pos (and c-state-cache
- (if (consp (car c-state-cache))
- (cdr (car c-state-cache))
- (1+ (car c-state-cache)))))
- (if (or (not last-pos)
- (< last-pos c-state-cache-good-pos))
- (setq last-pos c-state-cache-good-pos)
- ;; Take the opportunity to move the cached good position
- ;; further down.
- (if (< last-pos here-bol)
- (setq c-state-cache-good-pos last-pos)))
+(defun c-parse-state ()
+ ;; This is a wrapper over `c-parse-state-1'. See that function for a
+ ;; description of the functionality and return value.
+ ;;
+ ;; It suppresses the syntactic effect of the < and > (template) brackets and
+ ;; of all parens in preprocessor constructs, except for any such construct
+ ;; containing point. We can then call `c-parse-state-1' without worrying
+ ;; further about macros and template delimiters.
+ (let (here-cpp-beg here-cpp-end)
+ (save-excursion
+ (when (c-beginning-of-macro)
+ (setq here-cpp-beg (point))
+ (unless
+ (> (setq here-cpp-end (c-syntactic-end-of-macro))
+ here-cpp-beg)
+ (setq here-cpp-beg nil here-cpp-end nil))))
+ ;; FIXME!!! Put in a `condition-case' here to protect the integrity of the
+ ;; subsystem.
+ (prog1
+ (c-with-<->-as-parens-suppressed
+ (if (and here-cpp-beg (> here-cpp-end here-cpp-beg))
+ (c-with-all-but-one-cpps-commented-out
+ here-cpp-beg here-cpp-end
+ (c-parse-state-1))
+ (c-with-cpps-commented-out
+ (c-parse-state-1))))
+ (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t))
+ c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t)))
+ )))
- ;; Check if `last-pos' is in a macro. If it is, and we're not
- ;; in the same macro, we must discard everything on
- ;; `c-state-cache' that is inside the macro before using it.
- (save-excursion
- (goto-char last-pos)
- (when (and (c-beginning-of-macro)
- (/= (point) in-macro-start))
- (c-invalidate-state-cache (point))
- ;; Set `last-pos' again just like above except that there's
- ;; no use looking at `c-state-cache-good-pos' here.
- (setq last-pos (if c-state-cache
- (if (consp (car c-state-cache))
- (cdr (car c-state-cache))
- (1+ (car c-state-cache)))
- 1))))
-
- ;; If we've moved very far from the last cached position then
- ;; it's probably better to redo it from scratch, otherwise we
- ;; might spend a lot of time searching from `last-pos' down to
- ;; here.
- (when (< last-pos (- here 20000))
- ;; First get the fallback start position. If it turns out
- ;; that it's so far back that the cached state is closer then
- ;; we'll keep it afterall.
- (setq pos (c-get-fallback-start-pos here))
- (if (<= pos last-pos)
- (setq pos nil)
- (setq last-pos nil
- c-state-cache nil
- c-state-cache-good-pos 1)))
-
- ;; Find the start position for the forward search. (Can't
- ;; search in the backward direction since the point might be in
- ;; some kind of literal.)
-
- (unless pos
- (setq old-state c-state-cache)
-
- ;; There's a cached state with a containing paren. Pop off
- ;; the stale containing sexps from it by going forward out of
- ;; parens as far as possible.
- (narrow-to-region (point-min) here)
- (let (placeholder pair-beg)
- (while (and c-state-cache
- (setq placeholder
- (c-up-list-forward last-pos)))
- (setq last-pos placeholder)
- (if (consp (car c-state-cache))
- (setq pair-beg (car-safe (cdr c-state-cache))
- c-state-cache (cdr-safe (cdr c-state-cache)))
- (setq pair-beg (car c-state-cache)
- c-state-cache (cdr c-state-cache))))
-
- (when (and pair-beg (eq (char-after pair-beg) ?{))
- ;; The last paren pair we moved out from was a brace
- ;; pair. Modify the state to record this as a closed
- ;; pair now.
- (if (consp (car-safe c-state-cache))
- (setq c-state-cache (cdr c-state-cache)))
- (setq c-state-cache (cons (cons pair-beg last-pos)
- c-state-cache))))
-
- ;; Check if the preceding balanced paren is within a
- ;; macro; it should be ignored if we're outside the
- ;; macro. There's no need to check any further upwards;
- ;; if the macro contains an unbalanced opening paren then
- ;; we're smoked anyway.
- (when (and (<= (point) in-macro-start)
- (consp (car c-state-cache)))
- (save-excursion
- (goto-char (car (car c-state-cache)))
- (when (c-beginning-of-macro)
- (setq here (point)
- c-state-cache (cdr c-state-cache)))))
-
- (unless (eq c-state-cache old-state)
- ;; Have to adjust the cached good position if state has been
- ;; popped off.
- (setq c-state-cache-good-pos
- (if c-state-cache
- (if (consp (car c-state-cache))
- (cdr (car c-state-cache))
- (1+ (car c-state-cache)))
- 1)
- old-state c-state-cache))
-
- (when c-state-cache
- (setq pos last-pos)))
-
- ;; Get the fallback start position.
- (unless pos
- (setq pos (c-get-fallback-start-pos here)
- c-state-cache nil
- c-state-cache-good-pos 1))
-
- (narrow-to-region (point-min) here)
-
- (while pos
- (setq save-pos pos
- brace-pair-open nil)
-
- ;; Find the balanced brace pairs. This loop is hot, so it
- ;; does ugly tricks to go faster.
- (c-safe
- (let (set-good-pos set-brace-pair)
- (while t
- (setq last-pos nil
- last-pos (scan-lists pos 1 -1)) ; Might signal.
- (setq pos (scan-lists last-pos 1 1) ; Might signal.
- set-good-pos (< pos here-bol)
- set-brace-pair (eq (char-before last-pos) ?{))
-
- ;; Update the cached good position and record the brace
- ;; pair, whichever is applicable for the paren we've
- ;; just jumped over. But first check that it isn't
- ;; inside a macro and the point isn't inside the same
- ;; one.
- (when (and (or set-good-pos set-brace-pair)
- (or (>= pos in-macro-start)
- (save-excursion
- (goto-char pos)
- (not (c-beginning-of-macro)))))
- (if set-good-pos
- (setq c-state-cache-good-pos pos))
- (if set-brace-pair
- (setq brace-pair-open last-pos
- brace-pair-close pos))))))
-
- ;; Record the last brace pair.
- (when brace-pair-open
- (let ((head (car-safe c-state-cache)))
- (if (consp head)
- (progn
- (setcar head (1- brace-pair-open))
- (setcdr head brace-pair-close))
- (setq c-state-cache (cons (cons (1- brace-pair-open)
- brace-pair-close)
- c-state-cache)))))
-
- (if last-pos
- ;; Prepare to loop, but record the open paren only if it's
- ;; outside a macro or within the same macro as point, and
- ;; if it is a legitimate open paren and not some character
- ;; that got an open paren syntax-table property.
- (progn
- (setq pos last-pos)
- (when (and (or (>= last-pos in-macro-start)
- (save-excursion
- (goto-char last-pos)
- (not (c-beginning-of-macro))))
- ;; Check for known types of parens that we
- ;; want to record. The syntax table is not to
- ;; be trusted here since the caller might be
- ;; using e.g. `c++-template-syntax-table'.
- (memq (char-before last-pos) '(?{ ?\( ?\[)))
- (if (< last-pos here-bol)
- (setq c-state-cache-good-pos last-pos))
- (setq c-state-cache (cons (1- last-pos) c-state-cache))))
-
- (if (setq last-pos (c-up-list-forward pos))
- ;; Found a close paren without a corresponding opening
- ;; one. Maybe we didn't go back far enough, so try to
- ;; scan backward for the start paren and then start over.
- (progn
- (setq pos (c-up-list-backward pos)
- c-state-cache nil
- c-state-cache-good-pos c-state-cache-start)
- (when (or (not pos)
- ;; Emacs (up to at least 21.2) can get confused by
- ;; open parens in column zero inside comments: The
- ;; sexp functions can then misbehave and bring us
- ;; back to the same point again. Check this so that
- ;; we don't get an infinite loop.
- (>= pos save-pos))
- (setq pos last-pos
- c-parsing-error
- (format "Unbalanced close paren at line %d"
- (1+ (count-lines (point-min)
- (c-point 'bol last-pos)))))))
- (setq pos nil))))
-
- ;;(message "c-parse-state: %S end: %S" c-state-cache c-state-cache-good-pos)
- c-state-cache)))
-
-;; Debug tool to catch cache inconsistencies.
+;; Debug tool to catch cache inconsistencies. This is called from
+;; 000tests.el.
(defvar c-debug-parse-state nil)
(unless (fboundp 'c-real-parse-state)
(fset 'c-real-parse-state (symbol-function 'c-parse-state)))
(cc-bytecomp-defun c-real-parse-state)
(defun c-debug-parse-state ()
- (let ((res1 (c-real-parse-state)) res2)
+ (let ((here (point)) (res1 (c-real-parse-state)) res2)
(let ((c-state-cache nil)
- (c-state-cache-start 1)
- (c-state-cache-good-pos 1))
+ (c-state-cache-good-pos 1)
+ (c-state-nonlit-pos-cache nil)
+ (c-state-nonlit-pos-cache-limit 1)
+ (c-state-brace-pair-desert nil)
+ (c-state-point-min 1)
+ (c-state-point-min-lit-type nil)
+ (c-state-point-min-lit-start nil)
+ (c-state-min-scan-pos 1)
+ (c-state-old-cpp-beg nil)
+ (c-state-old-cpp-end nil))
(setq res2 (c-real-parse-state)))
(unless (equal res1 res2)
;; The cache can actually go further back due to the ad-hoc way
(while (not (or (bobp) (eq (char-after) ?{)))
(c-beginning-of-defun-1))
(unless (equal (c-whack-state-before (point) res1) res2)
- (message (concat "c-parse-state inconsistency: "
+ (message (concat "c-parse-state inconsistency at %s: "
"using cache: %s, from scratch: %s")
- res1 res2))))
+ here res1 res2))))
res1))
+
(defun c-toggle-parse-state-debug (&optional arg)
(interactive "P")
(setq c-debug-parse-state (c-calculate-state arg c-debug-parse-state))
(when c-debug-parse-state
(c-toggle-parse-state-debug 1))
+\f
(defun c-whack-state-before (bufpos paren-state)
;; Whack off any state information from PAREN-STATE which lies
;; before BUFPOS. Not destructive on PAREN-STATE.
)))
\f
-;; Handling of small scale constructs like types and names.
+;; Setting and removing syntax properties on < and > in languages (C++
+;; and Java) where they can be template/generic delimiters as well as
+;; their normal meaning of "less/greater than".
+
+;; Normally, < and > have syntax 'punctuation'. When they are found to
+;; be delimiters, they are marked as such with the category properties
+;; c-<-as-paren-syntax, c->-as-paren-syntax respectively.
+
+;; STRATEGY:
+;;
+;; It is impossible to determine with certainty whether a <..> pair in
+;; C++ is two comparison operators or is template delimiters, unless
+;; one duplicates a lot of a C++ compiler. For example, the following
+;; code fragment:
+;;
+;; foo (a < b, c > d) ;
+;;
+;; could be a function call with two integer parameters (each a
+;; relational expression), or it could be a constructor for class foo
+;; taking one parameter d of templated type "a < b, c >". They are
+;; somewhat easier to distinguish in Java.
+;;
+;; The strategy now (2010-01) adopted is to mark and unmark < and
+;; > IN MATCHING PAIRS ONLY. [Previously, they were marked
+;; individually when their context so indicated. This gave rise to
+;; intractible problems when one of a matching pair was deleted, or
+;; pulled into a literal.]
+;;
+;; At each buffer change, the syntax-table properties are removed in a
+;; before-change function and reapplied, when needed, in an
+;; after-change function. It is far more important that the
+;; properties get removed when they they are spurious than that they
+;; be present when wanted.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun c-clear-<-pair-props (&optional pos)
+ ;; POS (default point) is at a < character. If it is marked with
+ ;; open paren syntax-table text property, remove the property,
+ ;; together with the close paren property on the matching > (if
+ ;; any).
+ (save-excursion
+ (if pos
+ (goto-char pos)
+ (setq pos (point)))
+ (when (equal (c-get-char-property (point) 'syntax-table)
+ c-<-as-paren-syntax)
+ (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+ (c-go-list-forward))
+ (when (equal (c-get-char-property (1- (point)) 'syntax-table)
+ c->-as-paren-syntax) ; should always be true.
+ (c-clear-char-property (1- (point)) 'category))
+ (c-clear-char-property pos 'category))))
+
+(defun c-clear->-pair-props (&optional pos)
+ ;; POS (default point) is at a > character. If it is marked with
+ ;; close paren syntax-table property, remove the property, together
+ ;; with the open paren property on the matching < (if any).
+ (save-excursion
+ (if pos
+ (goto-char pos)
+ (setq pos (point)))
+ (when (equal (c-get-char-property (point) 'syntax-table)
+ c->-as-paren-syntax)
+ (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+ (c-go-up-list-backward))
+ (when (equal (c-get-char-property (point) 'syntax-table)
+ c-<-as-paren-syntax) ; should always be true.
+ (c-clear-char-property (point) 'category))
+ (c-clear-char-property pos 'category))))
+
+(defun c-clear-<>-pair-props (&optional pos)
+ ;; POS (default point) is at a < or > character. If it has an
+ ;; open/close paren syntax-table property, remove this property both
+ ;; from the current character and its partner (which will also be
+ ;; thusly marked).
+ (cond
+ ((eq (char-after) ?\<)
+ (c-clear-<-pair-props pos))
+ ((eq (char-after) ?\>)
+ (c-clear->-pair-props pos))
+ (t (c-benign-error
+ "c-clear-<>-pair-props called from wrong position"))))
+
+(defun c-clear-<-pair-props-if-match-after (lim &optional pos)
+ ;; POS (default point) is at a < character. If it is both marked
+ ;; with open/close paren syntax-table property, and has a matching >
+ ;; (also marked) which is after LIM, remove the property both from
+ ;; the current > and its partner.
+ (save-excursion
+ (if pos
+ (goto-char pos)
+ (setq pos (point)))
+ (when (equal (c-get-char-property (point) 'syntax-table)
+ c-<-as-paren-syntax)
+ (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+ (c-go-list-forward))
+ (when (and (>= (point) lim)
+ (equal (c-get-char-property (1- (point)) 'syntax-table)
+ c->-as-paren-syntax)) ; should always be true.
+ (c-unmark-<->-as-paren (1- (point)))
+ (c-unmark-<->-as-paren pos)))))
+
+(defun c-clear->-pair-props-if-match-before (lim &optional pos)
+ ;; POS (default point) is at a > character. If it is both marked
+ ;; with open/close paren syntax-table property, and has a matching <
+ ;; (also marked) which is before LIM, remove the property both from
+ ;; the current < and its partner.
+ (save-excursion
+ (if pos
+ (goto-char pos)
+ (setq pos (point)))
+ (when (equal (c-get-char-property (point) 'syntax-table)
+ c->-as-paren-syntax)
+ (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+ (c-go-up-list-backward))
+ (when (and (<= (point) lim)
+ (equal (c-get-char-property (point) 'syntax-table)
+ c-<-as-paren-syntax)) ; should always be true.
+ (c-unmark-<->-as-paren (point))
+ (c-unmark-<->-as-paren pos)))))
+
+(defun c-before-change-check-<>-operators (beg end)
+ ;; Unmark certain pairs of "< .... >" which are currently marked as
+ ;; template/generic delimiters. (This marking is via syntax-table
+ ;; text properties).
+ ;;
+ ;; These pairs are those which are in the current "statement" (i.e.,
+ ;; the region between the {, }, or ; before BEG and the one after
+ ;; END), and which enclose any part of the interval (BEG END).
+ ;;
+ ;; Note that in C++ (?and Java), template/generic parens cannot
+ ;; enclose a brace or semicolon, so we use these as bounds on the
+ ;; region we must work on.
+ ;;
+ ;; This function is called from before-change-functions (via
+ ;; c-get-state-before-change-functions). Thus the buffer is widened,
+ ;; and point is undefined, both at entry and exit.
+ ;;
+ ;; FIXME!!! This routine ignores the possibility of macros entirely.
+ ;; 2010-01-29.
+ (save-excursion
+ (let ((beg-lit-limits (progn (goto-char beg) (c-literal-limits)))
+ (end-lit-limits (progn (goto-char end) (c-literal-limits))))
+ ;; Locate the barrier before the changed region
+ (goto-char (if beg-lit-limits (car beg-lit-limits) beg))
+ (c-syntactic-skip-backward "^;{}" (max (- beg 2048) (point-min)))
+
+ ;; Remove the syntax-table properties from each pertinent <...> pair.
+ ;; Firsly, the ones with the < before beg and > after beg.
+ (while (c-search-forward-char-property 'category 'c-<-as-paren-syntax beg)
+ (c-clear-<-pair-props-if-match-after beg (1- (point))))
+
+ ;; Locate the barrier after END.
+ (goto-char (if end-lit-limits (cdr end-lit-limits) end))
+ (c-syntactic-re-search-forward "[;{}]"
+ (min (+ end 2048) (point-max)) 'end)
+
+ ;; Remove syntax-table properties from the remaining pertinent <...>
+ ;; pairs, those with a > after end and < before end.
+ (while (c-search-backward-char-property 'category 'c->-as-paren-syntax end)
+ (c-clear->-pair-props-if-match-before end)))))
+
+
(defun c-after-change-check-<>-operators (beg end)
;; This is called from `after-change-functions' when
(< beg (setq beg (match-end 0))))
(while (progn (skip-chars-forward "^<>" beg)
(< (point) beg))
- (c-clear-char-property (point) 'syntax-table)
+ (c-clear-<>-pair-props)
(forward-char))))
(when (< beg end)
(< end (setq end (match-end 0))))
(while (progn (skip-chars-forward "^<>" end)
(< (point) end))
- (c-clear-char-property (point) 'syntax-table)
+ (c-clear-<>-pair-props)
(forward-char)))))))
+
+\f
+;; Handling of small scale constructs like types and names.
+
;; Dynamically bound variable that instructs `c-forward-type' to also
;; treat possible types (i.e. those that it normally returns 'maybe or
;; 'found for) as actual types (and always return 'found for them).
(progn
(c-mark-<-as-paren beg)
(c-mark->-as-paren end))
- (c-clear-char-property beg 'syntax-table)))
+ ;; (c-clear-char-property beg 'syntax-table)
+ (c-clear-char-property beg 'category)))
nil)))))))
;; #define.
(and (c-lang-const c++-make-template-syntax-table)
(funcall (c-lang-const c++-make-template-syntax-table))))
+(c-lang-defconst c-no-parens-syntax-table
+ ;; A variant of the standard syntax table which is used to find matching
+ ;; "<"s and ">"s which have been marked as parens using syntax table
+ ;; properties. The other paren characters (e.g. "{", ")" "]") are given a
+ ;; non-paren syntax here. so that the list commands will work on "< ... >"
+ ;; even when there's unbalanced other parens inside them.
+ ;;
+ ;; This variable is nil for languages which don't have template stuff.
+ t `(lambda ()
+ (if (c-lang-const c-recognize-<>-arglists)
+ (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
+ (modify-syntax-entry ?\( "." table)
+ (modify-syntax-entry ?\) "." table)
+ (modify-syntax-entry ?\[ "." table)
+ (modify-syntax-entry ?\] "." table)
+ (modify-syntax-entry ?\{ "." table)
+ (modify-syntax-entry ?\} "." table)
+ table))))
+(c-lang-defvar c-no-parens-syntax-table
+ (funcall (c-lang-const c-no-parens-syntax-table)))
+
(c-lang-defconst c-identifier-syntax-modifications
"A list that describes the modifications that should be done to the
mode syntax table to get a syntax table that matches all identifiers
classifies symbol constituents like '_' and '$' as word constituents,
so that all identifiers are recognized as words.")
-(c-lang-defconst c-get-state-before-change-function
- "If non-nil, a function called from c-before-change-hook.
-Typically it will record enough state to allow
+(c-lang-defconst c-get-state-before-change-functions
+ ;; For documentation see the following c-lang-defvar of the same name.
+ ;; The value here may be a list of functions or a single function.
+ t nil
+ c++ '(c-extend-region-for-CPP c-before-change-check-<>-operators)
+ (c objc) 'c-extend-region-for-CPP
+ ;; java 'c-before-change-check-<>-operators
+ awk 'c-awk-record-region-clear-NL)
+(c-lang-defvar c-get-state-before-change-functions
+ (let ((fs (c-lang-const c-get-state-before-change-functions)))
+ (if (listp fs)
+ fs
+ (list fs)))
+ "If non-nil, a list of functions called from c-before-change-hook.
+Typically these will record enough state to allow
`c-before-font-lock-function' to extend the region to fontify,
and may do such things as removing text-properties which must be
recalculated.
-It takes 2 parameters, the BEG and END supplied to every
+These functions will be run in the order given. Each of them
+takes 2 parameters, the BEG and END supplied to every
before-change function; on entry, the buffer will have been
widened and match-data will have been saved; point is undefined
on both entry and exit; the return value is ignored.
-When the mode is initialized, this function is called with
-parameters \(point-min) and \(point-max)."
- t nil
- (c c++ objc) 'c-extend-region-for-CPP
- awk 'c-awk-record-region-clear-NL)
-(c-lang-defvar c-get-state-before-change-function
- (c-lang-const c-get-state-before-change-function))
-
+The functions are called even when font locking isn't enabled.
+
+When the mode is initialized, the functions are called with
+parameters \(point-min) and \(point-max).")
+
(c-lang-defconst c-before-font-lock-function
"If non-nil, a function called just before font locking.
Typically it will extend the region about to be fontified \(see
When the mode is initialized, this function is called with
parameters \(point-min), \(point-max) and <buffer size>."
t nil
- (c c++ objc) 'c-extend-and-neutralize-syntax-in-CPP
+ (c c++ objc) 'c-neutralize-syntax-in-and-mark-CPP
awk 'c-awk-extend-and-syntax-tablify-region)
(c-lang-defvar c-before-font-lock-function
(c-lang-const c-before-font-lock-function))
;; temporary changes in some font lock support modes, causing extra
;; unnecessary work and font lock glitches due to interactions between
;; various text properties.
-;;
+;;
;; (2007-02-12): The macro `combine-after-change-calls' ISN'T used any
;; more.
end (point))))))))
;; c-maybe-stale-found-type records a place near the region being
-;; changed where an element of `found-types' might become stale. It
+;; changed where an element of `found-types' might become stale. It
;; is set in c-before-change and is either nil, or has the form:
;;
;; (c-decl-id-start "foo" 97 107 " (* ooka) " "o"), where
-;;
+;;
;; o - `c-decl-id-start' is the c-type text property value at buffer
;; pos 96.
-;;
+;;
;; o - 97 107 is the region potentially containing the stale type -
;; this is delimited by a non-nil c-type text property at 96 and
;; either another one or a ";", "{", or "}" at 107.
-;;
+;;
;; o - " (* ooka) " is the (before change) buffer portion containing
;; the suspect type (here "ooka").
;;
(make-local-variable 'fill-paragraph-function)
(setq fill-paragraph-function 'c-fill-paragraph)
+ ;; Initialise the cache of brace pairs, and opening braces/brackets/parens.
+ (c-state-cache-init)
+
(when (or c-recognize-<>-arglists
(c-major-mode-is 'awk-mode)
(c-major-mode-is '(c-mode c++-mode objc-mode)))
(save-restriction
(widen)
(save-excursion
- (if c-get-state-before-change-function
- (funcall c-get-state-before-change-function (point-min) (point-max)))
+ (if c-get-state-before-change-functions
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)))
+ c-get-state-before-change-functions))
(if c-before-font-lock-function
(funcall c-before-font-lock-function (point-min) (point-max)
(- (point-max) (point-min))))))
(defmacro c-run-mode-hooks (&rest hooks)
;; Emacs 21.1 has introduced a system with delayed mode hooks that
- ;; require the use of the new function `run-mode-hooks'.
+ ;; requires the use of the new function `run-mode-hooks'.
(if (cc-bytecomp-fboundp 'run-mode-hooks)
`(run-mode-hooks ,@hooks)
`(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks))))
;; has already been widened, and match-data saved. The return value is
;; meaningless.
;;
- ;; This function is the C/C++/ObjC value of
- ;; `c-get-state-before-change-function' and is called exclusively as a
+ ;; This function is in the C/C++/ObjC values of
+ ;; `c-get-state-before-change-functions' and is called exclusively as a
;; before change function.
(goto-char beg)
(c-beginning-of-macro)
(setq c-old-BOM (point))
(goto-char end)
- (if (c-beginning-of-macro)
- (c-end-of-macro))
+ (when (c-beginning-of-macro)
+ (c-end-of-macro)
+ (or (eobp) (forward-char))) ; Over the terminating NL which may be marked
+ ; with a c-cpp-delimiter category property
(setq c-old-EOM (point)))
(defun c-neutralize-CPP-line (beg end)
t)
(t nil)))))))
-(defun c-extend-and-neutralize-syntax-in-CPP (begg endd old-len)
+(defun c-neutralize-syntax-in-and-mark-CPP (begg endd old-len)
;; (i) Extend the font lock region to cover all changed preprocessor
;; regions; it does this by setting the variables `c-new-BEG' and
;; `c-new-END' to the new boundaries.
;; extended changed region. "Restore" lines which were CPP lines before the
;; change and are no longer so; these can be located from the Buffer local
;; variables `c-old-BOM' and `c-old-EOM'.
- ;;
+ ;;
+ ;; (iii) Mark every CPP construct by placing a `category' property value
+ ;; `c-cpp-delimiter' at its start and end. The marked characters are the
+ ;; opening # and usually the terminating EOL, but sometimes the character
+ ;; before a comment/string delimiter.
+ ;;
;; That is, set syntax-table properties on characters that would otherwise
;; interact syntactically with those outside the CPP line(s).
- ;;
+ ;;
;; This function is called from an after-change function, BEGG ENDD and
;; OLD-LEN being the standard parameters. It prepares the buffer for font
;; locking, hence must get called before `font-lock-after-change-function'.
;; This function is the C/C++/ObjC value of `c-before-font-lock-function'.
;;
;; Note: SPEED _MATTERS_ IN THIS FUNCTION!!!
- ;;
+ ;;
;; This function might make hidden buffer changes.
- (c-save-buffer-state (limits mbeg+1)
+ (c-save-buffer-state (limits)
;; First determine the region, (c-new-BEG c-new-END), which will get font
;; locked. It might need "neutralizing". This region may not start
;; inside a string, comment, or macro.
(goto-char c-old-BOM) ; already set to old start of macro or begg.
(setq c-new-BEG
- (if (setq limits (c-literal-limits))
+ (if (setq limits (c-state-literal-at (point)))
(cdr limits) ; go forward out of any string or comment.
(point)))
(goto-char endd)
- (if (setq limits (c-literal-limits))
+ (if (setq limits (c-state-literal-at (point)))
(goto-char (car limits))) ; go backward out of any string or comment.
(if (c-beginning-of-macro)
(c-end-of-macro))
(setq c-new-END (max (+ (- c-old-EOM old-len) (- endd begg))
(point)))
- ;; Clear any existing punctuation properties.
+ ;; Clear all old relevant properties.
(c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
+ (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter)
+ ;; FIXME!!! What about the "<" and ">" category properties? 2009-11-16
;; Add needed properties to each CPP construct in the region.
(goto-char c-new-BEG)
- (let ((pps-position c-new-BEG) pps-state)
+ (let ((pps-position c-new-BEG) pps-state mbeg)
(while (and (< (point) c-new-END)
(search-forward-regexp c-anchored-cpp-prefix c-new-END t))
;; If we've found a "#" inside a string/comment, ignore it.
pps-position (point))
(unless (or (nth 3 pps-state) ; in a string?
(nth 4 pps-state)) ; in a comment?
- (setq mbeg+1 (point))
- (c-end-of-macro) ; Do we need to go forward 1 char here? No!
- (c-neutralize-CPP-line mbeg+1 (point))
- (setq pps-position (point))))))) ; no need to update pps-state.
+ (goto-char (match-beginning 0))
+ (setq mbeg (point))
+ (if (> (c-syntactic-end-of-macro) mbeg)
+ (progn
+ (c-neutralize-CPP-line mbeg (point))
+ (c-set-cpp-delimiters mbeg (point))
+ ;(setq pps-position (point))
+ )
+ (forward-line)) ; no infinite loop with, e.g., "#//"
+ )))))
(defun c-before-change (beg end)
- ;; Function to be put on `before-change-function'. Primarily, this calls
- ;; the language dependent `c-get-state-before-change-function'. It is
+ ;; Function to be put on `before-change-functions'. Primarily, this calls
+ ;; the language dependent `c-get-state-before-change-functions'. It is
;; otherwise used only to remove stale entries from the `c-found-types'
;; cache, and to record entries which a `c-after-change' function might
;; confirm as stale.
- ;;
+ ;;
;; Note that this function must be FAST rather than accurate. Note
;; also that it only has any effect when font locking is enabled.
;; We exploit this by checking for font-lock-*-face instead of doing
;; larger than (beg end).
(setq c-new-BEG beg
c-new-END end)
- (if c-get-state-before-change-function
- (funcall c-get-state-before-change-function beg end))
+ (if c-get-state-before-change-functions
+ (mapc (lambda (fn)
+ (funcall fn beg end))
+ c-get-state-before-change-functions))
))))
(defun c-after-change (beg end old-len)
(when (> beg end)
(setq beg end)))
+ ;; C-y is capable of spuriously converting category properties
+ ;; c-</>-as-paren-syntax into hard syntax-table properties. Remove
+ ;; these when it happens.
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c-<-as-paren-syntax)
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c->-as-paren-syntax)
+
(c-trim-found-types beg end old-len) ; maybe we don't need all of these.
(c-invalidate-sws-region-after beg end)
(c-invalidate-state-cache beg)
:type 'boolean
:group 'compilation)
+(defcustom compilation-save-buffers-predicate nil
+ "The second argument (PRED) passed to `save-some-buffers' before compiling.
+E.g., one can set this to
+ (lambda ()
+ (string-prefix-p my-compilation-root (file-truename (buffer-file-name))))
+to limit saving to files located under `my-compilation-root'.
+Note, that, in general, `compilation-directory' cannot be used instead
+of `my-compilation-root' here."
+ :type '(choice
+ (const :tag "Default (save all file-visiting buffers)" nil)
+ (const :tag "Save all buffers" t)
+ function)
+ :group 'compilation
+ :version "24.1")
+
;;;###autoload
(defcustom compilation-search-path '(nil)
"List of directories to search for source files named in error messages.
"If non-nil, automatically jump to the next error encountered.")
(make-variable-buffer-local 'compilation-auto-jump-to-next)
+(defvar compilation-buffer-modtime nil
+ "The buffer modification time, for buffers not associated with files.")
+(make-variable-buffer-local 'compilation-buffer-modtime)
(defvar compilation-skip-to-next-location t
"*If non-nil, skip multiple error messages for the same source location.")
(consp current-prefix-arg)))
(unless (equal command (eval compile-command))
(setq compile-command command))
- (save-some-buffers (not compilation-ask-about-save) nil)
+ (save-some-buffers (not compilation-ask-about-save)
+ compilation-save-buffers-predicate)
(setq-default compilation-directory default-directory)
(compilation-start command comint))
original use. Otherwise, recompile using `compile-command'.
If the optional argument `edit-command' is non-nil, the command can be edited."
(interactive "P")
- (save-some-buffers (not compilation-ask-about-save) nil)
+ (save-some-buffers (not compilation-ask-about-save)
+ compilation-save-buffers-predicate)
(let ((default-directory (or compilation-directory default-directory)))
(when edit-command
(setcar compilation-arguments
;; Then evaluate a cd command if any, but don't perform it yet, else
;; start-command would do it again through the shell: (cd "..") AND
;; sh -c "cd ..; make"
- (cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" command)
+ (cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]"
+ command)
(if (match-end 1)
(substitute-env-vars (match-string 1 command))
"~")
(set (make-local-variable 'compilation-auto-jump-to-next) t))
;; Output a mode setter, for saving and later reloading this buffer.
(insert "-*- mode: " name-of-mode
- "; default-directory: " (prin1-to-string default-directory)
+ "; default-directory: "
+ (prin1-to-string (abbreviate-file-name default-directory))
" -*-\n"
(format "%s started at %s\n\n"
mode-name
mode-name (or name-of-mode "Compilation"))
(set (make-local-variable 'page-delimiter)
compilation-page-delimiter)
+ (set (make-local-variable 'compilation-buffer-modtime) nil)
(compilation-setup)
(setq buffer-read-only t)
(run-mode-hooks 'compilation-mode-hook))
(unless comint-inhibit-carriage-motion
(comint-carriage-motion (process-mark proc) (point)))
(set-marker (process-mark proc) (point))
+ (set (make-local-variable 'compilation-buffer-modtime) (current-time))
(run-hooks 'compilation-filter-hook))
(goto-char pos)
(narrow-to-region min max)
;; (`omake -P' polls filesystem for changes and recompiles when needed
;; in the same process and buffer).
;; So, recalculate all markers for that file.
- (unless (and (nth 3 loc) (marker-buffer (nth 3 loc))
- ;; There may be no timestamp info if the loc is a `fake-loc'.
- ;; So we skip the time-check here, although we should maybe
- ;; change `compilation-fake-loc' to add timestamp info.
- (or (null (nth 4 loc))
- (equal (nth 4 loc)
- (setq timestamp
- (with-current-buffer
- (marker-buffer (nth 3 loc))
- (visited-file-modtime))))))
+ (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)) (nthcdr 4 loc)
+ ;; There may be no timestamp info if the loc is a `fake-loc',
+ ;; but we just checked that the file has been visited before!
+ (equal (nth 4 loc)
+ (setq timestamp compilation-buffer-modtime)))
(with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
(cadr (car (nth 2 loc))))
(save-restriction
(substring v (match-beginning 1) (match-end 1)))
"Version of IZ-supported CPerl package this file is based on.")
+(defun cperl-mode-unload-function ()
+ "Unload the Cperl mode library."
+ (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
+ 'fundamental-mode
+ 'perl-mode)))
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when (eq major-mode 'cperl-mode)
+ (funcall new-mode)))))
+ ;; continue standard unloading
+ nil)
+
(provide 'cperl-mode)
;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6
(if (get-file-buffer file)
;; The file is already in a buffer. Check for the visited file
;; having changed since we last used it.
- (let (win)
+ (progn
(set-buffer (get-file-buffer file))
- (setq win (or verify-tags-table-function (tags-table-mode)))
+ (or verify-tags-table-function (tags-table-mode))
(if (or (verify-visited-file-modtime (current-buffer))
;; Decide whether to revert the file.
;; revert-without-query can say to revert
(let ((enable-recursive-minibuffers t))
(visit-tags-table-buffer))
(complete-with-action action (tags-completion-table) string pred))))))
+
+;;;###autoload (defun tags-completion-at-point-function ()
+;;;###autoload (if (or tags-table-list tags-file-name)
+;;;###autoload (progn
+;;;###autoload (load "etags")
+;;;###autoload (tags-completion-at-point-function))))
+
+(defun tags-completion-at-point-function ()
+ "Using tags, return a completion table for the text around point.
+If no tags table is loaded, do nothing and return nil."
+ (when (or tags-table-list tags-file-name)
+ (let ((completion-ignore-case (if (memq tags-case-fold-search '(t nil))
+ tags-case-fold-search
+ case-fold-search))
+ (pattern (funcall (or find-tag-default-function
+ (get major-mode 'find-tag-default-function)
+ 'find-tag-default)))
+ beg)
+ (when pattern
+ (save-excursion
+ (search-backward pattern) ;FIXME: will fail if we're inside pattern.
+ (setq beg (point))
+ (forward-char (length pattern))
+ (list beg (point) (tags-lazy-completion-table)))))))
\f
(defun find-tag-tag (string)
"Read a tag name, with defaulting and completion."
(error "%s"
(substitute-command-keys
"No tags table loaded; try \\[visit-tags-table]")))
- (let ((completion-ignore-case (if (memq tags-case-fold-search '(t nil))
- tags-case-fold-search
- case-fold-search))
- (pattern (funcall (or find-tag-default-function
- (get major-mode 'find-tag-default-function)
- 'find-tag-default)))
- (comp-table (tags-lazy-completion-table))
- beg)
- (or pattern
- (error "Nothing to complete"))
- (search-backward pattern)
- (setq beg (point))
- (forward-char (length pattern))
- (completion-in-region beg (point) comp-table)))
+ (let ((comp-data (tags-completion-at-point-function)))
+ (if (null comp-data)
+ (error "Nothing to complete")
+ (apply 'completion-in-region comp-data))))
(dolist (x '("^No tags table in use; use .* to select one$"
"^There is no default tag$"
:regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*")
\f
;;;###autoload
-(defun f90-mode ()
+(define-derived-mode f90-mode prog-mode "F90"
"Major mode for editing Fortran 90,95 code in free format.
For fixed format code, use `fortran-mode'.
Turning on F90 mode calls the value of the variable `f90-mode-hook'
with no args, if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'f90-mode
- mode-name "F90"
- local-abbrev-table f90-mode-abbrev-table)
- (set-syntax-table f90-mode-syntax-table)
- (use-local-map f90-mode-map)
+ :group 'f90
+ :syntax-table f90-mode-syntax-table
+ :abbrev-table f90-mode-abbrev-table
(set (make-local-variable 'indent-line-function) 'f90-indent-line)
(set (make-local-variable 'indent-region-function) 'f90-indent-region)
(set (make-local-variable 'require-final-newline) mode-require-final-newline)
'f90-beginning-of-subprogram)
(set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram)
(set (make-local-variable 'add-log-current-defun-function)
- #'f90-current-defun)
- (run-mode-hooks 'f90-mode-hook))
+ #'f90-current-defun))
\f
;; Inline-functions.
\f
;;;###autoload
-(defun fortran-mode ()
+(define-derived-mode fortran-mode prog-mode "Fortran"
"Major mode for editing Fortran code in fixed format.
For free format code, use `f90-mode'.
Turning on Fortran mode calls the value of the variable `fortran-mode-hook'
with no args, if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'fortran-mode
- mode-name "Fortran"
- local-abbrev-table fortran-mode-abbrev-table)
- (set-syntax-table fortran-mode-syntax-table)
- (use-local-map fortran-mode-map)
+ :group 'fortran
+ :syntax-table fortran-mode-syntax-table
+ :abbrev-table fortran-mode-abbrev-table
(set (make-local-variable 'indent-line-function) 'fortran-indent-line)
(set (make-local-variable 'indent-region-function)
(lambda (start end)
#'fortran-current-defun)
(set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
(set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
- (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
- (run-mode-hooks 'fortran-mode-hook))
+ (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t))
\f
(defun fortran-line-length (nchars &optional global)
--- /dev/null
+;;; gdb-mi.el --- User Interface for running GDB
+
+;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+;; Author: Nick Roberts <nickrob@gnu.org>
+;; Maintainer: FSF
+;; Keywords: unix, tools
+
+;; This file is part of GNU Emacs.
+
+;; Homepage: http://www.emacswiki.org/emacs/GDB-MI
+
+;; 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/>.
+
+;;; Credits:
+
+;; This file was written by by Nick Roberts following the general design
+;; used in gdb-ui.el for Emacs 22.1 - 23.1. It is currently being developed
+;; by Dmitry Dzhus <dima@sphinx.net.ru> as part of the Google Summer
+;; of Code 2009 Project "Emacs GDB/MI migration".
+
+;;; Commentary:
+
+;; This mode acts as a graphical user interface to GDB. You can interact with
+;; GDB through the GUD buffer in the usual way, but there are also further
+;; buffers which control the execution and describe the state of your program.
+;; It separates the input/output of your program from that of GDB and displays
+;; expressions and their current values in their own buffers. It also uses
+;; features of Emacs 21 such as the fringe/display margin for breakpoints, and
+;; the toolbar (see the GDB Graphical Interface section in the Emacs info
+;; manual).
+
+;; M-x gdb will start the debugger.
+
+;; This file uses GDB/MI as the primary interface to GDB. It is still under
+;; development and is part of a process to migrate Emacs from annotations (as
+;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and
+;; access CLI using "-interpreter-exec console cli-command". This code works
+;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI
+;; should be asynchronous.
+
+;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline
+;; doesn't update properly when execution commands are issued from GUD buffer)
+;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on.
+;;
+;; You need development version of GDB 7.0 for the thread buffer to work.
+
+;; This file replaces gdb-ui.el and is for development with GDB. Use the
+;; release branch of Emacs 22 for the latest version of gdb-ui.el.
+
+;; Windows Platforms:
+
+;; If you are using Emacs and GDB on Windows you will need to flush the buffer
+;; explicitly in your program if you want timely display of I/O in Emacs.
+;; Alternatively you can make the output stream unbuffered, for example, by
+;; using a macro:
+
+;; #ifdef UNBUFFERED
+;; setvbuf (stdout, (char *) NULL, _IONBF, 0);
+;; #endif
+
+;; and compiling with -DUNBUFFERED while debugging.
+
+;; If you are using Cygwin GDB and find that the source is not being displayed
+;; in Emacs when you step through it, possible solutions are to:
+
+;; 1) Use Cygwin X Windows and Cygwin Emacs.
+;; (Since 22.1 Emacs builds under Cygwin.)
+;; 2) Use MinGW GDB instead.
+;; 3) Use cygwin-mount.el
+
+;;; Mac OSX:
+
+;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made
+;; some changes to the version that they include as part of Mac OSX.
+;; This requires GDB version 7.0 or later (estimated release date Aug 2009)
+;; as earlier versions don not compile on Mac OSX.
+
+;;; Known Bugs:
+
+;; 1) Stack buffer doesn't parse MI output if you stop in a routine without
+;; line information, e.g., a routine in libc (just a TODO item).
+
+;; TODO:
+;; 2) Watch windows to work with threads.
+;; 3) Use treebuffer.el instead of the speedbar for watch-expressions?
+;; 4) Mark breakpoint locations on scroll-bar of source buffer?
+
+;;; Code:
+
+(require 'gud)
+(require 'json)
+(require 'bindat)
+(eval-when-compile (require 'cl))
+
+(defvar tool-bar-map)
+(defvar speedbar-initial-expansion-list-name)
+(defvar speedbar-frame)
+
+(defvar gdb-memory-address "main")
+(defvar gdb-memory-last-address nil
+ "Last successfully accessed memory address.")
+(defvar gdb-memory-next-page nil
+ "Address of next memory page for program memory buffer.")
+(defvar gdb-memory-prev-page nil
+ "Address of previous memory page for program memory buffer.")
+
+(defvar gdb-thread-number nil
+ "Main current thread.
+
+Invalidation triggers use this variable to query GDB for
+information on the specified thread by wrapping GDB/MI commands
+in `gdb-current-context-command'.
+
+This variable may be updated implicitly by GDB via `gdb-stopped'
+or explicitly by `gdb-select-thread'.
+
+Only `gdb-setq-thread-number' should be used to change this
+value.")
+
+(defvar gdb-frame-number nil
+ "Selected frame level for main current thread.
+
+Updated according to the following rules:
+
+When a thread is selected or current thread stops, set to \"0\".
+
+When current thread goes running (and possibly exits eventually),
+set to nil.
+
+May be manually changed by user with `gdb-select-frame'.")
+
+(defvar gdb-frame-address nil "Identity of frame for watch expression.")
+
+;; Used to show overlay arrow in source buffer. All set in
+;; gdb-get-main-selected-frame. Disassembly buffer should not use
+;; these but rely on buffer-local thread information instead.
+(defvar gdb-selected-frame nil
+ "Name of selected function for main current thread.")
+(defvar gdb-selected-file nil
+ "Name of selected file for main current thread.")
+(defvar gdb-selected-line nil
+ "Number of selected line for main current thread.")
+
+(defvar gdb-threads-list nil
+ "Associative list of threads provided by \"-thread-info\" MI command.
+
+Keys are thread numbers (in strings) and values are structures as
+returned from -thread-info by `gdb-json-partial-output'. Updated in
+`gdb-thread-list-handler-custom'.")
+
+(defvar gdb-running-threads-count nil
+ "Number of currently running threads.
+
+Nil means that no information is available.
+
+Updated in `gdb-thread-list-handler-custom'.")
+
+(defvar gdb-stopped-threads-count nil
+ "Number of currently stopped threads.
+
+See also `gdb-running-threads-count'.")
+
+(defvar gdb-breakpoints-list nil
+ "Associative list of breakpoints provided by \"-break-list\" MI command.
+
+Keys are breakpoint numbers (in string) and values are structures
+as returned from \"-break-list\" by `gdb-json-partial-output'
+\(\"body\" field is used). Updated in
+`gdb-breakpoints-list-handler-custom'.")
+
+(defvar gdb-current-language nil)
+(defvar gdb-var-list nil
+ "List of variables in watch window.
+Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
+where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
+address for root variables.")
+(defvar gdb-main-file nil "Source file from which program execution begins.")
+
+;; Overlay arrow markers
+(defvar gdb-stack-position nil)
+(defvar gdb-thread-position nil)
+(defvar gdb-disassembly-position nil)
+
+(defvar gdb-location-alist nil
+ "Alist of breakpoint numbers and full filenames. Only used for files that
+Emacs can't find.")
+(defvar gdb-active-process nil
+ "GUD tooltips display variable values when t, and macro definitions otherwise.")
+(defvar gdb-error "Non-nil when GDB is reporting an error.")
+(defvar gdb-macro-info nil
+ "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
+(defvar gdb-register-names nil "List of register names.")
+(defvar gdb-changed-registers nil
+ "List of changed register numbers (strings).")
+(defvar gdb-buffer-fringe-width nil)
+(defvar gdb-last-command nil)
+(defvar gdb-prompt-name nil)
+(defvar gdb-token-number 0)
+(defvar gdb-handler-alist '())
+(defvar gdb-handler-number nil)
+(defvar gdb-source-file-list nil
+ "List of source files for the current executable.")
+(defvar gdb-first-done-or-error t)
+(defvar gdb-source-window nil)
+(defvar gdb-inferior-status nil)
+(defvar gdb-continuation nil)
+(defvar gdb-version nil)
+(defvar gdb-filter-output nil
+ "Message to be shown in GUD console.
+
+This variable is updated in `gdb-done-or-error' and returned by
+`gud-gdbmi-marker-filter'.")
+
+(defvar gdb-non-stop nil
+ "Indicates whether current GDB session is using non-stop mode.
+
+It is initialized to `gdb-non-stop-setting' at the beginning of
+every GDB session.")
+
+(defvar gdb-buffer-type nil
+ "One of the symbols bound in `gdb-buffer-rules'.")
+(make-variable-buffer-local 'gdb-buffer-type)
+
+(defvar gdb-output-sink 'nil
+ "The disposition of the output of the current gdb command.
+Possible values are these symbols:
+
+ `user' -- gdb output should be copied to the GUD buffer
+ for the user to see.
+
+ `emacs' -- output should be collected in the partial-output-buffer
+ for subsequent processing by a command. This is the
+ disposition of output generated by commands that
+ gdb mode sends to gdb on its own behalf.")
+
+;; Pending triggers prevent congestion: Emacs won't send two similar
+;; consecutive requests.
+
+(defvar gdb-pending-triggers '()
+ "A list of trigger functions which have not yet been handled.
+
+Elements are either function names or pairs (buffer . function)")
+
+(defmacro gdb-add-pending (item)
+ `(push ,item gdb-pending-triggers))
+(defmacro gdb-pending-p (item)
+ `(member ,item gdb-pending-triggers))
+(defmacro gdb-delete-pending (item)
+ `(setq gdb-pending-triggers
+ (delete ,item gdb-pending-triggers)))
+
+(defmacro gdb-wait-for-pending (&rest body)
+ "Wait until `gdb-pending-triggers' is empty and evaluate FORM.
+
+This function checks `gdb-pending-triggers' value every
+`gdb-wait-for-pending' seconds."
+ (run-with-timer
+ 0.5 nil
+ `(lambda ()
+ (if (not gdb-pending-triggers)
+ (progn ,@body)
+ (gdb-wait-for-pending ,@body)))))
+
+;; Publish-subscribe
+
+(defmacro gdb-add-subscriber (publisher subscriber)
+ "Register new PUBLISHER's SUBSCRIBER.
+
+SUBSCRIBER must be a pair, where cdr is a function of one
+argument (see `gdb-emit-signal')."
+ `(add-to-list ',publisher ,subscriber t))
+
+(defmacro gdb-delete-subscriber (publisher subscriber)
+ "Unregister SUBSCRIBER from PUBLISHER."
+ `(setq ,publisher (delete ,subscriber
+ ,publisher)))
+
+(defun gdb-get-subscribers (publisher)
+ publisher)
+
+(defun gdb-emit-signal (publisher &optional signal)
+ "Call cdr for each subscriber of PUBLISHER with SIGNAL as argument."
+ (dolist (subscriber (gdb-get-subscribers publisher))
+ (funcall (cdr subscriber) signal)))
+
+(defvar gdb-buf-publisher '()
+ "Used to invalidate GDB buffers by emitting a signal in
+`gdb-update'.
+
+Must be a list of pairs with cars being buffers and cdr's being
+valid signal handlers.")
+
+(defgroup gdb nil
+ "GDB graphical interface"
+ :group 'tools
+ :link '(info-link "(emacs)GDB Graphical Interface")
+ :version "23.2")
+
+(defgroup gdb-non-stop nil
+ "GDB non-stop debugging settings"
+ :group 'gdb
+ :version "23.2")
+
+(defgroup gdb-buffers nil
+ "GDB buffers"
+ :group 'gdb
+ :version "23.2")
+
+(defcustom gdb-debug-log-max 128
+ "Maximum size of `gdb-debug-log'. If nil, size is unlimited."
+ :group 'gdb
+ :type '(choice (integer :tag "Number of elements")
+ (const :tag "Unlimited" nil))
+ :version "22.1")
+
+(defcustom gdb-non-stop-setting t
+ "When in non-stop mode, stopped threads can be examined while
+other threads continue to execute.
+
+GDB session needs to be restarted for this setting to take
+effect."
+ :type 'boolean
+ :group 'gdb-non-stop
+ :version "23.2")
+
+;; TODO Some commands can't be called with --all (give a notice about
+;; it in setting doc)
+(defcustom gdb-gud-control-all-threads t
+ "When enabled, GUD execution commands affect all threads when
+in non-stop mode. Otherwise, only current thread is affected."
+ :type 'boolean
+ :group 'gdb-non-stop
+ :version "23.2")
+
+(defcustom gdb-switch-reasons t
+ "List of stop reasons which cause Emacs to switch to the thread
+which caused the stop. When t, switch to stopped thread no matter
+what the reason was. When nil, never switch to stopped thread
+automatically.
+
+This setting is used in non-stop mode only. In all-stop mode,
+Emacs always switches to the thread which caused the stop."
+ ;; exited, exited-normally and exited-signalled are not
+ ;; thread-specific stop reasons and therefore are not included in
+ ;; this list
+ :type '(choice
+ (const :tag "All reasons" t)
+ (set :tag "Selection of reasons..."
+ (const :tag "A breakpoint was reached." "breakpoint-hit")
+ (const :tag "A watchpoint was triggered." "watchpoint-trigger")
+ (const :tag "A read watchpoint was triggered." "read-watchpoint-trigger")
+ (const :tag "An access watchpoint was triggered." "access-watchpoint-trigger")
+ (const :tag "Function finished execution." "function-finished")
+ (const :tag "Location reached." "location-reached")
+ (const :tag "Watchpoint has gone out of scope" "watchpoint-scope")
+ (const :tag "End of stepping range reached." "end-stepping-range")
+ (const :tag "Signal received (like interruption)." "signal-received"))
+ (const :tag "None" nil))
+ :group 'gdb-non-stop
+ :version "23.2"
+ :link '(info-link "(gdb)GDB/MI Async Records"))
+
+(defcustom gdb-stopped-hooks nil
+ "This variable holds a list of functions to be called whenever
+GDB stops.
+
+Each function takes one argument, a parsed MI response, which
+contains fields of corresponding MI *stopped async record:
+
+ ((stopped-threads . \"all\")
+ (thread-id . \"1\")
+ (frame (line . \"38\")
+ (fullname . \"/home/sphinx/projects/gsoc/server.c\")
+ (file . \"server.c\")
+ (args ((value . \"0x804b038\")
+ (name . \"arg\")))
+ (func . \"hello\")
+ (addr . \"0x0804869e\"))
+ (reason . \"end-stepping-range\"))
+
+Note that \"reason\" is only present in non-stop debugging mode.
+
+`bindat-get-field' may be used to access the fields of response.
+
+Each function is called after the new current thread was selected
+and GDB buffers were updated in `gdb-stopped'."
+ :type '(repeat function)
+ :group 'gdb
+ :version "23.2"
+ :link '(info-link "(gdb)GDB/MI Async Records"))
+
+(defcustom gdb-switch-when-another-stopped t
+ "When nil, Emacs won't switch to stopped thread if some other
+stopped thread is already selected."
+ :type 'boolean
+ :group 'gdb-non-stop
+ :version "23.2")
+
+(defcustom gdb-stack-buffer-locations t
+ "Show file information or library names in stack buffers."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-stack-buffer-addresses nil
+ "Show frame addresses in stack buffers."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-thread-buffer-verbose-names t
+ "Show long thread names in threads buffer."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-thread-buffer-arguments t
+ "Show function arguments in threads buffer."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-thread-buffer-locations t
+ "Show file information or library names in threads buffer."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-thread-buffer-addresses nil
+ "Show addresses for thread frames in threads buffer."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defcustom gdb-show-threads-by-default nil
+ "Show threads list buffer instead of breakpoints list by
+default."
+ :type 'boolean
+ :group 'gdb-buffers
+ :version "23.2")
+
+(defvar gdb-debug-log nil
+ "List of commands sent to and replies received from GDB.
+Most recent commands are listed first. This list stores only the last
+`gdb-debug-log-max' values. This variable is used to debug GDB-MI.")
+
+;;;###autoload
+(defcustom gdb-enable-debug nil
+ "Non-nil means record the process input and output in `gdb-debug-log'."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
+ "Shell command for generating a list of defined macros in a source file.
+This list is used to display the #define directive associated
+with an identifier as a tooltip. It works in a debug session with
+GDB, when `gud-tooltip-mode' is t.
+
+Set `gdb-cpp-define-alist-flags' for any include paths or
+predefined macros."
+ :type 'string
+ :group 'gdb
+ :version "22.1")
+
+(defcustom gdb-cpp-define-alist-flags ""
+ "Preprocessor flags for `gdb-cpp-define-alist-program'."
+ :type 'string
+ :group 'gdb
+ :version "22.1")
+
+ (defcustom gdb-create-source-file-list t
+ "Non-nil means create a list of files from which the executable was built.
+ Set this to nil if the GUD buffer displays \"initializing...\" in the mode
+ line for a long time when starting, possibly because your executable was
+ built from a large number of files. This allows quicker initialization
+ but means that these files are not automatically enabled for debugging,
+ e.g., you won't be able to click in the fringe to set a breakpoint until
+ execution has already stopped there."
+ :type 'boolean
+ :group 'gdb
+ :version "23.1")
+
+(defcustom gdb-show-main nil
+ "Non-nil means display source file containing the main routine at startup.
+Also display the main routine in the disassembly buffer if present."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defun gdb-force-mode-line-update (status)
+ (let ((buffer gud-comint-buffer))
+ (if (and buffer (buffer-name buffer))
+ (with-current-buffer buffer
+ (setq mode-line-process
+ (format ":%s [%s]"
+ (process-status (get-buffer-process buffer)) status))
+ ;; Force mode line redisplay soon.
+ (force-mode-line-update)))))
+
+(defun gdb-enable-debug (arg)
+ "Toggle logging of transaction between Emacs and Gdb.
+The log is stored in `gdb-debug-log' as an alist with elements
+whose cons is send, send-item or recv and whose cdr is the string
+being transferred. This list may grow up to a size of
+`gdb-debug-log-max' after which the oldest element (at the end of
+the list) is deleted every time a new one is added (at the front)."
+ (interactive "P")
+ (setq gdb-enable-debug
+ (if (null arg)
+ (not gdb-enable-debug)
+ (> (prefix-numeric-value arg) 0)))
+ (message (format "Logging of transaction %sabled"
+ (if gdb-enable-debug "en" "dis"))))
+
+;; These two are used for menu and toolbar
+(defun gdb-control-all-threads ()
+ "Switch to non-stop/A mode."
+ (interactive)
+ (setq gdb-gud-control-all-threads t)
+ ;; Actually forcing the tool-bar to update.
+ (force-mode-line-update)
+ (message "Now in non-stop/A mode."))
+
+(defun gdb-control-current-thread ()
+ "Switch to non-stop/T mode."
+ (interactive)
+ (setq gdb-gud-control-all-threads nil)
+ ;; Actually forcing the tool-bar to update.
+ (force-mode-line-update)
+ (message "Now in non-stop/T mode."))
+
+(defun gdb-find-watch-expression ()
+ (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
+ (varnum (car var)) expr array)
+ (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
+ (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
+ (component-list (split-string (match-string 2 varnum) "\\." t)))
+ (setq expr (nth 1 var1))
+ (setq varnumlet (car var1))
+ (dolist (component component-list)
+ (setq var2 (assoc varnumlet gdb-var-list))
+ (setq expr (concat expr
+ (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
+ (concat "[" component "]")
+ (concat "." component))))
+ (setq varnumlet (concat varnumlet "." component)))
+ expr)))
+
+;; noall is used for commands which don't take --all, but only
+;; --thread.
+(defun gdb-gud-context-command (command &optional noall)
+ "When `gdb-non-stop' is t, add --thread option to COMMAND if
+`gdb-gud-control-all-threads' is nil and --all option otherwise.
+If NOALL is t, always add --thread option no matter what
+`gdb-gud-control-all-threads' value is.
+
+When `gdb-non-stop' is nil, return COMMAND unchanged."
+ (if gdb-non-stop
+ (if (and gdb-gud-control-all-threads
+ (not noall)
+ (string-equal gdb-version "7.0+"))
+ (concat command " --all ")
+ (gdb-current-context-command command))
+ command))
+
+(defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
+ "`gud-call' wrapper which adds --thread/--all options between
+CMD1 and CMD2. NOALL is the same as in `gdb-gud-context-command'.
+
+NOARG must be t when this macro is used outside `gud-def'"
+ `(gud-call
+ (concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2)
+ ,(when (not noarg) 'arg)))
+
+;;;###autoload
+(defun gdb (command-line)
+ "Run gdb on program FILE in buffer *gud-FILE*.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger.
+
+If `gdb-many-windows' is nil (the default value) then gdb just
+pops up the GUD buffer unless `gdb-show-main' is t. In this case
+it starts with two windows: one displaying the GUD buffer and the
+other with the source file with the main routine of the inferior.
+
+If `gdb-many-windows' is t, regardless of the value of
+`gdb-show-main', the layout below will appear. Keybindings are
+shown in some of the buffers.
+
+Watch expressions appear in the speedbar/slowbar.
+
+The following commands help control operation :
+
+`gdb-many-windows' - Toggle the number of windows gdb uses.
+`gdb-restore-windows' - To restore the window layout.
+
+See Info node `(emacs)GDB Graphical Interface' for a more
+detailed description of this mode.
+
+
++----------------------------------------------------------------------+
+| GDB Toolbar |
++-----------------------------------+----------------------------------+
+| GUD buffer (I/O of GDB) | Locals buffer |
+| | |
+| | |
+| | |
++-----------------------------------+----------------------------------+
+| Source buffer | I/O buffer (of debugged program) |
+| | (comint-mode) |
+| | |
+| | |
+| | |
+| | |
+| | |
+| | |
++-----------------------------------+----------------------------------+
+| Stack buffer | Breakpoints buffer |
+| RET gdb-select-frame | SPC gdb-toggle-breakpoint |
+| | RET gdb-goto-breakpoint |
+| | D gdb-delete-breakpoint |
++-----------------------------------+----------------------------------+"
+ ;;
+ (interactive (list (gud-query-cmdline 'gdb)))
+
+ (when (and gud-comint-buffer
+ (buffer-name gud-comint-buffer)
+ (get-buffer-process gud-comint-buffer)
+ (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
+ (gdb-restore-windows)
+ (error
+ "Multiple debugging requires restarting in text command mode"))
+ ;;
+ (gud-common-init command-line nil 'gud-gdbmi-marker-filter)
+ (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+ (setq comint-input-sender 'gdb-send)
+
+ (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
+ "Set temporary breakpoint at current line.")
+ (gud-def gud-jump
+ (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
+ "\C-j" "Set execution address to current line.")
+
+ (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
+ (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
+ (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
+ (gud-def gud-pstar "print* %e" nil
+ "Evaluate C dereferenced pointer expression at point.")
+
+ (gud-def gud-step (gdb-gud-context-call "-exec-step" "%p" t)
+ "\C-s"
+ "Step one source line with display.")
+ (gud-def gud-stepi (gdb-gud-context-call "-exec-step-instruction" "%p" t)
+ "\C-i"
+ "Step one instruction with display.")
+ (gud-def gud-next (gdb-gud-context-call "-exec-next" "%p" t)
+ "\C-n"
+ "Step one line (skip functions).")
+ (gud-def gud-nexti (gdb-gud-context-call "-exec-next-instruction" "%p" t)
+ nil
+ "Step one instruction (skip functions).")
+ (gud-def gud-cont (gdb-gud-context-call "-exec-continue")
+ "\C-r"
+ "Continue with display.")
+ (gud-def gud-finish (gdb-gud-context-call "-exec-finish" nil t)
+ "\C-f"
+ "Finish executing current function.")
+ (gud-def gud-run "-exec-run"
+ nil
+ "Run the program.")
+
+ (gud-def gud-break (if (not (string-match "Disassembly" mode-name))
+ (gud-call "break %f:%l" arg)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 2)
+ (gud-call "break *%a" arg)))
+ "\C-b" "Set breakpoint at current line or address.")
+
+ (gud-def gud-remove (if (not (string-match "Disassembly" mode-name))
+ (gud-call "clear %f:%l" arg)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 2)
+ (gud-call "clear *%a" arg)))
+ "\C-d" "Remove breakpoint at current line or address.")
+
+ ;; -exec-until doesn't support --all yet
+ (gud-def gud-until (if (not (string-match "Disassembly" mode-name))
+ (gud-call "-exec-until %f:%l" arg)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 2)
+ (gud-call "-exec-until *%a" arg)))
+ "\C-u" "Continue to current line or address.")
+ ;; TODO Why arg here?
+ (gud-def
+ gud-go (gud-call (if gdb-active-process
+ (gdb-gud-context-command "-exec-continue")
+ "-exec-run") arg)
+ nil "Start or continue execution.")
+
+ ;; For debugging Emacs only.
+ (gud-def gud-pp
+ (gud-call
+ (concat
+ "pp1 " (if (eq (buffer-local-value
+ 'major-mode (window-buffer)) 'speedbar-mode)
+ (gdb-find-watch-expression) "%e")) arg)
+ nil "Print the Emacs s-expression.")
+
+ (define-key gud-minor-mode-map [left-margin mouse-1]
+ 'gdb-mouse-set-clear-breakpoint)
+ (define-key gud-minor-mode-map [left-fringe mouse-1]
+ 'gdb-mouse-set-clear-breakpoint)
+ (define-key gud-minor-mode-map [left-margin C-mouse-1]
+ 'gdb-mouse-toggle-breakpoint-margin)
+ (define-key gud-minor-mode-map [left-fringe C-mouse-1]
+ 'gdb-mouse-toggle-breakpoint-fringe)
+
+ (define-key gud-minor-mode-map [left-margin drag-mouse-1]
+ 'gdb-mouse-until)
+ (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
+ 'gdb-mouse-until)
+ (define-key gud-minor-mode-map [left-margin mouse-3]
+ 'gdb-mouse-until)
+ (define-key gud-minor-mode-map [left-fringe mouse-3]
+ 'gdb-mouse-until)
+
+ (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
+ 'gdb-mouse-jump)
+ (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
+ 'gdb-mouse-jump)
+ (define-key gud-minor-mode-map [left-fringe C-mouse-3]
+ 'gdb-mouse-jump)
+ (define-key gud-minor-mode-map [left-margin C-mouse-3]
+ 'gdb-mouse-jump)
+
+ (local-set-key "\C-i" 'gud-gdb-complete-command)
+ (setq gdb-first-prompt t)
+ (setq gud-running nil)
+
+ (gdb-update)
+
+ (run-hooks 'gdb-mode-hook))
+
+(defun gdb-init-1 ()
+ ;; (re-)initialise
+ (setq gdb-selected-frame nil
+ gdb-frame-number nil
+ gdb-thread-number nil
+ gdb-var-list nil
+ gdb-pending-triggers nil
+ gdb-output-sink 'user
+ gdb-location-alist nil
+ gdb-source-file-list nil
+ gdb-last-command nil
+ gdb-token-number 0
+ gdb-handler-alist '()
+ gdb-handler-number nil
+ gdb-prompt-name nil
+ gdb-first-done-or-error t
+ gdb-buffer-fringe-width (car (window-fringes))
+ gdb-debug-log nil
+ gdb-source-window nil
+ gdb-inferior-status nil
+ gdb-continuation nil
+ gdb-buf-publisher '()
+ gdb-threads-list '()
+ gdb-breakpoints-list '()
+ gdb-register-names '()
+ gdb-non-stop gdb-non-stop-setting)
+ ;;
+ (setq gdb-buffer-type 'gdbmi)
+ ;;
+ (gdb-force-mode-line-update
+ (propertize "initializing..." 'face font-lock-variable-name-face))
+
+ (gdb-get-buffer-create 'gdb-inferior-io)
+ (gdb-clear-inferior-io)
+ (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter)
+ (gdb-input
+ ;; Needs GDB 6.4 onwards
+ (list (concat "-inferior-tty-set "
+ (process-tty-name (get-process "gdb-inferior")))
+ 'ignore))
+ (if (eq window-system 'w32)
+ (gdb-input (list "-gdb-set new-console off" 'ignore)))
+ (gdb-input (list "-gdb-set height 0" 'ignore))
+
+ (when gdb-non-stop
+ (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler)))
+
+ ;; find source file and compilation directory here
+ (gdb-input
+ ; Needs GDB 6.2 onwards.
+ (list "-file-list-exec-source-files" 'gdb-get-source-file-list))
+ (if gdb-create-source-file-list
+ (gdb-input
+ ; Needs GDB 6.0 onwards.
+ (list "-file-list-exec-source-file" 'gdb-get-source-file)))
+ (gdb-input
+ (list "-gdb-show prompt" 'gdb-get-prompt)))
+
+(defun gdb-non-stop-handler ()
+ (goto-char (point-min))
+ (if (re-search-forward "No symbol" nil t)
+ (progn
+ (message "This version of GDB doesn't support non-stop mode. Turning it off.")
+ (setq gdb-non-stop nil)
+ (setq gdb-version "pre-7.0"))
+ (setq gdb-version "7.0+")
+ (gdb-input (list "-gdb-set target-async 1" 'ignore))
+ (gdb-input (list "-enable-pretty-printing" 'ignore))))
+
+(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
+
+(defun gdb-create-define-alist ()
+ "Create an alist of #define directives for GUD tooltips."
+ (let* ((file (buffer-file-name))
+ (output
+ (with-output-to-string
+ (with-current-buffer standard-output
+ (and file
+ (file-exists-p file)
+ ;; call-process doesn't work with remote file names.
+ (not (file-remote-p default-directory))
+ (call-process shell-file-name file
+ (list t nil) nil "-c"
+ (concat gdb-cpp-define-alist-program " "
+ gdb-cpp-define-alist-flags))))))
+ (define-list (split-string output "\n" t))
+ (name))
+ (setq gdb-define-alist nil)
+ (dolist (define define-list)
+ (setq name (nth 1 (split-string define "[( ]")))
+ (push (cons name define) gdb-define-alist))))
+
+(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
+(defvar tooltip-use-echo-area)
+
+(defun gdb-tooltip-print (expr)
+ (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+ (goto-char (point-min))
+ (if (re-search-forward ".*value=\\(\".*\"\\)" nil t)
+ (tooltip-show
+ (concat expr " = " (read (match-string 1)))
+ (or gud-tooltip-echo-area tooltip-use-echo-area
+ (not (display-graphic-p)))))))
+
+;; If expr is a macro for a function don't print because of possible dangerous
+;; side-effects. Also printing a function within a tooltip generates an
+;; unexpected starting annotation (phase error).
+(defun gdb-tooltip-print-1 (expr)
+ (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+ (goto-char (point-min))
+ (if (search-forward "expands to: " nil t)
+ (unless (looking-at "\\S-+.*(.*).*")
+ (gdb-input
+ (list (concat "-data-evaluate-expression " expr)
+ `(lambda () (gdb-tooltip-print ,expr))))))))
+
+(defun gdb-init-buffer ()
+ (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+ (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+ (when gud-tooltip-mode
+ (make-local-variable 'gdb-define-alist)
+ (gdb-create-define-alist)
+ (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
+
+(defmacro gdb-if-arrow (arrow-position &rest body)
+ `(if ,arrow-position
+ (let ((buffer (marker-buffer ,arrow-position)) (line))
+ (if (equal buffer (window-buffer (posn-window end)))
+ (with-current-buffer buffer
+ (when (or (equal start end)
+ (equal (posn-point start)
+ (marker-position ,arrow-position)))
+ ,@body))))))
+
+(defun gdb-mouse-until (event)
+ "Continue running until a source line past the current line.
+The destination source line can be selected either by clicking
+with mouse-3 on the fringe/margin or dragging the arrow
+with mouse-1 (default bindings)."
+ (interactive "e")
+ (let ((start (event-start event))
+ (end (event-end event)))
+ (gdb-if-arrow gud-overlay-arrow-position
+ (setq line (line-number-at-pos (posn-point end)))
+ (gud-call (concat "until " (number-to-string line))))
+ (gdb-if-arrow gdb-disassembly-position
+ (save-excursion
+ (goto-char (point-min))
+ (forward-line (1- (line-number-at-pos (posn-point end))))
+ (forward-char 2)
+ (gud-call (concat "until *%a"))))))
+
+(defun gdb-mouse-jump (event)
+ "Set execution address/line.
+The destination source line can be selected either by clicking with C-mouse-3
+on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings).
+Unlike `gdb-mouse-until' the destination address can be before the current
+line, and no execution takes place."
+ (interactive "e")
+ (let ((start (event-start event))
+ (end (event-end event)))
+ (gdb-if-arrow gud-overlay-arrow-position
+ (setq line (line-number-at-pos (posn-point end)))
+ (progn
+ (gud-call (concat "tbreak " (number-to-string line)))
+ (gud-call (concat "jump " (number-to-string line)))))
+ (gdb-if-arrow gdb-disassembly-position
+ (save-excursion
+ (goto-char (point-min))
+ (forward-line (1- (line-number-at-pos (posn-point end))))
+ (forward-char 2)
+ (progn
+ (gud-call (concat "tbreak *%a"))
+ (gud-call (concat "jump *%a")))))))
+
+(defcustom gdb-show-changed-values t
+ "If non-nil change the face of out of scope variables and changed values.
+Out of scope variables are suppressed with `shadow' face.
+Changed values are highlighted with the face `font-lock-warning-face'."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defcustom gdb-max-children 40
+ "Maximum number of children before expansion requires confirmation."
+ :type 'integer
+ :group 'gdb
+ :version "22.1")
+
+(defcustom gdb-delete-out-of-scope t
+ "If non-nil delete watch expressions automatically when they go out of scope."
+ :type 'boolean
+ :group 'gdb
+ :version "22.2")
+
+(defcustom gdb-speedbar-auto-raise nil
+ "If non-nil raise speedbar every time display of watch expressions is\
+ updated."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defcustom gdb-use-colon-colon-notation nil
+ "If non-nil use FUN::VAR format to display variables in the speedbar."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defun gdb-speedbar-auto-raise (arg)
+ "Toggle automatic raising of the speedbar for watch expressions.
+With prefix argument ARG, automatically raise speedbar if ARG is
+positive, otherwise don't automatically raise it."
+ (interactive "P")
+ (setq gdb-speedbar-auto-raise
+ (if (null arg)
+ (not gdb-speedbar-auto-raise)
+ (> (prefix-numeric-value arg) 0)))
+ (message (format "Auto raising %sabled"
+ (if gdb-speedbar-auto-raise "en" "dis"))))
+
+(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
+(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
+
+(declare-function tooltip-identifier-from-point "tooltip" (point))
+
+(defun gud-watch (&optional arg event)
+ "Watch expression at point.
+With arg, enter name of variable to be watched in the minibuffer."
+ (interactive (list current-prefix-arg last-input-event))
+ (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
+ (if (eq minor-mode 'gdbmi)
+ (progn
+ (if event (posn-set-point (event-end event)))
+ (require 'tooltip)
+ (save-selected-window
+ (let ((expr
+ (if arg
+ (completing-read "Name of variable: "
+ 'gud-gdb-complete-command)
+ (if (and transient-mark-mode mark-active)
+ (buffer-substring (region-beginning) (region-end))
+ (concat (if (eq major-mode 'gdb-registers-mode) "$")
+ (tooltip-identifier-from-point (point)))))))
+ (set-text-properties 0 (length expr) nil expr)
+ (gdb-input
+ (list (concat"-var-create - * " expr "")
+ `(lambda () (gdb-var-create-handler ,expr)))))))
+ (message "gud-watch is a no-op in this mode."))))
+
+(defun gdb-var-create-handler (expr)
+ (let* ((result (gdb-json-partial-output)))
+ (if (not (bindat-get-field result 'msg))
+ (let ((var
+ (list (bindat-get-field result 'name)
+ (if (and (string-equal gdb-current-language "c")
+ gdb-use-colon-colon-notation gdb-selected-frame)
+ (setq expr (concat gdb-selected-frame "::" expr))
+ expr)
+ (bindat-get-field result 'numchild)
+ (bindat-get-field result 'type)
+ (bindat-get-field result 'value)
+ nil
+ (bindat-get-field result 'has_more)
+ gdb-frame-address)))
+ (push var gdb-var-list)
+ (speedbar 1)
+ (unless (string-equal
+ speedbar-initial-expansion-list-name "GUD")
+ (speedbar-change-initial-expansion-list "GUD")))
+ (message-box "No symbol \"%s\" in current context." expr))))
+
+(defun gdb-speedbar-update ()
+ (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
+ (not (gdb-pending-p 'gdb-speedbar-timer)))
+ ;; Dummy command to update speedbar even when idle.
+ (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn))
+ ;; Keep gdb-pending-triggers non-nil till end.
+ (gdb-add-pending 'gdb-speedbar-timer)))
+
+(defun gdb-speedbar-timer-fn ()
+ (if gdb-speedbar-auto-raise
+ (raise-frame speedbar-frame))
+ (gdb-delete-pending 'gdb-speedbar-timer)
+ (speedbar-timer-fn))
+
+(defun gdb-var-evaluate-expression-handler (varnum changed)
+ (goto-char (point-min))
+ (re-search-forward ".*value=\\(\".*\"\\)" nil t)
+ (let ((var (assoc varnum gdb-var-list)))
+ (when var
+ (if changed (setcar (nthcdr 5 var) 'changed))
+ (setcar (nthcdr 4 var) (read (match-string 1)))))
+ (gdb-speedbar-update))
+
+; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards.
+(defun gdb-var-list-children (varnum)
+ (gdb-input
+ (list (concat "-var-update " varnum) 'ignore))
+ (gdb-input
+ (list (concat "-var-list-children --all-values "
+ varnum)
+ `(lambda () (gdb-var-list-children-handler ,varnum)))))
+
+(defun gdb-var-list-children-handler (varnum)
+ (let* ((var-list nil)
+ (output (bindat-get-field (gdb-json-partial-output "child")))
+ (children (bindat-get-field output 'children)))
+ (catch 'child-already-watched
+ (dolist (var gdb-var-list)
+ (if (string-equal varnum (car var))
+ (progn
+ ;; With dynamic varobjs numchild may have increased.
+ (setcar (nthcdr 2 var) (bindat-get-field output 'numchild))
+ (push var var-list)
+ (dolist (child children)
+ (let ((varchild (list (bindat-get-field child 'name)
+ (bindat-get-field child 'exp)
+ (bindat-get-field child 'numchild)
+ (bindat-get-field child 'type)
+ (bindat-get-field child 'value)
+ nil
+ (bindat-get-field child 'has_more))))
+ (if (assoc (car varchild) gdb-var-list)
+ (throw 'child-already-watched nil))
+ (push varchild var-list))))
+ (push var var-list)))
+ (setq gdb-var-list (nreverse var-list))))
+ (gdb-speedbar-update))
+
+(defun gdb-var-set-format (format)
+ "Set the output format for a variable displayed in the speedbar."
+ (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+ (varnum (car var)))
+ (gdb-input
+ (list (concat "-var-set-format " varnum " " format) 'ignore))
+ (gdb-var-update)))
+
+(defun gdb-var-delete-1 (var varnum)
+ (gdb-input
+ (list (concat "-var-delete " varnum) 'ignore))
+ (setq gdb-var-list (delq var gdb-var-list))
+ (dolist (varchild gdb-var-list)
+ (if (string-match (concat (car var) "\\.") (car varchild))
+ (setq gdb-var-list (delq varchild gdb-var-list)))))
+
+(defun gdb-var-delete ()
+ "Delete watch expression at point from the speedbar."
+ (interactive)
+ (let ((text (speedbar-line-text)))
+ (string-match "\\(\\S-+\\)" text)
+ (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+ (varnum (car var)))
+ (if (string-match "\\." (car var))
+ (message-box "Can only delete a root expression")
+ (gdb-var-delete-1 var varnum)))))
+
+(defun gdb-var-delete-children (varnum)
+ "Delete children of variable object at point from the speedbar."
+ (gdb-input
+ (list (concat "-var-delete -c " varnum) 'ignore)))
+
+(defun gdb-edit-value (text token indent)
+ "Assign a value to a variable displayed in the speedbar."
+ (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+ (varnum (car var)) (value))
+ (setq value (read-string "New value: "))
+ (gdb-input
+ (list (concat "-var-assign " varnum " " value)
+ `(lambda () (gdb-edit-value-handler ,value))))))
+
+(defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)")
+
+(defun gdb-edit-value-handler (value)
+ (goto-char (point-min))
+ (if (re-search-forward gdb-error-regexp nil t)
+ (message-box "Invalid number or expression (%s)" value)))
+
+; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
+(defun gdb-var-update ()
+ (if (not (gdb-pending-p 'gdb-var-update))
+ (gdb-input
+ (list "-var-update --all-values *" 'gdb-var-update-handler)))
+ (gdb-add-pending 'gdb-var-update))
+
+(defun gdb-var-update-handler ()
+ (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist)))
+ (dolist (var gdb-var-list)
+ (setcar (nthcdr 5 var) nil))
+ (let ((temp-var-list gdb-var-list))
+ (dolist (change changelist)
+ (let* ((varnum (bindat-get-field change 'name))
+ (var (assoc varnum gdb-var-list))
+ (new-num (bindat-get-field change 'new_num_children)))
+ (when var
+ (let ((scope (bindat-get-field change 'in_scope))
+ (has-more (bindat-get-field change 'has_more)))
+ (cond ((string-equal scope "false")
+ (if gdb-delete-out-of-scope
+ (gdb-var-delete-1 var varnum)
+ (setcar (nthcdr 5 var) 'out-of-scope)))
+ ((string-equal scope "true")
+ (setcar (nthcdr 6 var) has-more)
+ (when (and (or (not has-more)
+ (string-equal has-more "0"))
+ (not new-num)
+ (string-equal (nth 2 var) "0"))
+ (setcar (nthcdr 4 var)
+ (bindat-get-field change 'value))
+ (setcar (nthcdr 5 var) 'changed)))
+ ((string-equal scope "invalid")
+ (gdb-var-delete-1 var varnum)))))
+ (let ((var-list nil) var1
+ (children (bindat-get-field change 'new_children)))
+ (if new-num
+ (progn
+ (setq var1 (pop temp-var-list))
+ (while var1
+ (if (string-equal varnum (car var1))
+ (let ((new (string-to-number new-num))
+ (previous (string-to-number (nth 2 var1))))
+ (setcar (nthcdr 2 var1) new-num)
+ (push var1 var-list)
+ (cond ((> new previous)
+ ;; Add new children to list.
+ (dotimes (dummy previous)
+ (push (pop temp-var-list) var-list))
+ (dolist (child children)
+ (let ((varchild
+ (list (bindat-get-field child 'name)
+ (bindat-get-field child 'exp)
+ (bindat-get-field child 'numchild)
+ (bindat-get-field child 'type)
+ (bindat-get-field child 'value)
+ 'changed
+ (bindat-get-field child 'has_more))))
+ (push varchild var-list))))
+ ;; Remove deleted children from list.
+ ((< new previous)
+ (dotimes (dummy new)
+ (push (pop temp-var-list) var-list))
+ (dotimes (dummy (- previous new))
+ (pop temp-var-list)))))
+ (push var1 var-list))
+ (setq var1 (pop temp-var-list)))
+ (setq gdb-var-list (nreverse var-list)))))))))
+ (setq gdb-pending-triggers
+ (delq 'gdb-var-update gdb-pending-triggers))
+ (gdb-speedbar-update))
+
+(defun gdb-speedbar-expand-node (text token indent)
+ "Expand the node the user clicked on.
+TEXT is the text of the button we clicked on, a + or - item.
+TOKEN is data related to this node.
+INDENT is the current indentation depth."
+ (cond ((string-match "+" text) ;expand this node
+ (let* ((var (assoc token gdb-var-list))
+ (expr (nth 1 var)) (children (nth 2 var)))
+ (if (or (<= (string-to-number children) gdb-max-children)
+ (y-or-n-p
+ (format "%s has %s children. Continue? " expr children)))
+ (gdb-var-list-children token))))
+ ((string-match "-" text) ;contract this node
+ (dolist (var gdb-var-list)
+ (if (string-match (concat token "\\.") (car var))
+ (setq gdb-var-list (delq var gdb-var-list))))
+ (gdb-var-delete-children token)
+ (speedbar-change-expand-button-char ?+)
+ (speedbar-delete-subblock indent))
+ (t (error "Ooops... not sure what to do")))
+ (speedbar-center-buffer-smartly))
+
+(defun gdb-get-target-string ()
+ (with-current-buffer gud-comint-buffer
+ gud-target-name))
+\f
+
+;;
+;; gdb buffers.
+;;
+;; Each buffer has a TYPE -- a symbol that identifies the function
+;; of that particular buffer.
+;;
+;; The usual gdb interaction buffer is given the type `gdbmi' and
+;; is constructed specially.
+;;
+;; Others are constructed by gdb-get-buffer-create and
+;; named according to the rules set forth in the gdb-buffer-rules
+
+(defvar gdb-buffer-rules '())
+
+(defun gdb-rules-name-maker (rules-entry)
+ (cadr rules-entry))
+(defun gdb-rules-buffer-mode (rules-entry)
+ (nth 2 rules-entry))
+(defun gdb-rules-update-trigger (rules-entry)
+ (nth 3 rules-entry))
+
+(defun gdb-update-buffer-name ()
+ "Rename current buffer according to name-maker associated with
+it in `gdb-buffer-rules'."
+ (let ((f (gdb-rules-name-maker (assoc gdb-buffer-type
+ gdb-buffer-rules))))
+ (when f (rename-buffer (funcall f)))))
+
+(defun gdb-current-buffer-rules ()
+ "Get `gdb-buffer-rules' entry for current buffer type."
+ (assoc gdb-buffer-type gdb-buffer-rules))
+
+(defun gdb-current-buffer-thread ()
+ "Get thread object of current buffer from `gdb-threads-list'.
+
+When current buffer is not bound to any thread, return main
+thread."
+ (cdr (assoc gdb-thread-number gdb-threads-list)))
+
+(defun gdb-current-buffer-frame ()
+ "Get current stack frame object for thread of current buffer."
+ (bindat-get-field (gdb-current-buffer-thread) 'frame))
+
+(defun gdb-buffer-type (buffer)
+ "Get value of `gdb-buffer-type' for BUFFER."
+ (with-current-buffer buffer
+ gdb-buffer-type))
+
+(defun gdb-buffer-shows-main-thread-p ()
+ "Return t if current GDB buffer shows main selected thread and
+is not bound to it."
+ (current-buffer)
+ (not (local-variable-p 'gdb-thread-number)))
+
+(defun gdb-get-buffer (buffer-type &optional thread)
+ "Get a specific GDB buffer.
+
+In that buffer, `gdb-buffer-type' must be equal to BUFFER-TYPE
+and `gdb-thread-number' (if provided) must be equal to THREAD."
+ (catch 'found
+ (dolist (buffer (buffer-list) nil)
+ (with-current-buffer buffer
+ (when (and (eq gdb-buffer-type buffer-type)
+ (or (not thread)
+ (equal gdb-thread-number thread)))
+ (throw 'found buffer))))))
+
+(defun gdb-get-buffer-create (buffer-type &optional thread)
+ "Create a new GDB buffer of the type specified by BUFFER-TYPE.
+The buffer-type should be one of the cars in `gdb-buffer-rules'.
+
+If THREAD is non-nil, it is assigned to `gdb-thread-number'
+buffer-local variable of the new buffer.
+
+Buffer mode and name are selected according to buffer type.
+
+If buffer has trigger associated with it in `gdb-buffer-rules',
+this trigger is subscribed to `gdb-buf-publisher' and called with
+'update argument."
+ (or (gdb-get-buffer buffer-type thread)
+ (let ((rules (assoc buffer-type gdb-buffer-rules))
+ (new (generate-new-buffer "limbo")))
+ (with-current-buffer new
+ (let ((mode (gdb-rules-buffer-mode rules))
+ (trigger (gdb-rules-update-trigger rules)))
+ (when mode (funcall mode))
+ (setq gdb-buffer-type buffer-type)
+ (when thread
+ (set (make-local-variable 'gdb-thread-number) thread))
+ (set (make-local-variable 'gud-minor-mode)
+ (buffer-local-value 'gud-minor-mode gud-comint-buffer))
+ (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+ (rename-buffer (funcall (gdb-rules-name-maker rules)))
+ (when trigger
+ (gdb-add-subscriber gdb-buf-publisher
+ (cons (current-buffer)
+ (gdb-bind-function-to-buffer trigger (current-buffer))))
+ (funcall trigger 'start))
+ (current-buffer))))))
+
+(defun gdb-bind-function-to-buffer (expr buffer)
+ "Return a function which will evaluate EXPR in BUFFER."
+ `(lambda (&rest args)
+ (with-current-buffer ,buffer
+ (apply ',expr args))))
+
+;; Used to define all gdb-frame-*-buffer functions except
+;; `gdb-frame-io-buffer'
+(defmacro def-gdb-frame-for-buffer (name buffer &optional doc)
+ "Define a function NAME which shows gdb BUFFER in a separate frame.
+
+DOC is an optional documentation string."
+ `(defun ,name (&optional thread)
+ ,(when doc doc)
+ (interactive)
+ (let ((special-display-regexps (append special-display-regexps '(".*")))
+ (special-display-frame-alist gdb-frame-parameters))
+ (display-buffer (gdb-get-buffer-create ,buffer thread)))))
+
+(defmacro def-gdb-display-buffer (name buffer &optional doc)
+ "Define a function NAME which shows gdb BUFFER.
+
+DOC is an optional documentation string."
+ `(defun ,name (&optional thread)
+ ,(when doc doc)
+ (interactive)
+ (gdb-display-buffer
+ (gdb-get-buffer-create ,buffer thread) t)))
+
+;; Used to display windows with thread-bound buffers
+(defmacro def-gdb-preempt-display-buffer (name buffer &optional doc
+ split-horizontal)
+ `(defun ,name (&optional thread)
+ ,(when doc doc)
+ (message thread)
+ (gdb-preempt-existing-or-display-buffer
+ (gdb-get-buffer-create ,buffer thread)
+ ,split-horizontal)))
+
+;; This assoc maps buffer type symbols to rules. Each rule is a list of
+;; at least one and possible more functions. The functions have these
+;; roles in defining a buffer type:
+;;
+;; NAME - Return a name for this buffer type.
+;;
+;; The remaining function(s) are optional:
+;;
+;; MODE - called in a new buffer with no arguments, should establish
+;; the proper mode for the buffer.
+;;
+
+(defun gdb-set-buffer-rules (buffer-type &rest rules)
+ (let ((binding (assoc buffer-type gdb-buffer-rules)))
+ (if binding
+ (setcdr binding rules)
+ (push (cons buffer-type rules)
+ gdb-buffer-rules))))
+
+(defun gdb-parent-mode ()
+ "Generic mode to derive all other GDB buffer modes from."
+ (kill-all-local-variables)
+ (setq buffer-read-only t)
+ (buffer-disable-undo)
+ ;; Delete buffer from gdb-buf-publisher when it's killed
+ ;; (if it has an associated update trigger)
+ (add-hook
+ 'kill-buffer-hook
+ (function
+ (lambda ()
+ (let ((trigger (gdb-rules-update-trigger
+ (gdb-current-buffer-rules))))
+ (when trigger
+ (gdb-delete-subscriber
+ gdb-buf-publisher
+ ;; This should match gdb-add-subscriber done in
+ ;; gdb-get-buffer-create
+ (cons (current-buffer)
+ (gdb-bind-function-to-buffer trigger (current-buffer))))))))
+ nil t))
+
+;; Partial-output buffer : This accumulates output from a command executed on
+;; behalf of emacs (rather than the user).
+;;
+(gdb-set-buffer-rules 'gdb-partial-output-buffer
+ 'gdb-partial-output-name)
+
+(defun gdb-partial-output-name ()
+ (concat " *partial-output-"
+ (gdb-get-target-string)
+ "*"))
+
+\f
+(gdb-set-buffer-rules 'gdb-inferior-io
+ 'gdb-inferior-io-name
+ 'gdb-inferior-io-mode)
+
+(defun gdb-inferior-io-name ()
+ (concat "*input/output of "
+ (gdb-get-target-string)
+ "*"))
+
+(defun gdb-display-io-buffer ()
+ "Display IO of debugged program in a separate window."
+ (interactive)
+ (gdb-display-buffer
+ (gdb-get-buffer-create 'gdb-inferior-io) t))
+
+(defconst gdb-frame-parameters
+ '((height . 14) (width . 80)
+ (unsplittable . t)
+ (tool-bar-lines . nil)
+ (menu-bar-lines . nil)
+ (minibuffer . nil)))
+
+(defun gdb-frame-io-buffer ()
+ "Display IO of debugged program in a new frame."
+ (interactive)
+ (let ((special-display-regexps (append special-display-regexps '(".*")))
+ (special-display-frame-alist gdb-frame-parameters))
+ (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))
+
+(defvar gdb-inferior-io-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-c" 'gdb-io-interrupt)
+ (define-key map "\C-c\C-z" 'gdb-io-stop)
+ (define-key map "\C-c\C-\\" 'gdb-io-quit)
+ (define-key map "\C-c\C-d" 'gdb-io-eof)
+ (define-key map "\C-d" 'gdb-io-eof)
+ map))
+
+;; We want to use comint because it has various nifty and familiar features.
+(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
+ "Major mode for gdb inferior-io.
+
+The following commands are available:
+\\{gdb-inferior-io-mode-map}"
+
+ :syntax-table nil :abbrev-table nil
+
+(make-comint-in-buffer "gdb-inferior" (current-buffer) nil))
+
+(defun gdb-inferior-filter (proc string)
+ (unless (string-equal string "")
+ (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t))
+ (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
+ (comint-output-filter proc string)))
+
+(defun gdb-io-interrupt ()
+ "Interrupt the program being debugged."
+ (interactive)
+ (interrupt-process
+ (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-quit ()
+ "Send quit signal to the program being debugged."
+ (interactive)
+ (quit-process
+ (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-stop ()
+ "Stop the program being debugged."
+ (interactive)
+ (stop-process
+ (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-eof ()
+ "Send end-of-file to the program being debugged."
+ (interactive)
+ (process-send-eof
+ (get-buffer-process gud-comint-buffer)))
+
+(defun gdb-clear-inferior-io ()
+ (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
+ (erase-buffer)))
+\f
+
+(defconst breakpoint-xpm-data
+ "/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+\"10 10 2 1\",
+\" c red\",
+\"+ c None\",
+/* pixels */
+\"+++ +++\",
+\"++ ++\",
+\"+ +\",
+\" \",
+\" \",
+\" \",
+\" \",
+\"+ +\",
+\"++ ++\",
+\"+++ +++\",
+};"
+ "XPM data used for breakpoint icon.")
+
+(defconst breakpoint-enabled-pbm-data
+ "P1
+10 10\",
+0 0 0 0 1 1 1 1 0 0 0 0
+0 0 0 1 1 1 1 1 1 0 0 0
+0 0 1 1 1 1 1 1 1 1 0 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 0 1 1 1 1 1 1 1 1 0 0
+0 0 0 1 1 1 1 1 1 0 0 0
+0 0 0 0 1 1 1 1 0 0 0 0"
+ "PBM data used for enabled breakpoint icon.")
+
+(defconst breakpoint-disabled-pbm-data
+ "P1
+10 10\",
+0 0 1 0 1 0 1 0 0 0
+0 1 0 1 0 1 0 1 0 0
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+0 0 1 0 1 0 1 0 1 0
+0 0 0 1 0 1 0 1 0 0"
+ "PBM data used for disabled breakpoint icon.")
+
+(defvar breakpoint-enabled-icon nil
+ "Icon for enabled breakpoint in display margin.")
+
+(defvar breakpoint-disabled-icon nil
+ "Icon for disabled breakpoint in display margin.")
+
+(declare-function define-fringe-bitmap "fringe.c"
+ (bitmap bits &optional height width align))
+
+(and (display-images-p)
+ ;; Bitmap for breakpoint in fringe
+ (define-fringe-bitmap 'breakpoint
+ "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
+ ;; Bitmap for gud-overlay-arrow in fringe
+ (define-fringe-bitmap 'hollow-right-triangle
+ "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
+
+(defface breakpoint-enabled
+ '((t
+ :foreground "red1"
+ :weight bold))
+ "Face for enabled breakpoint icon in fringe."
+ :group 'gdb)
+
+(defface breakpoint-disabled
+ '((((class color) (min-colors 88)) :foreground "grey70")
+ ;; Ensure that on low-color displays that we end up something visible.
+ (((class color) (min-colors 8) (background light))
+ :foreground "black")
+ (((class color) (min-colors 8) (background dark))
+ :foreground "white")
+ (((type tty) (class mono))
+ :inverse-video t)
+ (t :background "gray"))
+ "Face for disabled breakpoint icon in fringe."
+ :group 'gdb)
+
+\f
+(defun gdb-send (proc string)
+ "A comint send filter for gdb."
+ (with-current-buffer gud-comint-buffer
+ (let ((inhibit-read-only t))
+ (remove-text-properties (point-min) (point-max) '(face))))
+ ;; mimic <RET> key to repeat previous command in GDB
+ (if (not (string= "" string))
+ (setq gdb-last-command string)
+ (if gdb-last-command (setq string gdb-last-command)))
+ (if gdb-enable-debug
+ (push (cons 'mi-send (concat string "\n")) gdb-debug-log))
+ (if (string-match "^-" string)
+ ;; MI command
+ (progn
+ (setq gdb-first-done-or-error t)
+ (process-send-string proc (concat string "\n")))
+ ;; CLI command
+ (if (string-match "\\\\$" string)
+ (setq gdb-continuation (concat gdb-continuation string "\n"))
+ (setq gdb-first-done-or-error t)
+ (process-send-string proc (concat "-interpreter-exec console \""
+ gdb-continuation string "\"\n"))
+ (setq gdb-continuation nil))))
+
+(defun gdb-input (item)
+ (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
+ (setq gdb-token-number (1+ gdb-token-number))
+ (setcar item (concat (number-to-string gdb-token-number) (car item)))
+ (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist)
+ (process-send-string (get-buffer-process gud-comint-buffer)
+ (concat (car item) "\n")))
+
+;; NOFRAME is used for gud execution control commands
+(defun gdb-current-context-command (command)
+ "Add --thread to gdb COMMAND when needed."
+ (if (and gdb-thread-number
+ (string-equal gdb-version "7.0+"))
+ (concat command " --thread " gdb-thread-number)
+ command))
+
+(defun gdb-current-context-buffer-name (name)
+ "Add thread information and asterisks to string NAME.
+
+If `gdb-thread-number' is nil, just wrap NAME in asterisks."
+ (concat "*" name
+ (if (local-variable-p 'gdb-thread-number)
+ (format " (bound to thread %s)" gdb-thread-number)
+ "")
+ "*"))
+
+(defun gdb-current-context-mode-name (mode)
+ "Add thread information to MODE which is to be used as
+`mode-name'."
+ (concat mode
+ (if gdb-thread-number
+ (format " [thread %s]" gdb-thread-number)
+ "")))
+\f
+
+(defcustom gud-gdb-command-name "gdb -i=mi"
+ "Default command to execute an executable under the GDB debugger."
+ :type 'string
+ :group 'gdb)
+
+(defun gdb-resync()
+ (setq gud-running nil)
+ (setq gdb-output-sink 'user)
+ (setq gdb-pending-triggers nil))
+
+(defun gdb-update ()
+ "Update buffers showing status of debug session."
+ (when gdb-first-prompt
+ (gdb-force-mode-line-update
+ (propertize "initializing..." 'face font-lock-variable-name-face))
+ (gdb-init-1)
+ (setq gdb-first-prompt nil))
+
+ (gdb-get-main-selected-frame)
+ ;; We may need to update gdb-threads-list so we can use
+ (gdb-get-buffer-create 'gdb-threads-buffer)
+ ;; gdb-break-list is maintained in breakpoints handler
+ (gdb-get-buffer-create 'gdb-breakpoints-buffer)
+
+ (gdb-emit-signal gdb-buf-publisher 'update)
+
+ (gdb-get-changed-registers)
+
+ (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+ (dolist (var gdb-var-list)
+ (setcar (nthcdr 5 var) nil))
+ (gdb-var-update)))
+
+;; gdb-setq-thread-number and gdb-update-gud-running are decoupled
+;; because we may need to update current gud-running value without
+;; changing current thread (see gdb-running)
+(defun gdb-setq-thread-number (number)
+ "Only this function must be used to change `gdb-thread-number'
+value to NUMBER, because `gud-running' and `gdb-frame-number'
+need to be updated appropriately when current thread changes."
+ ;; GDB 6.8 and earlier always output thread-id="0" when stopping.
+ (unless (string-equal number "0") (setq gdb-thread-number number))
+ (setq gdb-frame-number "0")
+ (gdb-update-gud-running))
+
+(defun gdb-update-gud-running ()
+ "Set `gud-running' according to the state of current thread.
+
+`gdb-frame-number' is set to 0 if current thread is now stopped.
+
+Note that when `gdb-gud-control-all-threads' is t, `gud-running'
+cannot be reliably used to determine whether or not execution
+control buttons should be shown in menu or toolbar. Use
+`gdb-running-threads-count' and `gdb-stopped-threads-count'
+instead.
+
+For all-stop mode, thread information is unavailable while target
+is running."
+ (let ((old-value gud-running))
+ (setq gud-running
+ (string= (bindat-get-field (gdb-current-buffer-thread) 'state)
+ "running"))
+ ;; Set frame number to "0" when _current_ threads stops
+ (when (and (gdb-current-buffer-thread)
+ (not (eq gud-running old-value)))
+ (setq gdb-frame-number "0"))))
+
+(defun gdb-show-run-p ()
+ "Return t if \"Run/continue\" should be shown on the toolbar."
+ (or (not gdb-active-process)
+ (and (or
+ (not gdb-gud-control-all-threads)
+ (not gdb-non-stop))
+ (not gud-running))
+ (and gdb-gud-control-all-threads
+ (> gdb-stopped-threads-count 0))))
+
+(defun gdb-show-stop-p ()
+ "Return t if \"Stop\" should be shown on the toolbar."
+ (or (and (or
+ (not gdb-gud-control-all-threads)
+ (not gdb-non-stop))
+ gud-running)
+ (and gdb-gud-control-all-threads
+ (> gdb-running-threads-count 0))))
+
+;; GUD displays the selected GDB frame. This might might not be the current
+;; GDB frame (after up, down etc). If no GDB frame is visible but the last
+;; visited breakpoint is, use that window.
+(defun gdb-display-source-buffer (buffer)
+ (let* ((last-window (if gud-last-last-frame
+ (get-buffer-window
+ (gud-find-file (car gud-last-last-frame)))))
+ (source-window (or last-window
+ (if (and gdb-source-window
+ (window-live-p gdb-source-window))
+ gdb-source-window))))
+ (when source-window
+ (setq gdb-source-window source-window)
+ (set-window-buffer source-window buffer))
+ source-window))
+
+(defun gdb-car< (a b)
+ (< (car a) (car b)))
+
+(defvar gdbmi-record-list
+ '((gdb-gdb . "(gdb) \n")
+ (gdb-done . "\\([0-9]*\\)\\^done,?\\(.*?\\)\n")
+ (gdb-starting . "\\([0-9]*\\)\\^running\n")
+ (gdb-error . "\\([0-9]*\\)\\^error,\\(.*?\\)\n")
+ (gdb-console . "~\\(\".*?\"\\)\n")
+ (gdb-internals . "&\\(\".*?\"\\)\n")
+ (gdb-stopped . "\\*stopped,?\\(.*?\\)\n")
+ (gdb-running . "\\*running,\\(.*?\n\\)")
+ (gdb-thread-created . "=thread-created,\\(.*?\n\\)")
+ (gdb-thread-selected . "=thread-selected,\\(.*?\\)\n")
+ (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)")
+ (gdb-ignored-notification . "=[-[:alpha:]]+,?\\(.*?\\)\n")
+ (gdb-shell . "\\(\\(?:^.+\n\\)+\\)")))
+
+(defun gud-gdbmi-marker-filter (string)
+ "Filter GDB/MI output."
+
+ ;; Record transactions if logging is enabled.
+ (when gdb-enable-debug
+ (push (cons 'recv string) gdb-debug-log)
+ (if (and gdb-debug-log-max
+ (> (length gdb-debug-log) gdb-debug-log-max))
+ (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil)))
+
+ ;; Recall the left over gud-marker-acc from last time
+ (setq gud-marker-acc (concat gud-marker-acc string))
+
+ ;; Start accumulating output for the GUD buffer
+ (setq gdb-filter-output "")
+ (let ((output-record) (output-record-list))
+
+ ;; Process all the complete markers in this chunk.
+ (dolist (gdbmi-record gdbmi-record-list)
+ (while (string-match (cdr gdbmi-record) gud-marker-acc)
+ (push (list (match-beginning 0)
+ (car gdbmi-record)
+ (match-string 1 gud-marker-acc)
+ (match-string 2 gud-marker-acc)
+ (match-end 0))
+ output-record-list)
+ (setq gud-marker-acc
+ (concat (substring gud-marker-acc 0 (match-beginning 0))
+ ;; Pad with spaces to preserve position.
+ (make-string (length (match-string 0 gud-marker-acc)) 32)
+ (substring gud-marker-acc (match-end 0))))))
+
+ (setq output-record-list (sort output-record-list 'gdb-car<))
+
+ (dolist (output-record output-record-list)
+ (let ((record-type (cadr output-record))
+ (arg1 (nth 2 output-record))
+ (arg2 (nth 3 output-record)))
+ (if (eq record-type 'gdb-error)
+ (gdb-done-or-error arg2 arg1 'error)
+ (if (eq record-type 'gdb-done)
+ (gdb-done-or-error arg2 arg1 'done)
+ ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI
+ ;; error message on internal stream. Don't print to GUD buffer.
+ (unless (and (eq record-type 'gdb-internals)
+ (string-equal (read arg1) "No registers.\n"))
+ (funcall record-type arg1))))))
+
+ (setq gdb-output-sink 'user)
+ ;; Remove padding.
+ (string-match "^ *" gud-marker-acc)
+ (setq gud-marker-acc (substring gud-marker-acc (match-end 0)))
+
+ gdb-filter-output))
+
+(defun gdb-gdb (output-field))
+
+(defun gdb-shell (output-field)
+ (let ((gdb-output-sink gdb-output-sink))
+ (setq gdb-filter-output
+ (concat output-field gdb-filter-output))))
+
+(defun gdb-ignored-notification (output-field))
+
+;; gdb-invalidate-threads is defined to accept 'update-threads signal
+(defun gdb-thread-created (output-field))
+(defun gdb-thread-exited (output-field)
+ "Handle =thread-exited async record: unset `gdb-thread-number'
+ if current thread exited and update threads list."
+ (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'id)))
+ (if (string= gdb-thread-number thread-id)
+ (gdb-setq-thread-number nil))
+ ;; When we continue current thread and it quickly exits,
+ ;; gdb-pending-triggers left after gdb-running disallow us to
+ ;; properly call -thread-info without --thread option. Thus we
+ ;; need to use gdb-wait-for-pending.
+ (gdb-wait-for-pending
+ (gdb-emit-signal gdb-buf-publisher 'update-threads))))
+
+(defun gdb-thread-selected (output-field)
+ "Handler for =thread-selected MI output record.
+
+Sets `gdb-thread-number' to new id."
+ (let* ((result (gdb-json-string output-field))
+ (thread-id (bindat-get-field result 'id)))
+ (gdb-setq-thread-number thread-id)
+ ;; Typing `thread N` in GUD buffer makes GDB emit `^done` followed
+ ;; by `=thread-selected` notification. `^done` causes `gdb-update`
+ ;; as usually. Things happen to fast and second call (from
+ ;; gdb-thread-selected handler) gets cut off by our beloved
+ ;; gdb-pending-triggers.
+ ;; Solution is `gdb-wait-for-pending` macro: it guarantees that its
+ ;; body will get executed when `gdb-pending-triggers` is empty.
+ (gdb-wait-for-pending
+ (gdb-update))))
+
+(defun gdb-running (output-field)
+ (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'thread-id)))
+ ;; We reset gdb-frame-number to nil if current thread has gone
+ ;; running. This can't be done in gdb-thread-list-handler-custom
+ ;; because we need correct gdb-frame-number by the time
+ ;; -thread-info command is sent.
+ (when (or (string-equal thread-id "all")
+ (string-equal thread-id gdb-thread-number))
+ (setq gdb-frame-number nil)))
+ (setq gdb-inferior-status "running")
+ (gdb-force-mode-line-update
+ (propertize gdb-inferior-status 'face font-lock-type-face))
+ (when (not gdb-non-stop)
+ (setq gud-running t))
+ (setq gdb-active-process t)
+ (gdb-emit-signal gdb-buf-publisher 'update-threads))
+
+(defun gdb-starting (output-field)
+ ;; CLI commands don't emit ^running at the moment so use gdb-running too.
+ (setq gdb-inferior-status "running")
+ (gdb-force-mode-line-update
+ (propertize gdb-inferior-status 'face font-lock-type-face))
+ (setq gdb-active-process t)
+ (setq gud-running t)
+ ;; GDB doesn't seem to respond to -thread-info before first stop or
+ ;; thread exit (even in non-stop mode), so this is useless.
+ ;; Behaviour may change in the future.
+ (gdb-emit-signal gdb-buf-publisher 'update-threads))
+
+;; -break-insert -t didn't give a reason before gdb 6.9
+
+(defun gdb-stopped (output-field)
+ "Given the contents of *stopped MI async record, select new
+current thread and update GDB buffers."
+ ;; Reason is available with target-async only
+ (let* ((result (gdb-json-string output-field))
+ (reason (bindat-get-field result 'reason))
+ (thread-id (bindat-get-field result 'thread-id)))
+
+ ;; -data-list-register-names needs to be issued for any stopped
+ ;; thread
+ (when (not gdb-register-names)
+ (gdb-input
+ (list (concat "-data-list-register-names"
+ (if (string-equal gdb-version "7.0+")
+ (concat" --thread " thread-id)))
+ 'gdb-register-names-handler)))
+
+;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
+;;; because synchronous GDB doesn't give these fields with CLI.
+;;; (when file
+;;; (setq
+;;; ;; Extract the frame position from the marker.
+;;; gud-last-frame (cons file
+;;; (string-to-number
+;;; (match-string 6 gud-marker-acc)))))
+
+ (setq gdb-inferior-status (or reason "unknown"))
+ (gdb-force-mode-line-update
+ (propertize gdb-inferior-status 'face font-lock-warning-face))
+ (if (string-equal reason "exited-normally")
+ (setq gdb-active-process nil))
+
+ ;; Select new current thread.
+
+ ;; Don't switch if we have no reasons selected
+ (when gdb-switch-reasons
+ ;; Switch from another stopped thread only if we have
+ ;; gdb-switch-when-another-stopped:
+ (when (or gdb-switch-when-another-stopped
+ (not (string= "stopped"
+ (bindat-get-field (gdb-current-buffer-thread) 'state))))
+ ;; Switch if current reason has been selected or we have no
+ ;; reasons
+ (if (or (eq gdb-switch-reasons t)
+ (member reason gdb-switch-reasons))
+ (when (not (string-equal gdb-thread-number thread-id))
+ (message (concat "Switched to thread " thread-id))
+ (gdb-setq-thread-number thread-id))
+ (message (format "Thread %s stopped" thread-id)))))
+
+ ;; Print "(gdb)" to GUD console
+ (when gdb-first-done-or-error
+ (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+
+ ;; In non-stop, we update information as soon as another thread gets
+ ;; stopped
+ (when (or gdb-first-done-or-error
+ gdb-non-stop)
+ ;; In all-stop this updates gud-running properly as well.
+ (gdb-update)
+ (setq gdb-first-done-or-error nil))
+ (run-hook-with-args 'gdb-stopped-hooks result)))
+
+;; Remove the trimmings from log stream containing debugging messages
+;; being produced by GDB's internals, use warning face and send to GUD
+;; buffer.
+(defun gdb-internals (output-field)
+ (setq gdb-filter-output
+ (gdb-concat-output
+ gdb-filter-output
+ (let ((error-message
+ (read output-field)))
+ (put-text-property
+ 0 (length error-message)
+ 'face font-lock-warning-face
+ error-message)
+ error-message))))
+
+;; Remove the trimmings from the console stream and send to GUD buffer
+;; (frontend MI commands should not print to this stream)
+(defun gdb-console (output-field)
+ (setq gdb-filter-output
+ (gdb-concat-output
+ gdb-filter-output
+ (read output-field))))
+
+(defun gdb-done-or-error (output-field token-number type)
+ (if (string-equal token-number "")
+ ;; Output from command entered by user
+ (progn
+ (setq gdb-output-sink 'user)
+ (setq token-number nil)
+ ;; MI error - send to minibuffer
+ (when (eq type 'error)
+ ;; Skip "msg=" from `output-field'
+ (message (read (substring output-field 4)))
+ ;; Don't send to the console twice. (If it is a console error
+ ;; it is also in the console stream.)
+ (setq output-field nil)))
+ ;; Output from command from frontend.
+ (setq gdb-output-sink 'emacs))
+
+ (gdb-clear-partial-output)
+ (when gdb-first-done-or-error
+ (unless (or token-number gud-running)
+ (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+ (gdb-update)
+ (setq gdb-first-done-or-error nil))
+
+ (setq gdb-filter-output
+ (gdb-concat-output gdb-filter-output output-field))
+
+ (if token-number
+ (progn
+ (with-current-buffer
+ (gdb-get-buffer-create 'gdb-partial-output-buffer)
+ (funcall
+ (cdr (assoc (string-to-number token-number) gdb-handler-alist))))
+ (setq gdb-handler-alist
+ (assq-delete-all token-number gdb-handler-alist)))))
+
+(defun gdb-concat-output (so-far new)
+ (let ((sink gdb-output-sink))
+ (cond
+ ((eq sink 'user) (concat so-far new))
+ ((eq sink 'emacs)
+ (gdb-append-to-partial-output new)
+ so-far))))
+
+(defun gdb-append-to-partial-output (string)
+ (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+ (goto-char (point-max))
+ (insert string)))
+
+(defun gdb-clear-partial-output ()
+ (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+ (erase-buffer)))
+
+(defun gdb-jsonify-buffer (&optional fix-key fix-list)
+ "Prepare GDB/MI output in current buffer for parsing with `json-read'.
+
+Field names are wrapped in double quotes and equal signs are
+replaced with semicolons.
+
+If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurences from
+partial output. This is used to get rid of useless keys in lists
+in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and
+-break-info are examples of MI commands which issue such
+responses.
+
+If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
+\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
+-break-info output when it contains breakpoint script field
+incompatible with GDB/MI output syntax."
+ (save-excursion
+ (goto-char (point-min))
+ (when fix-key
+ (save-excursion
+ (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
+ (replace-match "" nil nil nil 1))))
+ (when fix-list
+ (save-excursion
+ ;; Find positions of braces which enclose broken list
+ (while (re-search-forward (concat fix-list "={\"") nil t)
+ (let ((p1 (goto-char (- (point) 2)))
+ (p2 (progn (forward-sexp)
+ (1- (point)))))
+ ;; Replace braces with brackets
+ (save-excursion
+ (goto-char p1)
+ (delete-char 1)
+ (insert "[")
+ (goto-char p2)
+ (delete-char 1)
+ (insert "]"))))))
+ (goto-char (point-min))
+ (insert "{")
+ (while (re-search-forward
+ "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
+ (replace-match "\"\\1\":\\2" nil nil))
+ (goto-char (point-max))
+ (insert "}")))
+
+(defun gdb-json-read-buffer (&optional fix-key fix-list)
+ "Prepare and parse GDB/MI output in current buffer with `json-read'.
+
+FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
+ (gdb-jsonify-buffer fix-key fix-list)
+ (save-excursion
+ (goto-char (point-min))
+ (let ((json-array-type 'list))
+ (json-read))))
+
+(defun gdb-json-string (string &optional fix-key fix-list)
+ "Prepare and parse STRING containing GDB/MI output with `json-read'.
+
+FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
+ (with-temp-buffer
+ (insert string)
+ (gdb-json-read-buffer fix-key fix-list)))
+
+(defun gdb-json-partial-output (&optional fix-key fix-list)
+ "Prepare and parse gdb-partial-output-buffer with `json-read'.
+
+FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'."
+ (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+ (gdb-json-read-buffer fix-key fix-list)))
+
+(defun gdb-line-posns (line)
+ "Return a pair of LINE beginning and end positions."
+ (let ((offset (1+ (- line (line-number-at-pos)))))
+ (cons
+ (line-beginning-position offset)
+ (line-end-position offset))))
+
+(defmacro gdb-mark-line (line variable)
+ "Set VARIABLE marker to point at beginning of LINE.
+
+If current window has no fringes, inverse colors on LINE.
+
+Return position where LINE begins."
+ `(save-excursion
+ (let* ((posns (gdb-line-posns ,line))
+ (start-posn (car posns))
+ (end-posn (cdr posns)))
+ (set-marker ,variable (copy-marker start-posn))
+ (when (not (> (car (window-fringes)) 0))
+ (put-text-property start-posn end-posn
+ 'font-lock-face '(:inverse-video t)))
+ start-posn)))
+
+(defun gdb-pad-string (string padding)
+ (format (concat "%" (number-to-string padding) "s") string))
+
+;; gdb-table struct is a way to programmatically construct simple
+;; tables. It help to reliably align columns of data in GDB buffers
+;; and provides
+(defstruct
+ gdb-table
+ (column-sizes nil)
+ (rows nil)
+ (row-properties nil)
+ (right-align nil))
+
+(defun gdb-mapcar* (function &rest seqs)
+ "Apply FUNCTION to each element of SEQS, and make a list of the results.
+If there are several SEQS, FUNCTION is called with that many
+arugments, and mapping stops as sson as the shortest list runs
+out."
+ (let ((shortest (apply #'min (mapcar #'length seqs))))
+ (mapcar (lambda (i)
+ (apply function
+ (mapcar
+ (lambda (seq)
+ (nth i seq))
+ seqs)))
+ (number-sequence 0 (1- shortest)))))
+
+(defun gdb-table-add-row (table row &optional properties)
+ "Add ROW of string to TABLE and recalculate column sizes.
+
+When non-nil, PROPERTIES will be added to the whole row when
+calling `gdb-table-string'."
+ (let ((rows (gdb-table-rows table))
+ (row-properties (gdb-table-row-properties table))
+ (column-sizes (gdb-table-column-sizes table))
+ (right-align (gdb-table-right-align table)))
+ (when (not column-sizes)
+ (setf (gdb-table-column-sizes table)
+ (make-list (length row) 0)))
+ (setf (gdb-table-rows table)
+ (append rows (list row)))
+ (setf (gdb-table-row-properties table)
+ (append row-properties (list properties)))
+ (setf (gdb-table-column-sizes table)
+ (gdb-mapcar* (lambda (x s)
+ (let ((new-x
+ (max (abs x) (string-width (or s "")))))
+ (if right-align new-x (- new-x))))
+ (gdb-table-column-sizes table)
+ row))
+ ;; Avoid trailing whitespace at eol
+ (if (not (gdb-table-right-align table))
+ (setcar (last (gdb-table-column-sizes table)) 0))))
+
+(defun gdb-table-string (table &optional sep)
+ "Return TABLE as a string with columns separated with SEP."
+ (let ((column-sizes (gdb-table-column-sizes table))
+ (res ""))
+ (mapconcat
+ 'identity
+ (gdb-mapcar*
+ (lambda (row properties)
+ (apply 'propertize
+ (mapconcat 'identity
+ (gdb-mapcar* (lambda (s x) (gdb-pad-string s x))
+ row column-sizes)
+ sep)
+ properties))
+ (gdb-table-rows table)
+ (gdb-table-row-properties table))
+ "\n")))
+
+;; bindat-get-field goes deep, gdb-get-many-fields goes wide
+(defun gdb-get-many-fields (struct &rest fields)
+ "Return a list of FIELDS values from STRUCT."
+ (let ((values))
+ (dolist (field fields values)
+ (setq values (append values (list (bindat-get-field struct field)))))))
+
+(defmacro def-gdb-auto-update-trigger (trigger-name gdb-command
+ handler-name
+ &optional signal-list)
+ "Define a trigger TRIGGER-NAME which sends GDB-COMMAND and sets
+HANDLER-NAME as its handler. HANDLER-NAME is bound to current
+buffer with `gdb-bind-function-to-buffer'.
+
+If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the
+defined trigger is called with an argument from SIGNAL-LIST. It's
+not recommended to define triggers with empty SIGNAL-LIST.
+Normally triggers should respond at least to 'update signal.
+
+Normally the trigger defined by this command must be called from
+the buffer where HANDLER-NAME must work. This should be done so
+that buffer-local thread number may be used in GDB-COMMAND (by
+calling `gdb-current-context-command').
+`gdb-bind-function-to-buffer' is used to achieve this, see
+`gdb-get-buffer-create'.
+
+Triggers defined by this command are meant to be used as a
+trigger argument when describing buffer types with
+`gdb-set-buffer-rules'."
+ `(defun ,trigger-name (&optional signal)
+ (when
+ (or (not ,signal-list)
+ (memq signal ,signal-list))
+ (when (not (gdb-pending-p
+ (cons (current-buffer) ',trigger-name)))
+ (gdb-input
+ (list ,gdb-command
+ (gdb-bind-function-to-buffer ',handler-name (current-buffer))))
+ (gdb-add-pending (cons (current-buffer) ',trigger-name))))))
+
+;; Used by disassembly buffer only, the rest use
+;; def-gdb-trigger-and-handler
+(defmacro def-gdb-auto-update-handler (handler-name trigger-name custom-defun
+ &optional nopreserve)
+ "Define a handler HANDLER-NAME for TRIGGER-NAME with CUSTOM-DEFUN.
+
+Handlers are normally called from the buffers they put output in.
+
+Delete ((current-buffer) . TRIGGER-NAME) from
+`gdb-pending-triggers', erase current buffer and evaluate
+CUSTOM-DEFUN. Then `gdb-update-buffer-name' is called.
+
+If NOPRESERVE is non-nil, window point is not restored after CUSTOM-DEFUN."
+ `(defun ,handler-name ()
+ (gdb-delete-pending (cons (current-buffer) ',trigger-name))
+ (let* ((buffer-read-only nil)
+ (window (get-buffer-window (current-buffer) 0))
+ (start (window-start window))
+ (p (window-point window)))
+ (erase-buffer)
+ (,custom-defun)
+ (gdb-update-buffer-name)
+ ,(when (not nopreserve)
+ '(set-window-start window start)
+ '(set-window-point window p)))))
+
+(defmacro def-gdb-trigger-and-handler (trigger-name gdb-command
+ handler-name custom-defun
+ &optional signal-list)
+ "Define trigger and handler.
+
+TRIGGER-NAME trigger is defined to send GDB-COMMAND. See
+`def-gdb-auto-update-trigger'.
+
+HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
+`def-gdb-auto-update-handler'."
+ `(progn
+ (def-gdb-auto-update-trigger ,trigger-name
+ ,gdb-command
+ ,handler-name ,signal-list)
+ (def-gdb-auto-update-handler ,handler-name
+ ,trigger-name ,custom-defun)))
+
+\f
+
+;; Breakpoint buffer : This displays the output of `-break-list'.
+(def-gdb-trigger-and-handler
+ gdb-invalidate-breakpoints "-break-list"
+ gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom
+ '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-breakpoints-buffer
+ 'gdb-breakpoints-buffer-name
+ 'gdb-breakpoints-mode
+ 'gdb-invalidate-breakpoints)
+
+(defun gdb-breakpoints-list-handler-custom ()
+ (let ((breakpoints-list (bindat-get-field
+ (gdb-json-partial-output "bkpt" "script")
+ 'BreakpointTable 'body))
+ (table (make-gdb-table)))
+ (setq gdb-breakpoints-list nil)
+ (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Addr" "Hits" "What"))
+ (dolist (breakpoint breakpoints-list)
+ (add-to-list 'gdb-breakpoints-list
+ (cons (bindat-get-field breakpoint 'number)
+ breakpoint))
+ (let ((at (bindat-get-field breakpoint 'at))
+ (pending (bindat-get-field breakpoint 'pending))
+ (func (bindat-get-field breakpoint 'func))
+ (type (bindat-get-field breakpoint 'type)))
+ (gdb-table-add-row table
+ (list
+ (bindat-get-field breakpoint 'number)
+ type
+ (bindat-get-field breakpoint 'disp)
+ (let ((flag (bindat-get-field breakpoint 'enabled)))
+ (if (string-equal flag "y")
+ (propertize "y" 'font-lock-face font-lock-warning-face)
+ (propertize "n" 'font-lock-face font-lock-comment-face)))
+ (bindat-get-field breakpoint 'addr)
+ (bindat-get-field breakpoint 'times)
+ (if (string-match ".*watchpoint" type)
+ (bindat-get-field breakpoint 'what)
+ (or pending at
+ (concat "in "
+ (propertize func 'font-lock-face font-lock-function-name-face)
+ (gdb-frame-location breakpoint)))))
+ ;; Add clickable properties only for breakpoints with file:line
+ ;; information
+ (append (list 'gdb-breakpoint breakpoint)
+ (when func '(help-echo "mouse-2, RET: visit breakpoint"
+ mouse-face highlight))))))
+ (insert (gdb-table-string table " "))
+ (gdb-place-breakpoints)))
+
+;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
+(defun gdb-place-breakpoints ()
+ (let ((flag) (bptno))
+ ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (if (and (eq gud-minor-mode 'gdbmi)
+ (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
+ (gdb-remove-breakpoint-icons (point-min) (point-max)))))
+ (dolist (breakpoint gdb-breakpoints-list)
+ (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is
+ ; an associative list
+ (line (bindat-get-field breakpoint 'line)))
+ (when line
+ (let ((file (bindat-get-field breakpoint 'fullname))
+ (flag (bindat-get-field breakpoint 'enabled))
+ (bptno (bindat-get-field breakpoint 'number)))
+ (unless (file-exists-p file)
+ (setq file (cdr (assoc bptno gdb-location-alist))))
+ (if (and file
+ (not (string-equal file "File not found")))
+ (with-current-buffer
+ (find-file-noselect file 'nowarn)
+ (gdb-init-buffer)
+ ;; Only want one breakpoint icon at each location.
+ (gdb-put-breakpoint-icon (string-equal flag "y") bptno
+ (string-to-number line)))
+ (gdb-input
+ (list (concat "list " file ":1")
+ 'ignore))
+ (gdb-input
+ (list "-file-list-exec-source-file"
+ `(lambda () (gdb-get-location
+ ,bptno ,line ,flag)))))))))))
+
+(defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"")
+
+(defun gdb-get-location (bptno line flag)
+ "Find the directory containing the relevant source file.
+Put in buffer and place breakpoint icon."
+ (goto-char (point-min))
+ (catch 'file-not-found
+ (if (re-search-forward gdb-source-file-regexp nil t)
+ (delete (cons bptno "File not found") gdb-location-alist)
+ (push (cons bptno (match-string 1)) gdb-location-alist)
+ (gdb-resync)
+ (unless (assoc bptno gdb-location-alist)
+ (push (cons bptno "File not found") gdb-location-alist)
+ (message-box "Cannot find source file for breakpoint location.
+Add directory to search path for source files using the GDB command, dir."))
+ (throw 'file-not-found nil))
+ (with-current-buffer (find-file-noselect (match-string 1))
+ (gdb-init-buffer)
+ ;; only want one breakpoint icon at each location
+ (gdb-put-breakpoint-icon (eq flag ?y) bptno (string-to-number line)))))
+
+(add-hook 'find-file-hook 'gdb-find-file-hook)
+
+(defun gdb-find-file-hook ()
+ "Set up buffer for debugging if file is part of the source code
+of the current session."
+ (if (and (buffer-name gud-comint-buffer)
+ ;; in case gud or gdb-ui is just loaded
+ gud-comint-buffer
+ (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi))
+ (if (member buffer-file-name gdb-source-file-list)
+ (with-current-buffer (find-buffer-visiting buffer-file-name)
+ (gdb-init-buffer)))))
+
+(declare-function gud-remove "gdb-mi" t t) ; gud-def
+(declare-function gud-break "gdb-mi" t t) ; gud-def
+(declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window))
+
+(defun gdb-mouse-set-clear-breakpoint (event)
+ "Set/clear breakpoint in left fringe/margin at mouse click.
+If not in a source or disassembly buffer just set point."
+ (interactive "e")
+ (mouse-minibuffer-check event)
+ (let ((posn (event-end event)))
+ (with-selected-window (posn-window posn)
+ (if (or (buffer-file-name) (eq major-mode 'gdb-disassembly-mode))
+ (if (numberp (posn-point posn))
+ (save-excursion
+ (goto-char (posn-point posn))
+ (if (or (posn-object posn)
+ (eq (car (fringe-bitmaps-at-pos (posn-point posn)))
+ 'breakpoint))
+ (gud-remove nil)
+ (gud-break nil)))))
+ (posn-set-point posn))))
+
+(defun gdb-mouse-toggle-breakpoint-margin (event)
+ "Enable/disable breakpoint in left margin with mouse click."
+ (interactive "e")
+ (mouse-minibuffer-check event)
+ (let ((posn (event-end event)))
+ (if (numberp (posn-point posn))
+ (with-selected-window (posn-window posn)
+ (save-excursion
+ (goto-char (posn-point posn))
+ (if (posn-object posn)
+ (gud-basic-call
+ (let ((bptno (get-text-property
+ 0 'gdb-bptno (car (posn-string posn)))))
+ (concat
+ (if (get-text-property
+ 0 'gdb-enabled (car (posn-string posn)))
+ "-break-disable "
+ "-break-enable ")
+ bptno)))))))))
+
+(defun gdb-mouse-toggle-breakpoint-fringe (event)
+ "Enable/disable breakpoint in left fringe with mouse click."
+ (interactive "e")
+ (mouse-minibuffer-check event)
+ (let* ((posn (event-end event))
+ (pos (posn-point posn))
+ obj)
+ (when (numberp pos)
+ (with-selected-window (posn-window posn)
+ (with-current-buffer (window-buffer (selected-window))
+ (goto-char pos)
+ (dolist (overlay (overlays-in pos pos))
+ (when (overlay-get overlay 'put-break)
+ (setq obj (overlay-get overlay 'before-string))))
+ (when (stringp obj)
+ (gud-basic-call
+ (concat
+ (if (get-text-property 0 'gdb-enabled obj)
+ "-break-disable "
+ "-break-enable ")
+ (get-text-property 0 'gdb-bptno obj)))))))))
+
+(defun gdb-breakpoints-buffer-name ()
+ (concat "*breakpoints of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+ gdb-display-breakpoints-buffer
+ 'gdb-breakpoints-buffer
+ "Display status of user-settable breakpoints.")
+
+(def-gdb-frame-for-buffer
+ gdb-frame-breakpoints-buffer
+ 'gdb-breakpoints-buffer
+ "Display status of user-settable breakpoints in a new frame.")
+
+(defvar gdb-breakpoints-mode-map
+ (let ((map (make-sparse-keymap))
+ (menu (make-sparse-keymap "Breakpoints")))
+ (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window))
+ (define-key menu [goto] '("Goto" . gdb-goto-breakpoint))
+ (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
+ (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
+ (suppress-keymap map)
+ (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
+ (define-key map " " 'gdb-toggle-breakpoint)
+ (define-key map "D" 'gdb-delete-breakpoint)
+ ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
+ (define-key map "q" 'gdb-delete-frame-or-window)
+ (define-key map "\r" 'gdb-goto-breakpoint)
+ (define-key map "\t" '(lambda ()
+ (interactive)
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create 'gdb-threads-buffer) t)))
+ (define-key map [mouse-2] 'gdb-goto-breakpoint)
+ (define-key map [follow-link] 'mouse-face)
+ map))
+
+(defun gdb-delete-frame-or-window ()
+ "Delete frame if there is only one window. Otherwise delete the window."
+ (interactive)
+ (if (one-window-p) (delete-frame)
+ (delete-window)))
+
+;;from make-mode-line-mouse-map
+(defun gdb-make-header-line-mouse-map (mouse function) "\
+Return a keymap with single entry for mouse key MOUSE on the header line.
+MOUSE is defined to run function FUNCTION with no args in the buffer
+corresponding to the mode line clicked."
+ (let ((map (make-sparse-keymap)))
+ (define-key map (vector 'header-line mouse) function)
+ (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
+ map))
+
+(defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
+ `(propertize ,name
+ 'help-echo ,help-echo
+ 'mouse-face ',mouse-face
+ 'face ',face
+ 'local-map
+ (gdb-make-header-line-mouse-map
+ 'mouse-1
+ (lambda (event) (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create ',buffer) t) )))))
+
+\f
+;; uses "-thread-info". Needs GDB 7.0 onwards.
+;;; Threads view
+
+(defun gdb-threads-buffer-name ()
+ (concat "*threads of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+ gdb-display-threads-buffer
+ 'gdb-threads-buffer
+ "Display GDB threads.")
+
+(def-gdb-frame-for-buffer
+ gdb-frame-threads-buffer
+ 'gdb-threads-buffer
+ "Display GDB threads in a new frame.")
+
+(def-gdb-trigger-and-handler
+ gdb-invalidate-threads (gdb-current-context-command "-thread-info")
+ gdb-thread-list-handler gdb-thread-list-handler-custom
+ '(start update update-threads))
+
+(gdb-set-buffer-rules
+ 'gdb-threads-buffer
+ 'gdb-threads-buffer-name
+ 'gdb-threads-mode
+ 'gdb-invalidate-threads)
+
+(defvar gdb-threads-font-lock-keywords
+ '(("in \\([^ ]+\\)" (1 font-lock-function-name-face))
+ (" \\(stopped\\)" (1 font-lock-warning-face))
+ (" \\(running\\)" (1 font-lock-string-face))
+ ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face)))
+ "Font lock keywords used in `gdb-threads-mode'.")
+
+(defvar gdb-threads-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\r" 'gdb-select-thread)
+ (define-key map "f" 'gdb-display-stack-for-thread)
+ (define-key map "F" 'gdb-frame-stack-for-thread)
+ (define-key map "l" 'gdb-display-locals-for-thread)
+ (define-key map "L" 'gdb-frame-locals-for-thread)
+ (define-key map "r" 'gdb-display-registers-for-thread)
+ (define-key map "R" 'gdb-frame-registers-for-thread)
+ (define-key map "d" 'gdb-display-disassembly-for-thread)
+ (define-key map "D" 'gdb-frame-disassembly-for-thread)
+ (define-key map "i" 'gdb-interrupt-thread)
+ (define-key map "c" 'gdb-continue-thread)
+ (define-key map "s" 'gdb-step-thread)
+ (define-key map "\t" '(lambda ()
+ (interactive)
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create 'gdb-breakpoints-buffer) t)))
+ (define-key map [mouse-2] 'gdb-select-thread)
+ (define-key map [follow-link] 'mouse-face)
+ map))
+
+(defvar gdb-threads-header
+ (list
+ (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
+ "mouse-1: select" mode-line-highlight mode-line-inactive)
+ " "
+ (gdb-propertize-header "Threads" gdb-threads-buffer
+ nil nil mode-line)))
+
+(define-derived-mode gdb-threads-mode gdb-parent-mode "Threads"
+ "Major mode for GDB threads.
+
+\\{gdb-threads-mode-map}"
+ (setq gdb-thread-position (make-marker))
+ (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
+ (setq header-line-format gdb-threads-header)
+ (set (make-local-variable 'font-lock-defaults)
+ '(gdb-threads-font-lock-keywords))
+ (run-mode-hooks 'gdb-threads-mode-hook)
+ 'gdb-invalidate-threads)
+
+(defun gdb-thread-list-handler-custom ()
+ (let ((threads-list (bindat-get-field (gdb-json-partial-output) 'threads))
+ (table (make-gdb-table))
+ (marked-line nil))
+ (setq gdb-threads-list nil)
+ (setq gdb-running-threads-count 0)
+ (setq gdb-stopped-threads-count 0)
+ (set-marker gdb-thread-position nil)
+
+ (dolist (thread (reverse threads-list))
+ (let ((running (string-equal (bindat-get-field thread 'state) "running")))
+ (add-to-list 'gdb-threads-list
+ (cons (bindat-get-field thread 'id)
+ thread))
+ (if running
+ (incf gdb-running-threads-count)
+ (incf gdb-stopped-threads-count))
+
+ (gdb-table-add-row table
+ (list
+ (bindat-get-field thread 'id)
+ (concat
+ (if gdb-thread-buffer-verbose-names
+ (concat (bindat-get-field thread 'target-id) " ") "")
+ (bindat-get-field thread 'state)
+ ;; Include frame information for stopped threads
+ (if (not running)
+ (concat
+ " in " (bindat-get-field thread 'frame 'func)
+ (if gdb-thread-buffer-arguments
+ (concat
+ " ("
+ (let ((args (bindat-get-field thread 'frame 'args)))
+ (mapconcat
+ (lambda (arg)
+ (apply 'format `("%s=%s" ,@(gdb-get-many-fields arg 'name 'value))))
+ args ","))
+ ")")
+ "")
+ (if gdb-thread-buffer-locations
+ (gdb-frame-location (bindat-get-field thread 'frame)) "")
+ (if gdb-thread-buffer-addresses
+ (concat " at " (bindat-get-field thread 'frame 'addr)) ""))
+ "")))
+ (list
+ 'gdb-thread thread
+ 'mouse-face 'highlight
+ 'help-echo "mouse-2, RET: select thread")))
+ (when (string-equal gdb-thread-number
+ (bindat-get-field thread 'id))
+ (setq marked-line (length gdb-threads-list))))
+ (insert (gdb-table-string table " "))
+ (when marked-line
+ (gdb-mark-line marked-line gdb-thread-position)))
+ ;; We update gud-running here because we need to make sure that
+ ;; gdb-threads-list is up-to-date
+ (gdb-update-gud-running)
+ (gdb-emit-signal gdb-buf-publisher 'update-disassembly))
+
+(defmacro def-gdb-thread-buffer-command (name custom-defun &optional doc)
+ "Define a NAME command which will act upon thread on the current line.
+
+CUSTOM-DEFUN may use locally bound `thread' variable, which will
+be the value of 'gdb-thread property of the current line. If
+'gdb-thread is nil, error is signaled."
+ `(defun ,name (&optional event)
+ ,(when doc doc)
+ (interactive (list last-input-event))
+ (if event (posn-set-point (event-end event)))
+ (save-excursion
+ (beginning-of-line)
+ (let ((thread (get-text-property (point) 'gdb-thread)))
+ (if thread
+ ,custom-defun
+ (error "Not recognized as thread line"))))))
+
+(defmacro def-gdb-thread-buffer-simple-command (name buffer-command &optional doc)
+ "Define a NAME which will call BUFFER-COMMAND with id of thread
+on the current line."
+ `(def-gdb-thread-buffer-command ,name
+ (,buffer-command (bindat-get-field thread 'id))
+ ,doc))
+
+(def-gdb-thread-buffer-command gdb-select-thread
+ (let ((new-id (bindat-get-field thread 'id)))
+ (gdb-setq-thread-number new-id)
+ (gdb-input (list (concat "-thread-select " new-id) 'ignore))
+ (gdb-update))
+ "Select the thread at current line of threads buffer.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-display-stack-for-thread
+ gdb-preemptively-display-stack-buffer
+ "Display stack buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-display-locals-for-thread
+ gdb-preemptively-display-locals-buffer
+ "Display locals buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-display-registers-for-thread
+ gdb-preemptively-display-registers-buffer
+ "Display registers buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-display-disassembly-for-thread
+ gdb-preemptively-display-disassembly-buffer
+ "Display disassembly buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-frame-stack-for-thread
+ gdb-frame-stack-buffer
+ "Display a new frame with stack buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-frame-locals-for-thread
+ gdb-frame-locals-buffer
+ "Display a new frame with locals buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-frame-registers-for-thread
+ gdb-frame-registers-buffer
+ "Display a new frame with registers buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+ gdb-frame-disassembly-for-thread
+ gdb-frame-disassembly-buffer
+ "Display a new frame with disassembly buffer for the thread at
+current line.")
+
+(defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc)
+ "Define a NAME which will execute GUD-COMMAND with
+`gdb-thread-number' locally bound to id of thread on the current
+line."
+ `(def-gdb-thread-buffer-command ,name
+ (if gdb-non-stop
+ (let ((gdb-thread-number (bindat-get-field thread 'id))
+ (gdb-gud-control-all-threads nil))
+ (call-interactively #',gud-command))
+ (error "Available in non-stop mode only, customize `gdb-non-stop-setting'"))
+ ,doc))
+
+(def-gdb-thread-buffer-gud-command
+ gdb-interrupt-thread
+ gud-stop-subjob
+ "Interrupt thread at current line.")
+
+(def-gdb-thread-buffer-gud-command
+ gdb-continue-thread
+ gud-cont
+ "Continue thread at current line.")
+
+(def-gdb-thread-buffer-gud-command
+ gdb-step-thread
+ gud-step
+ "Step thread at current line.")
+
+\f
+;;; Memory view
+
+(defcustom gdb-memory-rows 8
+ "Number of data rows in memory window."
+ :type 'integer
+ :group 'gud
+ :version "23.2")
+
+(defcustom gdb-memory-columns 4
+ "Number of data columns in memory window."
+ :type 'integer
+ :group 'gud
+ :version "23.2")
+
+(defcustom gdb-memory-format "x"
+ "Display format of data items in memory window."
+ :type '(choice (const :tag "Hexadecimal" "x")
+ (const :tag "Signed decimal" "d")
+ (const :tag "Unsigned decimal" "u")
+ (const :tag "Octal" "o")
+ (const :tag "Binary" "t"))
+ :group 'gud
+ :version "22.1")
+
+(defcustom gdb-memory-unit 4
+ "Unit size of data items in memory window."
+ :type '(choice (const :tag "Byte" 1)
+ (const :tag "Halfword" 2)
+ (const :tag "Word" 4)
+ (const :tag "Giant word" 8))
+ :group 'gud
+ :version "23.2")
+
+(def-gdb-trigger-and-handler
+ gdb-invalidate-memory
+ (format "-data-read-memory %s %s %d %d %d"
+ gdb-memory-address
+ gdb-memory-format
+ gdb-memory-unit
+ gdb-memory-rows
+ gdb-memory-columns)
+ gdb-read-memory-handler
+ gdb-read-memory-custom
+ '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-memory-buffer
+ 'gdb-memory-buffer-name
+ 'gdb-memory-mode
+ 'gdb-invalidate-memory)
+
+(defun gdb-memory-column-width (size format)
+ "Return length of string with memory unit of SIZE in FORMAT.
+
+SIZE is in bytes, as in `gdb-memory-unit'. FORMAT is a string as
+in `gdb-memory-format'."
+ (let ((format-base (cdr (assoc format
+ '(("x" . 16)
+ ("d" . 10) ("u" . 10)
+ ("o" . 8)
+ ("t" . 2))))))
+ (if format-base
+ (let ((res (ceiling (log (expt 2.0 (* size 8)) format-base))))
+ (cond ((string-equal format "x")
+ (+ 2 res)) ; hexadecimal numbers have 0x in front
+ ((or (string-equal format "d")
+ (string-equal format "o"))
+ (1+ res))
+ (t res)))
+ (error "Unknown format"))))
+
+(defun gdb-read-memory-custom ()
+ (let* ((res (gdb-json-partial-output))
+ (err-msg (bindat-get-field res 'msg)))
+ (if (not err-msg)
+ (let ((memory (bindat-get-field res 'memory)))
+ (setq gdb-memory-address (bindat-get-field res 'addr))
+ (setq gdb-memory-next-page (bindat-get-field res 'next-page))
+ (setq gdb-memory-prev-page (bindat-get-field res 'prev-page))
+ (setq gdb-memory-last-address gdb-memory-address)
+ (dolist (row memory)
+ (insert (concat (bindat-get-field row 'addr) ":"))
+ (dolist (column (bindat-get-field row 'data))
+ (insert (gdb-pad-string column
+ (+ 2 (gdb-memory-column-width
+ gdb-memory-unit
+ gdb-memory-format)))))
+ (newline)))
+ ;; Show last page instead of empty buffer when out of bounds
+ (progn
+ (let ((gdb-memory-address gdb-memory-last-address))
+ (gdb-invalidate-memory 'update)
+ (error err-msg))))))
+
+(defvar gdb-memory-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map t)
+ (define-key map "q" 'kill-this-buffer)
+ (define-key map "n" 'gdb-memory-show-next-page)
+ (define-key map "p" 'gdb-memory-show-previous-page)
+ (define-key map "a" 'gdb-memory-set-address)
+ (define-key map "t" 'gdb-memory-format-binary)
+ (define-key map "o" 'gdb-memory-format-octal)
+ (define-key map "u" 'gdb-memory-format-unsigned)
+ (define-key map "d" 'gdb-memory-format-signed)
+ (define-key map "x" 'gdb-memory-format-hexadecimal)
+ (define-key map "b" 'gdb-memory-unit-byte)
+ (define-key map "h" 'gdb-memory-unit-halfword)
+ (define-key map "w" 'gdb-memory-unit-word)
+ (define-key map "g" 'gdb-memory-unit-giant)
+ (define-key map "R" 'gdb-memory-set-rows)
+ (define-key map "C" 'gdb-memory-set-columns)
+ map))
+
+(defun gdb-memory-set-address-event (event)
+ "Handle a click on address field in memory buffer header."
+ (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (gdb-memory-set-address)))
+
+;; Non-event version for use within keymap
+(defun gdb-memory-set-address ()
+ "Set the start memory address."
+ (interactive)
+ (let ((arg (read-from-minibuffer "Memory address: ")))
+ (setq gdb-memory-address arg))
+ (gdb-invalidate-memory 'update))
+
+(defmacro def-gdb-set-positive-number (name variable echo-string &optional doc)
+ "Define a function NAME which reads new VAR value from minibuffer."
+ `(defun ,name (event)
+ ,(when doc doc)
+ (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (let* ((arg (read-from-minibuffer ,echo-string))
+ (count (string-to-number arg)))
+ (if (<= count 0)
+ (error "Positive number only")
+ (customize-set-variable ',variable count)
+ (gdb-invalidate-memory 'update))))))
+
+(def-gdb-set-positive-number
+ gdb-memory-set-rows
+ gdb-memory-rows
+ "Rows: "
+ "Set the number of data rows in memory window.")
+
+(def-gdb-set-positive-number
+ gdb-memory-set-columns
+ gdb-memory-columns
+ "Columns: "
+ "Set the number of data columns in memory window.")
+
+(defmacro def-gdb-memory-format (name format doc)
+ "Define a function NAME to switch memory buffer to use FORMAT.
+
+DOC is an optional documentation string."
+ `(defun ,name () ,(when doc doc)
+ (interactive)
+ (customize-set-variable 'gdb-memory-format ,format)
+ (gdb-invalidate-memory 'update)))
+
+(def-gdb-memory-format
+ gdb-memory-format-binary "t"
+ "Set the display format to binary.")
+
+(def-gdb-memory-format
+ gdb-memory-format-octal "o"
+ "Set the display format to octal.")
+
+(def-gdb-memory-format
+ gdb-memory-format-unsigned "u"
+ "Set the display format to unsigned decimal.")
+
+(def-gdb-memory-format
+ gdb-memory-format-signed "d"
+ "Set the display format to decimal.")
+
+(def-gdb-memory-format
+ gdb-memory-format-hexadecimal "x"
+ "Set the display format to hexadecimal.")
+
+(defvar gdb-memory-format-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
+ map)
+ "Keymap to select format in the header line.")
+
+(defvar gdb-memory-format-menu (make-sparse-keymap "Format")
+ "Menu of display formats in the header line.")
+
+(define-key gdb-memory-format-menu [binary]
+ '(menu-item "Binary" gdb-memory-format-binary
+ :button (:radio . (equal gdb-memory-format "t"))))
+(define-key gdb-memory-format-menu [octal]
+ '(menu-item "Octal" gdb-memory-format-octal
+ :button (:radio . (equal gdb-memory-format "o"))))
+(define-key gdb-memory-format-menu [unsigned]
+ '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
+ :button (:radio . (equal gdb-memory-format "u"))))
+(define-key gdb-memory-format-menu [signed]
+ '(menu-item "Signed Decimal" gdb-memory-format-signed
+ :button (:radio . (equal gdb-memory-format "d"))))
+(define-key gdb-memory-format-menu [hexadecimal]
+ '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
+ :button (:radio . (equal gdb-memory-format "x"))))
+
+(defun gdb-memory-format-menu (event)
+ (interactive "@e")
+ (x-popup-menu event gdb-memory-format-menu))
+
+(defun gdb-memory-format-menu-1 (event)
+ (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (let* ((selection (gdb-memory-format-menu event))
+ (binding (and selection (lookup-key gdb-memory-format-menu
+ (vector (car selection))))))
+ (if binding (call-interactively binding)))))
+
+(defmacro def-gdb-memory-unit (name unit-size doc)
+ "Define a function NAME to switch memory unit size to UNIT-SIZE.
+
+DOC is an optional documentation string."
+ `(defun ,name () ,(when doc doc)
+ (interactive)
+ (customize-set-variable 'gdb-memory-unit ,unit-size)
+ (gdb-invalidate-memory 'update)))
+
+(def-gdb-memory-unit gdb-memory-unit-giant 8
+ "Set the unit size to giant words (eight bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-word 4
+ "Set the unit size to words (four bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-halfword 2
+ "Set the unit size to halfwords (two bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-byte 1
+ "Set the unit size to bytes.")
+
+(defmacro def-gdb-memory-show-page (name address-var &optional doc)
+ "Define a function NAME which show new address in memory buffer.
+
+The defined function switches Memory buffer to show address
+stored in ADDRESS-VAR variable.
+
+DOC is an optional documentation string."
+ `(defun ,name
+ ,(when doc doc)
+ (interactive)
+ (let ((gdb-memory-address ,address-var))
+ (gdb-invalidate-memory))))
+
+(def-gdb-memory-show-page gdb-memory-show-previous-page
+ gdb-memory-prev-page)
+
+(def-gdb-memory-show-page gdb-memory-show-next-page
+ gdb-memory-next-page)
+
+(defvar gdb-memory-unit-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
+ map)
+ "Keymap to select units in the header line.")
+
+(defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
+ "Menu of units in the header line.")
+
+(define-key gdb-memory-unit-menu [giantwords]
+ '(menu-item "Giant words" gdb-memory-unit-giant
+ :button (:radio . (equal gdb-memory-unit 8))))
+(define-key gdb-memory-unit-menu [words]
+ '(menu-item "Words" gdb-memory-unit-word
+ :button (:radio . (equal gdb-memory-unit 4))))
+(define-key gdb-memory-unit-menu [halfwords]
+ '(menu-item "Halfwords" gdb-memory-unit-halfword
+ :button (:radio . (equal gdb-memory-unit 2))))
+(define-key gdb-memory-unit-menu [bytes]
+ '(menu-item "Bytes" gdb-memory-unit-byte
+ :button (:radio . (equal gdb-memory-unit 1))))
+
+(defun gdb-memory-unit-menu (event)
+ (interactive "@e")
+ (x-popup-menu event gdb-memory-unit-menu))
+
+(defun gdb-memory-unit-menu-1 (event)
+ (interactive "e")
+ (save-selected-window
+ (select-window (posn-window (event-start event)))
+ (let* ((selection (gdb-memory-unit-menu event))
+ (binding (and selection (lookup-key gdb-memory-unit-menu
+ (vector (car selection))))))
+ (if binding (call-interactively binding)))))
+
+(defvar gdb-memory-font-lock-keywords
+ '(;; <__function.name+n>
+ ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
+ )
+ "Font lock keywords used in `gdb-memory-mode'.")
+
+(defvar gdb-memory-header
+ '(:eval
+ (concat
+ "Start address["
+ (propertize "-"
+ 'face font-lock-warning-face
+ 'help-echo "mouse-1: decrement address"
+ 'mouse-face 'mode-line-highlight
+ 'local-map (gdb-make-header-line-mouse-map
+ 'mouse-1
+ #'gdb-memory-show-previous-page))
+ "|"
+ (propertize "+"
+ 'face font-lock-warning-face
+ 'help-echo "mouse-1: increment address"
+ 'mouse-face 'mode-line-highlight
+ 'local-map (gdb-make-header-line-mouse-map
+ 'mouse-1
+ #'gdb-memory-show-next-page))
+ "]: "
+ (propertize gdb-memory-address
+ 'face font-lock-warning-face
+ 'help-echo "mouse-1: set start address"
+ 'mouse-face 'mode-line-highlight
+ 'local-map (gdb-make-header-line-mouse-map
+ 'mouse-1
+ #'gdb-memory-set-address-event))
+ " Rows: "
+ (propertize (number-to-string gdb-memory-rows)
+ 'face font-lock-warning-face
+ 'help-echo "mouse-1: set number of columns"
+ 'mouse-face 'mode-line-highlight
+ 'local-map (gdb-make-header-line-mouse-map
+ 'mouse-1
+ #'gdb-memory-set-rows))
+ " Columns: "
+ (propertize (number-to-string gdb-memory-columns)
+ 'face font-lock-warning-face
+ 'help-echo "mouse-1: set number of columns"
+ 'mouse-face 'mode-line-highlight
+ 'local-map (gdb-make-header-line-mouse-map
+ 'mouse-1
+ #'gdb-memory-set-columns))
+ " Display Format: "
+ (propertize gdb-memory-format
+ 'face font-lock-warning-face
+ 'help-echo "mouse-3: select display format"
+ 'mouse-face 'mode-line-highlight
+ 'local-map gdb-memory-format-map)
+ " Unit Size: "
+ (propertize (number-to-string gdb-memory-unit)
+ 'face font-lock-warning-face
+ 'help-echo "mouse-3: select unit size"
+ 'mouse-face 'mode-line-highlight
+ 'local-map gdb-memory-unit-map)))
+ "Header line used in `gdb-memory-mode'.")
+
+(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
+ "Major mode for examining memory.
+
+\\{gdb-memory-mode-map}"
+ (setq header-line-format gdb-memory-header)
+ (set (make-local-variable 'font-lock-defaults)
+ '(gdb-memory-font-lock-keywords))
+ (run-mode-hooks 'gdb-memory-mode-hook)
+ 'gdb-invalidate-memory)
+
+(defun gdb-memory-buffer-name ()
+ (concat "*memory of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+ gdb-display-memory-buffer
+ 'gdb-memory-buffer
+ "Display memory contents.")
+
+(defun gdb-frame-memory-buffer ()
+ "Display memory contents in a new frame."
+ (interactive)
+ (let* ((special-display-regexps (append special-display-regexps '(".*")))
+ (special-display-frame-alist
+ `((left-fringe . 0)
+ (right-fringe . 0)
+ (width . 83)
+ ,@gdb-frame-parameters)))
+ (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
+
+\f
+;;; Disassembly view
+
+(defun gdb-disassembly-buffer-name ()
+ (gdb-current-context-buffer-name
+ (concat "disassembly of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-disassembly-buffer
+ 'gdb-disassembly-buffer
+ "Display disassembly for current stack frame.")
+
+(def-gdb-preempt-display-buffer
+ gdb-preemptively-display-disassembly-buffer
+ 'gdb-disassembly-buffer)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-disassembly-buffer
+ 'gdb-disassembly-buffer
+ "Display disassembly in a new frame.")
+
+(def-gdb-auto-update-trigger gdb-invalidate-disassembly
+ (let* ((frame (gdb-current-buffer-frame))
+ (file (bindat-get-field frame 'fullname))
+ (line (bindat-get-field frame 'line)))
+ (when file
+ (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)))
+ gdb-disassembly-handler
+ ;; We update disassembly only after we have actual frame information
+ ;; about all threads, so no there's `update' signal in this list
+ '(start update-disassembly))
+
+(def-gdb-auto-update-handler
+ gdb-disassembly-handler
+ gdb-invalidate-disassembly
+ gdb-disassembly-handler-custom
+ t)
+
+(gdb-set-buffer-rules
+ 'gdb-disassembly-buffer
+ 'gdb-disassembly-buffer-name
+ 'gdb-disassembly-mode
+ 'gdb-invalidate-disassembly)
+
+(defvar gdb-disassembly-font-lock-keywords
+ '(;; <__function.name+n>
+ ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
+ (1 font-lock-function-name-face))
+ ;; 0xNNNNNNNN <__function.name+n>: opcode
+ ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
+ (4 font-lock-keyword-face))
+ ;; %register(at least i386)
+ ("%\\sw+" . font-lock-variable-name-face)
+ ("^\\(Dump of assembler code for function\\) \\(.+\\):"
+ (1 font-lock-comment-face)
+ (2 font-lock-function-name-face))
+ ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
+ "Font lock keywords used in `gdb-disassembly-mode'.")
+
+(defvar gdb-disassembly-mode-map
+ ;; TODO
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" 'kill-this-buffer)
+ map))
+
+(define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly"
+ "Major mode for GDB disassembly information.
+
+\\{gdb-disassembly-mode-map}"
+ ;; TODO Rename overlay variable for disassembly mode
+ (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
+ (setq fringes-outside-margins t)
+ (set (make-local-variable 'gdb-disassembly-position) (make-marker))
+ (set (make-local-variable 'font-lock-defaults)
+ '(gdb-disassembly-font-lock-keywords))
+ (run-mode-hooks 'gdb-disassembly-mode-hook)
+ 'gdb-invalidate-disassembly)
+
+(defun gdb-disassembly-handler-custom ()
+ (let* ((instructions (bindat-get-field (gdb-json-partial-output) 'asm_insns))
+ (address (bindat-get-field (gdb-current-buffer-frame) 'addr))
+ (pos 1)
+ (table (make-gdb-table))
+ (marked-line nil))
+ (dolist (instr instructions)
+ (gdb-table-add-row table
+ (list
+ (bindat-get-field instr 'address)
+ (apply 'format `("<%s+%s>:" ,@(gdb-get-many-fields instr 'func-name 'offset)))
+ (bindat-get-field instr 'inst)))
+ (when (string-equal (bindat-get-field instr 'address)
+ address)
+ (progn
+ (setq marked-line (length (gdb-table-rows table)))
+ (setq fringe-indicator-alist
+ (if (string-equal gdb-frame-number "0")
+ nil
+ '((overlay-arrow . hollow-right-triangle)))))))
+ (insert (gdb-table-string table " "))
+ (gdb-disassembly-place-breakpoints)
+ ;; Mark current position with overlay arrow and scroll window to
+ ;; that point
+ (when marked-line
+ (let ((window (get-buffer-window (current-buffer) 0)))
+ (set-window-point window (gdb-mark-line marked-line gdb-disassembly-position))))
+ (setq mode-name
+ (gdb-current-context-mode-name
+ (concat "Disassembly: "
+ (bindat-get-field (gdb-current-buffer-frame) 'func))))))
+
+(defun gdb-disassembly-place-breakpoints ()
+ (gdb-remove-breakpoint-icons (point-min) (point-max))
+ (dolist (breakpoint gdb-breakpoints-list)
+ (let* ((breakpoint (cdr breakpoint))
+ (bptno (bindat-get-field breakpoint 'number))
+ (flag (bindat-get-field breakpoint 'enabled))
+ (address (bindat-get-field breakpoint 'addr)))
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward (concat "^" address) nil t)
+ (gdb-put-breakpoint-icon (string-equal flag "y") bptno))))))
+
+\f
+(defvar gdb-breakpoints-header
+ (list
+ (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
+ nil nil mode-line)
+ " "
+ (gdb-propertize-header "Threads" gdb-threads-buffer
+ "mouse-1: select" mode-line-highlight mode-line-inactive)))
+
+;;; Breakpoints view
+(define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints"
+ "Major mode for gdb breakpoints.
+
+\\{gdb-breakpoints-mode-map}"
+ (setq header-line-format gdb-breakpoints-header)
+ (run-mode-hooks 'gdb-breakpoints-mode-hook)
+ 'gdb-invalidate-breakpoints)
+
+(defun gdb-toggle-breakpoint ()
+ "Enable/disable breakpoint at current line of breakpoints buffer."
+ (interactive)
+ (save-excursion
+ (beginning-of-line)
+ (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+ (if breakpoint
+ (gud-basic-call
+ (concat (if (string-equal "y" (bindat-get-field breakpoint 'enabled))
+ "-break-disable "
+ "-break-enable ")
+ (bindat-get-field breakpoint 'number)))
+ (error "Not recognized as break/watchpoint line")))))
+
+(defun gdb-delete-breakpoint ()
+ "Delete the breakpoint at current line of breakpoints buffer."
+ (interactive)
+ (save-excursion
+ (beginning-of-line)
+ (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+ (if breakpoint
+ (gud-basic-call (concat "-break-delete " (bindat-get-field breakpoint 'number)))
+ (error "Not recognized as break/watchpoint line")))))
+
+(defun gdb-goto-breakpoint (&optional event)
+ "Go to the location of breakpoint at current line of
+breakpoints buffer."
+ (interactive (list last-input-event))
+ (if event (posn-set-point (event-end event)))
+ ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer.
+ (let ((window (get-buffer-window gud-comint-buffer)))
+ (if window (save-selected-window (select-window window))))
+ (save-excursion
+ (beginning-of-line)
+ (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+ (if breakpoint
+ (let ((bptno (bindat-get-field breakpoint 'number))
+ (file (bindat-get-field breakpoint 'fullname))
+ (line (bindat-get-field breakpoint 'line)))
+ (save-selected-window
+ (let* ((buffer (find-file-noselect
+ (if (file-exists-p file) file
+ (cdr (assoc bptno gdb-location-alist)))))
+ (window (or (gdb-display-source-buffer buffer)
+ (display-buffer buffer))))
+ (setq gdb-source-window window)
+ (with-current-buffer buffer
+ (goto-char (point-min))
+ (forward-line (1- (string-to-number line)))
+ (set-window-point window (point))))))
+ (error "Not recognized as break/watchpoint line")))))
+
+\f
+;; Frames buffer. This displays a perpetually correct bactrack trace.
+;;
+(def-gdb-trigger-and-handler
+ gdb-invalidate-frames (gdb-current-context-command "-stack-list-frames")
+ gdb-stack-list-frames-handler gdb-stack-list-frames-custom
+ '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-stack-buffer
+ 'gdb-stack-buffer-name
+ 'gdb-frames-mode
+ 'gdb-invalidate-frames)
+
+(defun gdb-frame-location (frame)
+ "Return \" of file:line\" or \" of library\" for structure FRAME.
+
+FRAME must have either \"file\" and \"line\" members or \"from\"
+member."
+ (let ((file (bindat-get-field frame 'file))
+ (line (bindat-get-field frame 'line))
+ (from (bindat-get-field frame 'from)))
+ (let ((res (or (and file line (concat file ":" line))
+ from)))
+ (if res (concat " of " res) ""))))
+
+(defun gdb-stack-list-frames-custom ()
+ (let ((stack (bindat-get-field (gdb-json-partial-output "frame") 'stack))
+ (table (make-gdb-table)))
+ (set-marker gdb-stack-position nil)
+ (dolist (frame stack)
+ (gdb-table-add-row table
+ (list
+ (bindat-get-field frame 'level)
+ "in"
+ (concat
+ (bindat-get-field frame 'func)
+ (if gdb-stack-buffer-locations
+ (gdb-frame-location frame) "")
+ (if gdb-stack-buffer-addresses
+ (concat " at " (bindat-get-field frame 'addr)) "")))
+ `(mouse-face highlight
+ help-echo "mouse-2, RET: Select frame"
+ gdb-frame ,frame)))
+ (insert (gdb-table-string table " ")))
+ (when (and gdb-frame-number
+ (gdb-buffer-shows-main-thread-p))
+ (gdb-mark-line (1+ (string-to-number gdb-frame-number))
+ gdb-stack-position))
+ (setq mode-name
+ (gdb-current-context-mode-name "Frames")))
+
+(defun gdb-stack-buffer-name ()
+ (gdb-current-context-buffer-name
+ (concat "stack frames of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-stack-buffer
+ 'gdb-stack-buffer
+ "Display backtrace of current stack.")
+
+(def-gdb-preempt-display-buffer
+ gdb-preemptively-display-stack-buffer
+ 'gdb-stack-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-stack-buffer
+ 'gdb-stack-buffer
+ "Display backtrace of current stack in a new frame.")
+
+(defvar gdb-frames-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" 'kill-this-buffer)
+ (define-key map "\r" 'gdb-select-frame)
+ (define-key map [mouse-2] 'gdb-select-frame)
+ (define-key map [follow-link] 'mouse-face)
+ map))
+
+(defvar gdb-frames-font-lock-keywords
+ '(("in \\([^ ]+\\)" (1 font-lock-function-name-face)))
+ "Font lock keywords used in `gdb-frames-mode'.")
+
+(define-derived-mode gdb-frames-mode gdb-parent-mode "Frames"
+ "Major mode for gdb call stack.
+
+\\{gdb-frames-mode-map}"
+ (setq gdb-stack-position (make-marker))
+ (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
+ (setq truncate-lines t) ;; Make it easier to see overlay arrow.
+ (set (make-local-variable 'font-lock-defaults)
+ '(gdb-frames-font-lock-keywords))
+ (run-mode-hooks 'gdb-frames-mode-hook)
+ 'gdb-invalidate-frames)
+
+(defun gdb-select-frame (&optional event)
+ "Select the frame and display the relevant source."
+ (interactive (list last-input-event))
+ (if event (posn-set-point (event-end event)))
+ (let ((frame (get-text-property (point) 'gdb-frame)))
+ (if frame
+ (if (gdb-buffer-shows-main-thread-p)
+ (let ((new-level (bindat-get-field frame 'level)))
+ (setq gdb-frame-number new-level)
+ (gdb-input (list (concat "-stack-select-frame " new-level) 'ignore))
+ (gdb-update))
+ (error "Could not select frame for non-current thread"))
+ (error "Not recognized as frame line"))))
+
+\f
+;; Locals buffer.
+;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
+(def-gdb-trigger-and-handler
+ gdb-invalidate-locals
+ (concat (gdb-current-context-command "-stack-list-locals") " --simple-values")
+ gdb-locals-handler gdb-locals-handler-custom
+ '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-locals-buffer
+ 'gdb-locals-buffer-name
+ 'gdb-locals-mode
+ 'gdb-invalidate-locals)
+
+(defvar gdb-locals-watch-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "\r" 'gud-watch)
+ (define-key map [mouse-2] 'gud-watch)
+ map)
+ "Keymap to create watch expression of a complex data type local variable.")
+
+(defvar gdb-edit-locals-map-1
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "\r" 'gdb-edit-locals-value)
+ (define-key map [mouse-2] 'gdb-edit-locals-value)
+ map)
+ "Keymap to edit value of a simple data type local variable.")
+
+(defun gdb-edit-locals-value (&optional event)
+ "Assign a value to a variable displayed in the locals buffer."
+ (interactive (list last-input-event))
+ (save-excursion
+ (if event (posn-set-point (event-end event)))
+ (beginning-of-line)
+ (let* ((var (bindat-get-field
+ (get-text-property (point) 'gdb-local-variable) 'name))
+ (value (read-string (format "New value (%s): " var))))
+ (gud-basic-call
+ (concat "-gdb-set variable " var " = " value)))))
+
+;; Dont display values of arrays or structures.
+;; These can be expanded using gud-watch.
+(defun gdb-locals-handler-custom ()
+ (let ((locals-list (bindat-get-field (gdb-json-partial-output) 'locals))
+ (table (make-gdb-table)))
+ (dolist (local locals-list)
+ (let ((name (bindat-get-field local 'name))
+ (value (bindat-get-field local 'value))
+ (type (bindat-get-field local 'type)))
+ (if (or (not value)
+ (string-match "\\0x" value))
+ (add-text-properties 0 (length name)
+ `(mouse-face highlight
+ help-echo "mouse-2: create watch expression"
+ local-map ,gdb-locals-watch-map)
+ name)
+ (add-text-properties 0 (length value)
+ `(mouse-face highlight
+ help-echo "mouse-2: edit value"
+ local-map ,gdb-edit-locals-map-1)
+ value))
+ (gdb-table-add-row
+ table
+ (list
+ (propertize type 'font-lock-face font-lock-type-face)
+ (propertize name 'font-lock-face font-lock-variable-name-face)
+ value)
+ `(gdb-local-variable ,local))))
+ (insert (gdb-table-string table " "))
+ (setq mode-name
+ (gdb-current-context-mode-name
+ (concat "Locals: " (bindat-get-field (gdb-current-buffer-frame) 'func))))))
+
+(defvar gdb-locals-header
+ (list
+ (gdb-propertize-header "Locals" gdb-locals-buffer
+ nil nil mode-line)
+ " "
+ (gdb-propertize-header "Registers" gdb-registers-buffer
+ "mouse-1: select" mode-line-highlight mode-line-inactive)))
+
+(defvar gdb-locals-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" 'kill-this-buffer)
+ (define-key map "\t" '(lambda ()
+ (interactive)
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create
+ 'gdb-registers-buffer
+ gdb-thread-number) t)))
+ map))
+
+(define-derived-mode gdb-locals-mode gdb-parent-mode "Locals"
+ "Major mode for gdb locals.
+
+\\{gdb-locals-mode-map}"
+ (setq header-line-format gdb-locals-header)
+ (run-mode-hooks 'gdb-locals-mode-hook)
+ 'gdb-invalidate-locals)
+
+(defun gdb-locals-buffer-name ()
+ (gdb-current-context-buffer-name
+ (concat "locals of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-locals-buffer
+ 'gdb-locals-buffer
+ "Display local variables of current stack and their values.")
+
+(def-gdb-preempt-display-buffer
+ gdb-preemptively-display-locals-buffer
+ 'gdb-locals-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-locals-buffer
+ 'gdb-locals-buffer
+ "Display local variables of current stack and their values in a new frame.")
+
+\f
+;; Registers buffer.
+
+(def-gdb-trigger-and-handler
+ gdb-invalidate-registers
+ (concat (gdb-current-context-command "-data-list-register-values") " x")
+ gdb-registers-handler
+ gdb-registers-handler-custom
+ '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-registers-buffer
+ 'gdb-registers-buffer-name
+ 'gdb-registers-mode
+ 'gdb-invalidate-registers)
+
+(defun gdb-registers-handler-custom ()
+ (when gdb-register-names
+ (let ((register-values (bindat-get-field (gdb-json-partial-output) 'register-values))
+ (table (make-gdb-table)))
+ (dolist (register register-values)
+ (let* ((register-number (bindat-get-field register 'number))
+ (value (bindat-get-field register 'value))
+ (register-name (nth (string-to-number register-number)
+ gdb-register-names)))
+ (gdb-table-add-row
+ table
+ (list
+ (propertize register-name 'font-lock-face font-lock-variable-name-face)
+ (if (member register-number gdb-changed-registers)
+ (propertize value 'font-lock-face font-lock-warning-face)
+ value))
+ `(mouse-face highlight
+ help-echo "mouse-2: edit value"
+ gdb-register-name ,register-name))))
+ (insert (gdb-table-string table " ")))
+ (setq mode-name
+ (gdb-current-context-mode-name "Registers"))))
+
+(defun gdb-edit-register-value (&optional event)
+ "Assign a value to a register displayed in the registers buffer."
+ (interactive (list last-input-event))
+ (save-excursion
+ (if event (posn-set-point (event-end event)))
+ (beginning-of-line)
+ (let* ((var (bindat-get-field
+ (get-text-property (point) 'gdb-register-name)))
+ (value (read-string (format "New value (%s): " var))))
+ (gud-basic-call
+ (concat "-gdb-set variable $" var " = " value)))))
+
+(defvar gdb-registers-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "\r" 'gdb-edit-register-value)
+ (define-key map [mouse-2] 'gdb-edit-register-value)
+ (define-key map "q" 'kill-this-buffer)
+ (define-key map "\t" '(lambda ()
+ (interactive)
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create
+ 'gdb-locals-buffer
+ gdb-thread-number) t)))
+ map))
+
+(defvar gdb-registers-header
+ (list
+ (gdb-propertize-header "Locals" gdb-locals-buffer
+ "mouse-1: select" mode-line-highlight mode-line-inactive)
+ " "
+ (gdb-propertize-header "Registers" gdb-registers-buffer
+ nil nil mode-line)))
+
+(define-derived-mode gdb-registers-mode gdb-parent-mode "Registers"
+ "Major mode for gdb registers.
+
+\\{gdb-registers-mode-map}"
+ (setq header-line-format gdb-registers-header)
+ (run-mode-hooks 'gdb-registers-mode-hook)
+ 'gdb-invalidate-registers)
+
+(defun gdb-registers-buffer-name ()
+ (gdb-current-context-buffer-name
+ (concat "registers of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-registers-buffer
+ 'gdb-registers-buffer
+ "Display integer register contents.")
+
+(def-gdb-preempt-display-buffer
+ gdb-preemptively-display-registers-buffer
+ 'gdb-registers-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-registers-buffer
+ 'gdb-registers-buffer
+ "Display integer register contents in a new frame.")
+
+;; Needs GDB 6.4 onwards (used to fail with no stack).
+(defun gdb-get-changed-registers ()
+ (if (and (gdb-get-buffer 'gdb-registers-buffer)
+ (not (gdb-pending-p 'gdb-get-changed-registers)))
+ (progn
+ (gdb-input
+ (list
+ "-data-list-changed-registers"
+ 'gdb-changed-registers-handler))
+ (gdb-add-pending 'gdb-get-changed-registers))))
+
+(defun gdb-changed-registers-handler ()
+ (gdb-delete-pending 'gdb-get-changed-registers)
+ (setq gdb-changed-registers nil)
+ (dolist (register-number (bindat-get-field (gdb-json-partial-output) 'changed-registers))
+ (push register-number gdb-changed-registers)))
+
+(defun gdb-register-names-handler ()
+ ;; Don't use gdb-pending-triggers because this handler is called
+ ;; only once (in gdb-init-1)
+ (setq gdb-register-names nil)
+ (dolist (register-name (bindat-get-field (gdb-json-partial-output) 'register-names))
+ (push register-name gdb-register-names))
+ (setq gdb-register-names (reverse gdb-register-names)))
+\f
+
+(defun gdb-get-source-file-list ()
+ "Create list of source files for current GDB session.
+If buffers already exist for any of these files, gud-minor-mode
+is set in them."
+ (goto-char (point-min))
+ (while (re-search-forward gdb-source-file-regexp nil t)
+ (push (match-string 1) gdb-source-file-list))
+ (dolist (buffer (buffer-list))
+ (with-current-buffer buffer
+ (when (member buffer-file-name gdb-source-file-list)
+ (gdb-init-buffer))))
+ (gdb-force-mode-line-update
+ (propertize "ready" 'face font-lock-variable-name-face)))
+
+(defun gdb-get-main-selected-frame ()
+ "Trigger for `gdb-frame-handler' which uses main current
+thread. Called from `gdb-update'."
+ (if (not (gdb-pending-p 'gdb-get-main-selected-frame))
+ (progn
+ (gdb-input
+ (list (gdb-current-context-command "-stack-info-frame") 'gdb-frame-handler))
+ (gdb-add-pending 'gdb-get-main-selected-frame))))
+
+(defun gdb-frame-handler ()
+ "Sets `gdb-selected-frame' and `gdb-selected-file' to show
+overlay arrow in source buffer."
+ (gdb-delete-pending 'gdb-get-main-selected-frame)
+ (let ((frame (bindat-get-field (gdb-json-partial-output) 'frame)))
+ (when frame
+ (setq gdb-selected-frame (bindat-get-field frame 'func))
+ (setq gdb-selected-file (bindat-get-field frame 'fullname))
+ (setq gdb-frame-number (bindat-get-field frame 'level))
+ (setq gdb-frame-address (bindat-get-field frame 'addr))
+ (let ((line (bindat-get-field frame 'line)))
+ (setq gdb-selected-line (and line (string-to-number line)))
+ (when (and gdb-selected-file gdb-selected-line)
+ (setq gud-last-frame (cons gdb-selected-file gdb-selected-line))
+ (gud-display-frame)))
+ (if gud-overlay-arrow-position
+ (let ((buffer (marker-buffer gud-overlay-arrow-position))
+ (position (marker-position gud-overlay-arrow-position)))
+ (when buffer
+ (with-current-buffer buffer
+ (setq fringe-indicator-alist
+ (if (string-equal gdb-frame-number "0")
+ nil
+ '((overlay-arrow . hollow-right-triangle))))
+ (setq gud-overlay-arrow-position (make-marker))
+ (set-marker gud-overlay-arrow-position position))))))))
+
+(defvar gdb-prompt-name-regexp "value=\"\\(.*?\\)\"")
+
+(defun gdb-get-prompt ()
+ "Find prompt for GDB session."
+ (goto-char (point-min))
+ (setq gdb-prompt-name nil)
+ (re-search-forward gdb-prompt-name-regexp nil t)
+ (setq gdb-prompt-name (match-string 1))
+ ;; Insert first prompt.
+ (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+
+;;;; Window management
+(defun gdb-display-buffer (buf dedicated &optional frame)
+ "Show buffer BUF.
+
+If BUF is already displayed in some window, show it, deiconifying
+the frame if necessary. Otherwise, find least recently used
+window and show BUF there, if the window is not used for GDB
+already, in which case that window is splitted first."
+ (let ((answer (get-buffer-window buf (or frame 0))))
+ (if answer
+ (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary.
+ (let ((window (get-lru-window)))
+ (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window))
+ 'gdbmi)
+ (let* ((largest (get-largest-window))
+ (cur-size (window-height largest)))
+ (setq answer (split-window largest))
+ (set-window-buffer answer buf)
+ (set-window-dedicated-p answer dedicated)
+ answer)
+ (set-window-buffer window buf)
+ window)))))
+
+(defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal)
+ "Find window displaying a buffer with the same
+`gdb-buffer-type' as BUF and show BUF there. If no such window
+exists, just call `gdb-display-buffer' for BUF. If the window
+found is already dedicated, split window according to
+SPLIT-HORIZONTAL and show BUF in the new window."
+ (if buf
+ (when (not (get-buffer-window buf))
+ (let* ((buf-type (gdb-buffer-type buf))
+ (existing-window
+ (get-window-with-predicate
+ #'(lambda (w)
+ (and (eq buf-type
+ (gdb-buffer-type (window-buffer w)))
+ (not (window-dedicated-p w)))))))
+ (if existing-window
+ (set-window-buffer existing-window buf)
+ (let ((dedicated-window
+ (get-window-with-predicate
+ #'(lambda (w)
+ (eq buf-type
+ (gdb-buffer-type (window-buffer w)))))))
+ (if dedicated-window
+ (set-window-buffer
+ (split-window dedicated-window nil split-horizontal) buf)
+ (gdb-display-buffer buf t))))))
+ (error "Null buffer")))
+\f
+;;; Shared keymap initialization:
+
+(let ((menu (make-sparse-keymap "GDB-Windows")))
+ (define-key gud-menu-map [displays]
+ `(menu-item "GDB-Windows" ,menu
+ :visible (eq gud-minor-mode 'gdbmi)))
+ (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
+ (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
+ (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
+ (define-key menu [disassembly]
+ '("Disassembly" . gdb-display-disassembly-buffer))
+ (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
+ (define-key menu [inferior]
+ '("IO" . gdb-display-io-buffer))
+ (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
+ (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
+ (define-key menu [breakpoints]
+ '("Breakpoints" . gdb-display-breakpoints-buffer)))
+
+(let ((menu (make-sparse-keymap "GDB-Frames")))
+ (define-key gud-menu-map [frames]
+ `(menu-item "GDB-Frames" ,menu
+ :visible (eq gud-minor-mode 'gdbmi)))
+ (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
+ (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
+ (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
+ (define-key menu [disassembly] '("Disassembly" . gdb-frame-disassembly-buffer))
+ (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
+ (define-key menu [inferior]
+ '("IO" . gdb-frame-io-buffer))
+ (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
+ (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
+ (define-key menu [breakpoints]
+ '("Breakpoints" . gdb-frame-breakpoints-buffer)))
+
+(let ((menu (make-sparse-keymap "GDB-MI")))
+ (define-key menu [gdb-customize]
+ '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
+ :help "Customize Gdb Graphical Mode options."))
+ (define-key menu [gdb-many-windows]
+ '(menu-item "Display Other Windows" gdb-many-windows
+ :help "Toggle display of locals, stack and breakpoint information"
+ :button (:toggle . gdb-many-windows)))
+ (define-key menu [gdb-restore-windows]
+ '(menu-item "Restore Window Layout" gdb-restore-windows
+ :help "Restore standard layout for debug session."))
+ (define-key menu [sep1]
+ '(menu-item "--"))
+ (define-key menu [all-threads]
+ '(menu-item "GUD controls all threads"
+ (lambda ()
+ (interactive)
+ (setq gdb-gud-control-all-threads t))
+ :help "GUD start/stop commands apply to all threads"
+ :button (:radio . gdb-gud-control-all-threads)))
+ (define-key menu [current-thread]
+ '(menu-item "GUD controls current thread"
+ (lambda ()
+ (interactive)
+ (setq gdb-gud-control-all-threads nil))
+ :help "GUD start/stop commands apply to current thread only"
+ :button (:radio . (not gdb-gud-control-all-threads))))
+ (define-key menu [sep2]
+ '(menu-item "--"))
+ (define-key menu [gdb-customize-reasons]
+ '(menu-item "Customize switching..."
+ (lambda ()
+ (interactive)
+ (customize-option 'gdb-switch-reasons))))
+ (define-key menu [gdb-switch-when-another-stopped]
+ (menu-bar-make-toggle gdb-toggle-switch-when-another-stopped gdb-switch-when-another-stopped
+ "Automatically switch to stopped thread"
+ "GDB thread switching %s"
+ "Switch to stopped thread"))
+ (define-key gud-menu-map [mi]
+ `(menu-item "GDB-MI" ,menu :visible (eq gud-minor-mode 'gdbmi))))
+
+;; TODO Fit these into tool-bar-local-item-from-menu call in gud.el.
+;; GDB-MI menu will need to be moved to gud.el. We can't use
+;; tool-bar-local-item-from-menu here because it appends new buttons
+;; to toolbar from right to left while we want our A/T throttle to
+;; show up right before Run button.
+(define-key-after gud-tool-bar-map [all-threads]
+ '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads
+ :image (find-image '((:type xpm :file "gud/thread.xpm")))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ gdb-non-stop
+ (not gdb-gud-control-all-threads)))
+ 'run)
+
+(define-key-after gud-tool-bar-map [current-thread]
+ '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread
+ :image (find-image '((:type xpm :file "gud/all.xpm")))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ gdb-non-stop
+ gdb-gud-control-all-threads))
+ 'all-threads)
+
+(defun gdb-frame-gdb-buffer ()
+ "Display GUD buffer in a new frame."
+ (interactive)
+ (let ((special-display-regexps (append special-display-regexps '(".*")))
+ (special-display-frame-alist
+ (remove '(menu-bar-lines) (remove '(tool-bar-lines)
+ gdb-frame-parameters)))
+ (same-window-regexps nil))
+ (display-buffer gud-comint-buffer)))
+
+(defun gdb-display-gdb-buffer ()
+ "Display GUD buffer."
+ (interactive)
+ (let ((same-window-regexps nil))
+ (select-window (display-buffer gud-comint-buffer nil 0))))
+
+(defun gdb-set-window-buffer (name &optional ignore-dedicated)
+ "Set buffer of selected window to NAME and dedicate window.
+
+When IGNORE-DEDICATED is non-nil, buffer is set even if selected
+window is dedicated."
+ (when ignore-dedicated
+ (set-window-dedicated-p (selected-window) nil))
+ (set-window-buffer (selected-window) (get-buffer name))
+ (set-window-dedicated-p (selected-window) t))
+
+(defun gdb-setup-windows ()
+ "Layout the window pattern for `gdb-many-windows'."
+ (gdb-display-locals-buffer)
+ (gdb-display-stack-buffer)
+ (delete-other-windows)
+ (gdb-display-breakpoints-buffer)
+ (delete-other-windows)
+ ; Don't dedicate.
+ (pop-to-buffer gud-comint-buffer)
+ (split-window nil ( / ( * (window-height) 3) 4))
+ (split-window nil ( / (window-height) 3))
+ (split-window-horizontally)
+ (other-window 1)
+ (gdb-set-window-buffer (gdb-locals-buffer-name))
+ (other-window 1)
+ (switch-to-buffer
+ (if gud-last-last-frame
+ (gud-find-file (car gud-last-last-frame))
+ (if gdb-main-file
+ (gud-find-file gdb-main-file)
+ ;; Put buffer list in window if we
+ ;; can't find a source file.
+ (list-buffers-noselect))))
+ (setq gdb-source-window (selected-window))
+ (split-window-horizontally)
+ (other-window 1)
+ (gdb-set-window-buffer
+ (gdb-get-buffer-create 'gdb-inferior-io))
+ (other-window 1)
+ (gdb-set-window-buffer (gdb-stack-buffer-name))
+ (split-window-horizontally)
+ (other-window 1)
+ (gdb-set-window-buffer (if gdb-show-threads-by-default
+ (gdb-threads-buffer-name)
+ (gdb-breakpoints-buffer-name)))
+ (other-window 1))
+
+(defcustom gdb-many-windows nil
+ "If nil just pop up the GUD buffer unless `gdb-show-main' is t.
+In this case it starts with two windows: one displaying the GUD
+buffer and the other with the source file with the main routine
+of the debugged program. Non-nil means display the layout shown for
+`gdb'."
+ :type 'boolean
+ :group 'gdb
+ :version "22.1")
+
+(defun gdb-many-windows (arg)
+ "Toggle the number of windows in the basic arrangement.
+With arg, display additional buffers iff arg is positive."
+ (interactive "P")
+ (setq gdb-many-windows
+ (if (null arg)
+ (not gdb-many-windows)
+ (> (prefix-numeric-value arg) 0)))
+ (message (format "Display of other windows %sabled"
+ (if gdb-many-windows "en" "dis")))
+ (if (and gud-comint-buffer
+ (buffer-name gud-comint-buffer))
+ (condition-case nil
+ (gdb-restore-windows)
+ (error nil))))
+
+(defun gdb-restore-windows ()
+ "Restore the basic arrangement of windows used by gdb.
+This arrangement depends on the value of `gdb-many-windows'."
+ (interactive)
+ (pop-to-buffer gud-comint-buffer) ;Select the right window and frame.
+ (delete-other-windows)
+ (if gdb-many-windows
+ (gdb-setup-windows)
+ (when (or gud-last-last-frame gdb-show-main)
+ (split-window)
+ (other-window 1)
+ (switch-to-buffer
+ (if gud-last-last-frame
+ (gud-find-file (car gud-last-last-frame))
+ (gud-find-file gdb-main-file)))
+ (setq gdb-source-window (selected-window))
+ (other-window 1))))
+
+(defun gdb-reset ()
+ "Exit a debugging session cleanly.
+Kills the gdb buffers, and resets variables and the source buffers."
+ (dolist (buffer (buffer-list))
+ (unless (eq buffer gud-comint-buffer)
+ (with-current-buffer buffer
+ (if (eq gud-minor-mode 'gdbmi)
+ (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
+ (kill-buffer nil)
+ (gdb-remove-breakpoint-icons (point-min) (point-max) t)
+ (setq gud-minor-mode nil)
+ (kill-local-variable 'tool-bar-map)
+ (kill-local-variable 'gdb-define-alist))))))
+ (setq gdb-disassembly-position nil)
+ (setq overlay-arrow-variable-list
+ (delq 'gdb-disassembly-position overlay-arrow-variable-list))
+ (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
+ (setq gdb-stack-position nil)
+ (setq overlay-arrow-variable-list
+ (delq 'gdb-stack-position overlay-arrow-variable-list))
+ (setq gdb-thread-position nil)
+ (setq overlay-arrow-variable-list
+ (delq 'gdb-thread-position overlay-arrow-variable-list))
+ (if (boundp 'speedbar-frame) (speedbar-timer-fn))
+ (setq gud-running nil)
+ (setq gdb-active-process nil)
+ (remove-hook 'after-save-hook 'gdb-create-define-alist t))
+
+(defun gdb-get-source-file ()
+ "Find the source file where the program starts and display it with related
+buffers, if required."
+ (goto-char (point-min))
+ (if (re-search-forward gdb-source-file-regexp nil t)
+ (setq gdb-main-file (match-string 1)))
+ (if gdb-many-windows
+ (gdb-setup-windows)
+ (gdb-get-buffer-create 'gdb-breakpoints-buffer)
+ (if gdb-show-main
+ (let ((pop-up-windows t))
+ (display-buffer (gud-find-file gdb-main-file))))))
+
+;;from put-image
+(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
+ "Put string PUTSTRING in front of POS in the current buffer.
+PUTSTRING is displayed by putting an overlay into the current buffer with a
+`before-string' string that has a `display' property whose value is
+PUTSTRING."
+ (let ((string (make-string 1 ?x))
+ (buffer (current-buffer)))
+ (setq putstring (copy-sequence putstring))
+ (let ((overlay (make-overlay pos pos buffer))
+ (prop (or dprop
+ (list (list 'margin 'left-margin) putstring))))
+ (put-text-property 0 1 'display prop string)
+ (if sprops
+ (add-text-properties 0 1 sprops string))
+ (overlay-put overlay 'put-break t)
+ (overlay-put overlay 'before-string string))))
+
+;;from remove-images
+(defun gdb-remove-strings (start end &optional buffer)
+ "Remove strings between START and END in BUFFER.
+Remove only strings that were put in BUFFER with calls to `gdb-put-string'.
+BUFFER nil or omitted means use the current buffer."
+ (unless buffer
+ (setq buffer (current-buffer)))
+ (dolist (overlay (overlays-in start end))
+ (when (overlay-get overlay 'put-break)
+ (delete-overlay overlay))))
+
+(defun gdb-put-breakpoint-icon (enabled bptno &optional line)
+ (let* ((posns (gdb-line-posns (or line (line-number-at-pos))))
+ (start (- (car posns) 1))
+ (end (+ (cdr posns) 1))
+ (putstring (if enabled "B" "b"))
+ (source-window (get-buffer-window (current-buffer) 0)))
+ (add-text-properties
+ 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
+ putstring)
+ (if enabled
+ (add-text-properties
+ 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
+ (add-text-properties
+ 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
+ (gdb-remove-breakpoint-icons start end)
+ (if (display-images-p)
+ (if (>= (or left-fringe-width
+ (if source-window (car (window-fringes source-window)))
+ gdb-buffer-fringe-width) 8)
+ (gdb-put-string
+ nil (1+ start)
+ `(left-fringe breakpoint
+ ,(if enabled
+ 'breakpoint-enabled
+ 'breakpoint-disabled))
+ 'gdb-bptno bptno
+ 'gdb-enabled enabled)
+ (when (< left-margin-width 2)
+ (save-current-buffer
+ (setq left-margin-width 2)
+ (if source-window
+ (set-window-margins
+ source-window
+ left-margin-width right-margin-width))))
+ (put-image
+ (if enabled
+ (or breakpoint-enabled-icon
+ (setq breakpoint-enabled-icon
+ (find-image `((:type xpm :data
+ ,breakpoint-xpm-data
+ :ascent 100 :pointer hand)
+ (:type pbm :data
+ ,breakpoint-enabled-pbm-data
+ :ascent 100 :pointer hand)))))
+ (or breakpoint-disabled-icon
+ (setq breakpoint-disabled-icon
+ (find-image `((:type xpm :data
+ ,breakpoint-xpm-data
+ :conversion disabled
+ :ascent 100 :pointer hand)
+ (:type pbm :data
+ ,breakpoint-disabled-pbm-data
+ :ascent 100 :pointer hand))))))
+ (+ start 1)
+ putstring
+ 'left-margin))
+ (when (< left-margin-width 2)
+ (save-current-buffer
+ (setq left-margin-width 2)
+ (let ((window (get-buffer-window (current-buffer) 0)))
+ (if window
+ (set-window-margins
+ window left-margin-width right-margin-width)))))
+ (gdb-put-string
+ (propertize putstring
+ 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled))
+ (1+ start)))))
+
+(defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
+ (gdb-remove-strings start end)
+ (if (display-images-p)
+ (remove-images start end))
+ (when remove-margin
+ (setq left-margin-width 0)
+ (let ((window (get-buffer-window (current-buffer) 0)))
+ (if window
+ (set-window-margins
+ window left-margin-width right-margin-width)))))
+
+(provide 'gdb-mi)
+
+;; arch-tag: 1b41ea2b-f364-4cec-8f35-e02e4fe01912
+;;; gdb-mi.el ends here
+++ /dev/null
-;;; gdb-ui.el --- User Interface for running GDB
-
-;; Author: Nick Roberts <nickrob@gnu.org>
-;; Maintainer: FSF
-;; Keywords: unix, tools
-
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; 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:
-
-;; This mode acts as a graphical user interface to GDB. You can interact with
-;; GDB through the GUD buffer in the usual way, but there are also further
-;; buffers which control the execution and describe the state of your program.
-;; It separates the input/output of your program from that of GDB, if
-;; required, and watches expressions in the speedbar. It also uses features of
-;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
-;; (see the GDB Graphical Interface section in the Emacs info manual).
-
-;; By default, M-x gdb will start the debugger.
-
-;; This file has evolved from gdba.el that was included with GDB 5.0 and
-;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface.
-;; You don't need to know about annotations to use this mode as a debugger,
-;; but if you are interested developing the mode itself, see the Annotations
-;; section in the GDB info manual.
-
-;; GDB developers plan to make the annotation interface obsolete. A new
-;; interface called GDB/MI (machine interface) has been designed to replace it.
-;; Some GDB/MI commands are used in this file through the CLI command
-;; 'interpreter mi <mi-command>'. To help with the process of fully migrating
-;; Emacs from annotations to GDB/MI, there is an experimental package called
-;; gdb-mi in the Emacs Lisp Package Archive ("http://tromey.com/elpa/"). It
-;; comprises of modified gud.el and a file called gdb-mi.el which replaces
-;; gdb-ui.el. When installed, this overrides the current files and invoking
-;; M-x gdb will use GDB/MI directly (starts with "gdb -i=mi"). When deleted
-;; ('d' followed by 'x' in Package Menu mode), the files are deleted and old
-;; functionality restored. This provides a convenient way to review the
-;; current status/contribute to its improvement. For someone who just wants to
-;; use GDB, however, the current mode in Emacs 22 is a much better option.
-;; There is also a file, also called gdb-mi.el, a version of which is included
-;; the GDB distribution. This will probably only work with versions
-;; distributed with GDB 6.5 or later. Unlike the version in ELPA it works on
-;; top of gdb-ui.el and you can only start it with M-x gdbmi.
-
-;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST
-;; GDB 6.0 to use watch expressions. It works best with GDB 6.4 or later
-;; where watch expressions will update more quickly.
-
-;;; Windows Platforms:
-
-;; If you are using Emacs and GDB on Windows you will need to flush the buffer
-;; explicitly in your program if you want timely display of I/O in Emacs.
-;; Alternatively you can make the output stream unbuffered, for example, by
-;; using a macro:
-
-;; #ifdef UNBUFFERED
-;; setvbuf (stdout, (char *) NULL, _IONBF, 0);
-;; #endif
-
-;; and compiling with -DUNBUFFERED while debugging.
-
-;; If you are using Cygwin GDB and find that the source is not being displayed
-;; in Emacs when you step through it, possible solutions are to:
-
-;; 1) Use Cygwin X Windows and Cygwin Emacs.
-;; (Since 22.1 Emacs builds under Cygwin.)
-;; 2) Use MinGW GDB instead.
-;; 3) Use cygwin-mount.el
-
-;;; Mac OSX:
-
-;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made
-;; some changes to the version that they include as part of Mac OSX.
-;; This requires GDB version 7.0 or later (estimated release date June 2009)
-;; as earlier versions don not compile on Mac OSX.
-
-;;; Known Bugs:
-
-;; 1) Cannot handle multiple debug sessions.
-;; 2) If you wish to call procedures from your program in GDB
-;; e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations
-;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed.
-;; 3) After detaching from a process, clicking on the "GO" icon on toolbar
-;; (gud-go) sends "continue" to GDB (should be "run").
-
-;;; TODO:
-
-;; 1) Use MI command -data-read-memory for memory window.
-;; 2) Use tree-buffer.el (from ECB) instead of the speedbar for
-;; watch-expressions? Handling of watch-expressions needs to be
-;; overhauled to work for large arrays/structures by creating variable
-;; objects for visible watch-expressions only.
-;; 3) Mark breakpoint locations on scroll-bar of source buffer?
-
-;;; Code:
-
-(require 'gud)
-(require 'json)
-(require 'bindat)
-
-(defvar tool-bar-map)
-(defvar speedbar-initial-expansion-list-name)
-(defvar speedbar-frame)
-
-(defvar gdb-pc-address nil "Initialization for Assembler buffer.
-Set to \"main\" at start if `gdb-show-main' is t.")
-(defvar gdb-frame-address nil "Identity of frame for watch expression.")
-(defvar gdb-previous-frame-pc-address nil)
-(defvar gdb-memory-address "main")
-(defvar gdb-previous-frame nil)
-(defvar gdb-selected-frame nil)
-(defvar gdb-frame-number nil)
-(defvar gdb-current-language nil)
-(defvar gdb-var-list nil
- "List of variables in watch window.
-Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
-where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
-address for root variables.")
-(defvar gdb-main-file nil "Source file from which program execution begins.")
-(defvar gud-old-arrow nil)
-(defvar gdb-thread-indicator nil)
-(defvar gdb-overlay-arrow-position nil)
-(defvar gdb-stack-position nil)
-(defvar gdb-server-prefix nil)
-(defvar gdb-flush-pending-output nil)
-(defvar gdb-location-alist nil
- "Alist of breakpoint numbers and full filenames.
-Only used for files that Emacs can't find.")
-(defvar gdb-active-process nil
- "GUD tooltips display variable values when t, and macro definitions otherwise.")
-(defvar gdb-recording nil
- "If t, then record session for playback and reverse execution")
-(defvar gdb-error "Non-nil when GDB is reporting an error.")
-(defvar gdb-macro-info nil
- "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
-(defvar gdb-buffer-fringe-width nil)
-(defvar gdb-signalled nil)
-(defvar gdb-source-window nil)
-(defvar gdb-inferior-status nil)
-(defvar gdb-continuation nil)
-(defvar gdb-look-up-stack nil)
-(defvar gdb-frame-begin nil
- "Non-nil when GDB generates frame-begin annotation.")
-(defvar gdb-printing t)
-(defvar gdb-parent-bptno-enabled nil)
-(defvar gdb-ready nil)
-(defvar gdb-stack-update nil)
-(defvar gdb-early-user-input nil)
-
-(defvar gdb-buffer-type nil
- "One of the symbols bound in `gdb-buffer-rules'.")
-(make-variable-buffer-local 'gdb-buffer-type)
-
-(defvar gdb-input-queue ()
- "A list of gdb command objects.")
-
-(defvar gdb-prompting nil
- "True when gdb is idle with no pending input.")
-
-(defvar gdb-output-sink nil
- "The disposition of the output of the current gdb command.
-Possible values are these symbols:
-
- `user' -- gdb output should be copied to the GUD buffer
- for the user to see.
-
- `inferior' -- gdb output should be copied to the inferior-io buffer.
-
- `pre-emacs' -- output should be ignored util the post-prompt
- annotation is received. Then the output-sink
- becomes:...
- `emacs' -- output should be collected in the partial-output-buffer
- for subsequent processing by a command. This is the
- disposition of output generated by commands that
- gdb mode sends to gdb on its own behalf.
- `post-emacs' -- ignore output until the prompt annotation is
- received, then go to USER disposition.
-
-gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
-\(`user' and `emacs').")
-
-(defvar gdb-current-item nil
- "The most recent command item sent to gdb.")
-
-(defvar gdb-pending-triggers '()
- "A list of trigger functions that have run later than their output handlers.")
-
-(defvar gdb-first-post-prompt nil)
-(defvar gdb-version nil)
-(defvar gdb-locals-font-lock-keywords nil)
-(defvar gdb-source-file-list nil
- "List of source files for the current executable.")
-(defconst gdb-error-regexp "\\^error,msg=\"\\(.+\\)\"")
-
-(defvar gdb-locals-font-lock-keywords-1
- '(;; var = (struct struct_tag) value
- ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
- (1 font-lock-variable-name-face)
- (3 font-lock-keyword-face)
- (4 font-lock-type-face))
- ;; var = (type) value
- ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)"
- (1 font-lock-variable-name-face)
- (3 font-lock-type-face))
- ;; var = val
- ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]"
- (1 font-lock-variable-name-face)))
- "Font lock keywords used in `gdb-local-mode'.")
-
-(defvar gdb-locals-font-lock-keywords-2
- '(;; var = type value
- ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)"
- (1 font-lock-variable-name-face)
- (3 font-lock-type-face)))
- "Font lock keywords used in `gdb-local-mode'.")
-
-;; Variables for GDB 6.4+
-(defvar gdb-register-names nil "List of register names.")
-(defvar gdb-changed-registers nil
- "List of changed register numbers (strings).")
-
-;;;###autoload
-(defun gdb (command-line)
- "Run gdb on program FILE in buffer *gud-FILE*.
-The directory containing FILE becomes the initial working
-directory and source-file directory for your debugger.
-
-If `gdb-many-windows' is nil (the default value) then gdb just
-pops up the GUD buffer unless `gdb-show-main' is t. In this case
-it starts with two windows: one displaying the GUD buffer and the
-other with the source file with the main routine of the inferior.
-
-If `gdb-many-windows' is t, regardless of the value of
-`gdb-show-main', the layout below will appear unless
-`gdb-use-separate-io-buffer' is nil when the source buffer
-occupies the full width of the frame. Keybindings are shown in
-some of the buffers.
-
-Watch expressions appear in the speedbar/slowbar.
-
-The following commands help control operation :
-
-`gdb-many-windows' - Toggle the number of windows gdb uses.
-`gdb-restore-windows' - To restore the window layout.
-
-See Info node `(emacs)GDB Graphical Interface' for a more
-detailed description of this mode.
-
-+----------------------------------------------------------------------+
-| GDB Toolbar |
-+-----------------------------------+----------------------------------+
-| GUD buffer (I/O of GDB) | Locals buffer |
-|-----------------------------------+----------------------------------+
-| | |
-| Source buffer | I/O buffer for debugged program |
-| | |
-|-----------------------------------+----------------------------------+
-| Stack buffer | Breakpoints/threads buffer |
-+-----------------------------------+----------------------------------+
-
-The option \"--annotate=3\" must be included in this value. To
-run GDB in text command mode, use `gud-gdb'. You need to use
-text command mode to debug multiple programs within one Emacs
-session."
- (interactive (list (gud-query-cmdline 'gdb)))
-
- (when (and gud-comint-buffer
- (buffer-name gud-comint-buffer)
- (get-buffer-process gud-comint-buffer)
- (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
- (gdb-restore-windows)
- (error
- "Multiple debugging requires restarting in text command mode"))
-
- (gud-common-init command-line nil 'gud-gdba-marker-filter)
- (set (make-local-variable 'gud-minor-mode) 'gdba)
- (setq comint-input-sender 'gdb-send)
-
- (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.")
- (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
- "Set temporary breakpoint at current line.")
- (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line.")
- (gud-def gud-step "step %p" "\C-s" "Step one source line with display.")
- (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
- (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
- (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).")
- (gud-def gud-cont "continue" "\C-r" "Continue with display.")
- (gud-def gud-finish "finish" "\C-f" "Finish executing current function.")
- (gud-def gud-jump
- (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
- "\C-j" "Set execution address to current line.")
-
- (gud-def gud-rstep "reverse-step %p" nil "Reverse step one source line with display.")
- (gud-def gud-rstepi "reverse-stepi %p" nil "Reverse step one instruction with display.")
- (gud-def gud-rnext "reverse-next %p" nil "Reverse step one line (skip functions).")
- (gud-def gud-rnexti "reverse-nexti %p" nil "Reverse step one instruction (skip functions).")
- (gud-def gud-rcont "reverse-continue" nil "Reverse continue with display.")
- (gud-def gud-rfinish "reverse-finish" nil "Reverse finish executing current function.")
-
- (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
- (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
- (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
- (gud-def gud-pstar "print* %e" nil
- "Evaluate C dereferenced pointer expression at point.")
-
- ;; For debugging Emacs only.
- (gud-def gud-pv "pv1 %e" "\C-v" "Print the value of the lisp variable.")
-
- (gud-def gud-until "until %l" "\C-u" "Continue to current line.")
- (gud-def gud-run "run" nil "Run the program.")
-
- (local-set-key "\C-i" 'gud-gdb-complete-command)
- (setq comint-prompt-regexp "^(.*gdb[+]?) *")
- (setq paragraph-start comint-prompt-regexp)
- (setq gdb-output-sink 'user)
- (setq gdb-first-prompt t)
- (setq gud-running nil)
- (setq gdb-ready nil)
- (setq gdb-stack-update nil)
- (setq gdb-flush-pending-output nil)
- (setq gdb-early-user-input nil)
- (setq gud-filter-pending-text nil)
- (gdb-thread-identification)
- (run-hooks 'gdb-mode-hook))
-
-;; Keep as an alias for compatibility with Emacs 22.1.
-;;;###autoload
-(defalias 'gdba 'gdb)
-
-(defgroup gdb nil
- "Gdb Graphical Mode options specifically for running Gdb in Emacs."
- :group 'processes
- :group 'tools)
-
-(defcustom gdb-debug-log-max 128
- "Maximum size of `gdb-debug-log'. If nil, size is unlimited."
- :group 'gdb
- :type '(choice (integer :tag "Number of elements")
- (const :tag "Unlimited" nil))
- :version "22.1")
-
-(defvar gdb-debug-log nil
- "List of commands sent to and replies received from GDB.
-Most recent commands are listed first. This list stores only the last
-`gdb-debug-log-max' values. This variable is used to debug GDB-UI.")
-
-;;;###autoload
-(defcustom gdb-enable-debug nil
- "Non-nil means record the process input and output in `gdb-debug-log'."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
- "Shell command for generating a list of defined macros in a source file.
-This list is used to display the #define directive associated
-with an identifier as a tooltip. It works in a debug session with
-GDB, when `gud-tooltip-mode' is t.
-
-Set `gdb-cpp-define-alist-flags' for any include paths or
-predefined macros."
- :type 'string
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-cpp-define-alist-flags ""
- "Preprocessor flags for `gdb-cpp-define-alist-program'."
- :type 'string
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-create-source-file-list t
- "Non-nil means create a list of files from which the executable was built.
-Set this to nil if the GUD buffer displays \"initializing...\" in the mode
-line for a long time when starting, possibly because your executable was
-built from a large number of files. This allows quicker initialization
-but means that these files are not automatically enabled for debugging,
-e.g., you won't be able to click in the fringe to set a breakpoint until
-execution has already stopped there."
- :type 'boolean
- :group 'gdb
- :version "23.1")
-
-(defcustom gdb-show-main nil
- "Non-nil means display source file containing the main routine at startup.
-Also display the main routine in the disassembly buffer if present."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-many-windows nil
- "If nil, just pop up the GUD buffer unless `gdb-show-main' is t.
-In this case start with two windows: one displaying the GUD
-buffer and the other with the source file with the main routine
-of the debugged program. Non-nil means display the layout shown
-for `gdba'."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-use-separate-io-buffer nil
- "Non-nil means display output from the debugged program in a separate buffer."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defun gdb-force-mode-line-update (status)
- (let ((buffer gud-comint-buffer))
- (if (and buffer (buffer-name buffer))
- (with-current-buffer buffer
- (setq mode-line-process
- (format ":%s [%s]"
- (process-status (get-buffer-process buffer)) status))
- ;; Force mode line redisplay soon.
- (force-mode-line-update)))))
-
-(defun gdb-enable-debug (arg)
- "Toggle logging of transaction between Emacs and Gdb.
-The log is stored in `gdb-debug-log' as an alist with elements
-whose cons is send, send-item or recv and whose cdr is the string
-being transferred. This list may grow up to a size of
-`gdb-debug-log-max' after which the oldest element (at the end of
-the list) is deleted every time a new one is added (at the front)."
- (interactive "P")
- (setq gdb-enable-debug
- (if (null arg)
- (not gdb-enable-debug)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Logging of transaction %sabled"
- (if gdb-enable-debug "en" "dis"))))
-
-(defun gdb-many-windows (arg)
- "Toggle the number of windows in the basic arrangement.
-With prefix argument ARG, display additional buffers if ARG is positive,
-otherwise use a single window."
- (interactive "P")
- (setq gdb-many-windows
- (if (null arg)
- (not gdb-many-windows)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Display of other windows %sabled"
- (if gdb-many-windows "en" "dis")))
- (if (and gud-comint-buffer
- (buffer-name gud-comint-buffer))
- (condition-case nil
- (gdb-restore-windows)
- (error nil))))
-
-(defun gdb-use-separate-io-buffer (arg)
- "Toggle separate IO for debugged program.
-With prefix argument ARG, use separate IO if ARG is positive,
-otherwise do not."
- (interactive "P")
- (setq gdb-use-separate-io-buffer
- (if (null arg)
- (not gdb-use-separate-io-buffer)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Separate IO %sabled"
- (if gdb-use-separate-io-buffer "en" "dis")))
- (if (and gud-comint-buffer
- (buffer-name gud-comint-buffer))
- (condition-case nil
- (if gdb-use-separate-io-buffer
- (if gdb-many-windows (gdb-restore-windows))
- (kill-buffer (gdb-inferior-io-name)))
- (error nil))))
-
-(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
-
-(defun gdb-create-define-alist ()
- "Create an alist of #define directives for GUD tooltips."
- (let* ((file (buffer-file-name))
- (output
- (with-output-to-string
- (with-current-buffer standard-output
- (and file
- (file-exists-p file)
- ;; call-process doesn't work with remote file names.
- (not (file-remote-p default-directory))
- (call-process shell-file-name file
- (list t nil) nil "-c"
- (concat gdb-cpp-define-alist-program " "
- gdb-cpp-define-alist-flags))))))
- (define-list (split-string output "\n" t)) (name))
- (setq gdb-define-alist nil)
- (dolist (define define-list)
- (setq name (nth 1 (split-string define "[( ]")))
- (push (cons name define) gdb-define-alist))))
-
-(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
-(defvar tooltip-use-echo-area)
-
-(defun gdb-tooltip-print (expr)
- (tooltip-show
- (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
- (goto-char (point-min))
- (let ((string
- (if (search-forward "=" nil t)
- (concat expr (buffer-substring (- (point) 2) (point-max)))
- (buffer-string))))
- ;; remove newline for gud-tooltip-echo-area
- (substring string 0 (- (length string) 1))))
- (or gud-tooltip-echo-area tooltip-use-echo-area
- (not (display-graphic-p)))))
-
-;; If expr is a macro for a function don't print because of possible dangerous
-;; side-effects. Also printing a function within a tooltip generates an
-;; unexpected starting annotation (phase error).
-(defun gdb-tooltip-print-1 (expr)
- (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
- (goto-char (point-min))
- (if (search-forward "expands to: " nil t)
- (unless (looking-at "\\S-+.*(.*).*")
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "print " expr "\n")
- `(lambda () (gdb-tooltip-print ,expr))))))))
-
-(defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
-
-(defun gdb-init-buffer ()
- (set (make-local-variable 'gud-minor-mode)
- (buffer-local-value 'gud-minor-mode gud-comint-buffer))
- (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
- (when gud-tooltip-mode
- (make-local-variable 'gdb-define-alist)
- (gdb-create-define-alist)
- (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
-
-(defun gdb-set-gud-minor-mode-existing-buffers ()
- "Create list of source files for current GDB session."
- (goto-char (point-min))
- (when (search-forward "read in on demand:" nil t)
- (while (re-search-forward gdb-source-file-regexp nil t)
- (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
- gdb-source-file-list))
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (when (and buffer-file-name
- (member (file-name-nondirectory buffer-file-name)
- gdb-source-file-list))
- (gdb-init-buffer)))))
- (gdb-force-mode-line-update
- (propertize "ready" 'face font-lock-variable-name-face)))
-
-(defun gdb-find-watch-expression ()
- (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
- (varnum (car var)) expr array)
- (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
- (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
- (component-list (split-string (match-string 2 varnum) "\\." t)))
- (setq expr (nth 1 var1))
- (setq varnumlet (car var1))
- (dolist (component component-list)
- (setq var2 (assoc varnumlet gdb-var-list))
- (setq expr (concat expr
- (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
- (concat "[" component "]")
- (concat "." component))))
- (setq varnumlet (concat varnumlet "." component)))
- expr)))
-
-(defun gdb-toggle-recording ()
-"Start/stop recording of debug session."
- (interactive)
- (if gud-running
- (message-box "Recording cannot be started or stopped while your program is still running")
- (gdb-enqueue-input
- (list (concat gdb-server-prefix
- (if gdb-recording "record stop\n" "target record\n"))
- 'gdb-recording-handler))))
-
-;; Convenience function for tool bar.
-(defalias 'gdb-toggle-recording-1 'gdb-toggle-recording)
-
-(defun gdb-recording-handler ()
- (goto-char (point-min))
- (if (re-search-forward "current architecture doesn't support record function" nil t)
- (message-box "Not enabled. The current architecture doesn't support the process record function.")
- (goto-char (point-min))
- (if (re-search-forward "Undefined target command" nil t)
- (message-box "Not enabled. Process record requires GDB 7.0 onwards.")
- (goto-char (point-min))
- (if (re-search-forward "the program is not being run" nil t)
- (message-box "Not enabled. Starting process recording requires an active target (running process).")
- (setq gdb-recording (not gdb-recording))
- ;; Actually forcing the tool-bar to update.
- (force-mode-line-update)))))
-
-(defun gdb-init-1 ()
- (gud-def gud-break (if (not (string-match "Machine" mode-name))
- (gud-call "break %f:%l" arg)
- (save-excursion
- (beginning-of-line)
- (forward-char 2)
- (gud-call "break *%a" arg)))
- "\C-b" "Set breakpoint at current line or address.")
- ;;
- (gud-def gud-remove (if (not (string-match "Machine" mode-name))
- (gud-call "clear %f:%l" arg)
- (save-excursion
- (beginning-of-line)
- (forward-char 2)
- (gud-call "clear *%a" arg)))
- "\C-d" "Remove breakpoint at current line or address.")
- ;;
- (gud-def gud-until (if (not (string-match "Machine" mode-name))
- (gud-call "until %f:%l" arg)
- (save-excursion
- (beginning-of-line)
- (forward-char 2)
- (gud-call "until *%a" arg)))
- "\C-u" "Continue to current line or address.")
- ;;
- (gud-def gud-go (gud-call (if gdb-active-process "continue" "run") arg)
- nil "Start or continue execution.")
-
- ;; For debugging Emacs only.
- (gud-def gud-pp
- (gud-call
- (concat
- "pp1 " (if (eq (buffer-local-value
- 'major-mode (window-buffer)) 'speedbar-mode)
- (gdb-find-watch-expression) "%e")) arg)
- nil "Print the Emacs s-expression.")
-
- (define-key gud-minor-mode-map [left-margin mouse-1]
- 'gdb-mouse-set-clear-breakpoint)
- (define-key gud-minor-mode-map [left-fringe mouse-1]
- 'gdb-mouse-set-clear-breakpoint)
- (define-key gud-minor-mode-map [left-margin C-mouse-1]
- 'gdb-mouse-toggle-breakpoint-margin)
- (define-key gud-minor-mode-map [left-fringe C-mouse-1]
- 'gdb-mouse-toggle-breakpoint-fringe)
-
- (define-key gud-minor-mode-map [left-margin drag-mouse-1]
- 'gdb-mouse-until)
- (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
- 'gdb-mouse-until)
- (define-key gud-minor-mode-map [left-margin mouse-3]
- 'gdb-mouse-until)
- (define-key gud-minor-mode-map [left-fringe mouse-3]
- 'gdb-mouse-until)
-
- (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
- 'gdb-mouse-jump)
- (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
- 'gdb-mouse-jump)
- (define-key gud-minor-mode-map [left-fringe C-mouse-3]
- 'gdb-mouse-jump)
- (define-key gud-minor-mode-map [left-margin C-mouse-3]
- 'gdb-mouse-jump)
-
- ;; (re-)initialize
- (setq gdb-pc-address (if gdb-show-main "main" nil))
- (setq gdb-previous-frame-pc-address nil
- gdb-memory-address "main"
- gdb-previous-frame nil
- gdb-selected-frame nil
- gdb-current-language nil
- gdb-frame-number nil
- gdb-var-list nil
- gdb-main-file nil
- gdb-first-post-prompt t
- gdb-prompting nil
- gdb-input-queue nil
- gdb-current-item nil
- gdb-pending-triggers nil
- gdb-output-sink 'user
- gdb-server-prefix "server "
- gdb-location-alist nil
- gdb-source-file-list nil
- gdb-error nil
- gdb-macro-info nil
- gdb-buffer-fringe-width (car (window-fringes))
- gdb-debug-log nil
- gdb-signalled nil
- gdb-source-window nil
- gdb-inferior-status nil
- gdb-continuation nil
- gdb-look-up-stack nil
- gdb-frame-begin nil
- gdb-printing t
- gud-old-arrow nil
- gdb-thread-indicator nil
- gdb-register-names nil
- gdb-recording nil)
-
- (setq gdb-buffer-type 'gdba)
-
- (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
-
- (if (eq system-type 'darwin)
- (gdb-enqueue-input (list "server show version\n" 'gdb-apple-test)))
-
- ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
- (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
- 'gdb-get-version)))
-
-(defun gdb-init-2 ()
- (if (eq window-system 'w32)
- (gdb-enqueue-input (list "set new-console off\n" 'ignore)))
- (gdb-enqueue-input (list "set height 0\n" 'ignore))
- (gdb-enqueue-input (list "set width 0\n" 'ignore))
-
- (if (string-equal gdb-version "pre-6.4")
- (if gdb-create-source-file-list
- (gdb-enqueue-input (list (concat gdb-server-prefix "info sources\n")
- 'gdb-set-gud-minor-mode-existing-buffers))
- (setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-1))
- ; Needs GDB 6.2 onwards.
- (if gdb-create-source-file-list
- (gdb-enqueue-input
- (list "server interpreter mi \"-file-list-exec-source-files\"\n"
- 'gdb-set-gud-minor-mode-existing-buffers-1)))
- (setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-2)
- ; Needs GDB 7.0 onwards.
- (gdb-enqueue-input
- (list "server interpreter mi -enable-pretty-printing\n" 'ignore)))
-
- ;; Find source file and compilation directory here.
- ;; Works for C, C++, Fortran and Ada but not Java (GDB 6.4)
- (gdb-enqueue-input (list "server list\n" 'ignore))
- (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))
- (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)))
-
-;; Workaround for some Apple versions of GDB that add ^M at EOL
-;; after the command "server interpreter mi -stack-info-frame".
-(defun gdb-apple-test ()
- (goto-char (point-min))
- (if (re-search-forward "(Apple version " nil t)
- (let* ((process (get-buffer-process gud-comint-buffer))
- (coding-systems (process-coding-system process)))
- (set-process-coding-system process
- (coding-system-change-eol-conversion
- (car coding-systems) 'dos)
- (cdr coding-systems)))))
-
-(defun gdb-get-version ()
- (goto-char (point-min))
- (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)
- (setq gdb-version "pre-6.4")
- (setq gdb-version "6.4+"))
- (gdb-init-2))
-
-(defmacro gdb-if-arrow (arrow-position &rest body)
- `(if ,arrow-position
- (let ((buffer (marker-buffer ,arrow-position)) (line))
- (if (equal buffer (window-buffer (posn-window end)))
- (with-current-buffer buffer
- (when (or (equal start end)
- (equal (posn-point start)
- (marker-position ,arrow-position)))
- ,@body))))))
-
-(defun gdb-mouse-until (event)
- "Continue running until a source line past the current line.
-The destination source line can be selected either by clicking
-with mouse-3 on the fringe/margin or dragging the arrow
-with mouse-1 (default bindings)."
- (interactive "e")
- (let ((start (event-start event))
- (end (event-end event)))
- (gdb-if-arrow gud-overlay-arrow-position
- (setq line (line-number-at-pos (posn-point end)))
- (gud-call (concat "until " (number-to-string line))))
- (gdb-if-arrow gdb-overlay-arrow-position
- (save-excursion
- (goto-char (point-min))
- (forward-line (1- (line-number-at-pos (posn-point end))))
- (forward-char 2)
- (gud-call (concat "until *%a"))))))
-
-(defun gdb-mouse-jump (event)
- "Set execution address/line.
-The destination source line can be selected either by clicking with C-mouse-3
-on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings).
-Unlike `gdb-mouse-until' the destination address can be before the current
-line, and no execution takes place."
- (interactive "e")
- (let ((start (event-start event))
- (end (event-end event)))
- (gdb-if-arrow gud-overlay-arrow-position
- (setq line (line-number-at-pos (posn-point end)))
- (progn
- (gud-call (concat "tbreak " (number-to-string line)))
- (gud-call (concat "jump " (number-to-string line)))))
- (gdb-if-arrow gdb-overlay-arrow-position
- (save-excursion
- (goto-char (point-min))
- (forward-line (1- (line-number-at-pos (posn-point end))))
- (forward-char 2)
- (progn
- (gud-call (concat "tbreak *%a"))
- (gud-call (concat "jump *%a")))))))
-
-(defcustom gdb-speedbar-auto-raise nil
- "If non-nil raise speedbar every time display of watch expressions is\
- updated."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defun gdb-speedbar-auto-raise (arg)
- "Toggle automatic raising of the speedbar for watch expressions.
-With prefix argument ARG, automatically raise speedbar if ARG is
-positive, otherwise don't automatically raise it."
- (interactive "P")
- (setq gdb-speedbar-auto-raise
- (if (null arg)
- (not gdb-speedbar-auto-raise)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Auto raising %sabled"
- (if gdb-speedbar-auto-raise "en" "dis"))))
-
-(defcustom gdb-use-colon-colon-notation nil
- "If non-nil use FUN::VAR format to display variables in the speedbar."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
-(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
-
-(declare-function tooltip-identifier-from-point "tooltip" (point))
-
-(defun gud-watch (&optional arg event)
- "Watch expression at point.
-With arg, enter name of variable to be watched in the minibuffer."
- (interactive (list current-prefix-arg last-input-event))
- (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
- (if (memq minor-mode '(gdbmi gdba))
- (progn
- (if event (posn-set-point (event-end event)))
- (require 'tooltip)
- (save-selected-window
- (let ((expr
- (if arg
- (completing-read "Name of variable: "
- 'gud-gdb-complete-command)
- (if (and transient-mark-mode mark-active)
- (buffer-substring (region-beginning) (region-end))
- (concat (if (eq major-mode 'gdb-registers-mode) "$")
- (tooltip-identifier-from-point (point)))))))
- (set-text-properties 0 (length expr) nil expr)
- (gdb-enqueue-input
- (list
- (if (eq minor-mode 'gdba)
- (concat
- "server interpreter mi \"-var-create - * " expr "\"\n")
- (concat"-var-create - * " expr "\n"))
- `(lambda () (gdb-var-create-handler ,expr)))))))
- (message "gud-watch is a no-op in this mode."))))
-
-(declare-function speedbar-change-initial-expansion-list "speedbar" (new-default))
-
-(defun gdb-var-create-handler (expr)
- (let* ((result (gdb-json-partial-output)))
- (if (not (bindat-get-field result 'msg))
- (let ((var
- (list (bindat-get-field result 'name)
- (if (and (string-equal gdb-current-language "c")
- gdb-use-colon-colon-notation gdb-selected-frame)
- (setq expr (concat gdb-selected-frame "::" expr))
- expr)
- (bindat-get-field result 'numchild)
- (bindat-get-field result 'type)
- (bindat-get-field result 'value)
- nil
- (bindat-get-field result 'has_more)
- gdb-frame-address)))
- (push var gdb-var-list)
- (speedbar 1)
- (unless (string-equal
- speedbar-initial-expansion-list-name "GUD")
- (speedbar-change-initial-expansion-list "GUD")))
- (message-box "No symbol \"%s\" in current context." expr))))
-
-(declare-function speedbar-timer-fn "speedbar" ())
-
-(defun gdb-speedbar-update ()
- (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
- (not (member 'gdb-speedbar-timer gdb-pending-triggers)))
- ;; Dummy command to update speedbar even when idle.
- (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
- ;; Keep gdb-pending-triggers non-nil till end.
- (push 'gdb-speedbar-timer gdb-pending-triggers)))
-
-(defun gdb-speedbar-timer-fn ()
- (if gdb-speedbar-auto-raise
- (raise-frame speedbar-frame))
- (setq gdb-pending-triggers
- (delq 'gdb-speedbar-timer gdb-pending-triggers))
- (speedbar-timer-fn))
-
-(defun gdb-var-evaluate-expression-handler (varnum changed)
- (goto-char (point-min))
- (re-search-forward "\\(.+\\)\\^done,value=\\(\".*\"\\)" nil t)
- (setq gdb-pending-triggers
- (delq (string-to-number (match-string 1)) gdb-pending-triggers))
- (let ((var (assoc varnum gdb-var-list)))
- (when var
- (if changed (setcar (nthcdr 5 var) 'changed))
- (setcar (nthcdr 4 var) (read (match-string 2)))))
- (gdb-speedbar-update))
-
-(defun gdb-var-list-children (varnum)
- (gdb-enqueue-input
- (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n")
- `(lambda () (gdb-var-list-children-handler ,varnum)))))
-
-(defconst gdb-var-list-children-regexp
- "child={.*?name=\"\\(.*?\\)\".*?,exp=\"\\(.*?\\)\".*?,\
-numchild=\"\\(.*?\\)\"\\(}\\|.*?,\\(type=\"\\(.*?\\)\"\\)?.*?}\\)")
-
-(defun gdb-var-list-children-handler (varnum)
- (goto-char (point-min))
- (let ((var-list nil))
- (catch 'child-already-watched
- (dolist (var gdb-var-list)
- (if (string-equal varnum (car var))
- (progn
- (push var var-list)
- (while (re-search-forward gdb-var-list-children-regexp nil t)
- (let ((varchild (list (match-string 1)
- (match-string 2)
- (match-string 3)
- (match-string 6)
- nil nil)))
- (if (assoc (car varchild) gdb-var-list)
- (throw 'child-already-watched nil))
- (push varchild var-list)
- (gdb-enqueue-input
- (list
- (concat
- "server interpreter mi \"0-var-evaluate-expression "
- (car varchild) "\"\n")
- `(lambda () (gdb-var-evaluate-expression-handler
- ,(car varchild) nil)))))))
- (push var var-list)))
- (setq gdb-var-list (nreverse var-list)))))
-
-(defun gdb-var-update ()
- (when (not (member 'gdb-var-update gdb-pending-triggers))
- (gdb-enqueue-input
- (list "server interpreter mi \"-var-update *\"\n"
- 'gdb-var-update-handler))
- (push 'gdb-var-update gdb-pending-triggers)))
-
-(defconst gdb-var-update-regexp
- "{.*?name=\"\\(.*?\\)\".*?,in_scope=\"\\(.*?\\)\".*?,\
-type_changed=\".*?\".*?}")
-
-(defun gdb-var-update-handler ()
- (dolist (var gdb-var-list)
- (setcar (nthcdr 5 var) nil))
- (goto-char (point-min))
- (let ((n 0))
- (while (re-search-forward gdb-var-update-regexp nil t)
- (let ((varnum (match-string 1)))
- (if (string-equal (match-string 2) "false")
- (let ((var (assoc varnum gdb-var-list)))
- (if var (setcar (nthcdr 5 var) 'out-of-scope)))
- (setq n (1+ n))
- (push n gdb-pending-triggers)
- (gdb-enqueue-input
- (list
- (concat "server interpreter mi \"" (number-to-string n)
- "-var-evaluate-expression " varnum "\"\n")
- `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
- (setq gdb-pending-triggers
- (delq 'gdb-var-update gdb-pending-triggers)))
-
-(defun gdb-var-set-format (format)
- "Set the output format for a variable displayed in the speedbar."
- (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
- (varnum (car var)))
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (concat "server interpreter mi \"-var-set-format "
- varnum " " format "\"\n")
- (concat "-var-set-format " varnum " " format "\n"))
- `(lambda () (gdb-var-set-format-handler ,varnum))))))
-
-(defconst gdb-var-set-format-regexp
- "format=\"\\(.*?\\)\",.*value=\"\\(.*?\\)\"")
-
-(defun gdb-var-set-format-handler (varnum)
- (goto-char (point-min))
- (if (re-search-forward gdb-var-set-format-regexp nil t)
- (let ((var (assoc varnum gdb-var-list)))
- (setcar (nthcdr 4 var) (match-string 2))
- (gdb-var-update-1))))
-
-(defun gdb-var-delete-1 (var varnum)
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (concat "server interpreter mi \"-var-delete " varnum "\"\n")
- (concat "-var-delete " varnum "\n"))
- 'ignore))
- (setq gdb-var-list (delq var gdb-var-list))
- (dolist (varchild gdb-var-list)
- (if (string-match (concat (car var) "\\.") (car varchild))
- (setq gdb-var-list (delq varchild gdb-var-list)))))
-
-(defun gdb-var-delete ()
- "Delete watch expression at point from the speedbar."
- (interactive)
- (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba))
- (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
- (varnum (car var)))
- (if (string-match "\\." (car var))
- (message-box "Can only delete a root expression")
- (gdb-var-delete-1 var varnum)))))
-
-(defun gdb-var-delete-children (varnum)
- "Delete children of variable object at point from the speedbar."
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (concat "server interpreter mi \"-var-delete -c " varnum "\"\n")
- (concat "-var-delete -c " varnum "\n")) 'ignore)))
-
-(defun gdb-edit-value (text token indent)
- "Assign a value to a variable displayed in the speedbar."
- (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
- (varnum (car var)) (value))
- (setq value (read-string "New value: "))
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (concat "server interpreter mi \"-var-assign "
- varnum " " value "\"\n")
- (concat "-var-assign " varnum " " value "\n"))
- `(lambda () (gdb-edit-value-handler ,value))))))
-
-(defun gdb-edit-value-handler (value)
- (goto-char (point-min))
- (if (re-search-forward gdb-error-regexp nil t)
- (message-box "Invalid number or expression (%s)" value)))
-
-(defcustom gdb-show-changed-values t
- "If non-nil change the face of out of scope variables and changed values.
-Out of scope variables are suppressed with `shadow' face.
-Changed values are highlighted with the face `font-lock-warning-face'."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-max-children 40
- "Maximum number of children before expansion requires confirmation."
- :type 'integer
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-delete-out-of-scope t
- "If non-nil delete watch expressions automatically when they go out of scope."
- :type 'boolean
- :group 'gdb
- :version "22.2")
-
-(declare-function speedbar-change-expand-button-char "speedbar" (char))
-(declare-function speedbar-delete-subblock "speedbar" (indent))
-(declare-function speedbar-center-buffer-smartly "speedbar" ())
-
-(defun gdb-speedbar-expand-node (text token indent)
- "Expand the node the user clicked on.
-TEXT is the text of the button we clicked on, a + or - item.
-TOKEN is data related to this node.
-INDENT is the current indentation depth."
- (if (and gud-comint-buffer (buffer-name gud-comint-buffer))
- (progn
- (cond ((string-match "+" text) ;expand this node
- (let* ((var (assoc token gdb-var-list))
- (expr (nth 1 var)) (children (nth 2 var)))
- (if (or (<= (string-to-number children) gdb-max-children)
- (y-or-n-p
- (format
- "%s has %s children. Continue? " expr children)))
- (if (and (eq (buffer-local-value
- 'gud-minor-mode gud-comint-buffer) 'gdba)
- (string-equal gdb-version "pre-6.4"))
- (gdb-var-list-children token)
- (gdb-var-list-children-1 token)))))
- ((string-match "-" text) ;contract this node
- (dolist (var gdb-var-list)
- (if (string-match (concat token "\\.") (car var))
- (setq gdb-var-list (delq var gdb-var-list))))
- (gdb-var-delete-children token)
- (speedbar-change-expand-button-char ?+)
- (speedbar-delete-subblock indent))
- (t (error "Ooops... not sure what to do")))
- (speedbar-center-buffer-smartly))
- (message-box "GUD session has been killed")))
-
-(defun gdb-get-target-string ()
- (with-current-buffer gud-comint-buffer
- gud-target-name))
-\f
-
-;;
-;; gdb buffers.
-;;
-;; Each buffer has a TYPE -- a symbol that identifies the function
-;; of that particular buffer.
-;;
-;; The usual gdb interaction buffer is given the type `gdba' and
-;; is constructed specially.
-;;
-;; Others are constructed by gdb-get-buffer-create and
-;; named according to the rules set forth in the gdb-buffer-rules-assoc
-
-(defvar gdb-buffer-rules-assoc '())
-
-(defun gdb-get-buffer (key)
- "Return the gdb buffer tagged with type KEY.
-The key should be one of the cars in `gdb-buffer-rules-assoc'."
- (save-excursion
- (gdb-look-for-tagged-buffer key (buffer-list))))
-
-(defun gdb-get-buffer-create (key)
- "Create a new gdb buffer of the type specified by KEY.
-The key should be one of the cars in `gdb-buffer-rules-assoc'."
- (or (gdb-get-buffer key)
- (let* ((rules (assoc key gdb-buffer-rules-assoc))
- (name (funcall (gdb-rules-name-maker rules)))
- (new (get-buffer-create name)))
- (with-current-buffer new
- (let ((trigger))
- (if (cdr (cdr rules))
- (setq trigger (funcall (car (cdr (cdr rules))))))
- (setq gdb-buffer-type key)
- (set (make-local-variable 'gud-minor-mode)
- (buffer-local-value 'gud-minor-mode gud-comint-buffer))
- (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
- (if trigger (funcall trigger)))
- new))))
-
-(defun gdb-rules-name-maker (rules) (car (cdr rules)))
-
-(defun gdb-look-for-tagged-buffer (key bufs)
- (let ((retval nil))
- (while (and (not retval) bufs)
- (set-buffer (car bufs))
- (if (eq gdb-buffer-type key)
- (setq retval (car bufs)))
- (setq bufs (cdr bufs)))
- retval))
-
-;;
-;; This assoc maps buffer type symbols to rules. Each rule is a list of
-;; at least one and possible more functions. The functions have these
-;; roles in defining a buffer type:
-;;
-;; NAME - Return a name for this buffer type.
-;;
-;; The remaining function(s) are optional:
-;;
-;; MODE - called in a new buffer with no arguments, should establish
-;; the proper mode for the buffer.
-;;
-
-(defun gdb-set-buffer-rules (buffer-type &rest rules)
- (let ((binding (assoc buffer-type gdb-buffer-rules-assoc)))
- (if binding
- (setcdr binding rules)
- (push (cons buffer-type rules)
- gdb-buffer-rules-assoc))))
-
-;; GUD buffers are an exception to the rules
-(gdb-set-buffer-rules 'gdba 'error)
-
-;; Partial-output buffer : This accumulates output from a command executed on
-;; behalf of emacs (rather than the user).
-;;
-(gdb-set-buffer-rules 'gdb-partial-output-buffer
- 'gdb-partial-output-name)
-
-(defun gdb-partial-output-name ()
- (concat " *partial-output-"
- (gdb-get-target-string)
- "*"))
-
-\f
-(gdb-set-buffer-rules 'gdb-inferior-io
- 'gdb-inferior-io-name
- 'gdb-inferior-io-mode)
-
-(defun gdb-inferior-io-name ()
- (concat "*input/output of "
- (gdb-get-target-string)
- "*"))
-
-(defun gdb-display-separate-io-buffer ()
- "Display IO of debugged program in a separate window."
- (interactive)
- (if gdb-use-separate-io-buffer
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-inferior-io) t)))
-
-(defconst gdb-frame-parameters
- '((height . 14) (width . 80)
- (unsplittable . t)
- (tool-bar-lines . nil)
- (menu-bar-lines . nil)
- (minibuffer . nil)))
-
-(defun gdb-frame-separate-io-buffer ()
- "Display IO of debugged program in a new frame."
- (interactive)
- (if gdb-use-separate-io-buffer
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))))
-
-(defvar gdb-inferior-io-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
- (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
- (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
- (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
- (define-key map "\C-d" 'gdb-separate-io-eof)
- map))
-
-(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
- "Major mode for gdb inferior-io."
- :syntax-table nil :abbrev-table nil
- ;; We want to use comint because it has various nifty and familiar
- ;; features. We don't need a process, but comint wants one, so create
- ;; a dummy one.
- (make-comint-in-buffer
- (substring (buffer-name) 1 (- (length (buffer-name)) 1))
- (current-buffer) "hexl")
- (setq comint-input-sender 'gdb-inferior-io-sender))
-
-(defun gdb-inferior-io-sender (proc string)
- ;; PROC is the pseudo-process created to satisfy comint.
- (with-current-buffer (process-buffer proc)
- (setq proc (get-buffer-process gud-comint-buffer))
- (process-send-string proc string)
- (process-send-string proc "\n")))
-
-(defun gdb-separate-io-interrupt ()
- "Interrupt the program being debugged."
- (interactive)
- (interrupt-process
- (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-quit ()
- "Send quit signal to the program being debugged."
- (interactive)
- (quit-process
- (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-stop ()
- "Stop the program being debugged."
- (interactive)
- (stop-process
- (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-eof ()
- "Send end-of-file to the program being debugged."
- (interactive)
- (process-send-eof
- (get-buffer-process gud-comint-buffer)))
-\f
-
-;; gdb communications
-;;
-
-;; INPUT: things sent to gdb
-;;
-;; The queues are lists. Each element is either a string (indicating user or
-;; user-like input) or a list of the form:
-;;
-;; (INPUT-STRING HANDLER-FN)
-;;
-;; The handler function will be called from the partial-output buffer when the
-;; command completes. This is the way to write commands which invoke gdb
-;; commands autonomously.
-;;
-;; These lists are consumed tail first.
-;;
-
-(defun gdb-send (proc string)
- "A comint send filter for gdb.
-This filter may simply queue input for a later time."
- (if gdb-ready
- (progn
- (with-current-buffer gud-comint-buffer
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(face))))
- (if gud-running
- (progn
- (let ((item (concat string "\n")))
- (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
- (process-send-string proc item)))
- (if (string-match "\\\\\\'" string)
- (setq gdb-continuation (concat gdb-continuation string "\n"))
- (let ((item (concat
- gdb-continuation string
- (if (not comint-input-sender-no-newline) "\n"))))
- (gdb-enqueue-input item)
- (setq gdb-continuation nil)))))
- (push (concat string "\n") gdb-early-user-input)))
-
-;; Note: Stuff enqueued here will be sent to the next prompt, even if it
-;; is a query, or other non-top-level prompt.
-
-(defun gdb-enqueue-input (item)
- (if (not gud-running)
- (if gdb-prompting
- (progn
- (gdb-send-item item)
- (setq gdb-prompting nil))
- (push item gdb-input-queue))))
-
-(defun gdb-dequeue-input ()
- (let ((queue gdb-input-queue))
- (if queue
- (let ((last (car (last queue))))
- (unless (nbutlast queue) (setq gdb-input-queue '()))
- last)
- ;; This should be nil here anyway but set it just to make sure.
- (setq gdb-pending-triggers nil))))
-
-(defun gdb-send-item (item)
- (setq gdb-flush-pending-output nil)
- (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
- (setq gdb-current-item item)
- (let ((process (get-buffer-process gud-comint-buffer)))
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (if (stringp item)
- (progn
- (setq gdb-output-sink 'user)
- (process-send-string process item))
- (progn
- (gdb-clear-partial-output)
- (setq gdb-output-sink 'pre-emacs)
- (process-send-string process
- (car item))))
- ;; case: eq gud-minor-mode 'gdbmi
- (gdb-clear-partial-output)
- (setq gdb-output-sink 'emacs)
- (process-send-string process (car item)))))
-\f
-;;
-;; output -- things gdb prints to emacs
-;;
-;; GDB output is a stream interrupted by annotations.
-;; Annotations can be recognized by their beginning
-;; with \C-j\C-z\C-z<tag><opt>\C-j
-;;
-;; The tag is a string obeying symbol syntax.
-;;
-;; The optional part `<opt>' can be either the empty string
-;; or a space followed by more data relating to the annotation.
-;; For example, the SOURCE annotation is followed by a filename,
-;; line number and various useless goo. This data must not include
-;; any newlines.
-;;
-
-(defcustom gud-gdb-command-name "gdb --annotate=3"
- "Default command to execute an executable under the GDB debugger.
-The option \"--annotate=3\" must be included in this value if you
-want the GDB Graphical Interface."
- :type 'string
- :group 'gud
- :version "22.1")
-
-(defvar gdb-annotation-rules
- '(("pre-prompt" gdb-pre-prompt)
- ("prompt" gdb-prompt)
- ("commands" gdb-subprompt)
- ("overload-choice" gdb-subprompt)
- ("query" gdb-subprompt)
- ;; Need this prompt for GDB 6.1
- ("nquery" gdb-subprompt)
- ("prompt-for-continue" gdb-subprompt)
- ("post-prompt" gdb-post-prompt)
- ("source" gdb-source)
- ("starting" gdb-starting)
- ("exited" gdb-exited)
- ("signalled" gdb-signalled)
- ("signal" gdb-signal)
- ("breakpoint" gdb-stopping)
- ("watchpoint" gdb-stopping)
- ("frame-begin" gdb-frame-begin)
- ("stopped" gdb-stopped)
- ("error-begin" gdb-error)
- ("error" gdb-error)
- ("new-thread" (lambda (ignored)
- (gdb-get-buffer-create 'gdb-threads-buffer)))
- ("thread-changed" gdb-thread-changed))
- "An assoc mapping annotation tags to functions which process them.")
-
-(defun gdb-resync()
- (setq gdb-flush-pending-output t)
- (setq gud-running nil)
- (gdb-force-mode-line-update
- (propertize "stopped" 'face font-lock-warning-face))
- (setq gdb-output-sink 'user)
- (setq gdb-input-queue nil)
- (setq gdb-pending-triggers nil)
- (setq gdb-prompting t))
-
-(defconst gdb-source-spec-regexp
- "\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:0x0*\\([a-f0-9]*\\)")
-
-;; Do not use this except as an annotation handler.
-(defun gdb-source (args)
- (string-match gdb-source-spec-regexp args)
- ;; Extract the frame position from the marker.
- (setq gud-last-frame
- (cons
- (match-string 1 args)
- (string-to-number (match-string 2 args))))
- (setq gdb-pc-address (match-string 3 args))
- ;; cover for auto-display output which comes *before*
- ;; stopped annotation
- (if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user)))
-
-(defun gdb-pre-prompt (ignored)
- "An annotation handler for `pre-prompt'.
-This terminates the collection of output from a previous command if that
-happens to be in effect."
- (setq gdb-error nil)
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user) t)
- ((eq sink 'emacs)
- (setq gdb-output-sink 'post-emacs))
- (t
- (gdb-resync)
- (error "Phase error in gdb-pre-prompt (got %s)" sink)))))
-
-(defun gdb-prompt (ignored)
- "An annotation handler for `prompt'.
-This sends the next command (if any) to gdb."
- (when gdb-first-prompt
- (gdb-force-mode-line-update
- (propertize "initializing..." 'face font-lock-variable-name-face))
- (gdb-init-1)
- (setq gdb-first-prompt nil))
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user) t)
- ((eq sink 'post-emacs)
- (setq gdb-output-sink 'user)
- (let ((handler
- (car (cdr gdb-current-item))))
- (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
- (funcall handler))))
- (t
- (gdb-resync)
- (error "Phase error in gdb-prompt (got %s)" sink))))
- (let ((input (gdb-dequeue-input)))
- (if input
- (gdb-send-item input)
- (progn
- (setq gdb-prompting t)
- (gud-display-frame)
- (setq gdb-early-user-input (nreverse gdb-early-user-input))
- (while gdb-early-user-input
- (gdb-enqueue-input (car gdb-early-user-input))
- (setq gdb-early-user-input (cdr gdb-early-user-input)))))))
-
-(defun gdb-subprompt (ignored)
- "An annotation handler for non-top-level prompts."
- (setq gdb-prompting t))
-
-(defun gdb-starting (ignored)
- "An annotation handler for `starting'.
-This says that I/O for the subprocess is now the program being debugged,
-not GDB."
- (setq gdb-active-process t)
- (setq gdb-printing t)
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user)
- (progn
- (setq gud-running t)
- (setq gdb-stack-update t)
- ;; Temporarily set gud-running to nil to force "info stack" onto queue.
- (let ((gud-running nil))
- (gdb-invalidate-frames)
- (unless (or gdb-register-names
- (string-equal gdb-version "pre-6.4"))
- (gdb-enqueue-input
- (list "server interpreter mi -data-list-register-names\n"
- 'gdb-get-register-names))))
- (setq gdb-inferior-status "running")
- (setq gdb-signalled nil)
- (gdb-force-mode-line-update
- (propertize gdb-inferior-status 'face font-lock-type-face))
- (gdb-remove-text-properties)
- (setq gud-old-arrow gud-overlay-arrow-position)
- (setq gud-overlay-arrow-position nil)
- (setq gdb-overlay-arrow-position nil)
- (setq gdb-stack-position nil)
- (if gdb-use-separate-io-buffer
- (setq gdb-output-sink 'inferior))))
- (t
- (gdb-resync)
- (error "Unexpected `starting' annotation")))))
-
-(defun gdb-signal (ignored)
- (setq gdb-inferior-status "signal")
- (gdb-force-mode-line-update
- (propertize gdb-inferior-status 'face font-lock-warning-face))
- (gdb-stopping ignored))
-
-(defun gdb-stopping (ignored)
- "An annotation handler for `breakpoint' and other annotations.
-They say that I/O for the subprocess is now GDB, not the program
-being debugged."
- (if gdb-use-separate-io-buffer
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'inferior)
- (setq gdb-output-sink 'user))
- (t
- (gdb-resync)
- (error "Unexpected stopping annotation"))))))
-
-(defun gdb-exited (ignored)
- "An annotation handler for `exited' and `signalled'.
-They say that I/O for the subprocess is now GDB, not the program
-being debugged and that the program is no longer running. This
-function is used to change the focus of GUD tooltips to #define
-directives."
- (setq gdb-active-process nil)
- (setq gud-overlay-arrow-position nil)
- (setq gdb-overlay-arrow-position nil)
- (setq gdb-stack-position nil)
- (setq gud-old-arrow nil)
- (setq gdb-inferior-status "exited")
- (gdb-force-mode-line-update
- (propertize gdb-inferior-status 'face font-lock-warning-face))
- (gdb-stopping ignored))
-
-(defun gdb-signalled (ignored)
- (setq gdb-signalled t))
-
-(defun gdb-frame-begin (ignored)
- (setq gdb-frame-begin t)
- (setq gdb-printing nil)
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'inferior)
- (setq gdb-output-sink 'user))
- ((eq sink 'user) t)
- ((eq sink 'emacs) t)
- (t
- (gdb-resync)
- (error "Unexpected frame-begin annotation (%S)" sink)))))
-
-(defcustom gdb-same-frame (not focus-follows-mouse)
- "Non-nil means pop up GUD buffer in same frame."
- :group 'gdb
- :type 'boolean
- :version "22.1")
-
-(defcustom gdb-find-source-frame nil
- "Non-nil means try to find a source frame further up stack e.g after signal."
- :group 'gdb
- :type 'boolean
- :version "22.1")
-
-(defun gdb-find-source-frame (arg)
- "Toggle looking for a source frame further up call stack.
-The code associated with current (innermost) frame may not have
-been compiled with debug information, e.g., C library routine.
-With prefix argument ARG, look for a source frame further up
-stack to display in the source buffer if ARG is positive,
-otherwise don't look further up."
- (interactive "P")
- (setq gdb-find-source-frame
- (if (null arg)
- (not gdb-find-source-frame)
- (> (prefix-numeric-value arg) 0)))
- (message (format "Looking for source frame %sabled"
- (if gdb-find-source-frame "en" "dis"))))
-
-(defun gdb-stopped (ignored)
- "An annotation handler for `stopped'.
-It is just like `gdb-stopping', except that if we already set the output
-sink to `user' in `gdb-stopping', that is fine."
- (setq gud-running nil)
- (unless (or gud-overlay-arrow-position gud-last-frame)
- (if (and gdb-frame-begin gdb-printing)
- (setq gud-overlay-arrow-position gud-old-arrow)
- ;;Pop up GUD buffer to display current frame when it doesn't have source
- ;;information i.e if not compiled with -g as with libc routines generally.
- (if gdb-same-frame
- (gdb-display-gdb-buffer)
- (gdb-frame-gdb-buffer))
- (if gdb-find-source-frame
- ;;Try to find source further up stack e.g after signal.
- (setq gdb-look-up-stack
- (if (gdb-get-buffer 'gdb-stack-buffer)
- 'keep
- (progn
- (gdb-get-buffer-create 'gdb-stack-buffer)
- (gdb-invalidate-frames)
- 'delete))))))
- (unless (member gdb-inferior-status '("exited" "signal"))
- (setq gdb-active-process t) ;Just for attaching case.
- (setq gdb-inferior-status "stopped")
- (gdb-force-mode-line-update
- (propertize gdb-inferior-status 'face font-lock-warning-face)))
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'inferior)
- (setq gdb-output-sink 'user))
- ((eq sink 'user) t)
- (t
- (gdb-resync)
- (error "Unexpected stopped annotation"))))
- (if gdb-signalled (gdb-exited ignored)))
-
-(defun gdb-error (ignored)
- (setq gdb-error (not gdb-error)))
-
-(defun gdb-thread-changed (ignored)
- (gdb-frames-force-update))
-
-(defun gdb-post-prompt (ignored)
- "An annotation handler for `post-prompt'.
-This begins the collection of output from the current command if that
-happens to be appropriate."
- ;; Don't add to queue if there outstanding items or gdb-version is not known
- ;; yet.
- (unless (or gdb-pending-triggers gdb-first-post-prompt)
- (gdb-get-selected-frame)
- (gdb-invalidate-frames)
- ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted.
- (gdb-get-buffer-create 'gdb-breakpoints-buffer)
- (gdb-invalidate-breakpoints)
- ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
- ;; so gdb-pc-address is updated.
- ;; (gdb-invalidate-assembler)
-
- (if (string-equal gdb-version "pre-6.4")
- (gdb-invalidate-registers)
- (gdb-get-changed-registers)
- (gdb-invalidate-registers-1))
-
- (gdb-invalidate-memory)
- (if (string-equal gdb-version "pre-6.4")
- (gdb-invalidate-locals)
- (gdb-invalidate-locals-1))
-
- (gdb-invalidate-threads)
- (unless (or (null gdb-var-list)
- (eq system-type 'darwin)) ;Breaks on Darwin's GDB-5.3.
- ;; FIXME: with GDB-6 on Darwin, this might very well work.
- ;; Only needed/used with speedbar/watch expressions.
- (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- (if (string-equal gdb-version "pre-6.4")
- (gdb-var-update)
- (gdb-var-update-1)))))
- (setq gdb-first-post-prompt nil)
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user) t)
- ((eq sink 'pre-emacs)
- (setq gdb-output-sink 'emacs))
- (t
- (gdb-resync)
- (error "Phase error in gdb-post-prompt (got %s)" sink)))))
-
-(defconst gdb-buffer-list
-'(gdb-stack-buffer gdb-locals-buffer gdb-registers-buffer gdb-threads-buffer))
-
-(defun gdb-remove-text-properties ()
- (dolist (buffertype gdb-buffer-list)
- (let ((buffer (gdb-get-buffer buffertype)))
- (if buffer
- (with-current-buffer buffer
- (let ((inhibit-read-only t))
- (remove-text-properties
- (point-min) (point-max) '(mouse-face nil help-echo nil))))))))
-
-;; GUD displays the selected GDB frame. This might might not be the current
-;; GDB frame (after up, down etc). If no GDB frame is visible but the last
-;; visited breakpoint is, use that window.
-(defun gdb-display-source-buffer (buffer)
- (let* ((last-window (if gud-last-last-frame
- (get-buffer-window
- (gud-find-file (car gud-last-last-frame)))))
- (source-window (or last-window
- (if (and gdb-source-window
- (window-live-p gdb-source-window))
- gdb-source-window))))
- (when source-window
- (setq gdb-source-window source-window)
- (set-window-buffer source-window buffer))
- source-window))
-
-;; Derived from gud-gdb-marker-regexp
-(defvar gdb-fullname-regexp
- (concat "\\(.:?[^" ":" "\n]*\\)" ":" "\\([0-9]*\\)" ":" ".*"))
-
-(defun gud-gdba-marker-filter (string)
- "A gud marker filter for gdb. Handle a burst of output from GDB."
- (if gdb-flush-pending-output
- nil
- (when gdb-enable-debug
- (push (cons 'recv string) gdb-debug-log)
- (if (and gdb-debug-log-max
- (> (length gdb-debug-log) gdb-debug-log-max))
- (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil)))
- ;; Recall the left over gud-marker-acc from last time.
- (setq gud-marker-acc (concat gud-marker-acc string))
- ;; Start accumulating output for the GUD buffer.
- (let ((output ""))
- ;;
- ;; Process all the complete markers in this chunk.
- (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
- (let ((annotation (match-string 1 gud-marker-acc))
- (before (substring gud-marker-acc 0 (match-beginning 0)))
- (after (substring gud-marker-acc (match-end 0))))
- ;;
- ;; Parse the tag from the annotation, and maybe its arguments.
- (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation)
- (let* ((annotation-type (match-string 1 annotation))
- (annotation-arguments (match-string 2 annotation))
- (annotation-rule (assoc annotation-type
- gdb-annotation-rules)))
-
- ;; Stuff prior to the match is just ordinary output.
- ;; It is either concatenated to OUTPUT or directed
- ;; elsewhere.
- (setq output (gdb-concat-output output before))
-
- ;; Take that stuff off the gud-marker-acc.
- (setq gud-marker-acc after)
-
- ;; Call the handler for this annotation.
- (if annotation-rule
- (funcall (car (cdr annotation-rule))
- annotation-arguments))
-
- ;; Else the annotation is not recognized. Ignore it silently,
- ;; so that GDB can add new annotations without causing
- ;; us to blow up.
- )))
-
- ;; Does the remaining text end in a partial line?
- ;; If it does, then keep part of the gud-marker-acc until we get more.
- (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'"
- gud-marker-acc)
- (progn
- ;; Everything before the potential marker start can be output.
- (setq output
- (gdb-concat-output output
- (substring gud-marker-acc 0
- (match-beginning 0))))
- ;;
- ;; Everything after, we save, to combine with later input.
- (setq gud-marker-acc (substring gud-marker-acc
- (match-beginning 0))))
- ;;
- ;; In case we know the gud-marker-acc contains no partial annotations:
- (progn
- (setq output (gdb-concat-output output gud-marker-acc))
- (setq gud-marker-acc "")))
- output)))
-
-(defun gdb-concat-output (so-far new)
- (if gdb-error
- (put-text-property 0 (length new) 'face font-lock-warning-face new))
- (let ((sink gdb-output-sink))
- (cond
- ((eq sink 'user) (concat so-far new))
- ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far)
- ((eq sink 'emacs)
- (gdb-append-to-partial-output new)
- so-far)
- ((eq sink 'inferior)
- (gdb-append-to-inferior-io new)
- so-far)
- (t
- (gdb-resync)
- (error "Bogon output sink %S" sink)))))
-
-(defun gdb-append-to-partial-output (string)
- (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
- (goto-char (point-max))
- (insert string)))
-
-(defun gdb-clear-partial-output ()
- (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
- (erase-buffer)))
-
-(defun gdb-append-to-inferior-io (string)
- (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
- (goto-char (point-max))
- (insert-before-markers string))
- (if (not (string-equal string ""))
- (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)))
-
-(defun gdb-clear-inferior-io ()
- (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
- (erase-buffer)))
-
-(defun gdb-jsonify-buffer (&optional fix-key fix-list)
- "Prepare GDB/MI output in current buffer for parsing with `json-read'.
-
-Field names are wrapped in double quotes and equal signs are
-replaced with semicolons.
-
-If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurrences from
-partial output. This is used to get rid of useless keys in lists
-in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and
--break-info are examples of MI commands which issue such
-responses.
-
-If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
-\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
--break-info output when it contains breakpoint script field
-incompatible with GDB/MI output syntax."
- (save-excursion
- (goto-char (point-min))
- ;; Sometimes missing symbol information precedes "^done" record.
- (re-search-forward "[[:ascii:]]*?\\^done," nil t)
- (replace-match "")
- (re-search-forward "(gdb) \n" nil t)
- (replace-match "")
- (goto-char (point-min))
- (when fix-key
- (save-excursion
- (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
- (replace-match "" nil nil nil 1))))
- (when fix-list
- (save-excursion
- ;; Find positions of braces which enclose broken list
- (while (re-search-forward (concat fix-list "={\"") nil t)
- (let ((p1 (goto-char (- (point) 2)))
- (p2 (progn (forward-sexp)
- (1- (point)))))
- ;; Replace braces with brackets
- (save-excursion
- (goto-char p1)
- (delete-char 1)
- (insert "[")
- (goto-char p2)
- (delete-char 1)
- (insert "]"))))))
- (goto-char (point-min))
- (insert "{")
- (while (re-search-forward
- "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
- (replace-match "\"\\1\":\\2" nil nil))
- (goto-char (point-max))
- (insert "}")))
-
-(defun gdb-json-read-buffer (&optional fix-key fix-list)
- "Prepare and parse GDB/MI output in current buffer with `json-read'.
-
-FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
- (gdb-jsonify-buffer fix-key fix-list)
- (save-excursion
- (goto-char (point-min))
- (let ((json-array-type 'list))
- (json-read))))
-
-(defun gdb-json-partial-output (&optional fix-key fix-list)
- "Prepare and parse gdb-partial-output-buffer with `json-read'.
-
-FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'."
- (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
- (gdb-json-read-buffer fix-key fix-list)))
-\f
-
-;; One trick is to have a command who's output is always available in a buffer
-;; of it's own, and is always up to date. We build several buffers of this
-;; type.
-;;
-;; There are two aspects to this: gdb has to tell us when the output for that
-;; command might have changed, and we have to be able to run the command
-;; behind the user's back.
-;;
-;; The output phasing associated with the variable gdb-output-sink
-;; help us to run commands behind the user's back.
-;;
-;; Below is the code for specificly managing buffers of output from one
-;; command.
-;;
-
-;; The trigger function is suitable for use in the assoc GDB-ANNOTATION-RULES
-;; It adds an input for the command we are tracking. It should be the
-;; annotation rule binding of whatever gdb sends to tell us this command
-;; might have changed it's output.
-;;
-;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed.
-;; GDB-COMMAND is a string of such. OUTPUT-HANDLER is the function bound to the
-;; input in the input queue (see comment about ``gdb communications'' above).
-
-(defmacro def-gdb-auto-update-trigger (name demand-predicate gdb-command
- output-handler)
- `(defun ,name (&optional ignored)
- (if (and ,demand-predicate
- (not (member ',name
- gdb-pending-triggers)))
- (progn
- (gdb-enqueue-input
- (list ,gdb-command ',output-handler))
- (push ',name gdb-pending-triggers)))))
-
-(defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun)
- `(defun ,name ()
- (setq gdb-pending-triggers
- (delq ',trigger
- gdb-pending-triggers))
- (let ((buf (gdb-get-buffer ',buf-key)))
- (and buf
- (with-current-buffer buf
- (let* ((window (get-buffer-window buf 0))
- (start (window-start window))
- (p (if window (window-point window) (point)))
- (buffer-read-only nil))
- (erase-buffer)
- (insert-buffer-substring (gdb-get-buffer-create
- 'gdb-partial-output-buffer))
- (if window
- (progn
- (set-window-start window start)
- (set-window-point window p))
- (goto-char p))))))
- ;; put customisation here
- (,custom-defun)))
-
-(defmacro def-gdb-auto-updated-buffer (buffer-key
- trigger-name gdb-command
- output-handler-name custom-defun)
- `(progn
- (def-gdb-auto-update-trigger ,trigger-name
- ;; The demand predicate:
- (gdb-get-buffer ',buffer-key)
- ,gdb-command
- ,output-handler-name)
- (def-gdb-auto-update-handler ,output-handler-name
- ,trigger-name ,buffer-key ,custom-defun)))
-
-\f
-;;
-;; Breakpoint buffer : This displays the output of `info breakpoints'.
-;;
-(gdb-set-buffer-rules 'gdb-breakpoints-buffer
- 'gdb-breakpoints-buffer-name
- 'gdb-breakpoints-mode)
-
-(def-gdb-auto-updated-buffer gdb-breakpoints-buffer
- ;; This defines the auto update rule for buffers of type
- ;; `gdb-breakpoints-buffer'.
- ;;
- ;; It defines a function to serve as the annotation handler that
- ;; handles the `foo-invalidated' message. That function is called:
- gdb-invalidate-breakpoints
- ;;
- ;; To update the buffer, this command is sent to gdb.
- "server info breakpoints\n"
- ;;
- ;; This also defines a function to be the handler for the output
- ;; from the command above. That function will copy the output into
- ;; the appropriately typed buffer. That function will be called:
- gdb-info-breakpoints-handler
- ;; buffer specific functions
- gdb-info-breakpoints-custom)
-
-(defconst breakpoint-xpm-data
- "/* XPM */
-static char *magick[] = {
-/* columns rows colors chars-per-pixel */
-\"10 10 2 1\",
-\" c red\",
-\"+ c None\",
-/* pixels */
-\"+++ +++\",
-\"++ ++\",
-\"+ +\",
-\" \",
-\" \",
-\" \",
-\" \",
-\"+ +\",
-\"++ ++\",
-\"+++ +++\",
-};"
- "XPM data used for breakpoint icon.")
-
-(defconst breakpoint-enabled-pbm-data
- "P1
-10 10\",
-0 0 0 0 1 1 1 1 0 0 0 0
-0 0 0 1 1 1 1 1 1 0 0 0
-0 0 1 1 1 1 1 1 1 1 0 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 0 1 1 1 1 1 1 1 1 0 0
-0 0 0 1 1 1 1 1 1 0 0 0
-0 0 0 0 1 1 1 1 0 0 0 0"
- "PBM data used for enabled breakpoint icon.")
-
-(defconst breakpoint-disabled-pbm-data
- "P1
-10 10\",
-0 0 1 0 1 0 1 0 0 0
-0 1 0 1 0 1 0 1 0 0
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-0 0 1 0 1 0 1 0 1 0
-0 0 0 1 0 1 0 1 0 0"
- "PBM data used for disabled breakpoint icon.")
-
-(defvar breakpoint-enabled-icon nil
- "Icon for enabled breakpoint in display margin.")
-
-(defvar breakpoint-disabled-icon nil
- "Icon for disabled breakpoint in display margin.")
-
-(declare-function define-fringe-bitmap "fringe.c"
- (bitmap bits &optional height width align))
-
-(and (display-images-p)
- ;; Bitmap for breakpoint in fringe
- (define-fringe-bitmap 'breakpoint
- "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
- ;; Bitmap for gud-overlay-arrow in fringe
- (define-fringe-bitmap 'hollow-right-triangle
- "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
-
-(defface breakpoint-enabled
- '((t
- :foreground "red1"
- :weight bold))
- "Face for enabled breakpoint icon in fringe."
- :group 'gdb)
-
-(defface breakpoint-disabled
- '((((class color) (min-colors 88)) :foreground "grey70")
- ;; Ensure that on low-color displays that we end up something visible.
- (((class color) (min-colors 8) (background light))
- :foreground "black")
- (((class color) (min-colors 8) (background dark))
- :foreground "white")
- (((type tty) (class mono))
- :inverse-video t)
- (t :background "gray"))
- "Face for disabled breakpoint icon in fringe."
- :group 'gdb)
-
-(defconst gdb-breakpoint-regexp
- "\\(?:\\([0-9]+\\).*?\\(?:point\\|catch\\s-+\\S-+\\)\\s-+\\S-+\\|\\([0-9]+\\.[0-9]+\\)\\)\\s-+\\(.\\)\\s-+")
-
-;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
-(defun gdb-info-breakpoints-custom ()
- (let ((flag) (bptno))
- ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (if (and (memq gud-minor-mode '(gdba gdbmi))
- (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
- (gdb-remove-breakpoint-icons (point-min) (point-max)))))
- (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
- (save-excursion
- (let ((buffer-read-only nil))
- (goto-char (point-min))
- (while (< (point) (- (point-max) 1))
- (forward-line 1)
- (if (looking-at gdb-breakpoint-regexp)
- (progn
- (setq bptno (or (match-string 1) (match-string 2)))
- (setq flag (char-after (match-beginning 3)))
- (if (match-string 1)
- (setq gdb-parent-bptno-enabled (eq flag ?y)))
- (add-text-properties
- (match-beginning 3) (match-end 3)
- (if (eq flag ?y)
- '(face font-lock-warning-face)
- '(face font-lock-type-face)))
- (let ((bl (point))
- (el (line-end-position)))
- (when (re-search-forward " in \\(.*\\) at" el t)
- (add-text-properties
- (match-beginning 1) (match-end 1)
- '(face font-lock-function-name-face)))
- (if (re-search-forward
- ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$" el t)
- (let ((line (match-string 2))
- (file (match-string 1)))
- (add-text-properties bl el
- '(mouse-face highlight
- help-echo "mouse-2, RET: visit breakpoint"))
- (unless (file-exists-p file)
- (setq file (cdr (assoc bptno gdb-location-alist))))
- (if (and file
- (not (string-equal file "File not found")))
- (with-current-buffer
- (find-file-noselect file 'nowarn)
- (gdb-init-buffer)
- ;; Only want one breakpoint icon at each
- ;; location.
- (save-excursion
- (goto-char (point-min))
- (forward-line (1- (string-to-number line)))
- (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix "list "
- (match-string-no-properties 1) ":1\n")
- 'ignore))
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "info source\n")
- `(lambda () (gdb-get-location
- ,bptno ,line ,flag))))))
- (if (re-search-forward
- "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
- el t)
- (add-text-properties
- (match-beginning 1) (match-end 1)
- '(face font-lock-function-name-face))
- (end-of-line)
- (re-search-backward "\\s-\\(\\S-*\\)"
- bl t)
- (add-text-properties
- (match-beginning 1) (match-end 1)
- '(face font-lock-variable-name-face)))))))
- (end-of-line))))))
- (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))
-
- ;; Breakpoints buffer is always present. Hack to just update
- ;; current frame if there's been no execution.
- (if gdb-stack-update
- (setq gdb-stack-update nil)
- (if (gdb-get-buffer 'gdb-stack-buffer) (gdb-info-stack-custom))))
-
-(declare-function gud-remove "gdb-ui" t t) ; gud-def
-(declare-function gud-break "gdb-ui" t t) ; gud-def
-(declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window))
-
-(defun gdb-mouse-set-clear-breakpoint (event)
- "Set/clear breakpoint in left fringe/margin at mouse click.
-If not in a source or disassembly buffer just set point."
- (interactive "e")
- (mouse-minibuffer-check event)
- (let ((posn (event-end event)))
- (with-selected-window (posn-window posn)
- (if (or (buffer-file-name) (eq major-mode 'gdb-assembler-mode))
- (if (numberp (posn-point posn))
- (save-excursion
- (goto-char (posn-point posn))
- (if (or (posn-object posn)
- (eq (car (fringe-bitmaps-at-pos (posn-point posn)))
- 'breakpoint))
- (gud-remove nil)
- (gud-break nil)))))
- (posn-set-point posn))))
-
-(defun gdb-mouse-toggle-breakpoint-margin (event)
- "Enable/disable breakpoint in left margin with mouse click."
- (interactive "e")
- (mouse-minibuffer-check event)
- (let ((posn (event-end event)))
- (if (numberp (posn-point posn))
- (with-selected-window (posn-window posn)
- (save-excursion
- (goto-char (posn-point posn))
- (if (posn-object posn)
- (let* ((bptno (get-text-property
- 0 'gdb-bptno (car (posn-string posn)))))
- (string-match "\\([0-9+]\\)*" bptno)
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix
- (if (get-text-property
- 0 'gdb-enabled (car (posn-string posn)))
- "disable "
- "enable ")
- (match-string 1 bptno) "\n")
- 'ignore)))))))))
-
-(defun gdb-mouse-toggle-breakpoint-fringe (event)
- "Enable/disable breakpoint in left fringe with mouse click."
- (interactive "e")
- (mouse-minibuffer-check event)
- (let* ((posn (event-end event))
- (pos (posn-point posn))
- obj)
- (when (numberp pos)
- (with-selected-window (posn-window posn)
- (with-current-buffer (window-buffer (selected-window))
- (goto-char pos)
- (dolist (overlay (overlays-in pos pos))
- (when (overlay-get overlay 'put-break)
- (setq obj (overlay-get overlay 'before-string))))
- (when (stringp obj)
- (let* ((bptno (get-text-property 0 'gdb-bptno obj)))
- (string-match "\\([0-9+]\\)*" bptno)
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix
- (if (get-text-property 0 'gdb-enabled obj)
- "disable "
- "enable ")
- (match-string 1 bptno) "\n")
- 'ignore)))))))))
-
-(defun gdb-breakpoints-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*breakpoints of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-breakpoints-buffer ()
- "Display status of user-settable breakpoints."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))
-
-(defun gdb-frame-breakpoints-buffer ()
- "Display status of user-settable breakpoints in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer))))
-
-(defvar gdb-breakpoints-mode-map
- (let ((map (make-sparse-keymap))
- (menu (make-sparse-keymap "Breakpoints")))
- (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window))
- (define-key menu [goto] '("Goto" . gdb-goto-breakpoint))
- (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
- (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
- (suppress-keymap map)
- (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
- (define-key map " " 'gdb-toggle-breakpoint)
- (define-key map "D" 'gdb-delete-breakpoint)
- ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
- (define-key map "q" 'gdb-delete-frame-or-window)
- (define-key map "\r" 'gdb-goto-breakpoint)
- (define-key map [mouse-2] 'gdb-goto-breakpoint)
- (define-key map [follow-link] 'mouse-face)
- map))
-
-(defun gdb-delete-frame-or-window ()
- "Delete frame if there is only one window. Otherwise delete the window."
- (interactive)
- (if (one-window-p) (delete-frame)
- (delete-window)))
-
-;;from make-mode-line-mouse-map
-(defun gdb-make-header-line-mouse-map (mouse function) "\
-Return a keymap with single entry for mouse key MOUSE on the header line.
-MOUSE is defined to run function FUNCTION with no args in the buffer
-corresponding to the mode line clicked."
- (let ((map (make-sparse-keymap)))
- (define-key map (vector 'header-line mouse) function)
- (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
- map))
-
-(defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
- `(propertize ,name
- 'help-echo ,help-echo
- 'mouse-face ',mouse-face
- 'face ',face
- 'local-map
- (gdb-make-header-line-mouse-map
- 'mouse-1
- (lambda (event) (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (set-window-dedicated-p (selected-window) nil)
- (switch-to-buffer
- (gdb-get-buffer-create ',buffer))
- (setq header-line-format(gdb-set-header ',buffer))
- (set-window-dedicated-p (selected-window) t))))))
-
-(defun gdb-set-header (buffer)
- (cond ((eq buffer 'gdb-locals-buffer)
- (list
- (gdb-propertize-header "Locals" gdb-locals-buffer
- nil nil mode-line)
- " "
- (gdb-propertize-header "Registers" gdb-registers-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)))
- ((eq buffer 'gdb-registers-buffer)
- (list
- (gdb-propertize-header "Locals" gdb-locals-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)
- " "
- (gdb-propertize-header "Registers" gdb-registers-buffer
- nil nil mode-line)))
- ((eq buffer 'gdb-breakpoints-buffer)
- (list
- (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
- nil nil mode-line)
- " "
- (gdb-propertize-header "Threads" gdb-threads-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)))
- ((eq buffer 'gdb-threads-buffer)
- (list
- (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)
- " "
- (gdb-propertize-header "Threads" gdb-threads-buffer
- nil nil mode-line)))))
-
-(defvar gdb-breakpoints-header
- (list
- (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
- nil nil mode-line)
- " "
- (gdb-propertize-header "Threads" gdb-threads-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)))
-
-(defun gdb-breakpoints-mode ()
- "Major mode for gdb breakpoints.
-
-\\{gdb-breakpoints-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-breakpoints-mode)
- (setq mode-name "Breakpoints")
- (use-local-map gdb-breakpoints-mode-map)
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (setq header-line-format gdb-breakpoints-header)
- (run-mode-hooks 'gdb-breakpoints-mode-hook)
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- 'gdb-invalidate-breakpoints
- 'gdbmi-invalidate-breakpoints))
-
-(defun gdb-toggle-breakpoint ()
- "Enable/disable breakpoint at current line."
- (interactive)
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at gdb-breakpoint-regexp)
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix
- (if (eq ?y (char-after (match-beginning 3)))
- "disable "
- "enable ")
- (or (match-string 1) (match-string 2)) "\n") 'ignore))
- (error "Not recognized as break/watchpoint line"))))
-
-(defun gdb-delete-breakpoint ()
- "Delete the breakpoint at current line."
- (interactive)
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at gdb-breakpoint-regexp)
- (if (match-string 1)
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix "delete " (match-string 1) "\n")
- 'ignore))
- (message-box "This breakpoint cannot be deleted on its own."))
- (error "Not recognized as break/watchpoint line"))))
-
-(defun gdb-goto-breakpoint (&optional event)
- "Display the breakpoint location specified at current line."
- (interactive (list last-input-event))
- (if event (posn-set-point (event-end event)))
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
- (let ((bptno (match-string 1))
- (file (match-string 2))
- (line (match-string 3)))
- (save-selected-window
- (let* ((buffer (find-file-noselect
- (if (file-exists-p file) file
- (cdr (assoc bptno gdb-location-alist)))))
- (window (or (gdb-display-source-buffer buffer)
- (display-buffer buffer))))
- (setq gdb-source-window window)
- (with-current-buffer buffer
- (goto-char (point-min))
- (forward-line (1- (string-to-number line)))
- (set-window-point window (point))))))
- (error "No location specified"))))
-\f
-
-;; Frames buffer. This displays a perpetually correct backtrace
-;; (from the command `where').
-;;
-;; Alas, if your stack is deep, it is costly.
-;;
-(defcustom gdb-max-frames 40
- "Maximum number of frames displayed in call stack."
- :type 'integer
- :group 'gdb
- :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-stack-buffer
- 'gdb-stack-buffer-name
- 'gdb-frames-mode)
-
-(def-gdb-auto-updated-buffer gdb-stack-buffer
- gdb-invalidate-frames
- (concat "server info stack " (number-to-string gdb-max-frames) "\n")
- gdb-info-stack-handler
- gdb-info-stack-custom)
-
-;; This may be more important for embedded targets where unwinding the
-;; stack may take a long time.
-(defadvice gdb-invalidate-frames (around gdb-invalidate-frames-advice
- (&optional ignored) activate compile)
- "Only queue \"info stack\" if execution has occurred."
- (if gdb-stack-update ad-do-it))
-
-(defun gdb-info-stack-custom ()
- (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
- (let (move-to)
- (save-excursion
- (unless (eq gdb-look-up-stack 'delete)
- (let ((buffer-read-only nil)
- bl el)
- (goto-char (point-min))
- (while (< (point) (point-max))
- (setq bl (line-beginning-position)
- el (line-end-position))
- (when (looking-at "#")
- (add-text-properties bl el
- '(mouse-face highlight
- help-echo "mouse-2, RET: Select frame")))
- (goto-char bl)
- (when (looking-at "^#\\([0-9]+\\)")
- (when (string-equal (match-string 1) gdb-frame-number)
- (if (gud-tool-bar-item-visible-no-fringe)
- (progn
- (put-text-property bl (+ bl 4)
- 'face '(:inverse-video t))
- (setq move-to bl))
- (or gdb-stack-position
- (setq gdb-stack-position (make-marker)))
- (set-marker gdb-stack-position (point))
- (setq move-to gdb-stack-position)))
- (when (re-search-forward "\\([^ ]+\\) (" el t)
- (put-text-property (match-beginning 1) (match-end 1)
- 'face font-lock-function-name-face)
- (setq bl (match-end 0))
- (while (re-search-forward "<\\([^>]+\\)>" el t)
- (put-text-property (match-beginning 1) (match-end 1)
- 'face font-lock-function-name-face))
- (goto-char bl)
- (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t)
- (put-text-property (match-beginning 1) (match-end 1)
- 'face font-lock-variable-name-face))))
- (forward-line 1))
- (forward-line -1)
- (when (looking-at "(More stack frames follow...)")
- (add-text-properties
- (match-beginning 0) (match-end 0)
- '(mouse-face highlight
- gdb-max-frames t
- help-echo
- "mouse-2, RET: customize gdb-max-frames to see more frames"
- )))))
- (when gdb-look-up-stack
- (goto-char (point-min))
- (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t)
- (let ((start (line-beginning-position))
- (file (match-string 1))
- (line (match-string 2)))
- (re-search-backward "^#*\\([0-9]+\\)" start t)
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "frame "
- (match-string 1) "\n") 'gdb-set-hollow))
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "frame 0\n") 'ignore))))))
- (when move-to
- (let ((window (get-buffer-window (current-buffer) 0)))
- (when window
- (with-selected-window window
- (goto-char move-to)
- (unless (pos-visible-in-window-p)
- (recenter '(center)))))))))
- (if (eq gdb-look-up-stack 'delete)
- (kill-buffer (gdb-get-buffer 'gdb-stack-buffer)))
- (setq gdb-look-up-stack nil))
-
-(defun gdb-set-hollow ()
- (if gud-last-last-frame
- (with-current-buffer (gud-find-file (car gud-last-last-frame))
- (setq fringe-indicator-alist
- '((overlay-arrow . hollow-right-triangle))))))
-
-(defun gdb-stack-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*stack frames of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-stack-buffer ()
- "Display backtrace of current stack."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-stack-buffer) t))
-
-(defun gdb-frame-stack-buffer ()
- "Display backtrace of current stack in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer))))
-
-(defvar gdb-frames-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
- (define-key map "\r" 'gdb-frames-select)
- (define-key map "F" 'gdb-frames-force-update)
- (define-key map [mouse-2] 'gdb-frames-select)
- (define-key map [follow-link] 'mouse-face)
- map))
-
-(declare-function gdbmi-invalidate-frames "ext:gdb-mi" nil t)
-
-(defun gdb-frames-force-update ()
- "Force update of call stack.
-Use when the displayed call stack gets out of sync with the
-actual one, e.g after using the Gdb command \"return\" or setting
-$pc directly from the GUD buffer. This command isn't normally needed."
- (interactive)
- (setq gdb-stack-update t)
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (gdb-invalidate-frames)
- (gdbmi-invalidate-frames)))
-
-(defun gdb-frames-mode ()
- "Major mode for gdb call stack.
-
-\\{gdb-frames-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-frames-mode)
- (setq mode-name "Frames")
- (setq gdb-stack-position nil)
- (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
- (setq truncate-lines t) ;; Make it easier to see overlay arrow.
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (gdb-thread-identification)
- (use-local-map gdb-frames-mode-map)
- (run-mode-hooks 'gdb-frames-mode-hook)
- (setq gdb-stack-update t)
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- 'gdb-invalidate-frames
- 'gdbmi-invalidate-frames))
-
-(defun gdb-get-frame-number ()
- (save-excursion
- (end-of-line)
- (let* ((start (line-beginning-position))
- (pos (re-search-backward "^#*\\([0-9]+\\)" start t))
- (n (or (and pos (match-string 1)) "0")))
- n)))
-
-(defun gdb-frames-select (&optional event)
- "Select the frame and display the relevant source."
- (interactive (list last-input-event))
- (if event (posn-set-point (event-end event)))
- (if (get-text-property (point) 'gdb-max-frames)
- (progn
- (message-box "After setting gdb-max-frames, you need to enter\n\
-another GDB command e.g pwd, to see new frames")
- (customize-variable-other-window 'gdb-max-frames))
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "frame "
- (gdb-get-frame-number) "\n") 'ignore))))
-\f
-
-;; Threads buffer. This displays a selectable thread list.
-;;
-(gdb-set-buffer-rules 'gdb-threads-buffer
- 'gdb-threads-buffer-name
- 'gdb-threads-mode)
-
-(def-gdb-auto-updated-buffer gdb-threads-buffer
- gdb-invalidate-threads
- (concat gdb-server-prefix "info threads\n")
- gdb-info-threads-handler
- gdb-info-threads-custom)
-
-(defun gdb-info-threads-custom ()
- (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer)
- (let ((buffer-read-only nil))
- (save-excursion
- (goto-char (point-min))
- (if (re-search-forward "\\* \\([0-9]+\\)" nil t)
- (setq gdb-thread-indicator
- (propertize (concat " [" (match-string 1) "]")
- ; FIXME: this help-echo doesn't work
- 'help-echo "thread id")))
- (goto-char (point-min))
- (while (< (point) (point-max))
- (unless (looking-at "No ")
- (add-text-properties (line-beginning-position) (line-end-position)
- '(mouse-face highlight
- help-echo "mouse-2, RET: select thread")))
- (forward-line 1))))))
-
-(defun gdb-threads-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*threads of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-threads-buffer ()
- "Display IDs of currently known threads."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-threads-buffer) t))
-
-(defun gdb-frame-threads-buffer ()
- "Display IDs of currently known threads in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer))))
-
-(defvar gdb-threads-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
- (define-key map "\r" 'gdb-threads-select)
- (define-key map [mouse-2] 'gdb-threads-select)
- (define-key map [follow-link] 'mouse-face)
- map))
-
-(defvar gdb-threads-font-lock-keywords
- '((") +\\([^ ]+\\) (" (1 font-lock-function-name-face))
- ("in \\([^ ]+\\) (" (1 font-lock-function-name-face))
- ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face)))
- "Font lock keywords used in `gdb-threads-mode'.")
-
-(defun gdb-threads-mode ()
- "Major mode for gdb threads.
-
-\\{gdb-threads-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-threads-mode)
- (setq mode-name "Threads")
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (setq header-line-format gdb-breakpoints-header)
- (use-local-map gdb-threads-mode-map)
- (set (make-local-variable 'font-lock-defaults)
- '(gdb-threads-font-lock-keywords))
- (run-mode-hooks 'gdb-threads-mode-hook)
- ;; Force "info threads" onto queue.
- (lambda () (let ((gud-running nil)) (gdb-invalidate-threads))))
-
-(defun gdb-get-thread-number ()
- (save-excursion
- (re-search-backward "^\\s-*\\([0-9]*\\)" nil t)
- (match-string-no-properties 1)))
-
-(defun gdb-threads-select (&optional event)
- "Select the thread and display the relevant source."
- (interactive (list last-input-event))
- (if event (posn-set-point (event-end event)))
- (setq gdb-stack-update t)
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "thread "
- (gdb-get-thread-number) "\n") 'ignore))
- (gud-display-frame))
-
-(defun gdb-thread-identification ()
- (setq mode-line-buffer-identification
- (list (car mode-line-buffer-identification)
- '(gdb-thread-indicator gdb-thread-indicator))))
-\f
-;; Registers buffer.
-;;
-(defcustom gdb-all-registers nil
- "Non-nil means include floating-point registers."
- :type 'boolean
- :group 'gdb
- :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-registers-buffer
- 'gdb-registers-buffer-name
- 'gdb-registers-mode)
-
-(def-gdb-auto-updated-buffer gdb-registers-buffer
- gdb-invalidate-registers
- (concat
- gdb-server-prefix "info " (if gdb-all-registers "all-") "registers\n")
- gdb-info-registers-handler
- gdb-info-registers-custom)
-
-(defun gdb-info-registers-custom ()
- (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
- (save-excursion
- (let ((buffer-read-only nil)
- start end)
- (goto-char (point-min))
- (while (< (point) (point-max))
- (setq start (line-beginning-position))
- (setq end (line-end-position))
- (when (looking-at "^[^ ]+")
- (unless (string-equal (match-string 0) "The")
- (put-text-property start (match-end 0)
- 'face font-lock-variable-name-face)
- (add-text-properties start end
- '(help-echo "mouse-2: edit value"
- mouse-face highlight))))
- (forward-line 1))))))
-
-(defun gdb-edit-register-value (&optional event)
- (interactive (list last-input-event))
- (save-excursion
- (if event (posn-set-point (event-end event)))
- (beginning-of-line)
- (let* ((register (current-word))
- (value (read-string (format "New value (%s): " register))))
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "set $" register "=" value "\n")
- 'ignore)))))
-
-(defvar gdb-registers-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "\r" 'gdb-edit-register-value)
- (define-key map [mouse-2] 'gdb-edit-register-value)
- (define-key map " " 'gdb-all-registers)
- (define-key map "q" 'kill-this-buffer)
- map))
-
-(defvar gdb-locals-header
- (list
- (gdb-propertize-header "Locals" gdb-locals-buffer
- nil nil mode-line)
- " "
- (gdb-propertize-header "Registers" gdb-registers-buffer
- "mouse-1: select" mode-line-highlight mode-line-inactive)))
-
-
-(defun gdb-registers-mode ()
- "Major mode for gdb registers.
-
-\\{gdb-registers-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-registers-mode)
- (setq mode-name "Registers")
- (setq header-line-format gdb-locals-header)
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (gdb-thread-identification)
- (use-local-map gdb-registers-mode-map)
- (run-mode-hooks 'gdb-registers-mode-hook)
- (if (string-equal gdb-version "pre-6.4")
- (progn
- (if gdb-all-registers (setq mode-name "Registers:All"))
- 'gdb-invalidate-registers)
- 'gdb-invalidate-registers-1))
-
-(defun gdb-registers-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*registers of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-registers-buffer ()
- "Display integer register contents."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-registers-buffer) t))
-
-(defun gdb-frame-registers-buffer ()
- "Display integer register contents in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer))))
-
-(defun gdb-all-registers ()
- "Toggle the display of floating-point registers (pre GDB 6.4 only)."
- (interactive)
- (when (string-equal gdb-version "pre-6.4")
- (if gdb-all-registers
- (progn
- (setq gdb-all-registers nil)
- (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
- (setq mode-name "Registers")))
- (setq gdb-all-registers t)
- (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
- (setq mode-name "Registers:All")))
- (message (format "Display of floating-point registers %sabled"
- (if gdb-all-registers "en" "dis")))
- (gdb-invalidate-registers)))
-\f
-
-;; Memory buffer.
-;;
-(defcustom gdb-memory-repeat-count 32
- "Number of data items in memory window."
- :type 'integer
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-memory-format "x"
- "Display format of data items in memory window."
- :type '(choice (const :tag "Hexadecimal" "x")
- (const :tag "Signed decimal" "d")
- (const :tag "Unsigned decimal" "u")
- (const :tag "Octal" "o")
- (const :tag "Binary" "t"))
- :group 'gdb
- :version "22.1")
-
-(defcustom gdb-memory-unit "w"
- "Unit size of data items in memory window."
- :type '(choice (const :tag "Byte" "b")
- (const :tag "Halfword" "h")
- (const :tag "Word" "w")
- (const :tag "Giant word" "g"))
- :group 'gdb
- :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-memory-buffer
- 'gdb-memory-buffer-name
- 'gdb-memory-mode)
-
-(def-gdb-auto-updated-buffer gdb-memory-buffer
- gdb-invalidate-memory
- (concat gdb-server-prefix "x/" (number-to-string gdb-memory-repeat-count)
- gdb-memory-format gdb-memory-unit " " gdb-memory-address "\n")
- gdb-read-memory-handler
- gdb-read-memory-custom)
-
-(defun gdb-read-memory-custom ()
- (save-excursion
- (goto-char (point-min))
- (if (looking-at "0x[[:xdigit:]]+")
- (setq gdb-memory-address (match-string 0)))))
-
-(defvar gdb-memory-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "S" 'gdb-memory-set-address)
- (define-key map "N" 'gdb-memory-set-repeat-count)
- (define-key map "q" 'kill-this-buffer)
- map))
-
-(defun gdb-memory-set-address (&optional event)
- "Set the start memory address."
- (interactive)
- (let ((arg (read-from-minibuffer "Start address: ")))
- (setq gdb-memory-address arg))
- (gdb-invalidate-memory))
-
-(defun gdb-memory-set-repeat-count (&optional event)
- "Set the number of data items in memory window."
- (interactive)
- (let* ((arg (read-from-minibuffer "Repeat count: "))
- (count (string-to-number arg)))
- (if (<= count 0)
- (error "Positive numbers only")
- (customize-set-variable 'gdb-memory-repeat-count count)
- (gdb-invalidate-memory))))
-
-(defun gdb-memory-format-binary ()
- "Set the display format to binary."
- (interactive)
- (customize-set-variable 'gdb-memory-format "t")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-format-octal ()
- "Set the display format to octal."
- (interactive)
- (customize-set-variable 'gdb-memory-format "o")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-format-unsigned ()
- "Set the display format to unsigned decimal."
- (interactive)
- (customize-set-variable 'gdb-memory-format "u")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-format-signed ()
- "Set the display format to decimal."
- (interactive)
- (customize-set-variable 'gdb-memory-format "d")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-format-hexadecimal ()
- "Set the display format to hexadecimal."
- (interactive)
- (customize-set-variable 'gdb-memory-format "x")
- (gdb-invalidate-memory))
-
-(defvar gdb-memory-format-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
- map)
- "Keymap to select format in the header line.")
-
-(defvar gdb-memory-format-menu (make-sparse-keymap "Format")
- "Menu of display formats in the header line.")
-
-(define-key gdb-memory-format-menu [binary]
- '(menu-item "Binary" gdb-memory-format-binary
- :button (:radio . (equal gdb-memory-format "t"))))
-(define-key gdb-memory-format-menu [octal]
- '(menu-item "Octal" gdb-memory-format-octal
- :button (:radio . (equal gdb-memory-format "o"))))
-(define-key gdb-memory-format-menu [unsigned]
- '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
- :button (:radio . (equal gdb-memory-format "u"))))
-(define-key gdb-memory-format-menu [signed]
- '(menu-item "Signed Decimal" gdb-memory-format-signed
- :button (:radio . (equal gdb-memory-format "d"))))
-(define-key gdb-memory-format-menu [hexadecimal]
- '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
- :button (:radio . (equal gdb-memory-format "x"))))
-
-(defun gdb-memory-format-menu (event)
- (interactive "@e")
- (x-popup-menu event gdb-memory-format-menu))
-
-(defun gdb-memory-format-menu-1 (event)
- (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (let* ((selection (gdb-memory-format-menu event))
- (binding (and selection (lookup-key gdb-memory-format-menu
- (vector (car selection))))))
- (if binding (call-interactively binding)))))
-
-(defun gdb-memory-unit-giant ()
- "Set the unit size to giant words (eight bytes)."
- (interactive)
- (customize-set-variable 'gdb-memory-unit "g")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-word ()
- "Set the unit size to words (four bytes)."
- (interactive)
- (customize-set-variable 'gdb-memory-unit "w")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-halfword ()
- "Set the unit size to halfwords (two bytes)."
- (interactive)
- (customize-set-variable 'gdb-memory-unit "h")
- (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-byte ()
- "Set the unit size to bytes."
- (interactive)
- (customize-set-variable 'gdb-memory-unit "b")
- (gdb-invalidate-memory))
-
-(defvar gdb-memory-unit-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
- map)
- "Keymap to select units in the header line.")
-
-(defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
- "Menu of units in the header line.")
-
-(define-key gdb-memory-unit-menu [giantwords]
- '(menu-item "Giant words" gdb-memory-unit-giant
- :button (:radio . (equal gdb-memory-unit "g"))))
-(define-key gdb-memory-unit-menu [words]
- '(menu-item "Words" gdb-memory-unit-word
- :button (:radio . (equal gdb-memory-unit "w"))))
-(define-key gdb-memory-unit-menu [halfwords]
- '(menu-item "Halfwords" gdb-memory-unit-halfword
- :button (:radio . (equal gdb-memory-unit "h"))))
-(define-key gdb-memory-unit-menu [bytes]
- '(menu-item "Bytes" gdb-memory-unit-byte
- :button (:radio . (equal gdb-memory-unit "b"))))
-
-(defun gdb-memory-unit-menu (event)
- (interactive "@e")
- (x-popup-menu event gdb-memory-unit-menu))
-
-(defun gdb-memory-unit-menu-1 (event)
- (interactive "e")
- (save-selected-window
- (select-window (posn-window (event-start event)))
- (let* ((selection (gdb-memory-unit-menu event))
- (binding (and selection (lookup-key gdb-memory-unit-menu
- (vector (car selection))))))
- (if binding (call-interactively binding)))))
-
-(defvar gdb-memory-font-lock-keywords
- '(;; <__function.name+n>
- ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
- )
- "Font lock keywords used in `gdb-memory-mode'.")
-
-(defun gdb-memory-mode ()
- "Major mode for examining memory.
-
-\\{gdb-memory-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-memory-mode)
- (setq mode-name "Memory")
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (use-local-map gdb-memory-mode-map)
- (setq header-line-format
- '(:eval
- (concat
- "Start address["
- (propertize
- "-"
- 'face font-lock-warning-face
- 'help-echo "mouse-1: decrement address"
- 'mouse-face 'mode-line-highlight
- 'local-map
- (gdb-make-header-line-mouse-map
- 'mouse-1
- (lambda () (interactive)
- (let ((gdb-memory-address
- ;; Let GDB do the arithmetic.
- (concat
- gdb-memory-address " - "
- (number-to-string
- (* gdb-memory-repeat-count
- (cond ((string= gdb-memory-unit "b") 1)
- ((string= gdb-memory-unit "h") 2)
- ((string= gdb-memory-unit "w") 4)
- ((string= gdb-memory-unit "g") 8)))))))
- (gdb-invalidate-memory)))))
- "|"
- (propertize "+"
- 'face font-lock-warning-face
- 'help-echo "mouse-1: increment address"
- 'mouse-face 'mode-line-highlight
- 'local-map (gdb-make-header-line-mouse-map
- 'mouse-1
- (lambda () (interactive)
- (let ((gdb-memory-address nil))
- (gdb-invalidate-memory)))))
- "]: "
- (propertize gdb-memory-address
- 'face font-lock-warning-face
- 'help-echo "mouse-1: set start address"
- 'mouse-face 'mode-line-highlight
- 'local-map (gdb-make-header-line-mouse-map
- 'mouse-1
- #'gdb-memory-set-address))
- " Repeat Count: "
- (propertize (number-to-string gdb-memory-repeat-count)
- 'face font-lock-warning-face
- 'help-echo "mouse-1: set repeat count"
- 'mouse-face 'mode-line-highlight
- 'local-map (gdb-make-header-line-mouse-map
- 'mouse-1
- #'gdb-memory-set-repeat-count))
- " Display Format: "
- (propertize gdb-memory-format
- 'face font-lock-warning-face
- 'help-echo "mouse-3: select display format"
- 'mouse-face 'mode-line-highlight
- 'local-map gdb-memory-format-map)
- " Unit Size: "
- (propertize gdb-memory-unit
- 'face font-lock-warning-face
- 'help-echo "mouse-3: select unit size"
- 'mouse-face 'mode-line-highlight
- 'local-map gdb-memory-unit-map))))
- (set (make-local-variable 'font-lock-defaults)
- '(gdb-memory-font-lock-keywords))
- (run-mode-hooks 'gdb-memory-mode-hook)
- 'gdb-invalidate-memory)
-
-(defun gdb-memory-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*memory of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-memory-buffer ()
- "Display memory contents."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-memory-buffer) t))
-
-(defun gdb-frame-memory-buffer ()
- "Display memory contents in a new frame."
- (interactive)
- (let* ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist
- (cons '(left-fringe . 0)
- (cons '(right-fringe . 0)
- (cons '(width . 83) gdb-frame-parameters)))))
- (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
-\f
-
-;; Locals buffer.
-;;
-(gdb-set-buffer-rules 'gdb-locals-buffer
- 'gdb-locals-buffer-name
- 'gdb-locals-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-locals
- (gdb-get-buffer 'gdb-locals-buffer)
- "server info locals\n"
- gdb-info-locals-handler)
-
-(defvar gdb-locals-watch-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "\r" (lambda () (interactive)
- (beginning-of-line)
- (gud-watch)))
- (define-key map [mouse-2] (lambda (event) (interactive "e")
- (mouse-set-point event)
- (beginning-of-line)
- (gud-watch)))
- map)
- "Keymap to create watch expression of a complex data type local variable.")
-
-(defconst gdb-struct-string
- (concat (propertize "[struct/union]"
- 'mouse-face 'highlight
- 'help-echo "mouse-2: create watch expression"
- 'local-map gdb-locals-watch-map) "\n"))
-
-(defconst gdb-array-string
- (concat " " (propertize "[array]"
- 'mouse-face 'highlight
- 'help-echo "mouse-2: create watch expression"
- 'local-map gdb-locals-watch-map) "\n"))
-
-;; Abbreviate for arrays and structures.
-;; These can be expanded using gud-display.
-(defun gdb-info-locals-handler ()
- (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
- gdb-pending-triggers))
- (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
- (with-current-buffer buf
- (goto-char (point-min))
- ;; Need this in case "set print pretty" is on.
- (while (re-search-forward "^[ }].*\n" nil t)
- (replace-match "" nil nil))
- (goto-char (point-min))
- (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
- (replace-match gdb-struct-string nil nil))
- (goto-char (point-min))
- (while (re-search-forward "\\s-*{[^.].*\n" nil t)
- (replace-match gdb-array-string nil nil))))
- (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
- (and buf
- (with-current-buffer buf
- (let* ((window (get-buffer-window buf 0))
- (start (window-start window))
- (p (window-point window))
- (buffer-read-only nil))
- (erase-buffer)
- (insert-buffer-substring (gdb-get-buffer-create
- 'gdb-partial-output-buffer))
- (set-window-start window start)
- (set-window-point window p)))))
- (run-hooks 'gdb-info-locals-hook))
-
-(defvar gdb-locals-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
- map))
-
-(defun gdb-locals-mode ()
- "Major mode for gdb locals.
-
-\\{gdb-locals-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-locals-mode)
- (setq mode-name (concat "Locals:" gdb-selected-frame))
- (use-local-map gdb-locals-mode-map)
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (setq header-line-format gdb-locals-header)
- (gdb-thread-identification)
- (set (make-local-variable 'font-lock-defaults)
- '(gdb-locals-font-lock-keywords))
- (run-mode-hooks 'gdb-locals-mode-hook)
- (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (string-equal gdb-version "pre-6.4"))
- 'gdb-invalidate-locals
- 'gdb-invalidate-locals-1))
-
-(defun gdb-locals-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*locals of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-locals-buffer ()
- "Display local variables of current stack and their values."
- (interactive)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-locals-buffer) t))
-
-(defun gdb-frame-locals-buffer ()
- "Display local variables of current stack and their values in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer))))
-\f
-
-;;;; Window management
-(defun gdb-display-buffer (buf dedicated &optional frame)
- (let ((answer (get-buffer-window buf (or frame 0))))
- (if answer
- (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary.
- (let ((window (get-lru-window)))
- (if (memq (buffer-local-value 'gud-minor-mode (window-buffer window))
- '(gdba gdbmi))
- (let* ((largest (get-largest-window))
- (cur-size (window-height largest)))
- (setq answer (split-window largest))
- (set-window-buffer answer buf)
- (set-window-dedicated-p answer dedicated)
- answer)
- (set-window-buffer window buf)
- window)))))
-
-\f
-;;; Shared keymap initialization:
-
-(let ((menu (make-sparse-keymap "GDB-Windows")))
- (define-key gud-menu-map [displays]
- `(menu-item "GDB-Windows" ,menu
- :help "Open a GDB-UI buffer in a new window."
- :visible (memq gud-minor-mode '(gdbmi gdba))))
- (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
- (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
- (define-key menu [inferior]
- '(menu-item "Separate IO" gdb-display-separate-io-buffer
- :enable gdb-use-separate-io-buffer))
- (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
- (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
- (define-key menu [disassembly]
- '("Disassembly" . gdb-display-assembler-buffer))
- (define-key menu [breakpoints]
- '("Breakpoints" . gdb-display-breakpoints-buffer))
- (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
- (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)))
-
-(let ((menu (make-sparse-keymap "GDB-Frames")))
- (define-key gud-menu-map [frames]
- `(menu-item "GDB-Frames" ,menu
- :help "Open a GDB-UI buffer in a new frame."
- :visible (memq gud-minor-mode '(gdbmi gdba))))
- (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
- (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
- (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
- (define-key menu [inferior]
- '(menu-item "Separate IO" gdb-frame-separate-io-buffer
- :enable gdb-use-separate-io-buffer))
- (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
- (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
- (define-key menu [breakpoints]
- '("Breakpoints" . gdb-frame-breakpoints-buffer))
- (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
- (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)))
-
-(let ((menu (make-sparse-keymap "GDB-UI/MI")))
- (define-key gud-menu-map [ui]
- `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
- ,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
- (define-key menu [gdb-customize]
- '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
- :help "Customize Gdb Graphical Mode options."))
- (define-key menu [gdb-find-source-frame]
- '(menu-item "Look For Source Frame" gdb-find-source-frame
- :visible (eq gud-minor-mode 'gdba)
- :help "Toggle looking for source frame further up call stack."
- :button (:toggle . gdb-find-source-frame)))
- (define-key menu [gdb-use-separate-io]
- '(menu-item "Separate IO" gdb-use-separate-io-buffer
- :visible (eq gud-minor-mode 'gdba)
- :help "Toggle separate IO for debugged program."
- :button (:toggle . gdb-use-separate-io-buffer)))
- (define-key menu [gdb-many-windows]
- '(menu-item "Display Other Windows" gdb-many-windows
- :help "Toggle display of locals, stack and breakpoint information."
- :button (:toggle . gdb-many-windows)))
- (define-key menu [gdb-restore-windows]
- '(menu-item "Restore Window Layout" gdb-restore-windows
- :help "Restore standard layout for debug session.")))
-
-(defun gdb-frame-gdb-buffer ()
- "Display GUD buffer in a new frame."
- (interactive)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist
- (remove '(menu-bar-lines) (remove '(tool-bar-lines)
- gdb-frame-parameters)))
- (same-window-regexps nil))
- (display-buffer gud-comint-buffer)))
-
-(defun gdb-display-gdb-buffer ()
- "Display GUD buffer."
- (interactive)
- (let ((same-window-regexps nil))
- (select-window (display-buffer gud-comint-buffer nil 0))))
-
-(defun gdb-set-window-buffer (name)
- (set-window-buffer (selected-window) (get-buffer name))
- (set-window-dedicated-p (selected-window) t))
-
-(defun gdb-setup-windows ()
- "Layout the window pattern for `gdb-many-windows'."
- (gdb-display-locals-buffer)
- (gdb-display-stack-buffer)
- (delete-other-windows)
- (gdb-display-breakpoints-buffer)
- (delete-other-windows)
- ; Don't dedicate.
- (pop-to-buffer gud-comint-buffer)
- (split-window nil ( / ( * (window-height) 3) 4))
- (split-window nil ( / (window-height) 3))
- (split-window-horizontally)
- (other-window 1)
- (gdb-set-window-buffer (gdb-locals-buffer-name))
- (other-window 1)
- (switch-to-buffer
- (if gud-last-last-frame
- (gud-find-file (car gud-last-last-frame))
- (if gdb-main-file
- (gud-find-file gdb-main-file)
- ;; Put buffer list in window if we
- ;; can't find a source file.
- (list-buffers-noselect))))
- (setq gdb-source-window (selected-window))
- (when gdb-use-separate-io-buffer
- (split-window-horizontally)
- (other-window 1)
- (gdb-set-window-buffer
- (gdb-get-buffer-create 'gdb-inferior-io)))
- (other-window 1)
- (gdb-set-window-buffer (gdb-stack-buffer-name))
- (split-window-horizontally)
- (other-window 1)
- (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
- (other-window 1))
-
-(defun gdb-restore-windows ()
- "Restore the basic arrangement of windows used by gdba.
-This arrangement depends on the value of `gdb-many-windows'."
- (interactive)
- (pop-to-buffer gud-comint-buffer) ;Select the right window and frame.
- (delete-other-windows)
- (if gdb-many-windows
- (gdb-setup-windows)
- (when (or gud-last-last-frame gdb-show-main)
- (split-window)
- (other-window 1)
- (switch-to-buffer
- (if gud-last-last-frame
- (gud-find-file (car gud-last-last-frame))
- (gud-find-file gdb-main-file)))
- (setq gdb-source-window (selected-window))
- (other-window 1))))
-
-(defun gdb-reset ()
- "Exit a debugging session cleanly.
-Kills the gdb buffers, and resets variables and the source buffers."
- (dolist (buffer (buffer-list))
- (unless (eq buffer gud-comint-buffer)
- (with-current-buffer buffer
- (if (memq gud-minor-mode '(gdbmi gdba))
- (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
- (kill-buffer nil)
- (gdb-remove-breakpoint-icons (point-min) (point-max) t)
- (setq gud-minor-mode nil)
- (kill-local-variable 'tool-bar-map)
- (kill-local-variable 'gdb-define-alist))))))
- (setq gdb-overlay-arrow-position nil)
- (setq overlay-arrow-variable-list
- (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
- (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
- (setq gdb-stack-position nil)
- (setq overlay-arrow-variable-list
- (delq 'gdb-stack-position overlay-arrow-variable-list))
- (if (boundp 'speedbar-frame) (speedbar-timer-fn))
- (setq gud-running nil)
- (setq gdb-active-process nil)
- (setq gdb-var-list nil)
- (remove-hook 'after-save-hook 'gdb-create-define-alist t))
-
-(defun gdb-source-info ()
- "Find the source file where the program starts and display it with related
-buffers."
- (goto-char (point-min))
- (if (and (search-forward "Located in " nil t)
- (looking-at "\\S-+"))
- (setq gdb-main-file (match-string 0)))
- (goto-char (point-min))
- (if (search-forward "Includes preprocessor macro info." nil t)
- (setq gdb-macro-info t))
- (if gdb-many-windows
- (gdb-setup-windows)
- (gdb-get-buffer-create 'gdb-breakpoints-buffer)
- (if (and gdb-show-main gdb-main-file)
- (let ((pop-up-windows t))
- (display-buffer (gud-find-file gdb-main-file)))))
- (setq gdb-ready t))
-
-(defun gdb-get-location (bptno line flag)
- "Find the directory containing the relevant source file.
-Put in buffer and place breakpoint icon."
- (goto-char (point-min))
- (catch 'file-not-found
- (if (search-forward "Located in " nil t)
- (when (looking-at "\\S-+")
- (delete (cons bptno "File not found") gdb-location-alist)
- (push (cons bptno (match-string 0)) gdb-location-alist))
- (gdb-resync)
- (unless (assoc bptno gdb-location-alist)
- (push (cons bptno "File not found") gdb-location-alist)
- (message-box "Cannot find source file for breakpoint location.\n\
-Add directory to search path for source files using the GDB command, dir."))
- (throw 'file-not-found nil))
- (with-current-buffer
- (find-file-noselect (match-string 0))
- (gdb-init-buffer)
- ;; only want one breakpoint icon at each location
- (save-excursion
- (goto-char (point-min))
- (forward-line (1- (string-to-number line)))
- (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))
-
-(add-hook 'find-file-hook 'gdb-find-file-hook)
-
-(defun gdb-find-file-hook ()
- "Set up buffer for debugging if file is part of the source code
-of the current session."
- (if (and (buffer-name gud-comint-buffer)
- ;; in case gud or gdb-ui is just loaded
- gud-comint-buffer
- (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdba gdbmi)))
- ;;Pre GDB 6.3 "info sources" doesn't give absolute file name.
- (if (member (if (string-equal gdb-version "pre-6.4")
- (file-name-nondirectory buffer-file-name)
- buffer-file-name)
- gdb-source-file-list)
- (with-current-buffer (find-buffer-visiting buffer-file-name)
- (gdb-init-buffer)))))
-
-;;from put-image
-(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
- "Put string PUTSTRING in front of POS in the current buffer.
-PUTSTRING is displayed by putting an overlay into the current buffer with a
-`before-string' string that has a `display' property whose value is
-PUTSTRING."
- (let ((string (make-string 1 ?x))
- (buffer (current-buffer)))
- (setq putstring (copy-sequence putstring))
- (let ((overlay (make-overlay pos pos buffer))
- (prop (or dprop
- (list (list 'margin 'left-margin) putstring))))
- (put-text-property 0 1 'display prop string)
- (if sprops
- (add-text-properties 0 1 sprops string))
- (overlay-put overlay 'put-break t)
- (overlay-put overlay 'before-string string))))
-
-;;from remove-images
-(defun gdb-remove-strings (start end &optional buffer)
- "Remove strings between START and END in BUFFER.
-Remove only strings that were put in BUFFER with calls to `gdb-put-string'.
-BUFFER nil or omitted means use the current buffer."
- (unless buffer
- (setq buffer (current-buffer)))
- (dolist (overlay (overlays-in start end))
- (when (overlay-get overlay 'put-break)
- (delete-overlay overlay))))
-
-(defun gdb-put-breakpoint-icon (enabled bptno)
- (if (string-match "[0-9+]+\\." bptno)
- (setq enabled gdb-parent-bptno-enabled))
- (let ((start (- (line-beginning-position) 1))
- (end (+ (line-end-position) 1))
- (putstring (if enabled "B" "b"))
- (source-window (get-buffer-window (current-buffer) 0)))
- (add-text-properties
- 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
- putstring)
- (if enabled
- (add-text-properties
- 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
- (add-text-properties
- 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
- (gdb-remove-breakpoint-icons start end)
- (if (display-images-p)
- (if (>= (or left-fringe-width
- (if source-window (car (window-fringes source-window)))
- gdb-buffer-fringe-width) 8)
- (gdb-put-string
- nil (1+ start)
- `(left-fringe breakpoint
- ,(if enabled
- 'breakpoint-enabled
- 'breakpoint-disabled))
- 'gdb-bptno bptno
- 'gdb-enabled enabled)
- (when (< left-margin-width 2)
- (save-current-buffer
- (setq left-margin-width 2)
- (if source-window
- (set-window-margins
- source-window
- left-margin-width right-margin-width))))
- (put-image
- (if enabled
- (or breakpoint-enabled-icon
- (setq breakpoint-enabled-icon
- (find-image `((:type xpm :data
- ,breakpoint-xpm-data
- :ascent 100 :pointer hand)
- (:type pbm :data
- ,breakpoint-enabled-pbm-data
- :ascent 100 :pointer hand)))))
- (or breakpoint-disabled-icon
- (setq breakpoint-disabled-icon
- (find-image `((:type xpm :data
- ,breakpoint-xpm-data
- :conversion disabled
- :ascent 100 :pointer hand)
- (:type pbm :data
- ,breakpoint-disabled-pbm-data
- :ascent 100 :pointer hand))))))
- (+ start 1)
- putstring
- 'left-margin))
- (when (< left-margin-width 2)
- (save-current-buffer
- (setq left-margin-width 2)
- (let ((window (get-buffer-window (current-buffer) 0)))
- (if window
- (set-window-margins
- window left-margin-width right-margin-width)))))
- (gdb-put-string
- (propertize putstring
- 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled))
- (1+ start)))))
-
-(defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
- (gdb-remove-strings start end)
- (if (display-images-p)
- (remove-images start end))
- (when remove-margin
- (setq left-margin-width 0)
- (let ((window (get-buffer-window (current-buffer) 0)))
- (if window
- (set-window-margins
- window left-margin-width right-margin-width)))))
-
-\f
-;;
-;; Assembler buffer.
-;;
-(gdb-set-buffer-rules 'gdb-assembler-buffer
- 'gdb-assembler-buffer-name
- 'gdb-assembler-mode)
-
-;; We can't use def-gdb-auto-update-handler because we don't want to use
-;; window-start but keep the overlay arrow/current line visible.
-(defun gdb-assembler-handler ()
- (setq gdb-pending-triggers
- (delq 'gdb-invalidate-assembler
- gdb-pending-triggers))
- (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
- (with-current-buffer buf
- (goto-char (point-min))
- ;; The disassemble command in GDB 7.1 onwards displays an overlay arrow.
- (while (re-search-forward "\\(^ 0x\\|=> 0x\\)" nil t)
- (replace-match "0x" nil nil))))
- (let ((buf (gdb-get-buffer 'gdb-assembler-buffer)))
- (and buf
- (with-current-buffer buf
- (let* ((window (get-buffer-window buf 0))
- (p (window-point window))
- (buffer-read-only nil))
- (erase-buffer)
- (insert-buffer-substring (gdb-get-buffer-create
- 'gdb-partial-output-buffer))
- (set-window-point window p)))))
- ;; put customisation here
- (gdb-assembler-custom))
-
-(defun gdb-assembler-custom ()
- (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer))
- (pos 1) (address) (flag) (bptno))
- (with-current-buffer buffer
- (save-excursion
- (if (not (equal gdb-pc-address "main"))
- (progn
- (goto-char (point-min))
- (if (and gdb-pc-address
- (search-forward gdb-pc-address nil t))
- (progn
- (setq pos (point))
- (beginning-of-line)
- (setq fringe-indicator-alist
- (if (string-equal gdb-frame-number "0")
- nil
- '((overlay-arrow . hollow-right-triangle))))
- (or gdb-overlay-arrow-position
- (setq gdb-overlay-arrow-position (make-marker)))
- (set-marker gdb-overlay-arrow-position (point))))))
- ;; remove all breakpoint-icons in assembler buffer before updating.
- (gdb-remove-breakpoint-icons (point-min) (point-max))))
- (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
- (goto-char (point-min))
- (while (< (point) (- (point-max) 1))
- (forward-line 1)
- (when (looking-at
- "\\([0-9]+\\.?[0-9]*\\).*?\\s-+\\(.\\)\\s-+0x0*\\(\\S-+\\)")
- (setq bptno (match-string 1))
- (setq flag (char-after (match-beginning 2)))
- (setq address (match-string 3))
- (with-current-buffer buffer
- (save-excursion
- (goto-char (point-min))
- (if (re-search-forward (concat "^0x0*" address) nil t)
- (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
- (if (not (equal gdb-pc-address "main"))
- (with-current-buffer buffer
- (set-window-point (get-buffer-window buffer 0) pos)))))
-
-(defvar gdb-assembler-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'kill-this-buffer)
- map))
-
-(defvar gdb-assembler-font-lock-keywords
- '(;; <__function.name+n>
- ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
- (1 font-lock-function-name-face))
- ;; 0xNNNNNNNN <__function.name+n>: opcode
- ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
- (4 font-lock-keyword-face))
- ;; %register(at least i386)
- ("%\\sw+" . font-lock-variable-name-face)
- ("^\\(Dump of assembler code for function\\) \\(.+\\):"
- (1 font-lock-comment-face)
- (2 font-lock-function-name-face))
- ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
- "Font lock keywords used in `gdb-assembler-mode'.")
-
-(defun gdb-assembler-mode ()
- "Major mode for viewing code assembler.
-
-\\{gdb-assembler-mode-map}"
- (kill-all-local-variables)
- (setq major-mode 'gdb-assembler-mode)
- (setq mode-name (concat "Machine:" gdb-selected-frame))
- (setq gdb-overlay-arrow-position nil)
- (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position)
- (setq fringes-outside-margins t)
- (setq buffer-read-only t)
- (buffer-disable-undo)
- (gdb-thread-identification)
- (use-local-map gdb-assembler-mode-map)
- (gdb-invalidate-assembler)
- (set (make-local-variable 'font-lock-defaults)
- '(gdb-assembler-font-lock-keywords))
- (run-mode-hooks 'gdb-assembler-mode-hook)
- 'gdb-invalidate-assembler)
-
-(defun gdb-assembler-buffer-name ()
- (with-current-buffer gud-comint-buffer
- (concat "*disassembly of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-assembler-buffer ()
- "Display disassembly view."
- (interactive)
- (setq gdb-previous-frame nil)
- (gdb-display-buffer
- (gdb-get-buffer-create 'gdb-assembler-buffer) t))
-
-(defun gdb-frame-assembler-buffer ()
- "Display disassembly view in a new frame."
- (interactive)
- (setq gdb-previous-frame nil)
- (let ((special-display-regexps (append special-display-regexps '(".*")))
- (special-display-frame-alist gdb-frame-parameters))
- (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer))))
-
-;; modified because if gdb-pc-address has changed value a new command
-;; must be enqueued to update the buffer with the new output
-(defun gdb-invalidate-assembler (&optional ignored)
- (if (gdb-get-buffer 'gdb-assembler-buffer)
- (progn
- (unless (and gdb-selected-frame
- (string-equal gdb-selected-frame gdb-previous-frame))
- (if (or (not (member 'gdb-invalidate-assembler
- gdb-pending-triggers))
- (not (equal (string-to-number gdb-pc-address)
- (string-to-number
- gdb-previous-frame-pc-address))))
- (progn
- ;; take previous disassemble command, if any, off the queue
- (with-current-buffer gud-comint-buffer
- (let ((queue gdb-input-queue))
- (dolist (item queue)
- (if (equal (cdr item) '(gdb-assembler-handler))
- (setq gdb-input-queue
- (delete item gdb-input-queue))))))
- (gdb-enqueue-input
- (list
- (concat gdb-server-prefix "disassemble " gdb-pc-address "\n")
- 'gdb-assembler-handler))
- (push 'gdb-invalidate-assembler gdb-pending-triggers)
- (setq gdb-previous-frame-pc-address gdb-pc-address)
- (setq gdb-previous-frame gdb-selected-frame)))))))
-
-(defun gdb-get-selected-frame ()
- (if (not (member 'gdb-get-selected-frame gdb-pending-triggers))
- (progn
- (if (string-equal gdb-version "pre-6.4")
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "info frame\n")
- 'gdb-frame-handler))
- (gdb-enqueue-input
- (list "server interpreter mi -stack-info-frame\n"
- 'gdb-frame-handler-1)))
- (push 'gdb-get-selected-frame gdb-pending-triggers))))
-
-(defun gdb-frame-handler ()
- (setq gdb-pending-triggers
- (delq 'gdb-get-selected-frame gdb-pending-triggers))
- (goto-char (point-min))
- (when (re-search-forward
- "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t)
- (setq gdb-frame-number (match-string 1))
- (setq gdb-frame-address (match-string 2)))
- (goto-char (point-min))
- (when (re-search-forward ".*=\\s-+\\(\\S-*\\)\\s-+in\\s-+\\(.*?\\)\
-\\(?: (\\(\\S-+?\\):[0-9]+?)\\)*; "
- nil t)
- (setq gdb-selected-frame (match-string 2))
- (if (gdb-get-buffer 'gdb-locals-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
- (setq mode-name (concat "Locals:" gdb-selected-frame))))
- (if (gdb-get-buffer 'gdb-assembler-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
- (setq mode-name (concat "Machine:" gdb-selected-frame))))
- (setq gdb-pc-address (match-string 1))
- (if (and (match-string 3) gud-overlay-arrow-position)
- (let ((buffer (marker-buffer gud-overlay-arrow-position))
- (position (marker-position gud-overlay-arrow-position)))
- (when (and buffer
- (string-equal (file-name-nondirectory
- (buffer-file-name buffer))
- (file-name-nondirectory (match-string 3))))
- (with-current-buffer buffer
- (setq fringe-indicator-alist
- (if (string-equal gdb-frame-number "0")
- nil
- '((overlay-arrow . hollow-right-triangle))))
- (set-marker gud-overlay-arrow-position position))))))
- (goto-char (point-min))
- (if (re-search-forward " source language \\(\\S-+\\)\." nil t)
- (setq gdb-current-language (match-string 1)))
- (gdb-invalidate-assembler))
-
-\f
-;; Code specific to GDB 6.4
-(defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
-
-(defun gdb-set-gud-minor-mode-existing-buffers-1 ()
- "Create list of source files for current GDB session.
-If buffers already exist for any of these files, `gud-minor-mode'
-is set in them."
- (goto-char (point-min))
- (while (re-search-forward gdb-source-file-regexp-1 nil t)
- (push (match-string 1) gdb-source-file-list))
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (when (member buffer-file-name gdb-source-file-list)
- (gdb-init-buffer))))
- (gdb-force-mode-line-update
- (propertize "ready" 'face font-lock-variable-name-face)))
-
-;; Used for -stack-info-frame but could be used for -stack-list-frames too.
-(defconst gdb-stack-list-frames-regexp
-".*?level=\"\\(.*?\\)\".*?,addr=\"\\(.*?\\)\".*?,func=\"\\(.*?\\)\",\
-\\(?:.*?file=\".*?\".*?,fullname=\"\\(.*?\\)\".*?,line=\"\\(.*?\\)\".*?}\\|\
-from=\"\\(.*?\\)\"\\)")
-
-(defun gdb-frame-handler-1 ()
- (setq gdb-pending-triggers
- (delq 'gdb-get-selected-frame gdb-pending-triggers))
- (goto-char (point-min))
- (when (re-search-forward gdb-stack-list-frames-regexp nil t)
- (setq gdb-frame-number (match-string 1))
- (setq gdb-pc-address (match-string 2))
- (setq gdb-selected-frame (match-string 3))
- (if (gdb-get-buffer 'gdb-locals-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
- (setq mode-name (concat "Locals:" gdb-selected-frame))))
- (if (gdb-get-buffer 'gdb-assembler-buffer)
- (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
- (setq mode-name (concat "Machine:" gdb-selected-frame)))))
- (if (and (match-string 4) (match-string 5) gud-overlay-arrow-position)
- (let ((buffer (marker-buffer gud-overlay-arrow-position))
- (position (marker-position gud-overlay-arrow-position)))
- (when (and buffer
- (string-equal (file-name-nondirectory
- (buffer-file-name buffer))
- (file-name-nondirectory (match-string 4))))
- (with-current-buffer buffer
- (setq fringe-indicator-alist
- (if (string-equal gdb-frame-number "0")
- nil
- '((overlay-arrow . hollow-right-triangle))))
- (set-marker gud-overlay-arrow-position position)))))
- (gdb-invalidate-assembler))
-
-; Uses "-var-list-children --all-values". Needs GDB 6.4 onwards.
-(defun gdb-var-list-children-1 (varnum)
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- (concat "server interpreter mi \"-var-list-children --all-values \\\""
- varnum "\\\"\"\n")
- (concat "-var-list-children --all-values \"" varnum "\"\n"))
- `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
-
-(defun gdb-var-list-children-handler-1 (varnum)
- (let* ((var-list nil)
- (output (bindat-get-field (gdb-json-partial-output "child")))
- (children (bindat-get-field output 'children)))
- (catch 'child-already-watched
- (dolist (var gdb-var-list)
- (if (string-equal varnum (car var))
- (progn
- ;; With dynamic varobjs numchild may have increased.
- (setcar (nthcdr 2 var) (bindat-get-field output 'numchild))
- (push var var-list)
- (dolist (child children)
- (let ((varchild (list (bindat-get-field child 'name)
- (bindat-get-field child 'exp)
- (bindat-get-field child 'numchild)
- (bindat-get-field child 'type)
- (bindat-get-field child 'value)
- nil
- (bindat-get-field child 'has_more))))
- (if (assoc (car varchild) gdb-var-list)
- (throw 'child-already-watched nil))
- (push varchild var-list))))
- (push var var-list)))
- (setq gdb-var-list (nreverse var-list))))
- (gdb-speedbar-update))
-
-; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
-(defun gdb-var-update-1 ()
- (if (not (member 'gdb-var-update gdb-pending-triggers))
- (progn
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- "server interpreter mi \"-var-update --all-values *\"\n"
- "-var-update --all-values *\n")
- 'gdb-var-update-handler-1))
- (push 'gdb-var-update gdb-pending-triggers))))
-
-(defun gdb-var-update-handler-1 ()
- (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist)))
- (dolist (var gdb-var-list)
- (setcar (nthcdr 5 var) nil))
- (let ((temp-var-list gdb-var-list))
- (dolist (change changelist)
- (let* ((varnum (bindat-get-field change 'name))
- (var (assoc varnum gdb-var-list))
- (new-num (bindat-get-field change 'new_num_children)))
- (when var
- (let ((scope (bindat-get-field change 'in_scope))
- (has-more (bindat-get-field change 'has_more)))
- (cond ((string-equal scope "false")
- (if gdb-delete-out-of-scope
- (gdb-var-delete-1 var varnum)
- (setcar (nthcdr 5 var) 'out-of-scope)))
- ((string-equal scope "true")
- (setcar (nthcdr 6 var) has-more)
- (when (and (or (not has-more)
- (string-equal has-more "0"))
- (not new-num)
- (string-equal (nth 2 var) "0"))
- (setcar (nthcdr 4 var)
- (bindat-get-field change 'value))
- (setcar (nthcdr 5 var) 'changed)))
- ((string-equal scope "invalid")
- (gdb-var-delete-1 var varnum)))))
- (let ((var-list nil) var1
- (children (bindat-get-field change 'new_children)))
- (if new-num
- (progn
- (setq var1 (pop temp-var-list))
- (while var1
- (if (string-equal varnum (car var1))
- (let ((new (string-to-number new-num))
- (previous (string-to-number (nth 2 var1))))
- (setcar (nthcdr 2 var1) new-num)
- (push var1 var-list)
- (cond ((> new previous)
- ;; Add new children to list.
- (dotimes (dummy previous)
- (push (pop temp-var-list) var-list))
- (dolist (child children)
- (let ((varchild
- (list (bindat-get-field child 'name)
- (bindat-get-field child 'exp)
- (bindat-get-field child 'numchild)
- (bindat-get-field child 'type)
- (bindat-get-field child 'value)
- 'changed
- (bindat-get-field child 'has_more))))
- (push varchild var-list))))
- ;; Remove deleted children from list.
- ((< new previous)
- (dotimes (dummy new)
- (push (pop temp-var-list) var-list))
- (dotimes (dummy (- previous new))
- (pop temp-var-list)))))
- (push var1 var-list))
- (setq var1 (pop temp-var-list)))
- (setq gdb-var-list (nreverse var-list)))))))))
- (setq gdb-pending-triggers
- (delq 'gdb-var-update gdb-pending-triggers))
- (gdb-speedbar-update))
-
-;; Registers buffer.
-;;
-(gdb-set-buffer-rules 'gdb-registers-buffer
- 'gdb-registers-buffer-name
- 'gdb-registers-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-registers-1
- (gdb-get-buffer 'gdb-registers-buffer)
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- "server interpreter mi \"-data-list-register-values x\"\n"
- "-data-list-register-values x\n")
- gdb-data-list-register-values-handler)
-
-(defconst gdb-data-list-register-values-regexp
- "{.*?number=\"\\(.*?\\)\".*?,value=\"\\(.*?\\)\".*?}")
-
-(defun gdb-data-list-register-values-handler ()
- (setq gdb-pending-triggers (delq 'gdb-invalidate-registers-1
- gdb-pending-triggers))
- (goto-char (point-min))
- (if (re-search-forward gdb-error-regexp nil t)
- (let ((err (match-string 1)))
- (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
- (let ((buffer-read-only nil))
- (erase-buffer)
- (put-text-property 0 (length err) 'face font-lock-warning-face err)
- (insert err)
- (goto-char (point-min)))))
- (let ((register-list (reverse gdb-register-names))
- (register nil) (register-string nil) (register-values nil))
- (goto-char (point-min))
- (while (re-search-forward gdb-data-list-register-values-regexp nil t)
- (setq register (pop register-list))
- (setq register-string (concat register "\t" (match-string 2) "\n"))
- (if (member (match-string 1) gdb-changed-registers)
- (put-text-property 0 (length register-string)
- 'face 'font-lock-warning-face
- register-string))
- (setq register-values
- (concat register-values register-string)))
- (let ((buf (gdb-get-buffer 'gdb-registers-buffer)))
- (with-current-buffer buf
- (let* ((window (get-buffer-window buf 0))
- (start (window-start window))
- (p (if window (window-point window) (point)))
- (buffer-read-only nil))
- (erase-buffer)
- (insert register-values)
- (if window
- (progn
- (set-window-start window start)
- (set-window-point window p))
- (goto-char p)))))))
- (gdb-data-list-register-values-custom))
-
-(defun gdb-data-list-register-values-custom ()
- (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
- (save-excursion
- (let ((buffer-read-only nil)
- start end)
- (goto-char (point-min))
- (while (< (point) (point-max))
- (setq start (line-beginning-position))
- (setq end (line-end-position))
- (when (looking-at "^[^\t]+")
- (unless (string-equal (match-string 0) "No registers.")
- (put-text-property start (match-end 0)
- 'face font-lock-variable-name-face)
- (add-text-properties start end
- '(help-echo "mouse-2: edit value"
- mouse-face highlight))))
- (forward-line 1))))))
-
-;; Needs GDB 6.4 onwards (used to fail with no stack).
-(defun gdb-get-changed-registers ()
- (if (and (gdb-get-buffer 'gdb-registers-buffer)
- (not (member 'gdb-get-changed-registers gdb-pending-triggers)))
- (progn
- (gdb-enqueue-input
- (list
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- "server interpreter mi -data-list-changed-registers\n"
- "-data-list-changed-registers\n")
- 'gdb-get-changed-registers-handler))
- (push 'gdb-get-changed-registers gdb-pending-triggers))))
-
-(defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"")
-
-(defun gdb-get-changed-registers-handler ()
- (setq gdb-pending-triggers
- (delq 'gdb-get-changed-registers gdb-pending-triggers))
- (setq gdb-changed-registers nil)
- (goto-char (point-min))
- (while (re-search-forward gdb-data-list-register-names-regexp nil t)
- (push (match-string 1) gdb-changed-registers)))
-\f
-
-;; Locals buffer.
-;;
-;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
-(gdb-set-buffer-rules 'gdb-locals-buffer
- 'gdb-locals-buffer-name
- 'gdb-locals-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-locals-1
- (gdb-get-buffer 'gdb-locals-buffer)
- (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
- "server interpreter mi -\"stack-list-locals --simple-values\"\n"
- "-stack-list-locals --simple-values\n")
- gdb-stack-list-locals-handler)
-
-(defconst gdb-stack-list-locals-regexp
- "{.*?name=\"\\(.*?\\)\".*?,type=\"\\(.*?\\)\"")
-
-(defvar gdb-locals-watch-map-1
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "\r" 'gud-watch)
- (define-key map [mouse-2] 'gud-watch)
- map)
- "Keymap to create watch expression of a complex data type local variable.")
-
-(defvar gdb-edit-locals-map-1
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "\r" 'gdb-edit-locals-value)
- (define-key map [mouse-2] 'gdb-edit-locals-value)
- map)
- "Keymap to edit value of a simple data type local variable.")
-
-(defun gdb-edit-locals-value (&optional event)
- "Assign a value to a variable displayed in the locals buffer."
- (interactive (list last-input-event))
- (save-excursion
- (if event (posn-set-point (event-end event)))
- (beginning-of-line)
- (let* ((var (current-word))
- (value (read-string (format "New value (%s): " var))))
- (gdb-enqueue-input
- (list (concat gdb-server-prefix "set variable " var " = " value "\n")
- 'ignore)))))
-
-;; Dont display values of arrays or structures.
-;; These can be expanded using gud-watch.
-(defun gdb-stack-list-locals-handler ()
- (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1
- gdb-pending-triggers))
- (goto-char (point-min))
- (if (re-search-forward gdb-error-regexp nil t)
- (let ((err (match-string 1)))
- (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
- (let ((buffer-read-only nil))
- (erase-buffer)
- (insert err)
- (goto-char (point-min)))))
- (let (local locals-list)
- (goto-char (point-min))
- (while (re-search-forward gdb-stack-list-locals-regexp nil t)
- (let ((local (list (match-string 1)
- (match-string 2)
- nil)))
- (if (looking-at ",value=\\(\".*\"\\).*?}")
- (setcar (nthcdr 2 local) (read (match-string 1))))
- (push local locals-list)))
- (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
- (and buf (with-current-buffer buf
- (let* ((window (get-buffer-window buf 0))
- (start (window-start window))
- (p (if window (window-point window) (point)))
- (buffer-read-only nil) (name) (value))
- (erase-buffer)
- (dolist (local locals-list)
- (setq name (car local))
- (setq value (nth 2 local))
- (if (or (not value)
- (string-match "^\\0x" value))
- (add-text-properties 0 (length name)
- `(mouse-face highlight
- help-echo "mouse-2: create watch expression"
- local-map ,gdb-locals-watch-map-1)
- name)
- (add-text-properties 0 (length value)
- `(mouse-face highlight
- help-echo "mouse-2: edit value"
- local-map ,gdb-edit-locals-map-1)
- value))
- (insert
- (concat name "\t" (nth 1 local)
- "\t" value "\n")))
- (if window
- (progn
- (set-window-start window start)
- (set-window-point window p))
- (goto-char p)))))))))
-
-(defun gdb-get-register-names ()
- "Create a list of register names."
- (goto-char (point-min))
- (while (re-search-forward gdb-data-list-register-names-regexp nil t)
- (push (match-string 1) gdb-register-names)))
-
-(provide 'gdb-ui)
-
-;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352
-;;; gdb-ui.el ends here
(file-name-nondirectory bn)))
(default-alias
(and fn
- (let ((aliases grep-files-aliases)
+ (let ((aliases (remove (assoc "all" grep-files-aliases)
+ grep-files-aliases))
alias)
(while aliases
(setq alias (car aliases)
aliases (cdr aliases))
- (if (string-match (wildcard-to-regexp (cdr alias)) fn)
+ (if (string-match (mapconcat
+ 'wildcard-to-regexp
+ (split-string (cdr alias) nil t)
+ "\\|")
+ fn)
(setq aliases nil)
(setq alias nil)))
(cdr alias))))
(require 'comint)
(defvar gdb-active-process)
-(defvar gdb-recording)
(defvar gdb-define-alist)
(defvar gdb-macro-info)
-(defvar gdb-server-prefix)
(defvar gdb-show-changed-values)
(defvar gdb-source-window)
(defvar gdb-var-list)
(throw 'info-found nil))))
nil 0)
(select-frame (make-frame)))
- (if (memq gud-minor-mode '(gdbmi gdba))
+ (if (eq gud-minor-mode 'gdbmi)
(info "(emacs)GDB Graphical Interface")
(info "(emacs)Debuggers"))))
(defun gud-tool-bar-item-visible-no-fringe ()
(not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode)
- (and (memq gud-minor-mode '(gdbmi gdba))
+ (eq (buffer-local-value 'major-mode (window-buffer)) 'gdb-memory-mode)
+ (and (eq gud-minor-mode 'gdbmi)
(> (car (window-fringes)) 0)))))
+(declare-function gdb-gud-context-command "gdb-mi.el")
+
(defun gud-stop-subjob ()
(interactive)
(with-current-buffer gud-comint-buffer
- (if (string-equal gud-target-name "emacs")
- (comint-stop-subjob)
- (if (eq gud-minor-mode 'jdb)
- (gud-call "suspend")
- (comint-interrupt-subjob)))))
+ (cond ((string-equal gud-target-name "emacs")
+ (comint-stop-subjob))
+ ((eq gud-minor-mode 'jdb)
+ (gud-call "suspend"))
+ ((eq gud-minor-mode 'gdbmi)
+ (gud-call (gdb-gud-context-command "-exec-interrupt")))
+ (t
+ (comint-interrupt-subjob)))))
(easy-mmode-defmap gud-menu-map
'(([help] "Info (debugger)" . gud-goto-info)
- ([rfinish] menu-item "Reverse Finish Function" gud-rfinish
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([rstepi] menu-item "Reverse Step Instruction" gud-rstepi
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([rnexti] menu-item "Reverse Next Instruction" gud-rnexti
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([rstep] menu-item "Reverse Step Line" gud-rstep
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([rnext] menu-item "Reverse Next Line" gud-rnext
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([rcont] menu-item "Reverse Continue" gud-rcont
- :enable (not gud-running)
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
- ([recstart] menu-item "Start Recording" gdb-toggle-recording-1
- :visible (and (not gdb-recording)
- (eq gud-minor-mode 'gdba)))
- ([recstop] menu-item "Stop Recording" gdb-toggle-recording
- :visible (and gdb-recording
- (eq gud-minor-mode 'gdba)))
([tooltips] menu-item "Show GUD tooltips" gud-tooltip-mode
:enable (and (not emacs-basic-display)
(display-graphic-p)
(fboundp 'x-show-tip))
:visible (memq gud-minor-mode
- '(gdbmi gdba dbx sdb xdb pdb))
+ '(gdbmi dbx sdb xdb pdb))
:button (:toggle . gud-tooltip-mode))
([refresh] "Refresh" . gud-refresh)
([run] menu-item "Run" gud-run
:enable (not gud-running)
:visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
([go] menu-item (if gdb-active-process "Continue" "Run") gud-go
- :visible (and (not gud-running)
- (eq gud-minor-mode 'gdba)))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ (gdb-show-run-p)))
([stop] menu-item "Stop" gud-stop-subjob
- :visible (or (not (memq gud-minor-mode '(gdba pdb)))
- (and gud-running
- (eq gud-minor-mode 'gdba))))
+ :visible (or (not (memq gud-minor-mode '(gdbmi pdb)))
+ (gdb-show-stop-p)))
([until] menu-item "Continue to selection" gud-until
:enable (not gud-running)
- :visible (and (memq gud-minor-mode '(gdbmi gdba gdb perldb))
+ :visible (and (memq gud-minor-mode '(gdbmi gdb perldb))
(gud-tool-bar-item-visible-no-fringe)))
([remove] menu-item "Remove Breakpoint" gud-remove
:enable (not gud-running)
([tbreak] menu-item "Temporary Breakpoint" gud-tbreak
:enable (not gud-running)
:visible (memq gud-minor-mode
- '(gdbmi gdba gdb sdb xdb)))
+ '(gdbmi gdb sdb xdb)))
([break] menu-item "Set Breakpoint" gud-break
:enable (not gud-running)
:visible (gud-tool-bar-item-visible-no-fringe))
([up] menu-item "Up Stack" gud-up
:enable (not gud-running)
:visible (memq gud-minor-mode
- '(gdbmi gdba gdb dbx xdb jdb pdb)))
+ '(gdbmi gdb dbx xdb jdb pdb)))
([down] menu-item "Down Stack" gud-down
:enable (not gud-running)
:visible (memq gud-minor-mode
- '(gdbmi gdba gdb dbx xdb jdb pdb)))
+ '(gdbmi gdb dbx xdb jdb pdb)))
([pp] menu-item "Print S-expression" gud-pp
:enable (and (not gud-running)
gdb-active-process)
:visible (and (string-equal
(buffer-local-value
'gud-target-name gud-comint-buffer) "emacs")
- (eq gud-minor-mode 'gdba)))
- ([print*] menu-item "Print Dereference" gud-pstar
+ (eq gud-minor-mode 'gdbmi)))
+ ([print*] menu-item (if (eq gud-minor-mode 'jdb)
+ "Dump object"
+ "Print Dereference") gud-pstar
:enable (not gud-running)
- :visible (memq gud-minor-mode '(gdbmi gdba gdb)))
+ :visible (memq gud-minor-mode '(gdbmi gdb jdb)))
([print] menu-item "Print Expression" gud-print
:enable (not gud-running))
([watch] menu-item "Watch Expression" gud-watch
:enable (not gud-running)
- :visible (memq gud-minor-mode '(gdbmi gdba)))
+ :visible (eq gud-minor-mode 'gdbmi))
([finish] menu-item "Finish Function" gud-finish
:enable (not gud-running)
:visible (memq gud-minor-mode
- '(gdbmi gdba gdb xdb jdb pdb)))
+ '(gdbmi gdb xdb jdb pdb)))
([stepi] menu-item "Step Instruction" gud-stepi
:enable (not gud-running)
- :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx)))
+ :visible (memq gud-minor-mode '(gdbmi gdb dbx)))
([nexti] menu-item "Next Instruction" gud-nexti
:enable (not gud-running)
- :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx)))
+ :visible (memq gud-minor-mode '(gdbmi gdb dbx)))
([step] menu-item "Step Line" gud-step
:enable (not gud-running))
([next] menu-item "Next Line" gud-next
:enable (not gud-running))
([cont] menu-item "Continue" gud-cont
:enable (not gud-running)
- :visible (not (eq gud-minor-mode 'gdba))))
+ :visible (not (eq gud-minor-mode 'gdbmi))))
"Menu for `gud-mode'."
:name "Gud")
. (,(propertize "next" 'face 'font-lock-doc-face) . gud-next))
([menu-bar until] menu-item
,(propertize "until" 'face 'font-lock-doc-face) gud-until
- :visible (memq gud-minor-mode '(gdbmi gdba gdb perldb)))
+ :visible (memq gud-minor-mode '(gdbmi gdb perldb)))
([menu-bar cont] menu-item
,(propertize "cont" 'face 'font-lock-doc-face) gud-cont
- :visible (not (eq gud-minor-mode 'gdba)))
+ :visible (not (eq gud-minor-mode 'gdbmi)))
([menu-bar run] menu-item
,(propertize "run" 'face 'font-lock-doc-face) gud-run
:visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
([menu-bar go] menu-item
,(propertize " go " 'face 'font-lock-doc-face) gud-go
- :visible (and (not gud-running)
- (eq gud-minor-mode 'gdba)))
+ :visible (and (eq gud-minor-mode 'gdbmi)
+ (gdb-show-run-p)))
([menu-bar stop] menu-item
,(propertize "stop" 'face 'font-lock-doc-face) gud-stop-subjob
- :visible (and gud-running
- (eq gud-minor-mode 'gdba)))
+ :visible (or (and (eq gud-minor-mode 'gdbmi)
+ (gdb-show-stop-p))
+ (not (eq gud-minor-mode 'gdbmi))))
([menu-bar print]
. (,(propertize "print" 'face 'font-lock-doc-face) . gud-print))
([menu-bar tools] . undefined)
(gud-stepi . "gud/stepi")
(gud-up . "gud/up")
(gud-down . "gud/down")
- (gdb-toggle-recording-1 . "gud/recstart")
- (gdb-toggle-recording . "gud/recstop")
- (gud-rcont . "gud/rcont")
- (gud-rnext . "gud/rnext")
- (gud-rstep . "gud/rstep")
- (gud-rfinish . "gud/rfinish")
- (gud-rnexti . "gud/rnexti")
- (gud-rstepi . "gud/rstepi")
(gud-goto-info . "info"))
map)
(tool-bar-local-item-from-menu
(setq directories (cdr directories)))
result)))
-(declare-function gdb-create-define-alist "gdb-ui" ())
+(declare-function gdb-create-define-alist "gdb-mi" ())
(defun gud-find-file (file)
;; Don't get confused by double slashes in the name that comes from GDB.
(set (make-local-variable 'gud-minor-mode) minor-mode)
(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
(when (and gud-tooltip-mode
- (memq gud-minor-mode '(gdbmi gdba)))
+ (eq gud-minor-mode 'gdbmi))
(make-local-variable 'gdb-define-alist)
(unless gdb-define-alist (gdb-create-define-alist))
(add-hook 'after-save-hook 'gdb-create-define-alist nil t))
(defvar gud-speedbar-menu-items
'(["Jump to stack frame" speedbar-edit-line
- :visible (not (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba)))]
+ :visible (not (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi))]
["Edit value" speedbar-edit-line
- :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba))]
+ :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi)]
["Delete expression" gdb-var-delete
- :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba))]
+ :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi)]
["Auto raise frame" gdb-speedbar-auto-raise
:style toggle :selected gdb-speedbar-auto-raise
- :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba))]
+ :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi)]
("Output Format"
- :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba))
+ :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi)
["Binary" (gdb-var-set-format "binary") t]
["Natural" (gdb-var-set-format "natural") t]
["Hexadecimal" (gdb-var-set-format "hexadecimal") t]))
(start (window-start window))
(p (window-point window)))
(cond
- ((memq minor-mode '(gdbmi gdba))
+ ((eq minor-mode 'gdbmi)
(erase-buffer)
(insert "Watch Expressions:\n")
(let ((var-list gdb-var-list) parent)
(car frame)
'speedbar-file-face
'speedbar-highlight-face
- (cond ((memq minor-mode '(gdbmi gdba gdb))
+ (cond ((memq minor-mode '(gdbmi gdb))
'gud-gdb-goto-stackframe)
(t (error "Should never be here")))
frame t))))
;; Set the accumulator to the remaining text.
gud-marker-acc (substring gud-marker-acc (match-end 0))))
- ;; Check for annotations and change gud-minor-mode to 'gdba if
- ;; they are found.
(while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
(let ((match (match-string 1 gud-marker-acc)))
(defvar gud-filter-pending-text nil
"Non-nil means this is text that has been saved for later in `gud-filter'.")
-;; If in gdba mode, gdb-ui is loaded.
-(declare-function gdb-restore-windows "gdb-ui" ())
+;; If in gdb mode, gdb-mi is loaded.
+(declare-function gdb-restore-windows "gdb-mi" ())
-;; The old gdb command (text command mode). The new one is in gdb-ui.el.
+;; The old gdb command (text command mode). The new one is in gdb-mi.el.
;;;###autoload
(defun gud-gdb (command-line)
"Run gdb on program FILE in buffer *gud-FILE*.
(when (and gud-comint-buffer
(buffer-name gud-comint-buffer)
(get-buffer-process gud-comint-buffer)
- (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
- (gdb-restore-windows)
- (error
- "Multiple debugging requires restarting in text command mode"))
+ (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)))
+ (gdb-restore-windows)
+ (error
+ "Multiple debugging requires restarting in text command mode"))
(gud-common-init command-line nil 'gud-gdb-marker-filter)
(set (make-local-variable 'gud-minor-mode) 'gdb)
(defvar gud-overlay-arrow-position nil)
(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
-(declare-function gdb-reset "gdb-ui" ())
+(declare-function gdb-reset "gdb-mi" ())
(defun gud-sentinel (proc msg)
(cond ((null (buffer-name (process-buffer proc)))
(string-equal speedbar-initial-expansion-list-name "GUD"))
(speedbar-change-initial-expansion-list
speedbar-previously-used-expansion-list-name))
- (if (memq gud-minor-mode-type '(gdbmi gdba))
+ (if (eq gud-minor-mode-type 'gdbmi)
(gdb-reset)
(gud-reset)))
((memq (process-status proc) '(signal exit))
;; Stop displaying an arrow in a source file.
(setq gud-overlay-arrow-position nil)
- (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdba gdbmi))
+ (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi)
(gdb-reset)
(gud-reset))
(let* ((obuf (current-buffer)))
(defun gud-kill-buffer-hook ()
(setq gud-minor-mode-type gud-minor-mode)
(condition-case nil
- (kill-process (get-buffer-process (current-buffer)))
+ (progn
+ (kill-process (get-buffer-process (current-buffer)))
+ (delete-process (get-process "gdb-inferior")))
(error nil)))
(defun gud-reset ()
(declare-function global-hl-line-highlight "hl-line" ())
(declare-function hl-line-highlight "hl-line" ())
-(declare-function gdb-display-source-buffer "gdb-ui" (buffer))
-(declare-function gdb-display-buffer "gdb-ui" (buf dedicated &optional size))
+(declare-function gdb-display-source-buffer "gdb-mi" (buffer))
+(declare-function gdb-display-buffer "gdb-mi" (buf dedicated &optional size))
;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
;; and that its line LINE is visible.
(gud-find-file true-file)))
(window (and buffer
(or (get-buffer-window buffer)
- (if (memq gud-minor-mode '(gdbmi gdba))
+ (if (eq gud-minor-mode 'gdbmi)
(or (if (get-buffer-window buffer 'visible)
(display-buffer buffer nil 'visible))
(unless (gdb-display-source-buffer buffer)
(goto-char pos))))
(when window
(set-window-point window gud-overlay-arrow-position)
- (if (memq gud-minor-mode '(gdbmi gdba))
+ (if (eq gud-minor-mode 'gdbmi)
(setq gdb-source-window window)))))))
;; The gud-call function must do the right thing whether its invoking
(forward-line 0))
(if (looking-at comint-prompt-regexp)
(set-marker gud-delete-prompt-marker (point)))
- (if (memq gud-minor-mode '(gdbmi gdba))
+ (if (eq gud-minor-mode 'gdbmi)
(apply comint-input-sender (list proc command))
(process-send-string proc (concat command "\n"))))))))
(gud-tooltip-activate-mouse-motions-if-enabled)
(if (and gud-comint-buffer
(buffer-name gud-comint-buffer); gud-comint-buffer might be killed
- (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
- '(gdbmi gdba)))
+ (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+ 'gdbmi))
(if gud-tooltip-mode
(progn
(dolist (buffer (buffer-list))
(unless (eq buffer gud-comint-buffer)
(with-current-buffer buffer
- (when (and (memq gud-minor-mode '(gdbmi gdba))
+ (when (and (eq gud-minor-mode 'gdbmi)
(not (string-match "\\`\\*.+\\*\\'"
(buffer-name))))
(make-local-variable 'gdb-define-alist)
; Larger arrays (say 400 elements) are displayed in
; the tooltip incompletely and spill over into the gud buffer.
; Switching the process-filter creates timing problems and
-; it may be difficult to do better. Using annotations as in
-; gdb-ui.el gets round this problem.
+; it may be difficult to do better. Using GDB/MI as in
+; gdb-mi.el gets round this problem.
(defun gud-tooltip-process-output (process output)
"Process debugger output and show it in a tooltip window."
(set-process-filter process gud-tooltip-original-filter)
(defun gud-tooltip-print-command (expr)
"Return a suitable command to print the expression EXPR."
(case gud-minor-mode
- (gdba (concat "server print " expr))
- ((dbx gdbmi) (concat "print " expr))
+ (gdbmi (concat "-data-evaluate-expression " expr))
+ (dbx (concat "print " expr))
((xdb pdb) (concat "p " expr))
(sdb (concat expr "/"))))
-(declare-function gdb-enqueue-input "gdb-ui" (item))
+(declare-function gdb-input "gdb-mi" (item))
(declare-function tooltip-expr-to-print "tooltip" (event))
(declare-function tooltip-event-buffer "tooltip" (event))
(buffer-name gud-comint-buffer); might be killed
(setq process (get-buffer-process gud-comint-buffer))
(posn-point (event-end event))
- (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
+ (or (and (eq gud-minor-mode 'gdbmi) (not gdb-active-process))
(progn (setq gud-tooltip-event event)
(eval (cons 'and gud-tooltip-display)))))
(let ((expr (tooltip-expr-to-print event)))
(when expr
- (if (and (eq gud-minor-mode 'gdba)
+ (if (and (eq gud-minor-mode 'gdbmi)
(not gdb-active-process))
(progn
(with-current-buffer (tooltip-event-buffer event)
(message-box "Using GUD tooltips in this mode is unsafe\n\
so they have been disabled."))
(unless (null cmd) ; CMD can be nil if unknown debugger
- (if (memq gud-minor-mode '(gdba gdbmi))
+ (if (eq gud-minor-mode 'gdbmi)
(if gdb-macro-info
- (gdb-enqueue-input
+ (gdb-input
(list (concat
- gdb-server-prefix "macro expand " expr "\n")
+ "server macro expand " expr "\n")
`(lambda () (gdb-tooltip-print-1 ,expr))))
- (gdb-enqueue-input
+ (gdb-input
(list (concat cmd "\n")
`(lambda () (gdb-tooltip-print ,expr)))))
(setq gud-tooltip-original-filter (process-filter process))
not possible without parsing. Thus assignment statement become just
the leftover unidentified statements containing an equal sign.")
+;; FIXME: This var seems to only ever be set, but never actually used!
(defvar idlwave-fill-function 'auto-fill-function
"IDL mode auto fill function.")
"Regex used to highlight makepp rule action lines in font lock mode.")
(defconst makefile-bsdmake-rule-action-regex
- (progn (string-match "-@" makefile-rule-action-regex)
- (replace-match "-+@" t t makefile-rule-action-regex))
+ (replace-regexp-in-string "-@" "-+@" makefile-rule-action-regex)
"Regex used to highlight BSD rule action lines in font lock mode.")
;; Note that the first and second subexpression is used by font lock. Note
("Macro Assignment" ,makefile-macroassign-regex 1))
"Imenu generic expression for Makefile mode. See `imenu-generic-expression'.")
-;;; ------------------------------------------------------------
-;;; The following configurable variables are used in the
-;;; up-to-date overview .
-;;; The standard configuration assumes that your `make' program
-;;; can be run in question/query mode using the `-q' option, this
-;;; means that the command
-;;;
-;;; make -q foo
-;;;
-;;; should return an exit status of zero if the target `foo' is
-;;; up to date and a nonzero exit status otherwise.
-;;; Many makes can do this although the docs/manpages do not mention
-;;; it. Try it with your favourite one. GNU make, System V make, and
-;;; Dennis Vadura's DMake have no problems.
-;;; Set the variable `makefile-brave-make' to the name of the
-;;; make utility that does this on your system.
-;;; To understand what this is all about see the function definition
-;;; of `makefile-query-by-make-minus-q' .
-;;; ------------------------------------------------------------
+;; ------------------------------------------------------------
+;; The following configurable variables are used in the
+;; up-to-date overview .
+;; The standard configuration assumes that your `make' program
+;; can be run in question/query mode using the `-q' option, this
+;; means that the command
+;;
+;; make -q foo
+;;
+;; should return an exit status of zero if the target `foo' is
+;; up to date and a nonzero exit status otherwise.
+;; Many makes can do this although the docs/manpages do not mention
+;; it. Try it with your favourite one. GNU make, System V make, and
+;; Dennis Vadura's DMake have no problems.
+;; Set the variable `makefile-brave-make' to the name of the
+;; make utility that does this on your system.
+;; To understand what this is all about see the function definition
+;; of `makefile-query-by-make-minus-q' .
+;; ------------------------------------------------------------
(defcustom makefile-brave-make "make"
"*How to invoke make, for `makefile-query-targets'.
;;; --- end of up-to-date-overview configuration ------------------
-(defvar makefile-mode-abbrev-table nil
+(define-abbrev-table 'makefile-mode-abbrev-table ()
"Abbrev table in use in Makefile buffers.")
-(if makefile-mode-abbrev-table
- ()
- (define-abbrev-table 'makefile-mode-abbrev-table ()))
(defvar makefile-mode-map
(let ((map (make-sparse-keymap))
(modify-syntax-entry ?\n "> " st)
st))
-(defvar makefile-imake-mode-syntax-table (copy-syntax-table
- makefile-mode-syntax-table))
-(if makefile-imake-mode-syntax-table
- ()
- (modify-syntax-entry ?/ ". 14" makefile-imake-mode-syntax-table)
- (modify-syntax-entry ?* ". 23" makefile-imake-mode-syntax-table)
- (modify-syntax-entry ?# "'" makefile-imake-mode-syntax-table)
- (modify-syntax-entry ?\n ". b" makefile-imake-mode-syntax-table))
-
+(defvar makefile-imake-mode-syntax-table
+ (let ((st (make-syntax-table makefile-mode-syntax-table)))
+ (modify-syntax-entry ?/ ". 14" st)
+ (modify-syntax-entry ?* ". 23" st)
+ (modify-syntax-entry ?# "'" st)
+ (modify-syntax-entry ?\n ". b" st)
+ st))
;;; ------------------------------------------------------------
;;; Internal variables.
;;; ------------------------------------------------------------
;;;###autoload
-(defun makefile-mode ()
+(define-derived-mode makefile-mode nil "Makefile"
"Major mode for editing standard Makefiles.
If you are editing a file for a different make, try one of the
List of special targets. You will be offered to complete
on one of those in the minibuffer whenever you enter a `.'.
at the beginning of a line in Makefile mode."
-
- (interactive)
- (kill-all-local-variables)
(add-hook 'write-file-functions
'makefile-warn-suspicious-lines nil t)
(add-hook 'write-file-functions
(make-local-variable 'makefile-need-macro-pickup)
;; Font lock.
- (make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults
- ;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down
- ;; near the end of a large buffer, due to parse-partial-sexp's
- ;; trying to parse all the way till the beginning of buffer.
- '(makefile-font-lock-keywords
- nil nil
- ((?$ . "."))
- backward-paragraph
- (font-lock-syntactic-keywords
- . makefile-font-lock-syntactic-keywords)))
+ (set (make-local-variable 'font-lock-defaults)
+ ;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down
+ ;; near the end of a large buffer, due to parse-partial-sexp's
+ ;; trying to parse all the way till the beginning of buffer.
+ '(makefile-font-lock-keywords
+ nil nil
+ ((?$ . "."))
+ backward-paragraph
+ (font-lock-syntactic-keywords
+ . makefile-font-lock-syntactic-keywords)))
;; Add-log.
- (make-local-variable 'add-log-current-defun-function)
- (setq add-log-current-defun-function 'makefile-add-log-defun)
+ (set (make-local-variable 'add-log-current-defun-function)
+ 'makefile-add-log-defun)
;; Imenu.
- (make-local-variable 'imenu-generic-expression)
- (setq imenu-generic-expression makefile-imenu-generic-expression)
+ (set (make-local-variable 'imenu-generic-expression)
+ makefile-imenu-generic-expression)
;; Dabbrev.
- (make-local-variable 'dabbrev-abbrev-skip-leading-regexp)
- (setq dabbrev-abbrev-skip-leading-regexp "\\$")
+ (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "\\$")
;; Other abbrevs.
(setq local-abbrev-table makefile-mode-abbrev-table)
;; Filling.
- (make-local-variable 'fill-paragraph-function)
- (setq fill-paragraph-function 'makefile-fill-paragraph)
+ (set (make-local-variable 'fill-paragraph-function) 'makefile-fill-paragraph)
;; Comment stuff.
- (make-local-variable 'comment-start)
- (setq comment-start "#")
- (make-local-variable 'comment-end)
- (setq comment-end "")
- (make-local-variable 'comment-start-skip)
- (setq comment-start-skip "#+[ \t]*")
+ (set (make-local-variable 'comment-start) "#")
+ (set (make-local-variable 'comment-end) "")
+ (set (make-local-variable 'comment-start-skip) "#+[ \t]*")
;; Make sure TAB really inserts \t.
(set (make-local-variable 'indent-line-function) 'indent-to-left-margin)
- ;; become the current major mode
- (setq major-mode 'makefile-mode)
- (setq mode-name "Makefile")
-
- ;; Activate keymap and syntax table.
- (use-local-map makefile-mode-map)
- (set-syntax-table makefile-mode-syntax-table)
-
;; Real TABs are important in makefiles
- (setq indent-tabs-mode t)
- (run-mode-hooks 'makefile-mode-hook))
+ (setq indent-tabs-mode t))
;; These should do more than just differentiate font-lock.
;;;###autoload
;; Maintainer: Pieter E.J. Pareit <pieter.pareit@gmail.com>
;; Created: 09 Nov 2002
;; Version: 0.1
-;; Keywords: languages Knuth mix mixal asm mixvm "The Art Of Computer Programming"
+;; Keywords: languages, Knuth, mix, mixal, asm, mixvm, The Art Of Computer Programming
;; This file is part of GNU Emacs.
(define-key map "\C-c\M-\C-d" 'octave-down-block)
(define-key map "\C-c\M-\C-h" 'octave-mark-block)
(define-key map "\C-c]" 'octave-close-block)
+ (define-key map "\C-c/" 'octave-close-block)
(define-key map "\C-c\C-f" 'octave-insert-defun)
(define-key map "\C-c\C-h" 'octave-help)
(define-key map "\C-c\C-il" 'octave-send-line)
(defvar comint-prompt-regexp)
(defvar comint-process-echoes)
+(defvar smie-indent-basic)
(defgroup prolog nil
"Major mode for editing and running Prolog under Emacs."
(defvar prolog-mode-abbrev-table nil)
(define-abbrev-table 'prolog-mode-abbrev-table ())
+(defconst prolog-smie-op-levels
+ ;; Rather than construct the operator levels table from the BNF,
+ ;; we directly provide the operator precedences from GNU Prolog's
+ ;; manual. The only problem is that GNU Prolog's manual uses
+ ;; precedence levels in the opposite sense (higher numbers bind less
+ ;; tightly) than SMIE, so we use negative numbers.
+ '(("." -10000 -10000)
+ (":-" -1200 -1200)
+ ("-->" -1200 -1200)
+ (";" -1100 -1100)
+ ("->" -1050 -1050)
+ ("," -1000 -1000)
+ ("\\+" -900 -900)
+ ("=" -700 -700)
+ ("\\=" -700 -700)
+ ("=.." -700 -700)
+ ("==" -700 -700)
+ ("\\==" -700 -700)
+ ("@<" -700 -700)
+ ("@=<" -700 -700)
+ ("@>" -700 -700)
+ ("@>=" -700 -700)
+ ("is" -700 -700)
+ ("=:=" -700 -700)
+ ("=\\=" -700 -700)
+ ("<" -700 -700)
+ ("=<" -700 -700)
+ (">" -700 -700)
+ (">=" -700 -700)
+ (":" -600 -600)
+ ("+" -500 -500)
+ ("-" -500 -500)
+ ("/\\" -500 -500)
+ ("\\/" -500 -500)
+ ("*" -400 -400)
+ ("/" -400 -400)
+ ("//" -400 -400)
+ ("rem" -400 -400)
+ ("mod" -400 -400)
+ ("<<" -400 -400)
+ (">>" -400 -400)
+ ("**" -200 -200)
+ ("^" -200 -200)
+ ;; Prefix
+ ;; ("+" 200 200)
+ ;; ("-" 200 200)
+ ;; ("\\" 200 200)
+ )
+ "Precedence levels of infix operators.")
+
+(defconst prolog-smie-indent-rules
+ '((":-")
+ ("->"))
+ "Prolog indentation rules.")
+
(defun prolog-mode-variables ()
(make-local-variable 'paragraph-separate)
(setq paragraph-separate (concat "%%\\|$\\|" page-delimiter)) ;'%%..'
(setq paragraph-ignore-fill-prefix t)
(make-local-variable 'imenu-generic-expression)
(setq imenu-generic-expression '((nil "^\\sw+" 0)))
- (make-local-variable 'indent-line-function)
- (setq indent-line-function 'prolog-indent-line)
+ (smie-setup prolog-smie-op-levels prolog-smie-indent-rules)
+ (set (make-local-variable 'forward-sexp-function)
+ 'smie-forward-sexp-command)
+ (set (make-local-variable 'smie-indent-basic) prolog-indent-width)
(make-local-variable 'comment-start)
(setq comment-start "%")
(make-local-variable 'comment-start-skip)
(define-key map "\C-c\C-l" 'inferior-prolog-load-file)
(define-key map "\C-c\C-z" 'switch-to-prolog)
map))
-
+
(easy-menu-define prolog-mode-menu prolog-mode-map "Menu for Prolog mode."
;; Mostly copied from scheme-mode's menu.
;; Not tremendously useful, but it's a start.
))
;;;###autoload
-(defun prolog-mode ()
+(define-derived-mode prolog-mode prog-mode "Prolog"
"Major mode for editing Prolog code for Prologs.
Blank lines and `%%...' separate paragraphs. `%'s start comments.
Commands:
\\{prolog-mode-map}
Entry to this mode calls the value of `prolog-mode-hook'
if that value is non-nil."
- (interactive)
- (kill-all-local-variables)
- (use-local-map prolog-mode-map)
- (set-syntax-table prolog-mode-syntax-table)
- (setq major-mode 'prolog-mode)
- (setq mode-name "Prolog")
(prolog-mode-variables)
(set (make-local-variable 'comment-add) 1)
- ;; font lock
(setq font-lock-defaults '(prolog-font-lock-keywords
nil nil nil
- beginning-of-line))
- (run-mode-hooks 'prolog-mode-hook))
-
-(defun prolog-indent-line ()
- "Indent current line as Prolog code.
-With argument, indent any additional lines of the same clause
-rigidly along with this one (not yet)."
- (interactive "p")
- (let ((indent (prolog-indent-level))
- (pos (- (point-max) (point))))
- (beginning-of-line)
- (indent-line-to indent)
- (if (> (- (point-max) pos) (point))
- (goto-char (- (point-max) pos)))))
-
-(defun prolog-indent-level ()
- "Compute Prolog indentation level."
- (save-excursion
- (beginning-of-line)
- (skip-chars-forward " \t")
- (cond
- ((looking-at "%%%") 0) ;Large comment starts
- ((looking-at "%[^%]") comment-column) ;Small comment starts
- ((bobp) 0) ;Beginning of buffer
- (t
- (let ((empty t) ind more less)
- (if (looking-at ")")
- (setq less t) ;Find close
- (setq less nil))
- ;; See previous indentation
- (while empty
- (forward-line -1)
- (beginning-of-line)
- (if (bobp)
- (setq empty nil)
- (skip-chars-forward " \t")
- (if (not (or (looking-at "%[^%]") (looking-at "\n")))
- (setq empty nil))))
- (if (bobp)
- (setq ind 0) ;Beginning of buffer
- (setq ind (current-column))) ;Beginning of clause
- ;; See its beginning
- (if (looking-at "%%[^%]")
- ind
- ;; Real prolog code
- (if (looking-at "(")
- (setq more t) ;Find open
- (setq more nil))
- ;; See its tail
- (end-of-prolog-clause)
- (or (bobp) (forward-char -1))
- (cond ((looking-at "[,(;>]")
- (if (and more (looking-at "[^,]"))
- (+ ind prolog-indent-width) ;More indentation
- (max tab-width ind))) ;Same indentation
- ((looking-at "-") tab-width) ;TAB
- ((or less (looking-at "[^.]"))
- (max (- ind prolog-indent-width) 0)) ;Less indentation
- (t 0)) ;No indentation
- )))
- )))
+ beginning-of-line)))
(defun end-of-prolog-clause ()
"Go to end of clause in this line."
(modify-syntax-entry (pop list) (pop list) table))
table)
-(defvar sh-mode-syntax-table nil
- "The syntax table to use for Shell-Script mode.
-This is buffer-local in every such buffer.")
-
-(defvar sh-mode-default-syntax-table
+(defvar sh-mode-syntax-table
(sh-mode-syntax-table ()
?\# "<"
?\n ">#"
?= "."
?< "."
?> ".")
- "Default syntax table for shell mode.")
+ "The syntax table to use for Shell-Script mode.
+This is buffer-local in every such buffer.")
(defvar sh-mode-syntax-table-input
'((sh . nil))
(defvar sh-header-marker nil
"When non-nil is the end of header for prepending by \\[sh-execute-region].
That command is also used for setting this variable.")
-
+(make-variable-buffer-local 'sh-header-marker)
(defcustom sh-beginning-of-command
"\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"
;; mode-command and utility functions
;;;###autoload
-(defun sh-mode ()
+(define-derived-mode sh-mode prog-mode "Shell-script"
"Major mode for editing shell scripts.
This mode works for many shells, since they all have roughly the same syntax,
as far as commands, arguments, variables, pipes, comments etc. are concerned.
If your shell gives error messages with line numbers, you can use \\[executable-interpret]
with your script for an edit-interpret-debug cycle."
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'sh-mode
- mode-name "Shell-script")
- (use-local-map sh-mode-map)
- (make-local-variable 'skeleton-end-hook)
- (make-local-variable 'paragraph-start)
- (make-local-variable 'paragraph-separate)
- (make-local-variable 'comment-start)
- (make-local-variable 'comment-start-skip)
- (make-local-variable 'require-final-newline)
- (make-local-variable 'sh-header-marker)
(make-local-variable 'sh-shell-file)
(make-local-variable 'sh-shell)
- (make-local-variable 'skeleton-pair-alist)
- (make-local-variable 'skeleton-pair-filter-function)
- (make-local-variable 'comint-dynamic-complete-functions)
- (make-local-variable 'comint-prompt-regexp)
- (make-local-variable 'font-lock-defaults)
- (make-local-variable 'skeleton-filter-function)
- (make-local-variable 'skeleton-newline-indent-rigidly)
- (make-local-variable 'sh-shell-variables)
- (make-local-variable 'sh-shell-variables-initialized)
- (make-local-variable 'imenu-generic-expression)
- (make-local-variable 'sh-indent-supported-here)
- (make-local-variable 'skeleton-pair-default-alist)
- (setq skeleton-pair-default-alist sh-skeleton-pair-default-alist)
- (setq skeleton-end-hook (lambda ()
- (or (eolp) (newline) (indent-relative)))
- paragraph-start (concat page-delimiter "\\|$")
- paragraph-separate paragraph-start
- comment-start "# "
- comment-start-skip "#+[\t ]*"
- local-abbrev-table sh-mode-abbrev-table
- comint-dynamic-complete-functions sh-dynamic-complete-functions
- ;; we can't look if previous line ended with `\'
- comint-prompt-regexp "^[ \t]*"
- imenu-case-fold-search nil
- font-lock-defaults
- `((sh-font-lock-keywords
- sh-font-lock-keywords-1 sh-font-lock-keywords-2)
- nil nil
- ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
- (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
- (font-lock-syntactic-face-function
- . sh-font-lock-syntactic-face-function))
- skeleton-pair-alist '((?` _ ?`))
- skeleton-pair-filter-function 'sh-quoted-p
- skeleton-further-elements '((< '(- (min sh-indentation
- (current-column)))))
- skeleton-filter-function 'sh-feature
- skeleton-newline-indent-rigidly t
- sh-indent-supported-here nil)
+
+ (set (make-local-variable 'skeleton-pair-default-alist)
+ sh-skeleton-pair-default-alist)
+ (set (make-local-variable 'skeleton-end-hook)
+ (lambda () (or (eolp) (newline) (indent-relative))))
+
+ (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$"))
+ (set (make-local-variable 'paragraph-separate) paragraph-start)
+ (set (make-local-variable 'comment-start) "# ")
+ (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
+ (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
+ (set (make-local-variable 'comint-dynamic-complete-functions)
+ sh-dynamic-complete-functions)
+ ;; we can't look if previous line ended with `\'
+ (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
+ (set (make-local-variable 'imenu-case-fold-search) nil)
+ (set (make-local-variable 'font-lock-defaults)
+ `((sh-font-lock-keywords
+ sh-font-lock-keywords-1 sh-font-lock-keywords-2)
+ nil nil
+ ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
+ (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
+ (font-lock-syntactic-face-function
+ . sh-font-lock-syntactic-face-function)))
+ (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`)))
+ (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
+ (set (make-local-variable 'skeleton-further-elements)
+ '((< '(- (min sh-indentation (current-column))))))
+ (set (make-local-variable 'skeleton-filter-function) 'sh-feature)
+ (set (make-local-variable 'skeleton-newline-indent-rigidly) t)
+ (set (make-local-variable 'sh-indent-supported-here) nil)
(set (make-local-variable 'defun-prompt-regexp)
(concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
- (set (make-local-variable 'parse-sexp-ignore-comments) t)
;; Parse or insert magic number for exec, and set all variables depending
;; on the shell thus determined.
(sh-set-shell
"sh")
(t
sh-shell-file))
- nil nil)
- (run-mode-hooks 'sh-mode-hook))
+ nil nil))
;;;###autoload
(defalias 'shell-script-mode 'sh-mode)
no-query-flag insert-flag)))
(let ((tem (sh-feature sh-require-final-newline)))
(if (eq tem t)
- (setq require-final-newline mode-require-final-newline)))
- (setq
- mode-line-process (format "[%s]" sh-shell)
- sh-shell-variables nil
- sh-shell-variables-initialized nil
- imenu-generic-expression (sh-feature sh-imenu-generic-expression))
- (make-local-variable 'sh-mode-syntax-table)
+ (set (make-local-variable 'require-final-newline)
+ mode-require-final-newline)))
+ (setq mode-line-process (format "[%s]" sh-shell))
+ (set (make-local-variable 'sh-shell-variables) nil)
+ (set (make-local-variable 'sh-shell-variables-initialized) nil)
+ (set (make-local-variable 'imenu-generic-expression)
+ (sh-feature sh-imenu-generic-expression))
(let ((tem (sh-feature sh-mode-syntax-table-input)))
- (setq sh-mode-syntax-table
- (if tem (apply 'sh-mode-syntax-table tem)
- sh-mode-default-syntax-table)))
- (set-syntax-table sh-mode-syntax-table)
+ (when tem
+ (set (make-local-variable 'sh-mode-syntax-table)
+ (apply 'sh-mode-syntax-table tem))
+ (set-syntax-table sh-mode-syntax-table)))
(dolist (var (sh-feature sh-variables))
(sh-remember-variable var))
- (make-local-variable 'indent-line-function)
(if (setq sh-indent-supported-here (sh-feature sh-indent-supported))
(progn
(message "Setting up indent for shell type %s" sh-shell)
(message "setting up indent stuff")
;; sh-mode has already made indent-line-function local
;; but do it in case this is called before that.
- (setq indent-line-function 'sh-indent-line)
+ (set (make-local-variable 'indent-line-function) 'sh-indent-line)
(if sh-make-vars-local
(sh-make-vars-local))
(message "Indentation setup for shell type %s" sh-shell))
nil means to return the best completion of STRING, or nil if there is none.
t means to return a list of all possible completions of STRING.
`lambda' means to return t if STRING is a valid completion as it stands."
- (let ((sh-shell-variables
+ (let ((vars
(with-current-buffer sh-add-buffer
(or sh-shell-variables-initialized
(sh-shell-initialize-variables))
(nconc (mapcar (lambda (var)
- (let ((name
- (substring var 0 (string-match "=" var))))
- (cons name name)))
+ (substring var 0 (string-match "=" var)))
process-environment)
sh-shell-variables))))
- (case code
- ((nil) (try-completion string sh-shell-variables predicate))
- (lambda (test-completion string sh-shell-variables predicate))
- (t (all-completions string sh-shell-variables predicate)))))
+ (complete-with-action code vars string predicate)))
(defun sh-add (var delta)
"Insert an addition of VAR and prefix DELTA for Bourne (type) shell."
;; Author: Alex Schroeder <alex@gnu.org>
;; Maintainer: Michael Mauger <mmaug@yahoo.com>
-;; Version: 2.0.2
+;; Version: 2.1
;; Keywords: comm languages processes
;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el
;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
;; identifiers; ms (Microsoft SQLServer) also supports identifiers
;; enclosed within brackets [].
-;; ChangeLog available on request.
-
;;; Product Support:
;; To add support for additional SQL products the following steps
;; must be followed ("xyz" is the name of the product in the examples
;; below):
-;; 1) Add the product to `sql-product' choice list.
+;; 1) Add the product to the list of known products.
-;; (const :tag "XyzDB" xyz)
+;; (sql-add-product 'xyz "XyzDB"
+;; '(:free-software t))
-;; 2) Add an entry to the `sql-product-alist' list.
+;; 2) Define font lock settings. All ANSI keywords will be
+;; highlighted automatically, so only product specific keywords
+;; need to be defined here.
-;; (xyz
-;; :font-lock sql-mode-xyz-font-lock-keywords
-;; :sqli-login (user password server database)
-;; :sqli-connect sql-connect-xyz
-;; :sqli-prompt-regexp "^xyzdb> "
-;; :sqli-prompt-length 7
-;; :sqli-input-sender nil
-;; :syntax-alist ((?# . "w")))
+;; (defvar my-sql-mode-xyz-font-lock-keywords
+;; '(("\\b\\(red\\|orange\\|yellow\\)\\b"
+;; . font-lock-keyword-face))
+;; "XyzDB SQL keywords used by font-lock.")
-;; 3) Add customizable values for the product interpreter and options.
+;; (sql-set-product-feature 'xyz
+;; :font-lock
+;; 'my-sql-mode-xyz-font-lock-keywords)
-;; ;; Customization for XyzDB
-;;
-;; (defcustom sql-xyz-program "ixyz"
-;; "*Command to start ixyz by XyzDB."
+;; 3) Define any special syntax characters including comments and
+;; identifier characters.
+
+;; (sql-set-product-feature 'xyz
+;; :syntax-alist ((?# . "w")))
+
+;; 4) Define the interactive command interpreter for the database
+;; product.
+
+;; (defcustom my-sql-xyz-program "ixyz"
+;; "Command to start ixyz by XyzDB."
;; :type 'file
;; :group 'SQL)
;;
-;; (defcustom sql-xyz-options '("-X" "-Y" "-Z")
-;; "*List of additional options for `sql-xyz-program'."
-;; :type '(repeat string)
+;; (sql-set-product-feature 'xyz
+;; :sqli-program 'my-sql-xyz-program)
+;; (sql-set-product-feature 'xyz
+;; :prompt-regexp "^xyzdb> ")
+;; (sql-set-product-feature 'xyz
+;; :prompt-length 7)
+
+;; 5) Define login parameters and command line formatting.
+
+;; (defcustom my-sql-xyz-login-params '(user password server database)
+;; "Login parameters to needed to connect to XyzDB."
+;; :type '(repeat (choice
+;; (const user)
+;; (const password)
+;; (const server)
+;; (const database)))
;; :group 'SQL)
+;;
+;; (sql-set-product-feature 'xyz
+;; :sqli-login 'my-sql-xyz-login-params)
-;; 4) Add an entry to SQL->Product submenu.
-
-;; ["XyzDB" sql-highlight-xyz-keywords
-;; :style radio
-;; :selected (eq sql-product 'xyz)]
-
-;; 5) Add the font-lock specifications. At a minimum, default to
-;; using ANSI keywords. See sql-mode-oracle-font-lock-keywords for
-;; a more complex example.
-
-;; (defvar sql-mode-xyz-font-lock-keywords nil
-;; "XyzDB SQL keywords used by font-lock.")
-
-;; 6) Add a product highlighting function.
-
-;; (defun sql-highlight-xyz-keywords ()
-;; "Highlight XyzDB keywords."
-;; (interactive)
-;; (sql-set-product 'xyz))
-
-;; 7) Add an autoloaded SQLi function.
-
-;; ;;;###autoload
-;; (defun sql-xyz ()
-;; "Run ixyz by XyzDB as an inferior process."
-;; (interactive)
-;; (sql-product-interactive 'xyz))
-
-;; 8) Add a connect function which formats the command line arguments
-;; and starts the product interpreter in a comint buffer. See the
-;; existing connect functions for examples of the types of
-;; processing available.
+;; (defcustom my-sql-xyz-options '("-X" "-Y" "-Z")
+;; "List of additional options for `sql-xyz-program'."
+;; :type '(repeat string)
+;; :group 'SQL)
+;;
+;; (sql-set-product-feature 'xyz
+;; :sqli-options 'my-sql-xyz-options))
-;; (defun sql-connect-xyz ()
-;; "Create comint buffer and connect to XyzDB using the login
-;; parameters and command options."
+;; (defun my-sql-connect-xyz (product options)
+;; "Connect ti XyzDB in a comint buffer."
;;
;; ;; Do something with `sql-user', `sql-password',
;; ;; `sql-database', and `sql-server'.
-;; (let ((params sql-xyz-options))
+;; (let ((params options))
;; (if (not (string= "" sql-server))
;; (setq params (append (list "-S" sql-server) params)))
;; (if (not (string= "" sql-database))
;; (setq params (append (list "-P" sql-password) params)))
;; (if (not (string= "" sql-user))
;; (setq params (append (list "-U" sql-user) params)))
-;; (set-buffer (apply 'make-comint "SQL" sql-xyz-program
-;; nil params))))
+;; (sql-connect product params)))
+;;
+;; (sql-set-product-feature 'xyz
+;; :sqli-connect-func 'my-sql-connect-xyz)
-;; 9) Save and compile sql.el.
+;; 6) Define a convienence function to invoke the SQL interpreter.
+
+;; (defun my-sql-xyz ()
+;; "Run ixyz by XyzDB as an inferior process."
+;; (interactive)
+;; (sql-product-interactive 'xyz))
;;; To Do:
-;; Add better hilight support for other brands; there is a bias towards
-;; Oracle because that's what I use at work. Anybody else just send in
-;; your lists of reserved words, keywords and builtin functions! As
-;; long as I don't receive any feedback, everything is hilighted with
-;; ANSI keywords only. I received the list of ANSI keywords from a
-;; user; if you know of any changes, let me know.
+;; Improve keyword highlighting for individual products. I have tried
+;; to update those database that I use. Feel free to send me updates,
+;; or direct me to the reference manuals for your favorite database.
-;; Add different hilighting levels.
+;; When there are no keywords defined, the ANSI keywords are
+;; highlighted. ANSI keywords are highlighted even if the keyword is
+;; not used for your current product. This should help identify
+;; portability concerns.
+
+;; Add different highlighting levels.
+
+;; Add support for listing available tables or the columns in a table.
;;; Thanks to all the people who helped me out:
-;; Alex Schroeder <alex@gnu.org>
+;; Alex Schroeder <alex@gnu.org> -- the original author
;; Kai Blauberg <kai.blauberg@metla.fi>
;; <ibalaban@dalet.com>
;; Yair Friedman <yfriedma@JohnBryce.Co.Il>
;; Michael Mauger <mmaug@yahoo.com> -- improved product support
;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support
;; Harald Maier <maierh@myself.com> -- sql-send-string
-;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections
+;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish
\f
(defgroup SQL nil
"Running a SQL interpreter from within Emacs buffers."
:version "20.4"
+ :group 'languages
:group 'processes)
;; These four variables will be used as defaults, if set.
(defcustom sql-user ""
- "*Default username."
+ "Default username."
:type 'string
:group 'SQL)
+(put 'sql-user 'safe-local-variable 'stringp)
(defcustom sql-password ""
- "*Default password.
+ "Default password.
Storing your password in a textfile such as ~/.emacs could be dangerous.
Customizing your password will store it in your ~/.emacs file."
:type 'string
:group 'SQL)
+(put 'sql-password 'risky-local-variable t)
(defcustom sql-database ""
- "*Default database."
+ "Default database."
:type 'string
:group 'SQL)
+(put 'sql-database 'safe-local-variable 'stringp)
(defcustom sql-server ""
- "*Default server or host."
+ "Default server or host."
:type 'string
:group 'SQL)
+(put 'sql-server 'safe-local-variable 'stringp)
+
+(defcustom sql-port nil
+ "Default server or host."
+ :type 'number
+ :group 'SQL)
+(put 'sql-port 'safe-local-variable 'numberp)
;; SQL Product support
'((ansi
:name "ANSI"
:font-lock sql-mode-ansi-font-lock-keywords)
+
(db2
:name "DB2"
:font-lock sql-mode-db2-font-lock-keywords
- :sqli-login nil
- :sqli-connect sql-connect-db2
- :sqli-prompt-regexp "^db2 => "
- :sqli-prompt-length 7)
+ :sqli-program sql-db2-program
+ :sqli-options sql-db2-options
+ :sqli-login sql-db2-login-params
+ :sqli-connect-func sql-connect-db2
+ :prompt-regexp "^db2 => "
+ :prompt-length 7
+ :input-filter sql-escape-newlines-filter)
+
(informix
+ :name "Informix"
:font-lock sql-mode-informix-font-lock-keywords
- :sqli-login (database)
- :sqli-connect sql-connect-informix
- :sqli-prompt-regexp "^SQL> "
- :sqli-prompt-length 5)
+ :sqli-program sql-informix-program
+ :sqli-options sql-informix-options
+ :sqli-login sql-informix-login-params
+ :sqli-connect-func sql-connect-informix
+ :prompt-regexp "^> "
+ :prompt-length 2
+ :syntax-alist ((?{ . "<") (?} . ">")))
+
(ingres
+ :name "Ingres"
:font-lock sql-mode-ingres-font-lock-keywords
- :sqli-login (database)
- :sqli-connect sql-connect-ingres
- :sqli-prompt-regexp "^\* "
- :sqli-prompt-length 2)
+ :sqli-program sql-ingres-program
+ :sqli-options sql-ingres-options
+ :sqli-login sql-ingres-login-params
+ :sqli-connect-func sql-connect-ingres
+ :prompt-regexp "^\* "
+ :prompt-length 2)
+
(interbase
+ :name "Interbase"
:font-lock sql-mode-interbase-font-lock-keywords
- :sqli-login (user password database)
- :sqli-connect sql-connect-interbase
- :sqli-prompt-regexp "^SQL> "
- :sqli-prompt-length 5)
+ :sqli-program sql-interbase-program
+ :sqli-options sql-interbase-options
+ :sqli-login sql-interbase-login-params
+ :sqli-connect-func sql-connect-interbase
+ :prompt-regexp "^SQL> "
+ :prompt-length 5)
+
(linter
+ :name "Linter"
:font-lock sql-mode-linter-font-lock-keywords
- :sqli-login (user password database server)
- :sqli-connect sql-connect-linter
- :sqli-prompt-regexp "^SQL>"
- :sqli-prompt-length 4)
+ :sqli-program sql-linter-program
+ :sqli-options sql-linter-options
+ :sqli-login sql-linter-login-params
+ :sqli-connect-func sql-connect-linter
+ :prompt-regexp "^SQL>"
+ :prompt-length 4)
+
(ms
- :name "MS SQLServer"
+ :name "Microsoft"
:font-lock sql-mode-ms-font-lock-keywords
- :sqli-login (user password server database)
- :sqli-connect sql-connect-ms
- :sqli-prompt-regexp "^[0-9]*>"
- :sqli-prompt-length 5
- :syntax-alist ((?@ . "w")))
+ :sqli-program sql-ms-program
+ :sqli-options sql-ms-options
+ :sqli-login sql-ms-login-params
+ :sqli-connect-func sql-connect-ms
+ :prompt-regexp "^[0-9]*>"
+ :prompt-length 5
+ :syntax-alist ((?@ . "w"))
+ :terminator ("^go" . "go"))
+
(mysql
:name "MySQL"
+ :free-software t
:font-lock sql-mode-mysql-font-lock-keywords
- :sqli-login (user password database server)
- :sqli-connect sql-connect-mysql
- :sqli-prompt-regexp "^mysql> "
- :sqli-prompt-length 6)
+ :sqli-program sql-mysql-program
+ :sqli-options sql-mysql-options
+ :sqli-login sql-mysql-login-params
+ :sqli-connect-func sql-connect-mysql
+ :prompt-regexp "^mysql> "
+ :prompt-length 6
+ :input-filter sql-remove-tabs-filter)
+
(oracle
+ :name "Oracle"
:font-lock sql-mode-oracle-font-lock-keywords
- :sqli-login (user password database)
- :sqli-connect sql-connect-oracle
- :sqli-prompt-regexp "^SQL> "
- :sqli-prompt-length 5
- :syntax-alist ((?$ . "w") (?# . "w")))
+ :sqli-program sql-oracle-program
+ :sqli-options sql-oracle-options
+ :sqli-login sql-oracle-login-params
+ :sqli-connect-func sql-connect-oracle
+ :prompt-regexp "^SQL> "
+ :prompt-length 5
+ :syntax-alist ((?$ . "w") (?# . "w"))
+ :terminator ("\\(^/\\|;\\)" . "/")
+ :input-filter sql-placeholders-filter)
+
(postgres
+ :name "Postgres"
+ :free-software t
:font-lock sql-mode-postgres-font-lock-keywords
- :sqli-login (user database server)
- :sqli-connect sql-connect-postgres
- :sqli-prompt-regexp "^.*[#>] *"
- :sqli-prompt-length 5)
+ :sqli-program sql-postgres-program
+ :sqli-options sql-postgres-options
+ :sqli-login sql-postgres-login-params
+ :sqli-connect-func sql-connect-postgres
+ :prompt-regexp "^.*[#>] *"
+ :prompt-length 5
+ :input-filter sql-remove-tabs-filter
+ :terminator ("\\(^[\\]g\\|;\\)" . ";"))
+
(solid
+ :name "Solid"
:font-lock sql-mode-solid-font-lock-keywords
- :sqli-login (user password server)
- :sqli-connect sql-connect-solid
- :sqli-prompt-regexp "^"
- :sqli-prompt-length 0)
+ :sqli-program sql-solid-program
+ :sqli-options sql-solid-options
+ :sqli-login sql-solid-login-params
+ :sqli-connect-func sql-connect-solid
+ :prompt-regexp "^"
+ :prompt-length 0)
+
(sqlite
:name "SQLite"
+ :free-software t
:font-lock sql-mode-sqlite-font-lock-keywords
- :sqli-login (database)
- :sqli-connect sql-connect-sqlite
- :sqli-prompt-regexp "^sqlite> "
- :sqli-prompt-length 8)
+ :sqli-program sql-sqlite-program
+ :sqli-options sql-sqlite-options
+ :sqli-login sql-sqlite-login-params
+ :sqli-connect-func sql-connect-sqlite
+ :prompt-regexp "^sqlite> "
+ :prompt-length 8)
+
(sybase
+ :name "Sybase"
:font-lock sql-mode-sybase-font-lock-keywords
- :sqli-login (server user password database)
- :sqli-connect sql-connect-sybase
- :sqli-prompt-regexp "^SQL> "
- :sqli-prompt-length 5
- :syntax-alist ((?@ . "w")))
+ :sqli-program sql-sybase-program
+ :sqli-options sql-sybase-options
+ :sqli-login sql-sybase-login-params
+ :sqli-connect-func sql-connect-sybase
+ :prompt-regexp "^SQL> "
+ :prompt-length 5
+ :syntax-alist ((?@ . "w"))
+ :terminator ("^go" . "go"))
)
- "This variable contains a list of product features for each of the
-SQL products handled by `sql-mode'. Without an entry in this list a
-product will not be properly highlighted and will not support
-`sql-interactive-mode'.
+ "An alist of product specific configuration settings.
+
+Without an entry in this list a product will not be properly
+highlighted and will not support `sql-interactive-mode'.
Each element in the list is in the following format:
\(PRODUCT FEATURE VALUE ...)
-where PRODUCT is the appropriate value of `sql-product'. The product
-name is then followed by FEATURE-VALUE pairs. If a FEATURE is not
-specified, its VALUE is treated as nil. FEATURE must be one of the
-following:
+where PRODUCT is the appropriate value of `sql-product'. The
+product name is then followed by FEATURE-VALUE pairs. If a
+FEATURE is not specified, its VALUE is treated as nil. FEATURE
+may be any one of the following:
+
+ :name string containing the displayable name of
+ the product.
+
+ :free-software is the product Free (as in Freedom) software?
:font-lock name of the variable containing the product
specific font lock highlighting patterns.
- :sqli-login a list of login parameters (i.e., user,
- password, database and server) needed to
- connect to the database.
+ :sqli-program name of the variable containing the product
+ specific interactive program name.
+
+ :sqli-options name of the variable containing the list
+ of product specific options.
- :sqli-connect the name of a function which accepts no
+ :sqli-login name of the variable containing the list of
+ login parameters (i.e., user, password,
+ database and server) needed to connect to
+ the database.
+
+ :sqli-connect-func name of a function which accepts no
parameters that will use the values of
`sql-user', `sql-password',
`sql-database' and `sql-server' to open a
database. Do product specific
configuration of comint in this function.
- :sqli-prompt-regexp a regular expression string that matches
+ :prompt-regexp regular expression string that matches
the prompt issued by the product
- interpreter. (Not needed in 21.3+)
-
- :sqli-prompt-length the length of the prompt on the line.(Not
- needed in 21.3+)
-
- :syntax-alist an alist of syntax table entries to enable
- special character treatment by font-lock and
- imenu. ")
+ interpreter.
+
+ :prompt-length length of the prompt on the line.
+
+ :input-filter function which can filter strings sent to
+ the command interpreter. It is also used
+ by the `sql-send-string',
+ `sql-send-region', `sql-send-paragraph'
+ and `sql-send-buffer' functions. The
+ function is passed the string sent to the
+ command interpreter and must return the
+ filtered string.
+
+ :terminator the terminator to be sent after a
+ `sql-send-string', `sql-send-region',
+ `sql-send-paragraph' and
+ `sql-send-buffer' command. May be the
+ literal string or a cons of a regexp to
+ match an existing terminator in the
+ string and the terminator to be used if
+ its absent. By default \";\".
+
+ :syntax-alist alist of syntax table entries to enable
+ special character treatment by font-lock
+ and imenu.
+
+Other features can be stored but they will be ignored. However,
+you can develop new functionality which is product independent by
+using `sql-get-product-feature' to lookup the product specific
+settings.")
+
+(defvar sql-indirect-features
+ '(:font-lock :sqli-program :sqli-options :sqli-login))
+;;;###autoload
(defcustom sql-product 'ansi
- "*Select the SQL database product used so that buffers can be
+ "Select the SQL database product used so that buffers can be
highlighted properly when you open them."
:type `(choice
,@(mapcar (lambda (prod-info)
,(car prod-info)))
sql-product-alist))
:group 'SQL)
+(put 'sql-product 'safe-local-variable 'symbolp)
-;; misc customization of sql.el behavior
+(defvar sql-interactive-product nil
+ "Product under `sql-interactive-mode'.")
+
+;; misc customization of sql.el behaviour
(defcustom sql-electric-stuff nil
"Treat some input as electric.
:version "20.8"
:group 'SQL)
-(defcustom sql-pop-to-buffer-after-send-region nil
- "*If t, pop to the buffer SQL statements are sent to.
+(defcustom sql-send-terminator nil
+ "When non-nil, add a terminator to text sent to the SQL interpreter.
+
+When text is sent to the SQL interpreter (via `sql-send-string',
+`sql-send-region', `sql-send-paragraph' or `sql-send-buffer'), a
+command terminator can be automatically sent as well. The
+terminator is not sent, if the string sent already ends with the
+terminator.
+
+If this value is t, then the default command terminator for the
+SQL interpreter is sent. If this value is a string, then the
+string is sent.
+
+If the value is a cons cell of the form (PAT . TERM), then PAT is
+a regexp used to match the terminator in the string and TERM is
+the terminator to be sent. This form is useful if the SQL
+interpreter has more than one way of submitting a SQL command.
+The PAT regexp can match any of them, and TERM is the way we do
+it automatically."
+
+ :type '(choice (const :tag "No Terminator" nil)
+ (const :tag "Default Terminator" t)
+ (string :tag "Terminator String")
+ (cons :tag "Terminator Pattern and String"
+ (string :tag "Terminator Pattern")
+ (string :tag "Terminator String")))
+ :version "22.2"
+ :group 'SQL)
-After a call to `sql-send-region' or `sql-send-buffer',
-the window is split and the SQLi buffer is shown. If this
-variable is not nil, that buffer's window will be selected
-by calling `pop-to-buffer'. If this variable is nil, that
-buffer is shown using `display-buffer'."
+(defcustom sql-pop-to-buffer-after-send-region nil
+ "When non-nil, pop to the buffer SQL statements are sent to.
+
+After a call to `sql-sent-string', `sql-send-region',
+`sql-send-paragraph' or `sql-send-buffer', the window is split
+and the SQLi buffer is shown. If this variable is not nil, that
+buffer's window will be selected by calling `pop-to-buffer'. If
+this variable is nil, that buffer is shown using
+`display-buffer'."
:type 'boolean
:group 'SQL)
("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3)
("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4)
("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
+ ("Types" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*type\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2)
("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3))
"Define interesting points in the SQL buffer for `imenu'.
;; history file
(defcustom sql-input-ring-file-name nil
- "*If non-nil, name of the file to read/write input history.
+ "If non-nil, name of the file to read/write input history.
You have to set this variable if you want the history of your commands
saved from one Emacs session to the next. If this variable is set,
:group 'SQL)
(defcustom sql-input-ring-separator "\n--\n"
- "*Separator between commands in the history file.
+ "Separator between commands in the history file.
If set to \"\\n\", each line in the history file will be interpreted as
one command. Multi-line commands are split into several commands when
;; The usual hooks
(defcustom sql-interactive-mode-hook '()
- "*Hook for customizing `sql-interactive-mode'."
+ "Hook for customizing `sql-interactive-mode'."
:type 'hook
:group 'SQL)
(defcustom sql-mode-hook '()
- "*Hook for customizing `sql-mode'."
+ "Hook for customizing `sql-mode'."
:type 'hook
:group 'SQL)
(defcustom sql-set-sqli-hook '()
- "*Hook for reacting to changes of `sql-buffer'.
+ "Hook for reacting to changes of `sql-buffer'.
This is called by `sql-set-sqli-buffer' when the value of `sql-buffer'
is changed."
;; Customization for Oracle
(defcustom sql-oracle-program "sqlplus"
- "*Command to start sqlplus by Oracle.
+ "Command to start sqlplus by Oracle.
Starts `sql-interactive-mode' after doing some setup.
-On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to
-start the sqlplus console, use \"plus33\" or something similar. You
-will find the file in your Orant\\bin directory.
-
-The program can also specify a TCP connection. See `make-comint'."
+On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order
+to start the sqlplus console, use \"plus33\" or something similar.
+You will find the file in your Orant\\bin directory."
:type 'file
:group 'SQL)
(defcustom sql-oracle-options nil
- "*List of additional options for `sql-oracle-program'."
+ "List of additional options for `sql-oracle-program'."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-oracle-login-params '(user password database)
+ "List of login parameters needed to connect to Oracle."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
+(defcustom sql-oracle-scan-on t
+ "Non-nil if placeholders should be replaced in Oracle SQLi.
+
+When non-nil, Emacs will scan text sent to sqlplus and prompt
+for replacement text for & placeholders as sqlplus does. This
+is needed on Windows where sqlplus output is buffered and the
+prompts are not shown until after the text is entered.
+
+You will probably want to issue the following command in sqlplus
+to be safe:
+
+ SET SCAN OFF"
+ :type 'boolean
+ :group 'SQL)
+
;; Customization for SQLite
(defcustom sql-sqlite-program "sqlite"
- "*Command to start SQLite.
-
-Starts `sql-interactive-mode' after doing some setup.
+ "Command to start SQLite.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-sqlite-options nil
- "*List of additional options for `sql-sqlite-program'."
+ "List of additional options for `sql-sqlite-program'."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-sqlite-login-params '(database)
+ "List of login parameters needed to connect to SQLite."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for MySql
(defcustom sql-mysql-program "mysql"
- "*Command to start mysql by TcX.
+ "Command to start mysql by TcX.
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-mysql-options nil
- "*List of additional options for `sql-mysql-program'.
+ "List of additional options for `sql-mysql-program'.
The following list of options is reported to make things work
on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-mysql-login-params '(user password database server)
+ "List of login parameters needed to connect to MySql."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)
+ (const port)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Solid
(defcustom sql-solid-program "solsql"
- "*Command to start SOLID SQL Editor.
+ "Command to start SOLID SQL Editor.
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
-;; Customization for SyBase
+(defcustom sql-solid-login-params '(user password server)
+ "List of login parameters needed to connect to Solid."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
-(defcustom sql-sybase-program "isql"
- "*Command to start isql by SyBase.
+;; Customization for Sybase
-Starts `sql-interactive-mode' after doing some setup.
+(defcustom sql-sybase-program "isql"
+ "Command to start isql by Sybase.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-sybase-options nil
- "*List of additional options for `sql-sybase-program'.
+ "List of additional options for `sql-sybase-program'.
Some versions of isql might require the -n option in order to work."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-sybase-login-params '(server user password database)
+ "List of login parameters needed to connect to Sybase."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Informix
(defcustom sql-informix-program "dbaccess"
- "*Command to start dbaccess by Informix.
-
-Starts `sql-interactive-mode' after doing some setup.
+ "Command to start dbaccess by Informix.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
+(defcustom sql-informix-login-params '(database)
+ "List of login parameters needed to connect to Informix."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Ingres
(defcustom sql-ingres-program "sql"
- "*Command to start sql by Ingres.
-
-Starts `sql-interactive-mode' after doing some setup.
+ "Command to start sql by Ingres.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
+(defcustom sql-ingres-login-params '(database)
+ "List of login parameters needed to connect to Ingres."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Microsoft
(defcustom sql-ms-program "osql"
- "*Command to start osql by Microsoft.
+ "Command to start osql by Microsoft.
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-ms-options '("-w" "300" "-n")
;; -w is the linesize
- "*List of additional options for `sql-ms-program'."
+ "List of additional options for `sql-ms-program'."
:type '(repeat string)
:version "22.1"
:group 'SQL)
+(defcustom sql-ms-login-params '(user password server database)
+ "List of login parameters needed to connect to Microsoft."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Postgres
(defcustom sql-postgres-program "psql"
"Command to start psql by Postgres.
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-postgres-options '("-P" "pager=off")
- "*List of additional options for `sql-postgres-program'.
+ "List of additional options for `sql-postgres-program'.
The default setting includes the -P option which breaks older versions
of the psql client (such as version 6.5.3). The -P option is equivalent
to the --pset option. If you want the psql to prompt you for a user
:version "20.8"
:group 'SQL)
+(defcustom sql-postgres-login-params '(user database server)
+ "List of login parameters needed to connect to Postgres."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Interbase
(defcustom sql-interbase-program "isql"
- "*Command to start isql by Interbase.
-
-Starts `sql-interactive-mode' after doing some setup.
+ "Command to start isql by Interbase.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-interbase-options nil
- "*List of additional options for `sql-interbase-program'."
+ "List of additional options for `sql-interbase-program'."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-interbase-login-params '(user password database)
+ "List of login parameters needed to connect to Interbase."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for DB2
(defcustom sql-db2-program "db2"
- "*Command to start db2 by IBM.
-
-Starts `sql-interactive-mode' after doing some setup.
+ "Command to start db2 by IBM.
-The program can also specify a TCP connection. See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-db2-options nil
- "*List of additional options for `sql-db2-program'."
+ "List of additional options for `sql-db2-program'."
:type '(repeat string)
:version "20.8"
:group 'SQL)
+(defcustom sql-db2-login-params nil
+ "List of login parameters needed to connect to DB2."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
;; Customization for Linter
(defcustom sql-linter-program "inl"
- "*Command to start inl by RELEX.
+ "Command to start inl by RELEX.
Starts `sql-interactive-mode' after doing some setup."
:type 'file
:group 'SQL)
(defcustom sql-linter-options nil
- "*List of additional options for `sql-linter-program'."
+ "List of additional options for `sql-linter-program'."
:type '(repeat string)
:version "21.3"
:group 'SQL)
+(defcustom sql-linter-login-params '(user password database server)
+ "Login parameters to needed to connect to Linter."
+ :type '(repeat (choice
+ (const user)
+ (const password)
+ (const server)
+ (const database)))
+ :version "24.1"
+ :group 'SQL)
+
\f
;;; Variables which do not need customization
(defvar sql-server-history nil
"History of servers used.")
+(defvar sql-port-history nil
+ "History of ports used.")
+
;; Passwords are not kept in a history.
(defvar sql-buffer nil
(define-key map (kbd "C-c C-r") 'sql-send-region)
(define-key map (kbd "C-c C-s") 'sql-send-string)
(define-key map (kbd "C-c C-b") 'sql-send-buffer)
+ (define-key map (kbd "C-c C-i") 'sql-product-interactive)
map)
"Mode map used for `sql-mode'.")
`("SQL"
["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer)
(get-buffer-process sql-buffer))]
- ["Send Region" sql-send-region (and (or (and (boundp 'mark-active); Emacs
- mark-active)
- (mark t)); XEmacs
+ ["Send Region" sql-send-region (and mark-active
(buffer-live-p sql-buffer)
(get-buffer-process sql-buffer))]
["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer)
(get-buffer-process sql-buffer))]
- ["Send String" sql-send-string t]
+ ["Send String" sql-send-string (and (buffer-live-p sql-buffer)
+ (get-buffer-process sql-buffer))]
["--" nil nil]
- ["Start SQLi session" sql-product-interactive (sql-product-feature :sqli-connect)]
+ ["Start SQLi session" sql-product-interactive (sql-get-product-feature sql-product :sqli-connect-func)]
["Show SQLi buffer" sql-show-sqli-buffer t]
["Set SQLi buffer" sql-set-sqli-buffer t]
["Pop to SQLi buffer after send"
statement. The format of variable should be a valid
`font-lock-keywords' entry.")
-(defmacro sql-keywords-re (&rest keywords)
- "Compile-time generation of regexp matching any one of KEYWORDS."
- `(eval-when-compile
- (concat "\\b"
- (regexp-opt ',keywords t)
- "\\b")))
+;; While there are international and American standards for SQL, they
+;; are not followed closely, and most vendors offer significant
+;; capabilities beyond those defined in the standard specifications.
+
+;; SQL mode provides support for hilighting based on the product. In
+;; addition to hilighting the product keywords, any ANSI keywords not
+;; used by the product are also hilighted. This will help identify
+;; keywords that could be restricted in future versions of the product
+;; or might be a problem if ported to another product.
+
+;; To reduce the complexity and size of the regular expressions
+;; generated to match keywords, ANSI keywords are filtered out of
+;; product keywords if they are equivalent. To do this, we define a
+;; function `sql-font-lock-keywords-builder' that removes any keywords
+;; that are matched by the ANSI patterns and results in the same face
+;; being applied. For this to work properly, we must play some games
+;; with the execution and compile time behavior. This code is a
+;; little tricky but works properly.
+
+;; When defining the keywords for individual products you should
+;; include all of the keywords that you want matched. The filtering
+;; against the ANSI keywords will be automatic if you use the
+;; `sql-font-lock-keywords-builder' function and follow the
+;; implementation pattern used for the other products in this file.
-(defvar sql-mode-ansi-font-lock-keywords
- (let ((ansi-funcs (sql-keywords-re
-"abs" "avg" "bit_length" "cardinality" "cast" "char_length"
-"character_length" "coalesce" "convert" "count" "current_date"
-"current_path" "current_role" "current_time" "current_timestamp"
-"current_user" "extract" "localtime" "localtimestamp" "lower" "max"
-"min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
-"substring" "sum" "system_user" "translate" "treat" "trim" "upper"
-"user"
-))
+(eval-when-compile
+ (defvar sql-mode-ansi-font-lock-keywords)
+ (setq sql-mode-ansi-font-lock-keywords nil))
+
+(eval-and-compile
+ (defun sql-font-lock-keywords-builder (face boundaries &rest keywords)
+ "Generation of regexp matching any one of KEYWORDS."
+
+ (let ((bdy (or boundaries '("\\b" . "\\b")))
+ kwd)
+
+ ;; Remove keywords that are defined in ANSI
+ (setq kwd keywords)
+ (dolist (k keywords)
+ (catch 'next
+ (dolist (a sql-mode-ansi-font-lock-keywords)
+ (when (and (eq face (cdr a))
+ (eq (string-match (car a) k 0) 0)
+ (eq (match-end 0) (length k)))
+ (setq kwd (delq k kwd))
+ (throw 'next nil)))))
+
+ ;; Create a properly formed font-lock-keywords item
+ (cons (concat (car bdy)
+ (regexp-opt kwd t)
+ (cdr bdy))
+ face))))
- (ansi-non-reserved (sql-keywords-re
+(eval-when-compile
+ (setq sql-mode-ansi-font-lock-keywords
+ (list
+ ;; ANSI Non Reserved keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"ada" "asensitive" "assignment" "asymmetric" "atomic" "between"
"bitvar" "called" "catalog_name" "chain" "character_set_catalog"
"character_set_name" "character_set_schema" "checked" "class_origin"
"trigger_name" "trigger_schema" "type" "uncommitted" "unnamed"
"user_defined_type_catalog" "user_defined_type_name"
"user_defined_type_schema"
-))
-
- (ansi-reserved (sql-keywords-re
+)
+ ;; ANSI Reserved keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"absolute" "action" "add" "admin" "after" "aggregate" "alias" "all"
"allocate" "alter" "and" "any" "are" "as" "asc" "assertion" "at"
"authorization" "before" "begin" "both" "breadth" "by" "call"
"trigger" "true" "under" "union" "unique" "unknown" "unnest" "update"
"usage" "using" "value" "values" "variable" "view" "when" "whenever"
"where" "with" "without" "work" "write" "year"
-))
+)
- (ansi-types (sql-keywords-re
+ ;; ANSI Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
+"abs" "avg" "bit_length" "cardinality" "cast" "char_length"
+"character_length" "coalesce" "convert" "count" "current_date"
+"current_path" "current_role" "current_time" "current_timestamp"
+"current_user" "extract" "localtime" "localtimestamp" "lower" "max"
+"min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
+"substring" "sum" "system_user" "translate" "treat" "trim" "upper"
+"user"
+)
+ ;; ANSI Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
"array" "binary" "bit" "blob" "boolean" "char" "character" "clob"
"date" "dec" "decimal" "double" "float" "int" "integer" "interval"
"large" "national" "nchar" "nclob" "numeric" "object" "precision"
"real" "ref" "row" "scope" "smallint" "time" "timestamp" "varchar"
"varying" "zone"
-)))
-
- `((,ansi-non-reserved . font-lock-keyword-face)
- (,ansi-reserved . font-lock-keyword-face)
- (,ansi-funcs . font-lock-builtin-face)
- (,ansi-types . font-lock-type-face)))
+))))
+(defvar sql-mode-ansi-font-lock-keywords
+ (eval-when-compile sql-mode-ansi-font-lock-keywords)
"ANSI SQL keywords used by font-lock.
This variable is used by `sql-mode' and `sql-interactive-mode'. The
to add functions and PL/SQL keywords.")
(defvar sql-mode-oracle-font-lock-keywords
- (let ((oracle-functions (sql-keywords-re
+ (eval-when-compile
+ (list
+ ;; Oracle SQL*Plus Commands
+ (cons
+ (concat
+ "^\\(?:\\(?:" (regexp-opt '(
+"@" "@@" "accept" "append" "archive" "attribute" "break"
+"btitle" "change" "clear" "column" "connect" "copy" "define"
+"del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
+"host" "input" "list" "password" "pause" "print" "prompt" "recover"
+"remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
+"spool" "start" "startup" "store" "timing" "ttitle" "undefine"
+"variable" "whenever"
+) t)
+
+ "\\)\\|"
+ "\\(?:compute\\s-+\\(?:avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
+ "\\(?:set\\s-+\\("
+
+ (regexp-opt
+ '("appi" "appinfo" "array" "arraysize" "auto" "autocommit"
+ "autop" "autoprint" "autorecovery" "autot" "autotrace" "blo"
+ "blockterminator" "buffer" "closecursor" "cmds" "cmdsep"
+ "colsep" "com" "compatibility" "con" "concat" "constraint"
+ "constraints" "copyc" "copycommit" "copytypecheck" "database"
+ "def" "define" "document" "echo" "editf" "editfile" "emb"
+ "embedded" "esc" "escape" "feed" "feedback" "flagger" "flu"
+ "flush" "hea" "heading" "heads" "headsep" "instance" "lin"
+ "linesize" "lobof" "loboffset" "logsource" "long" "longc"
+ "longchunksize" "maxdata" "newp" "newpage" "null" "num"
+ "numf" "numformat" "numwidth" "pages" "pagesize" "pau"
+ "pause" "recsep" "recsepchar" "role" "scan" "serveroutput"
+ "shift" "shiftinout" "show" "showmode" "space" "sqlbl"
+ "sqlblanklines" "sqlc" "sqlcase" "sqlco" "sqlcontinue" "sqln"
+ "sqlnumber" "sqlp" "sqlpluscompat" "sqlpluscompatibility"
+ "sqlpre" "sqlprefix" "sqlprompt" "sqlt" "sqlterminator"
+ "statement_id" "suf" "suffix" "tab" "term" "termout" "ti"
+ "time" "timi" "timing" "transaction" "trim" "trimout" "trims"
+ "trimspool" "truncate" "und" "underline" "ver" "verify" "wra"
+ "wrap")) "\\)\\)"
+
+ "\\)\\b.*"
+ )
+ 'font-lock-doc-face)
+ '("^[ \t]*rem\\(?:ark\\)?.*" . font-lock-comment-face)
+
+ ;; Oracle Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2"
"avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid"
"chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh"
"userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml"
"xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement"
"xmlforest" "xmlsequence" "xmltransform"
-))
-
- (oracle-keywords (sql-keywords-re
+)
+ ;; Oracle Keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"abort" "access" "accessed" "account" "activate" "add" "admin"
"advise" "after" "agent" "aggregate" "all" "allocate" "allow" "alter"
"always" "analyze" "ancillary" "and" "any" "apply" "archive"
"use" "using" "validate" "validation" "value" "values" "variable"
"varray" "version" "view" "wait" "when" "whenever" "where" "with"
"without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype"
-))
-
- (oracle-types (sql-keywords-re
+)
+ ;; Oracle Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
"bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal"
"double" "float" "int" "integer" "interval" "long" "national" "nchar"
"nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real"
"rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar"
"varchar2" "varying" "year" "zone"
-))
+)
- (plsql-functions (sql-keywords-re
+ ;; Oracle PL/SQL Attributes
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face '("" . "\\b")
"%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype"
-"%type" "extend" "prior"
-))
+"%type"
+)
+
+ ;; Oracle PL/SQL Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
+"extend" "prior"
+)
- (plsql-keywords (sql-keywords-re
+ ;; Oracle PL/SQL Keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"autonomous_transaction" "bulk" "char_base" "collect" "constant"
"cursor" "declare" "do" "elsif" "exception_init" "execute" "exit"
"extends" "false" "fetch" "forall" "goto" "hour" "if" "interface"
"separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype"
"the" "timezone_abbr" "timezone_hour" "timezone_minute"
"timezone_region" "true" "varrying" "while"
-))
+)
- (plsql-type (sql-keywords-re
+ ;; Oracle PL/SQL Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
"binary_integer" "boolean" "naturaln" "pls_integer" "positive"
"positiven" "record" "signtype" "string"
-))
+)
- (plsql-warning (sql-keywords-re
+ ;; Oracle PL/SQL Exceptions
+ (sql-font-lock-keywords-builder 'font-lock-warning-face nil
"access_into_null" "case_not_found" "collection_is_null"
"cursor_already_open" "dup_val_on_index" "invalid_cursor"
"invalid_number" "login_denied" "no_data_found" "not_logged_on"
"subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid"
"timeout_on_resource" "too_many_rows" "value_error" "zero_divide"
"exception" "notfound"
-))
-
- (sqlplus-commands
- (eval-when-compile (concat "^\\(\\("
- (regexp-opt '(
-"@" "@@" "accept" "append" "archive" "attribute" "break"
-"btitle" "change" "clear" "column" "connect" "copy" "define"
-"del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
-"host" "input" "list" "password" "pause" "print" "prompt" "recover"
-"remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
-"spool" "start" "startup" "store" "timing" "ttitle" "undefine"
-"variable" "whenever"
-
-) t)
-
- "\\)\\|"
- "\\(compute\\s-+\\(avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
- "\\(set\\s-+\\(appi\\(nfo\\)?\\|array\\(size\\)?\\|"
- "auto\\(commit\\)?\\|autop\\(rint\\)?\\|autorecovery\\|"
- "autot\\(race\\)?\\|blo\\(ckterminator\\)?\\|cmds\\(ep\\)?\\|"
- "colsep\\|com\\(patibility\\)?\\|con\\(cat\\)?\\|"
- "copyc\\(ommit\\)?\\|copytypecheck\\|def\\(ine\\)?\\|"
- "describe\\|echo\\|editf\\(ile\\)?\\|emb\\(edded\\)?\\|"
- "esc\\(ape\\)?\\|feed\\(back\\)?\\|flagger\\|"
- "flu\\(sh\\)?\\|hea\\(ding\\)?\\|heads\\(ep\\)?\\|"
- "instance\\|lin\\(esize\\)?\\|lobof\\(fset\\)?\\|"
- "logsource\\|long\\|longc\\(hunksize\\)?\\|mark\\(up\\)?\\|"
- "newp\\(age\\)?\\|null\\|numf\\(ormat\\)?\\|"
- "num\\(width\\)?\\|pages\\(ize\\)?\\|pau\\(se\\)?\\|"
- "recsep\\|recsepchar\\|serverout\\(put\\)?\\|"
- "shift\\(inout\\)?\\|show\\(mode\\)?\\|"
- "sqlbl\\(anklines\\)?\\|sqlc\\(ase\\)?\\|"
- "sqlco\\(ntinue\\)?\\|sqln\\(umber\\)?\\|"
- "sqlpluscompat\\(ibility\\)?\\|sqlpre\\(fix\\)?\\|"
- "sqlp\\(rompt\\)?\\|sqlt\\(erminator\\)?\\|"
- "suf\\(fix\\)?\\|tab\\|term\\(out\\)?\\|ti\\(me\\)?\\|"
- "timi\\(ng\\)?\\|trim\\(out\\)?\\|trims\\(pool\\)?\\|"
- "und\\(erline\\)?\\|ver\\(ify\\)?\\|wra\\(p\\)?\\)\\)\\)"
- "\\b.*$"
- ))))
-
- `((,sqlplus-commands . font-lock-doc-face)
- (,oracle-functions . font-lock-builtin-face)
- (,oracle-keywords . font-lock-keyword-face)
- (,oracle-types . font-lock-type-face)
- (,plsql-functions . font-lock-builtin-face)
- (,plsql-keywords . font-lock-keyword-face)
- (,plsql-type . font-lock-type-face)
- (,plsql-warning . font-lock-warning-face)))
+)))
"Oracle SQL keywords used by font-lock.
to add functions and PL/SQL keywords.")
(defvar sql-mode-postgres-font-lock-keywords
- (let ((pg-funcs (sql-keywords-re
+ (eval-when-compile
+ (list
+ ;; Postgres Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan"
"atan2" "avg" "bit_length" "both" "broadcast" "btrim" "cbrt" "ceil"
"center" "char_length" "chr" "coalesce" "col_description" "convert"
"substring" "sum" "tan" "timeofday" "to_ascii" "to_char" "to_date"
"to_hex" "to_number" "to_timestamp" "trailing" "translate" "trim"
"trunc" "upper" "variance" "version" "width"
-))
-
- (pg-reserved (sql-keywords-re
+)
+ ;; Postgres Reserved
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"abort" "access" "add" "after" "aggregate" "alignment" "all" "alter"
"analyze" "and" "any" "as" "asc" "assignment" "authorization"
"backward" "basetype" "before" "begin" "between" "binary" "by" "cache"
"usage" "user" "using" "vacuum" "valid" "validator" "values"
"variable" "verbose" "view" "volatile" "when" "where" "with" "without"
"work"
-))
+)
- (pg-types (sql-keywords-re
+ ;; Postgres Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
"anyarray" "bigint" "bigserial" "bit" "boolean" "box" "bytea" "char"
"character" "cidr" "circle" "cstring" "date" "decimal" "double"
"float4" "float8" "inet" "int2" "int4" "int8" "integer" "internal"
"timestamp" "varchar" "varying" "void" "zone"
)))
- `((,pg-funcs . font-lock-builtin-face)
- (,pg-reserved . font-lock-keyword-face)
- (,pg-types . font-lock-type-face)))
-
"Postgres SQL keywords used by font-lock.
This variable is used by `sql-mode' and `sql-interactive-mode'. The
you define your own `sql-mode-postgres-font-lock-keywords'.")
(defvar sql-mode-linter-font-lock-keywords
- (let ((linter-keywords (sql-keywords-re
+ (eval-when-compile
+ (list
+ ;; Linter Keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel"
"committed" "count" "countblob" "cross" "current" "data" "database"
"datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred"
"trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown"
"unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes"
"wait" "windows_code" "workspace" "write" "xml"
-))
+)
- (linter-reserved (sql-keywords-re
+ ;; Linter Reserved
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"access" "action" "add" "address" "after" "all" "alter" "always" "and"
"any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit"
"aud_obj_name_len" "backup" "base" "before" "between" "blobfile"
"start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then"
"to" "union" "unique" "unlock" "until" "update" "using" "values"
"view" "when" "where" "with" "without"
-))
+)
- (linter-types (sql-keywords-re
-"bigint" "bitmap" "blob" "boolean" "char" "character" "date"
-"datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
-"number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
-"cursor" "long"
-))
-
- (linter-functions (sql-keywords-re
+ ;; Linter Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime"
"exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw"
"getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log"
"to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode"
"substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap"
"instr" "least" "multime" "replace" "width"
-)))
+)
- `((,linter-keywords . font-lock-keyword-face)
- (,linter-reserved . font-lock-keyword-face)
- (,linter-functions . font-lock-builtin-face)
- (,linter-types . font-lock-type-face)))
+ ;; Linter Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
+"bigint" "bitmap" "blob" "boolean" "char" "character" "date"
+"datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
+"number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
+"cursor" "long"
+)))
"Linter SQL keywords used by font-lock.
function `regexp-opt'.")
(defvar sql-mode-ms-font-lock-keywords
- (let ((ms-reserved (sql-keywords-re
+ (eval-when-compile
+ (list
+ ;; MS isql/osql Commands
+ (cons
+ (concat
+ "^\\(?:\\(?:set\\s-+\\(?:"
+ (regexp-opt '(
+"datefirst" "dateformat" "deadlock_priority" "lock_timeout"
+"concat_null_yields_null" "cursor_close_on_commit"
+"disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
+"offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
+"nocount" "noexec" "numeric_roundabort" "parseonly"
+"query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
+"ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
+"ansi_warnings" "forceplan" "showplan_all" "showplan_text"
+"statistics" "implicit_transactions" "remote_proc_transactions"
+"transaction" "xact_abort"
+) t)
+ "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$")
+ 'font-lock-doc-face)
+
+ ;; MS Reserved
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"absolute" "add" "all" "alter" "and" "any" "as" "asc" "authorization"
"avg" "backup" "begin" "between" "break" "browse" "bulk" "by"
"cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce"
"updlock" "use" "user" "values" "view" "waitfor" "when" "where"
"while" "with" "work" "writetext" "collate" "function" "openxml"
"returns"
-))
+)
- (ms-types (sql-keywords-re
-"binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
-"double" "float" "image" "int" "integer" "money" "national" "nchar"
-"ntext" "numeric" "numeric" "nvarchar" "precision" "real"
-"smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
-"uniqueidentifier" "varbinary" "varchar" "varying"
-))
-
- (ms-vars "\\b@[a-zA-Z0-9_]*\\b")
-
- (ms-functions (sql-keywords-re
+ ;; MS Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts"
"@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy"
"@@langid" "@@language" "@@lock_timeout" "@@max_connections"
"suser_id" "suser_name" "suser_sid" "suser_sname" "system_user" "tan"
"textptr" "textvalid" "typeproperty" "unicode" "upper" "user"
"user_id" "user_name" "var" "varp" "year"
-))
+)
- (ms-commands
- (eval-when-compile
- (concat "^\\(\\(set\\s-+\\("
- (regexp-opt '(
-"datefirst" "dateformat" "deadlock_priority" "lock_timeout"
-"concat_null_yields_null" "cursor_close_on_commit"
-"disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
-"offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
-"nocount" "noexec" "numeric_roundabort" "parseonly"
-"query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
-"ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
-"ansi_warnings" "forceplan" "showplan_all" "showplan_text"
-"statistics" "implicit_transactions" "remote_proc_transactions"
-"transaction" "xact_abort"
-) t)
- "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$"))))
+ ;; MS Variables
+ '("\\b@[a-zA-Z0-9_]*\\b" . font-lock-variable-name-face)
- `((,ms-commands . font-lock-doc-face)
- (,ms-reserved . font-lock-keyword-face)
- (,ms-functions . font-lock-builtin-face)
- (,ms-vars . font-lock-variable-name-face)
- (,ms-types . font-lock-type-face)))
+ ;; MS Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
+"binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
+"double" "float" "image" "int" "integer" "money" "national" "nchar"
+"ntext" "numeric" "numeric" "nvarchar" "precision" "real"
+"smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
+"uniqueidentifier" "varbinary" "varchar" "varying"
+)))
"Microsoft SQLServer SQL keywords used by font-lock.
you define your own `sql-mode-solid-font-lock-keywords'.")
(defvar sql-mode-mysql-font-lock-keywords
- (let ((mysql-funcs (sql-keywords-re
+ (eval-when-compile
+ (list
+ ;; MySQL Functions
+ (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
"ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext"
"bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or"
"bit_xor" "both" "cast" "char_length" "character_length" "coalesce"
"release_lock" "repeat" "replace" "reverse" "rpad" "rtrim" "soundex"
"space" "std" "stddev" "substring" "substring_index" "sum" "sysdate"
"trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance"
-))
+)
- (mysql-keywords (sql-keywords-re
+ ;; MySQL Keywords
+ (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
"action" "add" "after" "against" "all" "alter" "and" "as" "asc"
"auto_increment" "avg_row_length" "bdb" "between" "by" "cascade"
"case" "change" "character" "check" "checksum" "close" "collate"
"then" "to" "transaction" "truncate" "type" "uncommitted" "union"
"unique" "unlock" "update" "use" "using" "values" "when" "where"
"with" "write" "xor"
-))
+)
- (mysql-types (sql-keywords-re
+ ;; MySQL Data Types
+ (sql-font-lock-keywords-builder 'font-lock-type-face nil
"bigint" "binary" "bit" "blob" "bool" "boolean" "char" "curve" "date"
"datetime" "dec" "decimal" "double" "enum" "fixed" "float" "geometry"
"geometrycollection" "int" "integer" "line" "linearring" "linestring"
"zerofill"
)))
- `((,mysql-funcs . font-lock-builtin-face)
- (,mysql-keywords . font-lock-keyword-face)
- (,mysql-types . font-lock-type-face)))
-
"MySQL SQL keywords used by font-lock.
This variable is used by `sql-mode' and `sql-interactive-mode'. The
;;; SQL Product support functions
-(defun sql-product-feature (feature &optional product)
- "Lookup `feature' needed to support the current SQL product.
+(defun sql-add-product (product display &rest plist)
+ "Add support for a database product in `sql-mode'.
+
+Add PRODUCT to `sql-product-alist' which enables `sql-mode' to
+properly support syntax highlighting and interactive interaction.
+DISPLAY is the name of the SQL product that will appear in the
+menu bar and in messages. PLIST initializes the product
+configuration."
+
+ ;; Don't do anything if the product is already supported
+ (if (assoc product sql-product-alist)
+ (message "Product `%s' is already defined" product)
+
+ ;; Add product to the alist
+ (add-to-list 'sql-product-alist `((,product :name ,display . ,plist)))
+ ;; Add a menu item to the SQL->Product menu
+ (easy-menu-add-item sql-mode-menu '("Product")
+ ;; Each product is represented by a radio
+ ;; button with it's display name.
+ `[,display
+ (lambda () (interactive) (sql-set-product ',product))
+ :style radio
+ :selected (eq sql-product ',product)]
+ ;; Maintain the product list in
+ ;; (case-insensitive) alphabetic order of the
+ ;; display names. Loop thru each keymap item
+ ;; looking for an item whose display name is
+ ;; after this product's name.
+ (let ((next-item)
+ (down-display (downcase display)))
+ (map-keymap (lambda (k b)
+ (when (and (not next-item)
+ (string-lessp down-display
+ (downcase (cadr b))))
+ (setq next-item k)))
+ (easy-menu-get-map sql-mode-menu '("Product")))
+ next-item))
+ product))
+
+(defun sql-del-product (product)
+ "Remove support for PRODUCT in `sql-mode'."
+
+ ;; Remove the menu item based on the display name
+ (easy-menu-remove-item sql-mode-menu '("Product") (sql-get-product-feature product :name))
+ ;; Remove the product alist item
+ (setq sql-product-alist (assq-delete-all product sql-product-alist))
+ nil)
+
+(defun sql-set-product-feature (product feature newvalue)
+ "Set FEATURE of database PRODUCT to NEWVALUE.
+
+The PRODUCT must be a symbol which identifies the database
+product. The product must have already exist on the product
+list. See `sql-add-product' to add new products. The FEATURE
+argument must be a plist keyword accepted by
+`sql-product-alist'."
+
+ (let* ((p (assoc product sql-product-alist))
+ (v (plist-get (cdr p) feature)))
+ (if p
+ (if (and
+ (member feature sql-indirect-features)
+ (symbolp v))
+ (set v newvalue)
+ (setcdr p (plist-put (cdr p) feature newvalue)))
+ (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
+
+(defun sql-get-product-feature (product feature &optional fallback)
+ "Lookup FEATURE associated with a SQL PRODUCT.
+
+If the FEATURE is nil for PRODUCT, and FALLBACK is specified,
+then the FEATURE associated with the FALLBACK product is
+returned.
See `sql-product-alist' for a list of products and supported features."
- (plist-get
- (cdr (assoc (or product sql-product)
- sql-product-alist))
- feature))
+ (let* ((p (assoc product sql-product-alist))
+ (v (plist-get (cdr p) feature)))
+
+ (if p
+ ;; If no value and fallback, lookup feature for fallback
+ (if (and (not v)
+ fallback
+ (not (eq product fallback)))
+ (sql-get-product-feature fallback feature)
+
+ (if (and
+ (member feature sql-indirect-features)
+ (symbolp v))
+ (symbol-value v)
+ v))
+ (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
(defun sql-product-font-lock (keywords-only imenu)
- "Sets `font-lock-defaults' and `font-lock-keywords' based on
-the product-specific keywords and syntax-alists defined in
-`sql-product-alist'."
+ "Configure font-lock and imenu with product-specific settings.
+
+The KEYWORDS-ONLY flag is passed to font-lock to specify whether
+only keywords should be hilighted and syntactic hilighting
+skipped. The IMENU flag indicates whether `imenu-mode' should
+also be configured."
+
(let
;; Get the product-specific syntax-alist.
((syntax-alist
(append
- (sql-product-feature :syntax-alist)
+ (sql-get-product-feature sql-product :syntax-alist)
'((?_ . "w") (?. . "w")))))
;; Get the product-specific keywords.
(setq sql-mode-font-lock-keywords
(append
(unless (eq sql-product 'ansi)
- (eval (sql-product-feature :font-lock)))
+ (sql-get-product-feature sql-product :font-lock))
;; Always highlight ANSI keywords
- (eval (sql-product-feature :font-lock 'ansi))
+ (sql-get-product-feature 'ansi :font-lock)
;; Fontify object names in CREATE, DROP and ALTER DDL
;; statements
(list sql-mode-font-lock-object-name)))
;; Setup font-lock. Force re-parsing of `font-lock-defaults'.
- (set (make-local-variable 'font-lock-set-defaults) nil)
+ (kill-local-variable 'font-lock-set-defaults)
(setq font-lock-defaults (list 'sql-mode-font-lock-keywords
keywords-only t syntax-alist))
;; Force font lock to reinitialize if it is already on
;; Otherwise, we can wait until it can be started.
(when (and (fboundp 'font-lock-mode)
+ (boundp 'font-lock-mode)
font-lock-mode)
(font-lock-mode-internal nil)
(font-lock-mode-internal t))
;; Setup imenu; it needs the same syntax-alist.
(when imenu
- (setq imenu-syntax-alist syntax-alist))))
+ (setq imenu-syntax-alist syntax-alist))))
;;;###autoload
(defun sql-add-product-keywords (product keywords &optional append)
"Add highlighting KEYWORDS for SQL PRODUCT.
-PRODUCT should be a symbol, the name of a sql product, such as
+PRODUCT should be a symbol, the name of a SQL product, such as
`oracle'. KEYWORDS should be a list; see the variable
`font-lock-keywords'. By default they are added at the beginning
of the current highlighting list. If optional argument APPEND is
adds a fontification pattern to fontify identifiers ending in
`_t' as data types."
- (let ((font-lock (sql-product-feature :font-lock product))
- old)
- (setq old (eval font-lock))
- (set font-lock
+ (let* ((sql-indirect-features nil)
+ (font-lock-var (sql-get-product-feature product :font-lock))
+ (old-val))
+
+ (setq old-val (symbol-value font-lock-var))
+ (set font-lock-var
(if (eq append 'set)
keywords
(if append
- (append old keywords)
- (append keywords old))))))
+ (append old-val keywords)
+ (append keywords old-val))))))
\f
;;; Functions to switch highlighting
(defun sql-highlight-product ()
- "Turn on the appropriate font highlighting for the SQL product selected."
+ "Turn on the font highlighting for the SQL product selected."
(when (derived-mode-p 'sql-mode)
;; Setup font-lock
(sql-product-font-lock nil t)
;; Set the mode name to include the product.
- (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]"))))
+ (setq mode-name (concat "SQL[" (or (sql-get-product-feature sql-product :name)
+ (symbol-name sql-product)) "]"))))
(defun sql-set-product (product)
- "Set `sql-product' to product and enable appropriate highlighting."
+ "Set `sql-product' to PRODUCT and enable appropriate highlighting."
(interactive
- (list (completing-read "Enter SQL product: "
+ (list (completing-read "SQL product: "
(mapcar (lambda (info) (symbol-name (car info)))
sql-product-alist)
- nil 'require-match)))
+ nil 'require-match
+ (or (and sql-product (symbol-name sql-product)) "ansi"))))
(if (stringp product) (setq product (intern product)))
(when (not (assoc product sql-product-alist))
(error "SQL product %s is not supported; treated as ANSI" product)
(newline))
(indent-according-to-mode))
+(defun sql-help-list-products (indent freep)
+ "Generate listing of products available for use under SQLi.
+
+List products with :free-softare attribute set to FREEP. Indent
+each line with INDENT."
+
+ (let (sqli-func doc)
+ (setq doc "")
+ (dolist (p sql-product-alist)
+ (setq sqli-func (intern (concat "sql-" (symbol-name (car p)))))
+
+ (if (and (fboundp sqli-func)
+ (eq (sql-get-product-feature (car p) :free-software) freep))
+ (setq doc
+ (concat doc
+ indent
+ (or (sql-get-product-feature (car p) :name)
+ (symbol-name (car p)))
+ ":\t"
+ "\\["
+ (symbol-name sqli-func)
+ "]\n"))))
+ doc))
+
;;;###autoload
(defun sql-help ()
"Show short help for the SQL modes.
Use the following commands to start a specific SQL interpreter:
- PostGres: \\[sql-postgres]
- MySQL: \\[sql-mysql]
- SQLite: \\[sql-sqlite]
+ \\\\FREE
Other non-free SQL implementations are also supported:
- Solid: \\[sql-solid]
- Oracle: \\[sql-oracle]
- Informix: \\[sql-informix]
- Sybase: \\[sql-sybase]
- Ingres: \\[sql-ingres]
- Microsoft: \\[sql-ms]
- DB2: \\[sql-db2]
- Interbase: \\[sql-interbase]
- Linter: \\[sql-linter]
+ \\\\NONFREE
But we urge you to choose a free implementation instead of these.
+You can also use \\[sql-product-interactive] to invoke the
+interpreter for the current `sql-product'.
+
Once you have the SQLi buffer, you can enter SQL statements in the
buffer. The output generated is appended to the buffer and a new prompt
is generated. See the In/Out menu in the SQLi buffer for some functions
buffer to the interactive SQL buffer (SQLi mode). The results are
appended to the SQLi buffer without disturbing your SQL buffer."
(interactive)
+
+ ;; Insert references to loaded products into the help buffer string
+ (let ((doc (documentation 'sql-help t))
+ changedp)
+ (setq changedp nil)
+
+ ;; Insert FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
+ t t doc 0)
+ changedp t))
+
+ ;; Insert non-FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
+ t t doc 0)
+ changedp t))
+
+ ;; If we changed the help text, save the change so that the help
+ ;; sub-system will see it
+ (when changedp
+ (put 'sql-help 'function-documentation doc)))
+
+ ;; Call help on this function
(describe-function 'sql-help))
(defun sql-read-passwd (prompt &optional default)
`sql-server-history' and `database-history'. Passwords are not stored
in a history.
-Parameter WHAT is a list of the arguments passed to this function.
-The function asks for the username if WHAT contains symbol `user', for
-the password if it contains symbol `password', for the server if it
-contains symbol `server', and for the database if it contains symbol
-`database'. The members of WHAT are processed in the order in which
-they are provided.
+Parameter WHAT is a list of tokens passed as arguments in the
+function call. The function asks for the username if WHAT
+contains the symbol `user', for the password if it contains the
+symbol `password', for the server if it contains the symbol
+`server', and for the database if it contains the symbol
+`database'. The members of WHAT are processed in the order in
+which they are provided.
In order to ask the user for username, password and database, call the
function like this: (sql-get-login 'user 'password 'database)."
((eq (car what) 'user) ; user
(setq sql-user
(read-from-minibuffer "User: " sql-user nil nil
- sql-user-history)))
+ 'sql-user-history)))
((eq (car what) 'password) ; password
(setq sql-password
(sql-read-passwd "Password: " sql-password)))
+
((eq (car what) 'server) ; server
(setq sql-server
(read-from-minibuffer "Server: " sql-server nil nil
- sql-server-history)))
+ 'sql-server-history)))
+ ((eq (car what) 'port) ; port
+ (setq sql-port
+ (read-from-minibuffer "Port: " sql-port nil nil
+ 'sql-port-history)))
((eq (car what) 'database) ; database
(setq sql-database
(read-from-minibuffer "Database: " sql-database nil nil
- sql-database-history))))
+ 'sql-database-history))))
(setq what (cdr what))))
(defun sql-find-sqli-buffer ()
- "Return the current default SQLi buffer or nil.
+ "Returns the current default SQLi buffer or nil.
In order to qualify, the SQLi buffer must be alive,
be in `sql-interactive-mode' and have a process."
(let ((default-buffer (default-value 'sql-buffer)))
(interactive)
(let ((column))
(save-excursion
- (setq column (buffer-substring
+ (setq column (buffer-substring-no-properties
(progn (forward-char 1) (backward-sexp 1) (point))
(progn (forward-sexp 1) (point))))
(goto-char (point-max))
(defvar sql-placeholder-history nil
"History of placeholder values used.")
-(defun sql-query-placeholders-and-send (proc string)
- "Send to PROC input STRING, maybe replacing placeholders.
-Placeholders are words starting with an ampersand like &this.
-This function is used for `comint-input-sender' if using
-`sql-oracle' on Windows."
- (while (string-match "&\\(\\sw+\\)" string)
- (setq string (replace-match
- (read-from-minibuffer
- (format "Enter value for %s: " (match-string 1 string))
- nil nil nil sql-placeholder-history)
- t t string)))
- (comint-send-string proc string)
- (if comint-input-sender-no-newline
- (if (not (string-equal string ""))
- (process-send-eof))
- (comint-send-string proc "\n")))
+(defun sql-placeholders-filter (string)
+ "Replace placeholders in STRING.
+Placeholders are words starting with an ampersand like &this."
+
+ (when sql-oracle-scan-on
+ (while (string-match "&\\(\\sw+\\)" string)
+ (setq string (replace-match
+ (read-from-minibuffer
+ (format "Enter value for %s: " (match-string 1 string))
+ nil nil nil 'sql-placeholder-history)
+ t t string))))
+ string)
;; Using DB2 interactively, newlines must be escaped with " \".
;; The space before the backslash is relevant.
-(defun sql-escape-newlines-and-send (proc string)
- "Send to PROC input STRING, escaping newlines if necessary.
+(defun sql-escape-newlines-filter (string)
+ "Escape newlines in STRING.
Every newline in STRING will be preceded with a space and a backslash."
(let ((result "") (start 0) mb me)
(while (string-match "\n" string start)
(setq mb (match-beginning 0)
- me (match-end 0))
- (if (and (> mb 1)
- (string-equal " \\" (substring string (- mb 2) mb)))
- (setq result (concat result (substring string start me)))
- (setq result (concat result (substring string start mb) " \\\n")))
- (setq start me))
- (setq result (concat result (substring string start)))
- (comint-send-string proc result)
- (if comint-input-sender-no-newline
- (if (not (string-equal string ""))
- (process-send-eof))
- (comint-send-string proc "\n"))))
+ me (match-end 0)
+ result (concat result
+ (substring string start mb)
+ (if (and (> mb 1)
+ (string-equal " \\" (substring string (- mb 2) mb)))
+ "" " \\\n"))
+ start me))
+ (concat result (substring string start))))
\f
+;;; Input sender for SQLi buffers
+
+(defun sql-input-sender (proc string)
+ "Send STRING to PROC after applying filters."
+
+ (let* ((product (with-current-buffer (process-buffer proc) sql-product))
+ (filter (sql-get-product-feature product :input-filter)))
+
+ ;; Send the string
+ (comint-simple-send proc (if filter (funcall filter string) string))))
+
;;; Sending the region to the SQLi buffer.
+(defun sql-send-string (str)
+ "Send the string STR to the SQL process."
+ (interactive "sSQL Text: ")
+
+ (let (comint-input-sender-no-newline proc)
+ (if (buffer-live-p sql-buffer)
+ (progn
+ ;; Ignore the hoping around...
+ (save-excursion
+ ;; Get the process
+ (setq proc (get-buffer-process sql-buffer))
+
+ ;; Set product context
+ (with-current-buffer sql-buffer
+ ;; Send the string
+ (sql-input-sender proc str)
+
+ ;; Send a newline if there wasn't one on the end of the string
+ (unless (string-equal "\n" (substring str (1- (length str))))
+ (comint-send-string proc "\n"))
+
+ ;; Send a command terminator if we must
+ (if sql-send-terminator
+ (sql-send-magic-terminator sql-buffer str sql-send-terminator))
+
+ (message "Sent string to buffer %s." (buffer-name sql-buffer))))
+
+ ;; Display the sql buffer
+ (if sql-pop-to-buffer-after-send-region
+ (pop-to-buffer sql-buffer)
+ (display-buffer sql-buffer)))
+
+ ;; We don't have no stinkin' sql
+ (message "No SQL process started."))))
+
(defun sql-send-region (start end)
"Send a region to the SQL process."
(interactive "r")
- (if (buffer-live-p sql-buffer)
- (save-excursion
- (comint-send-region sql-buffer start end)
- (if (string-match "\n$" (buffer-substring start end))
- ()
- (comint-send-string sql-buffer "\n"))
- (message "Sent string to buffer %s." (buffer-name sql-buffer))
- (if sql-pop-to-buffer-after-send-region
- (pop-to-buffer sql-buffer)
- (display-buffer sql-buffer)))
- (message "No SQL process started.")))
+ (sql-send-string (buffer-substring-no-properties start end)))
(defun sql-send-paragraph ()
"Send the current paragraph to the SQL process."
(interactive)
(sql-send-region (point-min) (point-max)))
-(defun sql-send-string (str)
- "Send a string to the SQL process."
- (interactive "sSQL Text: ")
- (if (buffer-live-p sql-buffer)
- (save-excursion
- (comint-send-string sql-buffer str)
- (comint-send-string sql-buffer "\n")
- (message "Sent string to buffer %s." (buffer-name sql-buffer))
- (if sql-pop-to-buffer-after-send-region
- (pop-to-buffer sql-buffer)
- (display-buffer sql-buffer)))
- (message "No SQL process started.")))
+(defun sql-send-magic-terminator (buf str terminator)
+ "Send TERMINATOR to buffer BUF if its not present in STR."
+ (let (pat term)
+ ;; If flag is merely on(t), get product-specific terminator
+ (if (eq terminator t)
+ (setq terminator (sql-get-product-feature sql-product :terminator)))
+
+ ;; If there is no terminator specified, use default ";"
+ (unless terminator
+ (setq terminator ";"))
+
+ ;; Parse the setting into the pattern and the terminator string
+ (cond ((stringp terminator)
+ (setq pat (regexp-quote terminator)
+ term terminator))
+ ((consp terminator)
+ (setq pat (car terminator)
+ term (cdr terminator)))
+ (t
+ nil))
+
+ ;; Check to see if the pattern is present in the str already sent
+ (unless (and pat term
+ (string-match (concat pat "\n?\\'") str))
+ (comint-send-string buf (concat term "\n")))))
+
+(defun sql-remove-tabs-filter (str)
+ "Replace tab characters with spaces."
+ (replace-regexp-in-string "\t" " " str nil t))
(defun sql-toggle-pop-to-buffer-after-send-region (&optional value)
"Toggle `sql-pop-to-buffer-after-send-region'.
(if value
(setq sql-pop-to-buffer-after-send-region value)
(setq sql-pop-to-buffer-after-send-region
- (null sql-pop-to-buffer-after-send-region ))))
+ (null sql-pop-to-buffer-after-send-region))))
\f
\(setq comint-output-filter-functions
\(function (lambda (STR) (comint-show-output))))"
(delay-mode-hooks (comint-mode))
+
;; Get the `sql-product' for this interactive session.
(set (make-local-variable 'sql-product)
(or sql-interactive-product
sql-product))
+
;; Setup the mode.
(setq major-mode 'sql-interactive-mode)
- (setq mode-name (concat "SQLi[" (prin1-to-string sql-product) "]"))
+ (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
+ (symbol-name sql-product)) "]"))
(use-local-map sql-interactive-mode-map)
(if sql-interactive-mode-menu
(easy-menu-add sql-interactive-mode-menu)) ; XEmacs
(set-syntax-table sql-mode-syntax-table)
(make-local-variable 'sql-mode-font-lock-keywords)
(make-local-variable 'font-lock-defaults)
+
;; Note that making KEYWORDS-ONLY nil will cause havoc if you try
;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column
;; will have just one quote. Therefore syntactic hilighting is
;; disabled for interactive buffers. No imenu support.
(sql-product-font-lock t nil)
+
;; Enable commenting and uncommenting of the region.
(make-local-variable 'comment-start)
(setq comment-start "--")
(setq sql-alternate-buffer-name (sql-make-alternate-buffer-name))
;; User stuff. Initialize before the hook.
(set (make-local-variable 'sql-prompt-regexp)
- (sql-product-feature :sqli-prompt-regexp))
+ (sql-get-product-feature sql-product :prompt-regexp))
(set (make-local-variable 'sql-prompt-length)
- (sql-product-feature :sqli-prompt-length))
+ (sql-get-product-feature sql-product :prompt-length))
(make-local-variable 'sql-input-ring-separator)
(make-local-variable 'sql-input-ring-file-name)
- ;; Run hook.
+ (setq comint-process-echoes t)
+ ;; Run the mode hook (along with comint's hooks).
(run-mode-hooks 'sql-interactive-mode-hook)
;; Set comint based on user overrides.
(setq comint-prompt-regexp sql-prompt-regexp)
(setq left-margin sql-prompt-length)
+ ;; Install input sender
+ (set (make-local-variable 'comint-input-sender) 'sql-input-sender)
;; People wanting a different history file for each
;; buffer/process/client/whatever can change separator and file-name
;; on the sql-interactive-mode-hook.
;;;###autoload
(defun sql-product-interactive (&optional product)
- "Run product interpreter as an inferior process.
+ "Run PRODUCT interpreter as an inferior process.
If buffer `*SQL*' exists but no process is running, make a new process.
If buffer exists and a process is running, just switch to buffer `*SQL*'.
\(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
- (interactive)
- (setq product (or product sql-product))
- (when (sql-product-feature :sqli-connect product)
- (if (comint-check-proc "*SQL*")
- (pop-to-buffer "*SQL*")
- ;; Get credentials.
- (apply 'sql-get-login (sql-product-feature :sqli-login product))
- ;; Connect to database.
- (message "Login...")
- (funcall (sql-product-feature :sqli-connect product))
- ;; Set SQLi mode.
- (setq sql-interactive-product product)
- (setq sql-buffer (current-buffer))
- (sql-interactive-mode)
- ;; All done.
- (message "Login...done")
- (pop-to-buffer sql-buffer))))
+ (interactive "P")
+
+ (setq product
+ (cond
+ ((equal product '(4)) ; Universal arg, prompt for product
+ (intern (completing-read "SQL product: "
+ (mapcar (lambda (info) (symbol-name (car info)))
+ sql-product-alist)
+ nil 'require-match
+ (or (and sql-product (symbol-name sql-product)) "ansi"))))
+ ((symbolp product) product) ; Product specified
+ (t sql-product))) ; Default to sql-product
+
+ (when (sql-get-product-feature product :sqli-connect-func)
+ (if (and sql-buffer
+ (buffer-live-p sql-buffer)
+ (comint-check-proc sql-buffer))
+ (pop-to-buffer sql-buffer)
+
+ ;; Is the current buffer in sql-mode and
+ ;; there is a buffer local setting of sql-buffer
+ (let* ((start-buffer
+ (and (derived-mode-p 'sql-mode)
+ (current-buffer)))
+ (start-sql-buffer
+ (and start-buffer
+ (let (found)
+ (dolist (var (buffer-local-variables))
+ (and (consp var)
+ (eq (car var) 'sql-buffer)
+ (buffer-live-p (cdr var))
+ (get-buffer-process (cdr var))
+ (setq found (cdr var))))
+ found)))
+ new-sqli-buffer)
+
+ ;; Get credentials.
+ (apply 'sql-get-login (sql-get-product-feature product :sqli-login))
+
+ ;; Connect to database.
+ (message "Login...")
+ (funcall (sql-get-product-feature product :sqli-connect-func)
+ product
+ (sql-get-product-feature product :sqli-options))
+
+ ;; Set SQLi mode.
+ (setq sql-interactive-product product
+ new-sqli-buffer (current-buffer)
+ sql-buffer new-sqli-buffer)
+ (sql-interactive-mode)
+
+ ;; Set `sql-buffer' in the start buffer
+ (when (and start-buffer (not start-sql-buffer))
+ (with-current-buffer start-buffer
+ (setq sql-buffer new-sqli-buffer)))
+
+ ;; All done.
+ (message "Login...done")
+ (pop-to-buffer sql-buffer)))))
+
+(defun sql-connect (product params)
+ "Set up a comint buffer to connect to the SQL processor.
+
+PRODUCT is the SQL product. PARAMS is a list of strings which are
+passed as command line arguments."
+ (let ((program (sql-get-product-feature product :sqli-program)))
+ (set-buffer
+ (if params
+ (apply 'make-comint "SQL" program nil params)
+ (make-comint "SQL" program nil)))))
;;;###autoload
(defun sql-oracle ()
(interactive)
(sql-product-interactive 'oracle))
-(defun sql-connect-oracle ()
- "Create comint buffer and connect to Oracle using the login
-parameters and command options."
+(defun sql-connect-oracle (product options)
+ "Create comint buffer and connect to Oracle."
;; Produce user/password@database construct. Password without user
;; is meaningless; database without user/password is meaningless,
;; because "@param" will ask sqlplus to interpret the script
;; "param".
- (let ((parameter
- (if (not (string= "" sql-user))
- (if (not (string= "" sql-password))
- (concat sql-user "/" sql-password)
- sql-user))))
+ (let ((parameter nil))
+ (if (not (string= "" sql-user))
+ (if (not (string= "" sql-password))
+ (setq parameter (concat sql-user "/" sql-password))
+ (setq parameter sql-user)))
(if (and parameter (not (string= "" sql-database)))
(setq parameter (concat parameter "@" sql-database)))
- (setq parameter (if parameter
- (nconc (list parameter) sql-oracle-options)
- sql-oracle-options))
- (set-buffer (apply 'make-comint "SQL" sql-oracle-program nil parameter))
- ;; SQL*Plus is buffered on Windows; this handles &placeholders.
- (if (eq window-system 'w32)
- (setq comint-input-sender 'sql-query-placeholders-and-send))))
+ (if parameter
+ (setq parameter (nconc (list parameter) options))
+ (setq parameter options))
+ (sql-connect product parameter)))
\f
;;;###autoload
(defun sql-sybase ()
- "Run isql by SyBase as an inferior process.
+ "Run isql by Sybase as an inferior process.
If buffer `*SQL*' exists but no process is running, make a new process.
If buffer exists and a process is running, just switch to buffer
(interactive)
(sql-product-interactive 'sybase))
-(defun sql-connect-sybase ()
- "Create comint buffer and connect to Sybase using the login
-parameters and command options."
+(defun sql-connect-sybase (product options)
+ "Create comint buffer and connect to Sybase."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params sql-sybase-options))
+ (let ((params options))
(if (not (string= "" sql-server))
(setq params (append (list "-S" sql-server) params)))
(if (not (string= "" sql-database))
(setq params (append (list "-P" sql-password) params)))
(if (not (string= "" sql-user))
(setq params (append (list "-U" sql-user) params)))
- (set-buffer (apply 'make-comint "SQL" sql-sybase-program
- nil params))))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'informix))
-(defun sql-connect-informix ()
- "Create comint buffer and connect to Informix using the login
-parameters and command options."
+(defun sql-connect-informix (product options)
+ "Create comint buffer and connect to Informix."
;; username and password are ignored.
- (set-buffer (if (string= "" sql-database)
- (make-comint "SQL" sql-informix-program nil)
- (make-comint "SQL" sql-informix-program nil sql-database "-"))))
+ (let ((db (if (string= "" sql-database)
+ "-"
+ (if (string= "" sql-server)
+ sql-database
+ (concat sql-database "@" sql-server)))))
+ (sql-connect product (append `(,db "-") options))))
\f
(interactive)
(sql-product-interactive 'sqlite))
-(defun sql-connect-sqlite ()
- "Create comint buffer and connect to SQLite using the login
-parameters and command options."
+(defun sql-connect-sqlite (product options)
+ "Create comint buffer and connect to SQLite."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
(let ((params))
(if (not (string= "" sql-database))
(setq params (append (list sql-database) params)))
- (if (not (null sql-sqlite-options))
- (setq params (append sql-sqlite-options params)))
- (set-buffer (apply 'make-comint "SQL" sql-sqlite-program
- nil params))))
+ (setq params (append options params))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'mysql))
-(defun sql-connect-mysql ()
- "Create comint buffer and connect to MySQL using the login
-parameters and command options."
+(defun sql-connect-mysql (product options)
+ "Create comint buffer and connect to MySQL."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
(let ((params))
(setq params (append (list sql-database) params)))
(if (not (string= "" sql-server))
(setq params (append (list (concat "--host=" sql-server)) params)))
+ (if (not (and sql-port (numberp sql-port)))
+ (setq params (append (list (concat "--port=" (number-to-string sql-port))) params)))
(if (not (string= "" sql-password))
(setq params (append (list (concat "--password=" sql-password)) params)))
(if (not (string= "" sql-user))
(setq params (append (list (concat "--user=" sql-user)) params)))
- (if (not (null sql-mysql-options))
- (setq params (append sql-mysql-options params)))
- (set-buffer (apply 'make-comint "SQL" sql-mysql-program
- nil params))))
+ (setq params (append options params))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'solid))
-(defun sql-connect-solid ()
- "Create comint buffer and connect to Solid using the login
-parameters and command options."
+(defun sql-connect-solid (product options)
+ "Create comint buffer and connect to Solid."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params))
+ (let ((params options))
;; It only makes sense if both username and password are there.
(if (not (or (string= "" sql-user)
(string= "" sql-password)))
(setq params (append (list sql-user sql-password) params)))
(if (not (string= "" sql-server))
(setq params (append (list sql-server) params)))
- (set-buffer (apply 'make-comint "SQL" sql-solid-program
- nil params))))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'ingres))
-(defun sql-connect-ingres ()
- "Create comint buffer and connect to Ingres using the login
-parameters and command options."
+(defun sql-connect-ingres (product options)
+ "Create comint buffer and connect to Ingres."
;; username and password are ignored.
- (set-buffer (if (string= "" sql-database)
- (make-comint "SQL" sql-ingres-program nil)
- (make-comint "SQL" sql-ingres-program nil sql-database))))
+ (sql-connect product
+ (append (if (string= "" sql-database)
+ nil
+ (list sql-database))
+ options)))
\f
(interactive)
(sql-product-interactive 'ms))
-(defun sql-connect-ms ()
- "Create comint buffer and connect to Microsoft using the login
-parameters and command options."
+(defun sql-connect-ms (product options)
+ "Create comint buffer and connect to Microsoft SQL Server."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params sql-ms-options))
+ (let ((params options))
(if (not (string= "" sql-server))
(setq params (append (list "-S" sql-server) params)))
(if (not (string= "" sql-database))
;; If -P is passed to ISQL as the last argument without a
;; password, it's considered null.
(setq params (append params (list "-P")))))
- (set-buffer (apply 'make-comint "SQL" sql-ms-program
- nil params))))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'postgres))
-(defun sql-connect-postgres ()
- "Create comint buffer and connect to Postgres using the login
-parameters and command options."
+(defun sql-connect-postgres (product options)
+ "Create comint buffer and connect to Postgres."
;; username and password are ignored. Mark Stosberg suggest to add
;; the database at the end. Jason Beegan suggest using --pset and
;; pager=off instead of \\o|cat. The later was the solution by
;; Gregor Zych. Jason's suggestion is the default value for
;; sql-postgres-options.
- (let ((params sql-postgres-options))
+ (let ((params options))
(if (not (string= "" sql-database))
(setq params (append params (list sql-database))))
(if (not (string= "" sql-server))
(setq params (append (list "-h" sql-server) params)))
(if (not (string= "" sql-user))
(setq params (append (list "-U" sql-user) params)))
- (set-buffer (apply 'make-comint "SQL" sql-postgres-program
- nil params))))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'interbase))
-(defun sql-connect-interbase ()
- "Create comint buffer and connect to Interbase using the login
-parameters and command options."
+(defun sql-connect-interbase (product options)
+ "Create comint buffer and connect to Interbase."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params sql-interbase-options))
+ (let ((params options))
(if (not (string= "" sql-user))
(setq params (append (list "-u" sql-user) params)))
(if (not (string= "" sql-password))
(setq params (append (list "-p" sql-password) params)))
(if (not (string= "" sql-database))
(setq params (cons sql-database params))) ; add to the front!
- (set-buffer (apply 'make-comint "SQL" sql-interbase-program
- nil params))))
+ (sql-connect product params)))
\f
(interactive)
(sql-product-interactive 'db2))
-(defun sql-connect-db2 ()
- "Create comint buffer and connect to DB2 using the login
-parameters and command options."
+(defun sql-connect-db2 (product options)
+ "Create comint buffer and connect to DB2."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (set-buffer (apply 'make-comint "SQL" sql-db2-program
- nil sql-db2-options))
- ;; Properly escape newlines when DB2 is interactive.
- (setq comint-input-sender 'sql-escape-newlines-and-send))
+ (sql-connect product options)
+)
+;; ;; Properly escape newlines when DB2 is interactive.
+;; (setq comint-input-sender 'sql-escape-newlines-and-send))
;;;###autoload
(defun sql-linter ()
Interpreter used comes from variable `sql-linter-program' - usually `inl'.
Login uses the variables `sql-user', `sql-password', `sql-database' and
`sql-server' as defaults, if set. Additional command line parameters
-can be stored in the list `sql-linter-options'. Run inl -h to get help on
+can be stored in the list `sql-linter-options'. Run inl -h to get help on
parameters.
`sql-database' is used to set the LINTER_MBX environment variable for
(interactive)
(sql-product-interactive 'linter))
-(defun sql-connect-linter ()
- "Create comint buffer and connect to Linter using the login
-parameters and command options."
+(defun sql-connect-linter (product options)
+ "Create comint buffer and connect to Linter."
;; Put all parameters to the program (if defined) in a list and call
;; make-comint.
- (let ((params sql-linter-options) (login nil) (old-mbx (getenv "LINTER_MBX")))
+ (let ((params options)
+ (login nil)
+ (old-mbx (getenv "LINTER_MBX")))
(if (not (string= "" sql-user))
(setq login (concat sql-user "/" sql-password)))
(setq params (append (list "-u" login) params))
(if (string= "" sql-database)
(setenv "LINTER_MBX" nil)
(setenv "LINTER_MBX" sql-database))
- (set-buffer (apply 'make-comint "SQL" sql-linter-program nil
- params))
+ (sql-connect product params)
(setenv "LINTER_MBX" old-mbx)))
\f
;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3
;;; sql.el ends here
+
;; the old `c-forward-into-nomenclature' originally contributed by
;; Terry_Glanfield dot Southern at rxuk dot xerox dot com.
-;; TODO: ispell-word and subword oriented C-w in isearch.
+;; TODO: ispell-word.
;;; Code:
;; .emacs, or in your site's site-load.el
; (autoload 'verilog-mode "verilog-mode" "Verilog mode" t )
-; (add-to-list 'auto-mode-alist '("\\.[ds]?v\\'" . verilog-mode))
+; (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode))
;; If you want to customize Verilog mode to fit your needs better,
;; you may add these lines (the values of the variables presented
;;; Code:
;; This variable will always hold the version number of the mode
-(defconst verilog-mode-version "556"
+(defconst verilog-mode-version "565"
"Version of this Verilog mode.")
-(defconst verilog-mode-release-date "2009-12-10-GNU"
+(defconst verilog-mode-release-date "2010-03-01-GNU"
"Release date of this Verilog mode.")
(defconst verilog-mode-release-emacs t
"If non-nil, this version of Verilog mode was released with Emacs itself.")
`(
"endmodule" "endprimitive" "endinterface" "endpackage" "endprogram" "endclass"
))))
-(defconst verilog-disable-fork-re "disable\\s-+fork")
+(defconst verilog-disable-fork-re "disable\\s-+fork\\>")
+(defconst verilog-fork-wait-re "fork\\s-+wait\\>")
(defconst verilog-extended-case-re "\\(unique\\s-+\\|priority\\s-+\\)?case[xz]?")
(defconst verilog-extended-complete-re
(concat "\\(\\<extern\\s-+\\|\\<virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)"
"unique" "unsigned" "use" "uwire" "var" "vectored" "virtual" "void"
"wait" "wait_order" "wand" "weak0" "weak1" "while" "wildcard"
"wire" "with" "within" "wor" "xnor" "xor"
+ ;; 1800-2009
+ "accept_on" "checker" "endchecker" "eventually" "global" "implies"
+ "let" "nexttime" "reject_on" "restrict" "s_always" "s_eventually"
+ "s_nexttime" "s_until" "s_until_with" "strong" "sync_accept_on"
+ "sync_reject_on" "unique0" "until" "until_with" "untyped" "weak"
)
"List of Verilog keywords.")
"and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam"
"event" "genvar" "inout" "input" "integer" "localparam"
"logic" "mailbox" "nand" "nmos" "not" "notif0" "notif1" "or"
- "output" "parameter" "pmos" "pull0" "pull1" "pullup"
+ "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup"
"rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran"
"rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply"
"supply0" "supply1" "time" "tran" "tranif0" "tranif1"
'("surefire" "synopsys" "rtl_synthesis" "verilint" "leda" "0in") nil
)))
- (verilog-p1800-keywords
+ (verilog-1800-2005-keywords
(eval-when-compile
(verilog-regexp-opt
'("alias" "assert" "assume" "automatic" "before" "bind"
"wait_order" "weak0" "weak1" "wildcard" "with" "within"
) nil )))
+ (verilog-1800-2009-keywords
+ (eval-when-compile
+ (verilog-regexp-opt
+ '("accept_on" "checker" "endchecker" "eventually" "global"
+ "implies" "let" "nexttime" "reject_on" "restrict" "s_always"
+ "s_eventually" "s_nexttime" "s_until" "s_until_with" "strong"
+ "sync_accept_on" "sync_reject_on" "unique0" "until"
+ "until_with" "untyped" "weak" ) nil )))
+
(verilog-ams-keywords
(eval-when-compile
(verilog-regexp-opt
'font-lock-type-face))
(cons (concat "\\<\\(" verilog-type-font-keywords "\\)\\>")
'font-lock-type-face)
- ;; Fontify IEEE-P1800 keywords appropriately
+ ;; Fontify IEEE-1800-2005 keywords appropriately
(if verilog-highlight-p1800-keywords
- (cons (concat "\\<\\(" verilog-p1800-keywords "\\)\\>")
+ (cons (concat "\\<\\(" verilog-1800-2005-keywords "\\)\\>")
'verilog-font-lock-p1800-face)
- (cons (concat "\\<\\(" verilog-p1800-keywords "\\)\\>")
+ (cons (concat "\\<\\(" verilog-1800-2005-keywords "\\)\\>")
+ 'font-lock-type-face))
+ ;; Fontify IEEE-1800-2009 keywords appropriately
+ (if verilog-highlight-p1800-keywords
+ (cons (concat "\\<\\(" verilog-1800-2009-keywords "\\)\\>")
+ 'verilog-font-lock-p1800-face)
+ (cons (concat "\\<\\(" verilog-1800-2009-keywords "\\)\\>")
'font-lock-type-face))
;; Fontify Verilog-AMS keywords
(cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>")
(setq md 3) ;; ender is third item in regexp
)
((match-end 4)
- ;; might be "disable fork"
- (if (or
- (looking-at verilog-disable-fork-re)
- (and (looking-at "fork")
- (progn
- (forward-word -1)
- (looking-at verilog-disable-fork-re))))
- (progn
- (goto-char (match-end 0))
- (forward-word 1)
- (setq reg nil))
- (progn
- ;; Search forward for matching join
- (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))))
+ ;; might be "disable fork" or "fork wait"
+ (let
+ (here)
+ (if (looking-at verilog-fork-wait-re)
+ (progn ;; it is a fork wait; ignore it
+ (goto-char (match-end 0))
+ (setq reg nil))
+ (if (or
+ (looking-at verilog-disable-fork-re)
+ (and (looking-at "fork")
+ (progn
+ (setq here (point)) ;; sometimes a fork is just a fork
+ (forward-word -1)
+ (looking-at verilog-disable-fork-re))))
+ (progn ;; it is a disable fork; ignore it
+ (goto-char (match-end 0))
+ (forward-word 1)
+ (setq reg nil))
+ (progn ;; it is a nice simple fork
+ (goto-char here) ;; return from looking for "disable fork"
+ ;; Search forward for matching join
+ (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))))))
((match-end 6)
;; Search forward for matching endclass
(setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" ))
(forward-word 1))
(catch 'skip
(if (eq nest 'yes)
- (let ((depth 1))
+ (let ((depth 1)
+ here)
(while (verilog-re-search-forward reg nil 'move)
(cond
- ((match-end md) ; the closer in reg, so we are climbing out
+ ((match-end md) ; a closer in regular expression, so we are climbing out
(setq depth (1- depth))
(if (= 0 depth) ; we are out!
(throw 'skip 1)))
- ((match-end 1) ; the opener in reg, so we are deeper now
- (setq depth (1+ depth))))))
+ ((match-end 1) ; an opener in the r-e, so we are in deeper now
+ (setq here (point)) ; remember where we started
+ (goto-char (match-beginning 1))
+ (cond
+ ((looking-at verilog-fork-wait-re)
+ (goto-char (match-end 0))) ; false alarm
+ ((if (or
+ (looking-at verilog-disable-fork-re)
+ (and (looking-at "fork")
+ (progn
+ (forward-word -1)
+ (looking-at verilog-disable-fork-re))))
+ (progn ;; it is a disable fork; another false alarm
+ (goto-char (match-end 0)))
+ (progn ;; it is a simple fork (or has nothing to do with fork)
+ (goto-char here)
+ (setq depth (1+ depth))))))))))
(if (verilog-re-search-forward reg nil 'move)
(throw 'skip 1))))))
((match-end 4) ; *sigh* could be "disable fork"
(let ((here (point)))
(verilog-beg-of-statement)
- (if (looking-at verilog-disable-fork-re)
- t ; is disable fork, this is a normal statement
+ (if (or (looking-at verilog-disable-fork-re)
+ (looking-at verilog-fork-wait-re))
+ t ; this is a normal statement
(progn ; or is fork, starts a new block
(goto-char here)
(throw 'nesting 'block)))))
(goto-char back)
t))))))))
-(defun verilog-backward-syntactic-ws (&optional bound)
- "Backward skip over syntactic whitespace for Emacs 19.
-Optional BOUND limits search."
- (save-restriction
- (let* ((bound (or bound (point-min))) (here bound) )
- (if (< bound (point))
- (progn
- (narrow-to-region bound (point))
- (while (/= here (point))
- (setq here (point))
- (verilog-skip-backward-comments))))))
- t)
+(defun verilog-backward-syntactic-ws ()
+ (verilog-skip-backward-comments)
+ (forward-comment (- (buffer-size))))
-(defun verilog-forward-syntactic-ws (&optional bound)
- "Forward skip over syntactic whitespace for Emacs 19.
-Optional BOUND limits search."
- (save-restriction
- (let* ((bound (or bound (point-max)))
- (here bound))
- (if (> bound (point))
- (progn
- (narrow-to-region (point) bound)
- (while (/= here (point))
- (setq here (point))
- (forward-comment (buffer-size))))))))
+(defun verilog-forward-syntactic-ws ()
+ (verilog-skip-forward-comment-p)
+ (forward-comment (buffer-size)))
(defun verilog-backward-ws&directives (&optional bound)
"Backward skip over syntactic whitespace and compiler directives for Emacs 19.
(search-backward "/*")
(skip-chars-backward " \t\n\f")
t)
- ((and (not (bobp))
- (= (char-before) ?\/)
- (= (char-before (1- (point))) ?\*))
- (goto-char (- (point) 2))
- t)
- (t
- (skip-chars-backward " \t\n\f")
- nil)))))))
+ ((if (and (not (bobp))
+ (= (char-before) ?\/)
+ (= (char-before (1- (point))) ?\*))
+ (goto-char (- (point) 2))
+ (/= (skip-chars-backward " \t\n\f") 0)))))))))
(defun verilog-skip-forward-comment-p ()
"If in comment, move to end and return true."
(progn
(setq state (save-excursion (verilog-syntax-ppss)))
(cond
- ((nth 3 state)
+ ((nth 3 state) ;Inside string
t)
((nth 7 state) ;Inside // comment
(end-of-line)
(forward-char 1)
t)
((nth 4 state) ;Inside any comment
+ (search-forward "*/")
+ (skip-chars-forward " \t\n\f")
t)
(t
- nil)))))
+ (skip-chars-forward " \t\n\f"))))))
(defun verilog-indent-line-relative ()
"Cheap version of indent line.
"Line up declarations around point.
Be verbose about progress unless optional QUIET set."
(interactive)
- (save-excursion
- (if (progn
- (verilog-beg-of-statement-1)
- (and (not (verilog-in-directive-p)) ;; could have `define input foo
- (not (verilog-parenthesis-depth)) ;; could be in a #(param block )
+ (let* ((m1 (make-marker))
+ (e (point))
+ el
+ r
+ (here (point))
+ ind
+ start
+ startpos
+ end
+ endpos
+ base-ind
+ )
+ (save-excursion
+ (if (progn
+; (verilog-beg-of-statement-1)
+ (beginning-of-line)
+ (verilog-forward-syntactic-ws)
+ (and (not (verilog-in-directive-p)) ;; could have `define input foo
(looking-at verilog-declaration-re)))
- (let* ((m1 (make-marker))
- (e (point))
- (r)
- (here (point))
- ;; Start of declaration range
- (start
- (progn
- (verilog-beg-of-statement-1)
- (while (and (looking-at verilog-declaration-re)
- (not (bobp)))
- (skip-chars-backward " \t")
- (setq e (point))
- (beginning-of-line)
- (verilog-backward-syntactic-ws)
- (backward-char)
- (verilog-beg-of-statement-1))
- e))
- ;; End of declaration range
- (end
- (progn
- (goto-char here)
- (verilog-end-of-statement)
- (setq e (point)) ;Might be on last line
- (verilog-forward-syntactic-ws)
- (while (looking-at verilog-declaration-re)
- ;;(beginning-of-line)
- (verilog-end-of-statement)
- (setq e (point))
- (verilog-forward-syntactic-ws))
- e))
- (edpos (set-marker (make-marker) end))
- (ind)
- (base-ind
- (progn
- (goto-char start)
- (verilog-do-indent (verilog-calculate-indent))
- (verilog-forward-ws&directives)
- (current-column))))
- (goto-char start)
- (if (and (not quiet)
- (> (- end start) 100))
- (message "Lining up declarations..(please stand by)"))
- ;; Get the beginning of line indent first
- (while (progn (setq e (marker-position edpos))
- (< (point) e))
- (cond
- ( (save-excursion (skip-chars-backward " \t")
- (bolp))
- (verilog-forward-ws&directives)
- (indent-line-to base-ind)
- (verilog-forward-ws&directives)
- (verilog-re-search-forward "[ \t\n\f]" e 'move))
- (t
- (just-one-space)
- (verilog-re-search-forward "[ \t\n\f]" e 'move)))
- ;;(forward-line)
- )
- ;; Now find biggest prefix
- (setq ind (verilog-get-lineup-indent start edpos))
- ;; Now indent each line.
- (goto-char start)
- (while (progn (setq e (marker-position edpos))
- (setq r (- e (point)))
- (> r 0))
- (setq e (point))
- (unless quiet (message "%d" r))
- (verilog-indent-line)
- (cond
- ((or (and verilog-indent-declaration-macros
- (looking-at verilog-declaration-re-2-macro))
- (looking-at verilog-declaration-re-2-no-macro))
- (let ((p (match-end 0)))
- (set-marker m1 p)
- (if (verilog-re-search-forward "[[#`]" p 'move)
- (progn
- (forward-char -1)
- (just-one-space)
- (goto-char (marker-position m1))
- (just-one-space)
- (indent-to ind))
- (progn
- (just-one-space)
- (indent-to ind)))))
- ((verilog-continued-line-1 start)
- (goto-char e)
- (indent-line-to ind))
- ((verilog-in-struct-p)
- ;; could have a declaration of a user defined item
- (goto-char e)
- (verilog-end-of-statement))
- (t ; Must be comment or white space
- (goto-char e)
- (verilog-forward-ws&directives)
- (forward-line -1)))
- (forward-line 1))
- (unless quiet (message ""))))))
+ (progn
+ (if (verilog-parenthesis-depth)
+ ;; in an argument list or parameter block
+ (setq el (backward-up-list -1)
+ start (progn
+ (goto-char e)
+ (backward-up-list 1)
+ (forward-line) ;; ignore ( input foo,
+ (verilog-re-search-forward verilog-declaration-re el 'move)
+ (goto-char (match-beginning 0))
+ (skip-chars-backward " \t")
+ (point))
+ startpos (set-marker (make-marker) start)
+ end (progn
+ (goto-char start)
+ (backward-up-list -1)
+ (forward-char -1)
+ (verilog-backward-syntactic-ws)
+ (point))
+ endpos (set-marker (make-marker) end)
+ base-ind (progn
+ (goto-char start)
+ (verilog-do-indent (verilog-calculate-indent))
+ (verilog-forward-ws&directives)
+ (current-column))
+ )
+ ;; in a declaration block (not in argument list)
+ (setq
+ start (progn
+ (verilog-beg-of-statement-1)
+ (while (and (looking-at verilog-declaration-re)
+ (not (bobp)))
+ (skip-chars-backward " \t")
+ (setq e (point))
+ (beginning-of-line)
+ (verilog-backward-syntactic-ws)
+ (backward-char)
+ (verilog-beg-of-statement-1))
+ e)
+ startpos (set-marker (make-marker) start)
+ end (progn
+ (goto-char here)
+ (verilog-end-of-statement)
+ (setq e (point)) ;Might be on last line
+ (verilog-forward-syntactic-ws)
+ (while (looking-at verilog-declaration-re)
+ ;;(beginning-of-line)
+ (verilog-end-of-statement)
+ (setq e (point))
+ (verilog-forward-syntactic-ws))
+ e)
+ endpos (set-marker (make-marker) end)
+ base-ind (progn
+ (goto-char start)
+ (verilog-do-indent (verilog-calculate-indent))
+ (verilog-forward-ws&directives)
+ (current-column))))
+ ;; OK, start and end are set
+ (goto-char (marker-position startpos))
+ (if (and (not quiet)
+ (> (- end start) 100))
+ (message "Lining up declarations..(please stand by)"))
+ ;; Get the beginning of line indent first
+ (while (progn (setq e (marker-position endpos))
+ (< (point) e))
+ (cond
+ ((save-excursion (skip-chars-backward " \t")
+ (bolp))
+ (verilog-forward-ws&directives)
+ (indent-line-to base-ind)
+ (verilog-forward-ws&directives)
+ (if (< (point) e)
+ (verilog-re-search-forward "[ \t\n\f]" e 'move)))
+ (t
+ (just-one-space)
+ (verilog-re-search-forward "[ \t\n\f]" e 'move)))
+ ;;(forward-line)
+ )
+ ;; Now find biggest prefix
+ (setq ind (verilog-get-lineup-indent (marker-position startpos) endpos))
+ ;; Now indent each line.
+ (goto-char (marker-position startpos))
+ (while (progn (setq e (marker-position endpos))
+ (setq r (- e (point)))
+ (> r 0))
+ (setq e (point))
+ (unless quiet (message "%d" r))
+ (verilog-indent-line)
+ (verilog-forward-ws&directives)
+ (cond
+ ((or (and verilog-indent-declaration-macros
+ (looking-at verilog-declaration-re-2-macro))
+ (looking-at verilog-declaration-re-2-no-macro))
+ (let ((p (match-end 0)))
+ (set-marker m1 p)
+ (if (verilog-re-search-forward "[[#`]" p 'move)
+ (progn
+ (forward-char -1)
+ (just-one-space)
+ (goto-char (marker-position m1))
+ (just-one-space)
+ (indent-to ind))
+ (progn
+ (just-one-space)
+ (indent-to ind)))))
+ ((verilog-continued-line-1 (marker-position startpos))
+ (goto-char e)
+ (indent-line-to ind))
+ ((verilog-in-struct-p)
+ ;; could have a declaration of a user defined item
+ (goto-char e)
+ (verilog-end-of-statement))
+ (t ; Must be comment or white space
+ (goto-char e)
+ (verilog-forward-ws&directives)
+ (forward-line -1)))
+ (forward-line 1))
+ (unless quiet (message "")))))))
(defun verilog-pretty-expr (&optional quiet myre)
"Line up expressions around point, optionally QUIET with regexp MYRE."
(if (or (eq myre nil)
(string-equal myre ""))
(setq myre "\\(<\\|:\\)?="))
- (setq myre (concat "\\(^[^;#:<=>]*\\)\\(" myre "\\)"))
+ ;; want to match the first <= | := | =
+ (setq myre (concat "\\(^.*?\\)\\(" myre "\\)"))
(let ((rexp(concat "^\\s-*" verilog-complete-reg)))
(beginning-of-line)
(if (and (not (looking-at rexp ))
(beginning-of-line)
)
e))
- (edpos (set-marker (make-marker) end))
+ (endpos (set-marker (make-marker) end))
(ind)
)
(goto-char start)
(message "Lining up expressions..(please stand by)"))
;; Set indent to minimum throughout region
- (while (< (point) (marker-position edpos))
+ (while (< (point) (marker-position endpos))
(beginning-of-line)
(verilog-just-one-space myre)
(end-of-line)
)
;; Now find biggest prefix
- (setq ind (verilog-get-lineup-indent-2 myre start edpos))
+ (setq ind (verilog-get-lineup-indent-2 myre start endpos))
;; Now indent each line.
(goto-char start)
- (while (progn (setq e (marker-position edpos))
+ (while (progn (setq e (marker-position endpos))
(setq r (- e (point)))
(> r 0))
(setq e (point))
;; No lineup-string found
(goto-char b)
(end-of-line)
- (skip-chars-backward " \t")
+ (verilog-backward-syntactic-ws)
+ ;;(skip-chars-backward " \t")
(1+ (current-column))))))
(defun verilog-get-lineup-indent-2 (myre b edpos)
'(
"and" "buf" "bufif0" "bufif1" "cmos" "defparam" "inout" "input"
"integer" "localparam" "logic" "mailbox" "nand" "nmos" "nor" "not" "notif0"
- "notif1" "or" "output" "parameter" "pmos" "pull0" "pull1" "pullup"
+ "notif1" "or" "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup"
"rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran" "rtranif0"
"rtranif1" "semaphore" "time" "tran" "tranif0" "tranif1" "tri" "tri0" "tri1"
"triand" "trior" "trireg" "wand" "wire" "wor" "xnor" "xor"
(verilog-read-sub-decls-expr
submoddecls comment port
(buffer-substring
- (point) (1- (progn (backward-char 1) ; start at (
+ (point) (1- (progn (search-backward "(") ; start at (
(forward-sexp 1) (point)))))))) ; expr
;;
(forward-line 1)))))
(defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning
(defvar vl-width nil "See `verilog-auto-inst'.") ; Prevent compile warning
(defvar vl-dir nil "See `verilog-auto-inst'.") ; Prevent compile warning
+(defvar vl-bits nil "See `verilog-auto-inst'.") ; Prevent compile warning
+(defvar vl-mbits nil "See `verilog-auto-inst'.") ; Prevent compile warning
(defun verilog-auto-inst-port (port-st indent-pt tpl-list tpl-num for-star par-values)
"Print out a instantiation connection for this PORT-ST.
(vl-name (verilog-sig-name port-st))
(vl-width (verilog-sig-width port-st))
(vl-modport (verilog-sig-modport port-st))
+ (vl-mbits (if (verilog-sig-multidim port-st)
+ (verilog-sig-multidim-string port-st) ""))
(vl-bits (if (or verilog-auto-inst-vector
(not (assoc port vector-skip-list))
(not (equal (verilog-sig-bits port-st)
vl-name Name portion of the input/output port.
vl-bits Bus bits portion of the input/output port ('[2:0]').
+ vl-mbits Multidimensional array bits for port ('[2:0][3:0]').
vl-width Width of the input/output port ('3' for [2:0]).
May be a (...) expression if bits isn't a constant.
vl-dir Direction of the pin input/output/inout/interface.
"Customizations for modes."
:group 'vhdl)
-(defcustom vhdl-electric-mode t
- "*Non-nil enables electrification (automatic template generation).
-If nil, template generators can still be invoked through key bindings and
-menu. Is indicated in the modeline by \"/e\" after the mode name and can be
-toggled by `\\[vhdl-electric-mode]'."
- :type 'boolean
- :group 'vhdl-mode)
-
-(defcustom vhdl-stutter-mode t
- "*Non-nil enables stuttering.
-Is indicated in the modeline by \"/s\" after the mode name and can be toggled
-by `\\[vhdl-stutter-mode]'."
- :type 'boolean
- :group 'vhdl-mode)
-
(defcustom vhdl-indent-tabs-mode nil
"*Non-nil means indentation can insert tabs.
Overrides local variable `indent-tabs-mode'."
("Mode"
["Electric Mode"
(progn (customize-set-variable 'vhdl-electric-mode
- (not vhdl-electric-mode))
- (vhdl-mode-line-update))
+ (not vhdl-electric-mode)))
:style toggle :selected vhdl-electric-mode :keys "C-c C-m C-e"]
["Stutter Mode"
(progn (customize-set-variable 'vhdl-stutter-mode
- (not vhdl-stutter-mode))
- (vhdl-mode-line-update))
+ (not vhdl-stutter-mode)))
:style toggle :selected vhdl-stutter-mode :keys "C-c C-m C-s"]
["Indent Tabs Mode"
(progn (customize-set-variable 'vhdl-indent-tabs-mode
(interactive)
(kill-all-local-variables)
(setq major-mode 'vhdl-mode)
- (setq mode-name "VHDL")
+ (setq mode-name '("VHDL"
+ (vhdl-electric-mode "/" (vhdl-stutter-mode "/"))
+ (vhdl-electric-mode "e")
+ (vhdl-stutter-mode "s")))
;; set maps and tables
(use-local-map vhdl-mode-map)
;; miscellaneous
(vhdl-ps-print-init)
(vhdl-write-file-hooks-init)
- (vhdl-mode-line-update)
(message "VHDL Mode %s.%s" vhdl-version
(if noninteractive "" " See menu for documentation and release notes."))
(vhdl-write-file-hooks-init)
(vhdl-update-mode-menu)
(vhdl-hideshow-init)
- (run-hooks 'menu-bar-update-hook)
- (vhdl-mode-line-update))
+ (run-hooks 'menu-bar-update-hook))
(defun vhdl-write-file-hooks-init ()
"Add/remove hooks when buffer is saved."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Enabling/disabling
-(defun vhdl-mode-line-update ()
- "Update the modeline string for VHDL major mode."
- (setq mode-name (concat "VHDL"
- (and (or vhdl-electric-mode vhdl-stutter-mode) "/")
- (and vhdl-electric-mode "e")
- (and vhdl-stutter-mode "s")))
- (force-mode-line-update t))
-
-(defun vhdl-electric-mode (arg)
+(define-minor-mode vhdl-electric-mode
"Toggle VHDL electric mode.
Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil."
- (interactive "P")
- (setq vhdl-electric-mode
- (cond ((or (not arg) (zerop arg)) (not vhdl-electric-mode))
- ((> arg 0) t) (t nil)))
- (vhdl-mode-line-update))
+ :global t)
-(defun vhdl-stutter-mode (arg)
+(define-minor-mode vhdl-stutter-mode
"Toggle VHDL stuttering mode.
Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil."
- (interactive "P")
- (setq vhdl-stutter-mode
- (cond ((or (not arg) (zerop arg)) (not vhdl-stutter-mode))
- ((> arg 0) t) (t nil)))
- (vhdl-mode-line-update))
+ :global t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Stuttering
(add-hook 'hs-minor-mode-hook 'hs-hide-all)
(remove-hook 'hs-minor-mode-hook 'hs-hide-all))
(hs-minor-mode arg)
- (vhdl-mode-line-update))) ; hack to update menu bar
+ (force-mode-line-update))) ; hack to update menu bar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"Support for printing and PostScript."
:tag "PostScript"
:version "20"
- :group 'emacs)
+ :group 'external)
(defgroup ps-print nil
"PostScript generator for Emacs."
:type 'boolean
:group 'matching)
-(defvar query-replace-history nil)
+(defvar query-replace-history nil
+ "Default history list for query-replace commands.
+See `query-replace-from-history-variable' and
+`query-replace-to-history-variable'.")
(defvar query-replace-defaults nil
"Default values of FROM-STRING and TO-STRING for `query-replace'.
(car regexp-search-ring)
(read-from-minibuffer "Map query replace (regexp): "
nil nil nil
- 'query-replace-history nil t)))
+ query-replace-from-history-variable
+ nil t)))
(to (read-from-minibuffer
(format "Query replace %s with (space-separated strings): "
(query-replace-descr from))
nil nil nil
- 'query-replace-history from t)))
+ query-replace-to-history-variable from t)))
(list from to
(and current-prefix-arg
(prefix-numeric-value current-prefix-arg))
:group 'matching
:version "22.1")
-(defun occur-accumulate-lines (count &optional keep-props)
- (save-excursion
- (let ((forwardp (> count 0))
- result beg end)
- (while (not (or (zerop count)
- (if forwardp
- (eobp)
- (bobp))))
- (setq count (+ count (if forwardp -1 1)))
- (setq beg (line-beginning-position)
- end (line-end-position))
- (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode)
- (text-property-not-all beg end 'fontified t))
- (if (fboundp 'jit-lock-fontify-now)
- (jit-lock-fontify-now beg end)))
- (push
- (if (and keep-props (not (eq occur-excluded-properties t)))
- (let ((str (buffer-substring beg end)))
- (remove-list-of-text-properties
- 0 (length str) occur-excluded-properties str)
- str)
- (buffer-substring-no-properties beg end))
- result)
- (forward-line (if forwardp 1 -1)))
- (nreverse result))))
-
(defun occur-read-primary-args ()
(list (read-regexp "List lines matching regexp"
(car regexp-history))
(defun occur-rename-buffer (&optional unique-p interactive-p)
"Rename the current *Occur* buffer to *Occur: original-buffer-name*.
-Here `original-buffer-name' is the buffer name were Occur was originally run.
+Here `original-buffer-name' is the buffer name where Occur was originally run.
When given the prefix argument, or called non-interactively, the renaming
will not clobber the existing buffer(s) of that name, but use
`generate-new-buffer-name' instead. You can add this to `occur-hook'
(defun occur (regexp &optional nlines)
"Show all lines in the current buffer containing a match for REGEXP.
-This function can not handle matches that span more than one line.
+If a match spreads across multiple lines, all those lines are shown.
Each line is displayed with NLINES lines before and after, or -NLINES
before if NLINES is negative.
(not (eq occur-excluded-properties t)))))
(let* ((bufcount (length active-bufs))
(diff (- (length bufs) bufcount)))
- (message "Searched %d buffer%s%s; %s match%s for `%s'"
+ (message "Searched %d buffer%s%s; %s match%s%s"
bufcount (if (= bufcount 1) "" "s")
(if (zerop diff) "" (format " (%d killed)" diff))
(if (zerop count) "no" (format "%d" count))
(if (= count 1) "" "es")
- regexp))
+ ;; Don't display regexp if with remaining text
+ ;; it is longer than window-width.
+ (if (> (+ (length regexp) 42) (window-width))
+ "" (format " for `%s'" (query-replace-descr regexp)))))
(setq occur-revert-arguments (list regexp nlines bufs))
(if (= count 0)
(kill-buffer occur-buf)
(set-buffer-modified-p nil)
(run-hooks 'occur-hook)))))))
-(defun occur-engine-add-prefix (lines)
- (mapcar
- #'(lambda (line)
- (concat " :" line "\n"))
- lines))
-
(defun occur-engine (regexp buffers out-buf nlines case-fold-search
title-face prefix-face match-face keep-props)
(with-current-buffer out-buf
(when (buffer-live-p buf)
(let ((matches 0) ;; count of matched lines
(lines 1) ;; line count
+ (prev-after-lines nil) ;; context lines of prev match
+ (prev-lines nil) ;; line number of prev match endpt
(matchbeg 0)
(origpt nil)
(begpt nil)
(endpt nil)
(marker nil)
(curstring "")
+ (ret nil)
(inhibit-field-text-motion t)
(headerpt (with-current-buffer out-buf (point))))
(with-current-buffer buf
(when (setq endpt (re-search-forward regexp nil t))
(setq matches (1+ matches)) ;; increment match count
(setq matchbeg (match-beginning 0))
- (setq lines (+ lines (1- (count-lines origpt endpt))))
+ ;; Get beginning of first match line and end of the last.
(save-excursion
(goto-char matchbeg)
- (setq begpt (line-beginning-position)
- endpt (line-end-position)))
+ (setq begpt (line-beginning-position))
+ (goto-char endpt)
+ (setq endpt (line-end-position)))
+ ;; Sum line numbers up to the first match line.
+ (setq lines (+ lines (count-lines origpt begpt)))
(setq marker (make-marker))
(set-marker marker matchbeg)
- (if (and keep-props
- (if (boundp 'jit-lock-mode) jit-lock-mode)
- (text-property-not-all begpt endpt 'fontified t))
- (if (fboundp 'jit-lock-fontify-now)
- (jit-lock-fontify-now begpt endpt)))
- (if (and keep-props (not (eq occur-excluded-properties t)))
- (progn
- (setq curstring (buffer-substring begpt endpt))
- (remove-list-of-text-properties
- 0 (length curstring) occur-excluded-properties curstring))
- (setq curstring (buffer-substring-no-properties begpt endpt)))
+ (setq curstring (occur-engine-line begpt endpt keep-props))
;; Highlight the matches
(let ((len (length curstring))
(start 0))
curstring)
(setq start (match-end 0))))
;; Generate the string to insert for this match
- (let* ((out-line
+ (let* ((match-prefix
+ ;; Using 7 digits aligns tabs properly.
+ (apply #'propertize (format "%7d:" lines)
+ (append
+ (when prefix-face
+ `(font-lock-face prefix-face))
+ `(occur-prefix t mouse-face (highlight)
+ occur-target ,marker follow-link t
+ help-echo "mouse-2: go to this occurrence"))))
+ (match-str
+ ;; We don't put `mouse-face' on the newline,
+ ;; because that loses. And don't put it
+ ;; on context lines to reduce flicker.
+ (propertize curstring 'mouse-face (list 'highlight)
+ 'occur-target marker
+ 'follow-link t
+ 'help-echo
+ "mouse-2: go to this occurrence"))
+ (out-line
(concat
- ;; Using 7 digits aligns tabs properly.
- (apply #'propertize (format "%7d:" lines)
- (append
- (when prefix-face
- `(font-lock-face prefix-face))
- `(occur-prefix t mouse-face (highlight)
- occur-target ,marker follow-link t
- help-echo "mouse-2: go to this occurrence")))
- ;; We don't put `mouse-face' on the newline,
- ;; because that loses. And don't put it
- ;; on context lines to reduce flicker.
- (propertize curstring 'mouse-face (list 'highlight)
- 'occur-target marker
- 'follow-link t
- 'help-echo
- "mouse-2: go to this occurrence")
+ match-prefix
+ ;; Add non-numeric prefix to all non-first lines
+ ;; of multi-line matches.
+ (replace-regexp-in-string
+ "\n"
+ "\n :"
+ match-str)
;; Add marker at eol, but no mouse props.
(propertize "\n" 'occur-target marker)))
(data
;; The simple display style
out-line
;; The complex multi-line display style.
- (occur-context-lines out-line nlines keep-props)
- )))
+ (setq ret (occur-context-lines
+ out-line nlines keep-props begpt endpt
+ lines prev-lines prev-after-lines))
+ ;; Set first elem of the returned list to `data',
+ ;; and the second elem to `prev-after-lines'.
+ (setq prev-after-lines (nth 1 ret))
+ (nth 0 ret))))
;; Actually insert the match display data
(with-current-buffer out-buf
(let ((beg (point))
- (end (progn (insert data) (point))))
- (unless (= nlines 0)
- (insert "-------\n")))))
+ (end (progn (insert data) (point)))))))
(goto-char endpt))
(if endpt
(progn
- (setq lines (1+ lines))
+ ;; Sum line numbers between first and last match lines.
+ (setq lines (+ lines (count-lines begpt endpt)
+ ;; Add 1 for empty last match line since
+ ;; count-lines returns 1 line less.
+ (if (and (bolp) (eolp)) 1 0)))
;; On to the next match...
(forward-line 1))
- (goto-char (point-max))))))
+ (goto-char (point-max)))
+ (setq prev-lines (1- lines)))
+ ;; Flush remaining context after-lines.
+ (when prev-after-lines
+ (with-current-buffer out-buf
+ (insert (apply #'concat (occur-engine-add-prefix
+ prev-after-lines)))))))
(when (not (zerop matches)) ;; is the count zero?
(setq globalcount (+ globalcount matches))
(with-current-buffer out-buf
(goto-char headerpt)
(let ((beg (point))
end)
- (insert (format "%d match%s for \"%s\" in buffer: %s\n"
+ (insert (format "%d match%s%s in buffer: %s\n"
matches (if (= matches 1) "" "es")
- regexp (buffer-name buf)))
+ ;; Don't display regexp for multi-buffer.
+ (if (> (length buffers) 1)
+ "" (format " for \"%s\""
+ (query-replace-descr regexp)))
+ (buffer-name buf)))
(setq end (point))
(add-text-properties beg end
(append
`(font-lock-face ,title-face))
`(occur-title ,buf))))
(goto-char (point-min)))))))
+ ;; Display total match count and regexp for multi-buffer.
+ (when (and (not (zerop globalcount)) (> (length buffers) 1))
+ (goto-char (point-min))
+ (let ((beg (point))
+ end)
+ (insert (format "%d match%s total for \"%s\":\n"
+ globalcount (if (= globalcount 1) "" "es")
+ (query-replace-descr regexp)))
+ (setq end (point))
+ (add-text-properties beg end (when title-face
+ `(font-lock-face ,title-face))))
+ (goto-char (point-min)))
(if coding
;; CODING is buffer-file-coding-system of the first buffer
;; that locally binds it. Let's use it also for the output
;; Return the number of matches
globalcount)))
+(defun occur-engine-line (beg end &optional keep-props)
+ (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode)
+ (text-property-not-all beg end 'fontified t))
+ (if (fboundp 'jit-lock-fontify-now)
+ (jit-lock-fontify-now beg end)))
+ (if (and keep-props (not (eq occur-excluded-properties t)))
+ (let ((str (buffer-substring beg end)))
+ (remove-list-of-text-properties
+ 0 (length str) occur-excluded-properties str)
+ str)
+ (buffer-substring-no-properties beg end)))
+
+(defun occur-engine-add-prefix (lines)
+ (mapcar
+ #'(lambda (line)
+ (concat " :" line "\n"))
+ lines))
+
+(defun occur-accumulate-lines (count &optional keep-props pt)
+ (save-excursion
+ (when pt
+ (goto-char pt))
+ (let ((forwardp (> count 0))
+ result beg end moved)
+ (while (not (or (zerop count)
+ (if forwardp
+ (eobp)
+ (and (bobp) (not moved)))))
+ (setq count (+ count (if forwardp -1 1)))
+ (setq beg (line-beginning-position)
+ end (line-end-position))
+ (push (occur-engine-line beg end keep-props) result)
+ (setq moved (= 0 (forward-line (if forwardp 1 -1)))))
+ (nreverse result))))
+
;; Generate context display for occur.
;; OUT-LINE is the line where the match is.
;; NLINES and KEEP-PROPS are args to occur-engine.
+;; LINES is line count of the current match,
+;; PREV-LINES is line count of the previous match,
+;; PREV-AFTER-LINES is a list of after-context lines of the previous match.
;; Generate a list of lines, add prefixes to all but OUT-LINE,
;; then concatenate them all together.
-(defun occur-context-lines (out-line nlines keep-props)
- (apply #'concat
- (nconc
- (occur-engine-add-prefix
- (nreverse (cdr (occur-accumulate-lines
- (- (1+ (abs nlines))) keep-props))))
- (list out-line)
- (if (> nlines 0)
- (occur-engine-add-prefix
- (cdr (occur-accumulate-lines (1+ nlines) keep-props)))))))
+(defun occur-context-lines (out-line nlines keep-props begpt endpt
+ lines prev-lines prev-after-lines)
+ ;; Find after- and before-context lines of the current match.
+ (let ((before-lines
+ (nreverse (cdr (occur-accumulate-lines
+ (- (1+ (abs nlines))) keep-props begpt))))
+ (after-lines
+ (cdr (occur-accumulate-lines
+ (1+ nlines) keep-props endpt)))
+ separator)
+
+ ;; Combine after-lines of the previous match
+ ;; with before-lines of the current match.
+
+ (when prev-after-lines
+ ;; Don't overlap prev after-lines with current before-lines.
+ (if (>= (+ prev-lines (length prev-after-lines))
+ (- lines (length before-lines)))
+ (setq prev-after-lines
+ (butlast prev-after-lines
+ (- (length prev-after-lines)
+ (- lines prev-lines (length before-lines) 1))))
+ ;; Separate non-overlapping context lines with a dashed line.
+ (setq separator "-------\n")))
+
+ (when prev-lines
+ ;; Don't overlap current before-lines with previous match line.
+ (if (<= (- lines (length before-lines))
+ prev-lines)
+ (setq before-lines
+ (nthcdr (- (length before-lines)
+ (- lines prev-lines 1))
+ before-lines))
+ ;; Separate non-overlapping before-context lines.
+ (unless (> nlines 0)
+ (setq separator "-------\n"))))
+
+ (list
+ ;; Return a list where the first element is the output line.
+ (apply #'concat
+ (append
+ (and prev-after-lines
+ (occur-engine-add-prefix prev-after-lines))
+ (and separator (list separator))
+ (occur-engine-add-prefix before-lines)
+ (list out-line)))
+ ;; And the second element is the list of context after-lines.
+ (if (> nlines 0) after-lines))))
+
\f
;; It would be nice to use \\[...], but there is no reasonable way
;; to make that display both SPC and Y.
(isearch-regexp regexp)
(search-whitespace-regexp nil)
(isearch-case-fold-search case-fold))
+ ;; Set isearch-word to nil because word-replace is regexp-based,
+ ;; so `isearch-search-fun' should not use `word-search-forward'.
+ (if (and isearch-word isearch-regexp) (setq isearch-word nil))
(isearch-lazy-highlight-new-loop range-beg range-end))))
(defun replace-dehighlight ()
(defgroup reveal nil
"Reveal hidden text on the fly."
- :group 'editing)
+ :group 'convenience)
(defcustom reveal-around-mark t
"Reveal text around the mark, if active."
:version "22.1"
:group 'minibuffer)
-;;;###autoload
-(defcustom savehist-mode nil
- "Mode for automatic saving of minibuffer history.
-Set this by calling the `savehist-mode' function or using the customize
-interface."
- :type 'boolean
- :set (lambda (symbol value) (savehist-mode (or value 0)))
- :initialize 'custom-initialize-default
- :require 'savehist
- :group 'savehist)
-
(defcustom savehist-save-minibuffer-history t
"If non-nil, save all recorded minibuffer histories.
If you want to save only specific histories, use `savehist-save-hook' to
;; Functions.
;;;###autoload
-(defun savehist-mode (arg)
+(define-minor-mode savehist-mode
"Toggle savehist-mode.
Positive ARG turns on `savehist-mode'. When on, savehist-mode causes
minibuffer history to be saved periodically and when exiting Emacs.
This mode should normally be turned on from your Emacs init file.
Calling it at any other time replaces your current minibuffer histories,
which is probably undesirable."
- (interactive "P")
- (setq savehist-mode
- (if (null arg)
- (not savehist-mode)
- (> (prefix-numeric-value arg) 0)))
+ :global t
(if (not savehist-mode)
(savehist-uninstall)
(when (and (not savehist-loaded)
(setq savehist-mode nil)
(savehist-uninstall)
(signal (car errvar) (cdr errvar)))))
- (savehist-install)
- (run-hooks 'savehist-mode-hook))
- ;; Return the new setting.
- savehist-mode)
-(add-minor-mode 'savehist-mode "")
+ (savehist-install)))
(defun savehist-load ()
"Load the variables stored in `savehist-file' and turn on `savehist-mode'.
(call-interactively 'scroll-all-scroll-down-all))
((eq this-command 'previous-line)
(call-interactively 'scroll-all-scroll-up-all))
- ((eq this-command 'scroll-up)
+ ((memq this-command '(scroll-up scroll-up-command))
(call-interactively 'scroll-all-page-down-all))
- ((eq this-command 'scroll-down)
+ ((memq this-command '(scroll-down scroll-down-command))
(call-interactively 'scroll-all-page-up-all))
((eq this-command 'beginning-of-buffer)
(call-interactively 'scroll-all-beginning-of-buffer-all))
;;; Code:
(require 'mouse)
+(eval-when-compile (require 'cl))
\f
;;;; Utilities.
"Non-nil means `set-scroll-bar-mode' should really do something.
This is nil while loading `scroll-bar.el', and t afterward.")
-(defun set-scroll-bar-mode-1 (ignore value)
- (set-scroll-bar-mode value))
-
(defun set-scroll-bar-mode (value)
"Set `scroll-bar-mode' to VALUE and put the new value into effect."
(if scroll-bar-mode
;; The default value for :initialize would try to use :set
;; when processing the file in cus-dep.el.
:initialize 'custom-initialize-default
- :set 'set-scroll-bar-mode-1)
+ :set (lambda (sym val) (set-scroll-bar-mode val)))
;; We just set scroll-bar-mode, but that was the default.
;; If it is set again, that is for real.
(setq scroll-bar-mode-explicit t)
-(defun scroll-bar-mode (&optional flag)
+(defun get-scroll-bar-mode () scroll-bar-mode)
+(defsetf get-scroll-bar-mode set-scroll-bar-mode)
+(define-minor-mode scroll-bar-mode
"Toggle display of vertical scroll bars on all frames.
This command applies to all frames that exist and frames to be
created in the future.
With a numeric argument, if the argument is positive
turn on scroll bars; otherwise turn off scroll bars."
- (interactive "P")
-
- ;; Tweedle the variable according to the argument.
- (set-scroll-bar-mode (if (if (null flag)
- (not scroll-bar-mode)
- (setq flag (prefix-numeric-value flag))
- (or (not (numberp flag)) (> flag 0)))
- (or previous-scroll-bar-mode
- default-frame-scroll-bars))))
+ :variable (eq (get-scroll-bar-mode)
+ (or previous-scroll-bar-mode
+ default-frame-scroll-bars)))
(defun toggle-scroll-bar (arg)
"Toggle whether or not the selected frame has vertical scroll bars.
;; for possible servers before doing anything, so it *should* be ours.
(and (process-contact proc :server)
(eq (process-status proc) 'closed)
- (ignore-errors (delete-file (process-get proc :server-file))))
+ (ignore-errors
+ (delete-file (process-get proc :server-file) t)))
(server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
(server-delete-client proc))
;; Delete the socket files made by previous server invocations.
(if (not (eq t (server-running-p server-name)))
;; Remove any leftover socket or authentication file
- (ignore-errors (delete-file server-file))
+ (ignore-errors
+ (let (delete-by-moving-to-trash)
+ (delete-file server-file)))
(setq server-mode nil) ;; already set by the minor mode code
(display-warning
'server
server-auth-dir
server-socket-dir))))
(condition-case nil
- (progn
+ (let (delete-by-moving-to-trash)
(delete-file file)
(message "Connection file %S deleted" file))
(file-error
(setq prog sha1-program
args nil))
(with-temp-buffer
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert string)
(apply (function call-process-region)
(point-min) (point-max)
Other major modes are defined by comparison with this one."
(interactive)
(kill-all-local-variables)
- (unless delay-mode-hooks
- (run-hooks 'after-change-major-mode-hook)))
+ (run-mode-hooks 'fundamental-mode-hook))
;; Special major modes to view specially formatted data rather than files.
"Parent major mode from which special major modes should inherit."
(setq buffer-read-only t))
+;; Major mode meant to be the parent of programming modes.
+
+(define-derived-mode prog-mode fundamental-mode "Prog"
+ "Major mode for editing programming language source code."
+ (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+ (set (make-local-variable 'parse-sexp-ignore-comments) t))
+
;; Making and deleting lines.
(defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))
Like `shell-command' but if COMMAND doesn't end in ampersand, adds `&'
surrounded by whitespace and executes the command asynchronously.
-The output appears in the buffer `*Async Shell Command*'."
+The output appears in the buffer `*Async Shell Command*'.
+
+In Elisp, you will often be better served by calling `start-process'
+directly, since it offers more control and does not impose the use of a
+shell (with its need to quote arguments)."
(interactive
(list
(read-shell-command "Async shell command: " nil nil
or buffer name to which to direct the command's standard error output.
If it is nil, error output is mingled with regular output.
In an interactive call, the variable `shell-command-default-error-buffer'
-specifies the value of ERROR-BUFFER."
+specifies the value of ERROR-BUFFER.
+
+In Elisp, you will often be better served by calling `call-process' or
+`start-process' directly, since it offers more control and does not impose
+the use of a shell (with its need to quote arguments)."
(interactive
(list
(reset-this-command-lengths)
(restore-overriding-map))
\f
+;; This function is here rather than in subr.el because it uses CL.
+(defmacro with-wrapper-hook (var args &rest body)
+ "Run BODY wrapped with the VAR hook.
+VAR is a special hook: its functions are called with a first argument
+which is the \"original\" code (the BODY), so the hook function can wrap
+the original function, or call it any number of times (including not calling
+it at all). This is similar to an `around' advice.
+VAR is normally a symbol (a variable) in which case it is treated like
+a hook, with a buffer-local and a global part. But it can also be an
+arbitrary expression.
+ARGS is a list of variables which will be passed as additional arguments
+to each function, after the initial argument, and which the first argument
+expects to receive when called."
+ (declare (indent 2) (debug t))
+ ;; We need those two gensyms because CL's lexical scoping is not available
+ ;; for function arguments :-(
+ (let ((funs (make-symbol "funs"))
+ (global (make-symbol "global"))
+ (argssym (make-symbol "args")))
+ ;; Since the hook is a wrapper, the loop has to be done via
+ ;; recursion: a given hook function will call its parameter in order to
+ ;; continue looping.
+ `(labels ((runrestofhook (,funs ,global ,argssym)
+ ;; `funs' holds the functions left on the hook and `global'
+ ;; holds the functions left on the global part of the hook
+ ;; (in case the hook is local).
+ (lexical-let ((funs ,funs)
+ (global ,global))
+ (if (consp funs)
+ (if (eq t (car funs))
+ (runrestofhook
+ (append global (cdr funs)) nil ,argssym)
+ (apply (car funs)
+ (lambda (&rest ,argssym)
+ (runrestofhook (cdr funs) global ,argssym))
+ ,argssym))
+ ;; Once there are no more functions on the hook, run
+ ;; the original body.
+ (apply (lambda ,args ,@body) ,argssym)))))
+ (runrestofhook ,var
+ ;; The global part of the hook, if any.
+ ,(if (symbolp var)
+ `(if (local-variable-p ',var)
+ (default-value ',var)))
+ (list ,@args)))))
+
+(defvar filter-buffer-substring-functions nil
+ "Wrapper hook around `filter-buffer-substring'.
+The functions on this special hook are called with 4 arguments:
+ NEXT-FUN BEG END DELETE
+NEXT-FUN is a function of 3 arguments (BEG END DELETE)
+that performs the default operation. The other 3 arguments are like
+the ones passed to `filter-buffer-substring'.")
+
(defvar buffer-substring-filters nil
"List of filter functions for `filter-buffer-substring'.
Each function must accept a single argument, a string, and return
return value of `filter-buffer-substring'.
If this variable is nil, no filtering is performed.")
+(make-obsolete-variable 'buffer-substring-filters
+ 'filter-buffer-substring-functions "24.1")
-(defun filter-buffer-substring (beg end &optional delete noprops)
+(defun filter-buffer-substring (beg end &optional delete)
"Return the buffer substring between BEG and END, after filtering.
-The buffer substring is passed through each of the filter
-functions in `buffer-substring-filters', and the value from the
-last filter function is returned. If `buffer-substring-filters'
-is nil, the buffer substring is returned unaltered.
+The filtering is performed by `filter-buffer-substring-functions'.
If DELETE is non-nil, the text between BEG and END is deleted
from the buffer.
-If NOPROPS is non-nil, final string returned does not include
-text properties, while the string passed to the filters still
-includes text properties from the buffer text.
-
-Point is temporarily set to BEG before calling
-`buffer-substring-filters', in case the functions need to know
-where the text came from.
-
This function should be used instead of `buffer-substring',
`buffer-substring-no-properties', or `delete-and-extract-region'
when you want to allow filtering to take place. For example,
-major or minor modes can use `buffer-substring-filters' to
+major or minor modes can use `filter-buffer-substring-functions' to
extract characters that are special to a buffer, and should not
be copied into other buffers."
- (cond
- ((or delete buffer-substring-filters)
- (save-excursion
- (goto-char beg)
- (let ((string (if delete (delete-and-extract-region beg end)
- (buffer-substring beg end))))
- (dolist (filter buffer-substring-filters)
- (setq string (funcall filter string)))
- (if noprops
- (set-text-properties 0 (length string) nil string))
- string)))
- (noprops
- (buffer-substring-no-properties beg end))
- (t
- (buffer-substring beg end))))
+ (with-wrapper-hook filter-buffer-substring-functions (beg end delete)
+ (cond
+ ((or delete buffer-substring-filters)
+ (save-excursion
+ (goto-char beg)
+ (let ((string (if delete (delete-and-extract-region beg end)
+ (buffer-substring beg end))))
+ (dolist (filter buffer-substring-filters)
+ (setq string (funcall filter string)))
+ string)))
+ (t
+ (buffer-substring beg end)))))
;;;; Window system cut and paste hooks.
(interactive
(list (read-buffer "Append to buffer: " (other-buffer (current-buffer) t))
(region-beginning) (region-end)))
- (let ((oldbuf (current-buffer)))
- (let* ((append-to (get-buffer-create buffer))
- (windows (get-buffer-window-list append-to t t))
- point)
- (save-excursion
- (with-current-buffer append-to
- (setq point (point))
- (barf-if-buffer-read-only)
- (insert-buffer-substring oldbuf start end)
- (dolist (window windows)
- (when (= (window-point window) point)
- (set-window-point window (point)))))))))
+ (let* ((oldbuf (current-buffer))
+ (append-to (get-buffer-create buffer))
+ (windows (get-buffer-window-list append-to t t))
+ point)
+ (save-excursion
+ (with-current-buffer append-to
+ (setq point (point))
+ (barf-if-buffer-read-only)
+ (insert-buffer-substring oldbuf start end)
+ (dolist (window windows)
+ (when (= (window-point window) point)
+ (set-window-point window (point))))))))
(defun prepend-to-buffer (buffer start end)
"Prepend to specified buffer the text of the region.
If `widen-automatically' is nil, these commands will do something else
as a fallback, and won't change the buffer bounds.")
+(defvar non-essential nil
+ "Whether the currently executing code is performing an essential task.
+This variable should be non-nil only when running code which should not
+disturb the user. E.g. it can be used to prevent Tramp from prompting the
+user for a password when we are simply scanning a set of files in the
+background or displaying possible completions before the user even asked
+for it.")
+
(defun pop-global-mark ()
"Pop off global mark ring and jump to the top location."
(interactive)
(insert (if use-hard-newlines hard-newline "\n")))
(line-move arg nil nil try-vscroll))
(if (called-interactively-p 'interactive)
- (condition-case nil
+ (condition-case err
(line-move arg nil nil try-vscroll)
- ((beginning-of-buffer end-of-buffer) (ding)))
+ ((beginning-of-buffer end-of-buffer)
+ (signal (car err) (cdr err))))
(line-move arg nil nil try-vscroll)))
nil)
(interactive "^p\np")
(or arg (setq arg 1))
(if (called-interactively-p 'interactive)
- (condition-case nil
+ (condition-case err
(line-move (- arg) nil nil try-vscroll)
- ((beginning-of-buffer end-of-buffer) (ding)))
+ ((beginning-of-buffer end-of-buffer)
+ (signal (car err) (cdr err))))
(line-move (- arg) nil nil try-vscroll))
nil)
(let ((goal-column 0)
(line-move-visual nil))
(and (line-move arg t)
+ ;; With bidi reordering, we may not be at bol,
+ ;; so make sure we are.
+ (skip-chars-backward "^\n")
(not (bobp))
(progn
(while (and (not (bobp)) (invisible-p (1- (point))))
(define-globalized-minor-mode global-visual-line-mode
visual-line-mode turn-on-visual-line-mode
:lighter " vl")
-\f
-(defun scroll-other-window-down (lines)
- "Scroll the \"other window\" down.
-For more details, see the documentation for `scroll-other-window'."
- (interactive "P")
- (scroll-other-window
- ;; Just invert the argument's meaning.
- ;; We can do that without knowing which window it will be.
- (if (eq lines '-) nil
- (if (null lines) '-
- (- (prefix-numeric-value lines))))))
-
-(defun beginning-of-buffer-other-window (arg)
- "Move point to the beginning of the buffer in the other window.
-Leave mark at previous position.
-With arg N, put point N/10 of the way from the true beginning."
- (interactive "P")
- (let ((orig-window (selected-window))
- (window (other-window-for-scrolling)))
- ;; We use unwind-protect rather than save-window-excursion
- ;; because the latter would preserve the things we want to change.
- (unwind-protect
- (progn
- (select-window window)
- ;; Set point and mark in that window's buffer.
- (with-no-warnings
- (beginning-of-buffer arg))
- ;; Set point accordingly.
- (recenter '(t)))
- (select-window orig-window))))
-
-(defun end-of-buffer-other-window (arg)
- "Move point to the end of the buffer in the other window.
-Leave mark at previous position.
-With arg N, put point N/10 of the way from the true end."
- (interactive "P")
- ;; See beginning-of-buffer-other-window for comments.
- (let ((orig-window (selected-window))
- (window (other-window-for-scrolling)))
- (unwind-protect
- (progn
- (select-window window)
- (with-no-warnings
- (end-of-buffer arg))
- (recenter '(t)))
- (select-window orig-window))))
+
\f
(defun transpose-chars (arg)
"Interchange characters around point, moving forward one character.
(put 'auto-fill-function 'safe-local-variable 'null)
;; FIXME: turn into a proper minor mode.
;; Add a global minor mode version of it.
-(defun auto-fill-mode (&optional arg)
+(define-minor-mode auto-fill-mode
"Toggle Auto Fill mode.
With ARG, turn Auto Fill mode on if and only if ARG is positive.
In Auto Fill mode, inserting a space at a column beyond `current-fill-column'
The value of `normal-auto-fill-function' specifies the function to use
for `auto-fill-function' when turning Auto Fill mode on."
- (interactive "P")
- (prog1 (setq auto-fill-function
- (if (if (null arg)
- (not auto-fill-function)
- (> (prefix-numeric-value arg) 0))
- normal-auto-fill-function
- nil))
- (force-mode-line-update)))
+ :variable (eq auto-fill-function normal-auto-fill-function))
;; This holds a document string used to document auto-fill-mode.
(defun auto-fill-function ()
(defvar overwrite-mode-binary (purecopy " Bin Ovwrt")
"The string displayed in the mode line when in binary overwrite mode.")
-(defun overwrite-mode (arg)
+(define-minor-mode overwrite-mode
"Toggle overwrite mode.
With prefix argument ARG, turn overwrite mode on if ARG is positive,
otherwise turn it off. In overwrite mode, printing characters typed
Before a tab, such characters insert until the tab is filled in.
\\[quoted-insert] still inserts characters in overwrite mode; this
is supposed to make it easier to insert characters when necessary."
- (interactive "P")
- (setq overwrite-mode
- (if (if (null arg) (not overwrite-mode)
- (> (prefix-numeric-value arg) 0))
- 'overwrite-mode-textual))
- (force-mode-line-update))
+ :variable (eq overwrite-mode 'overwrite-mode-textual))
-(defun binary-overwrite-mode (arg)
+(define-minor-mode binary-overwrite-mode
"Toggle binary overwrite mode.
With prefix argument ARG, turn binary overwrite mode on if ARG is
positive, otherwise turn it off. In binary overwrite mode, printing
Note that binary overwrite mode is not its own minor mode; it is a
specialization of overwrite mode, entered by setting the
`overwrite-mode' variable to `overwrite-mode-binary'."
- (interactive "P")
- (setq overwrite-mode
- (if (if (null arg)
- (not (eq overwrite-mode 'overwrite-mode-binary))
- (> (prefix-numeric-value arg) 0))
- 'overwrite-mode-binary))
- (force-mode-line-update))
+ :variable (eq overwrite-mode 'overwrite-mode-binary))
(define-minor-mode line-number-mode
"Toggle Line Number mode.
otherwise turn it off. When Size Indication mode is enabled, the
size of the accessible part of the buffer appears in the mode line."
:global t :group 'mode-line)
+
+(define-minor-mode auto-save-mode
+ "Toggle auto-saving of contents of current buffer.
+With prefix argument ARG, turn auto-saving on if positive, else off."
+ :variable ((and buffer-auto-save-file-name
+ ;; If auto-save is off because buffer has shrunk,
+ ;; then toggling should turn it on.
+ (>= buffer-saved-size 0))
+ . (lambda (val)
+ (setq buffer-auto-save-file-name
+ (cond
+ ((null val) nil)
+ ((and buffer-file-name auto-save-visited-file-name
+ (not buffer-read-only))
+ buffer-file-name)
+ (t (make-auto-save-file-name))))))
+ ;; If -1 was stored here, to temporarily turn off saving,
+ ;; turn it back on.
+ (and (< buffer-saved-size 0)
+ (setq buffer-saved-size 0)))
\f
(defgroup paren-blinking nil
"Blinking matching of parens and expressions."
or go back to just one window (by deleting all but the selected window)."
(interactive)
(cond ((eq last-command 'mode-exited) nil)
+ ((region-active-p)
+ (deactivate-mark))
((> (minibuffer-depth) 0)
(abort-recursive-edit))
(current-prefix-arg
nil)
- ((region-active-p)
- (deactivate-mark))
((> (recursion-depth) 0)
(exit-recursive-edit))
(buffer-quit-function
normal-erase-is-backspace)
1 0)))))
-(defun normal-erase-is-backspace-mode (&optional arg)
+(define-minor-mode normal-erase-is-backspace-mode
"Toggle the Erase and Delete mode of the Backspace and Delete keys.
With numeric ARG, turn the mode on if and only if ARG is positive.
have both Backspace, Delete and F1 keys.
See also `normal-erase-is-backspace'."
- (interactive "P")
- (let ((enabled (or (and arg (> (prefix-numeric-value arg) 0))
- (not (or arg
- (eq 1 (terminal-parameter
- nil 'normal-erase-is-backspace)))))))
- (set-terminal-parameter nil 'normal-erase-is-backspace
- (if enabled 1 0))
+ :variable (eq (terminal-parameter
+ nil 'normal-erase-is-backspace) 1)
+ (let ((enabled (eq 1 (terminal-parameter
+ nil 'normal-erase-is-backspace))))
(cond ((or (memq window-system '(x w32 ns pc))
(memq system-type '(ms-dos windows-nt)))
(keyboard-translate ?\C-h ?\C-h)
(keyboard-translate ?\C-? ?\C-?))))
- (run-hooks 'normal-erase-is-backspace-hook)
(if (called-interactively-p 'interactive)
(message "Delete key deletes %s"
(if (eq 1 (terminal-parameter nil 'normal-erase-is-backspace))
was called."
(lexical-let ((fun fun) (args1 args))
(lambda (&rest args2) (apply fun (append args1 args2)))))
-
-;; This function is here rather than in subr.el because it uses CL.
-(defmacro with-wrapper-hook (var args &rest body)
- "Run BODY wrapped with the VAR hook.
-VAR is a special hook: its functions are called with a first argument
-which is the \"original\" code (the BODY), so the hook function can wrap
-the original function, or call it any number of times (including not calling
-it at all). This is similar to an `around' advice.
-VAR is normally a symbol (a variable) in which case it is treated like
-a hook, with a buffer-local and a global part. But it can also be an
-arbitrary expression.
-ARGS is a list of variables which will be passed as additional arguments
-to each function, after the initial argument, and which the first argument
-expects to receive when called."
- (declare (indent 2) (debug t))
- ;; We need those two gensyms because CL's lexical scoping is not available
- ;; for function arguments :-(
- (let ((funs (make-symbol "funs"))
- (global (make-symbol "global"))
- (argssym (make-symbol "args")))
- ;; Since the hook is a wrapper, the loop has to be done via
- ;; recursion: a given hook function will call its parameter in order to
- ;; continue looping.
- `(labels ((runrestofhook (,funs ,global ,argssym)
- ;; `funs' holds the functions left on the hook and `global'
- ;; holds the functions left on the global part of the hook
- ;; (in case the hook is local).
- (lexical-let ((funs ,funs)
- (global ,global))
- (if (consp funs)
- (if (eq t (car funs))
- (runrestofhook
- (append global (cdr funs)) nil ,argssym)
- (apply (car funs)
- (lambda (&rest ,argssym)
- (runrestofhook (cdr funs) global ,argssym))
- ,argssym))
- ;; Once there are no more functions on the hook, run
- ;; the original body.
- (apply (lambda ,args ,@body) ,argssym)))))
- (runrestofhook ,var
- ;; The global part of the hook, if any.
- ,(if (symbolp var)
- `(if (local-variable-p ',var)
- (default-value ',var)))
- (list ,@args)))))
\f
;; Minibuffer prompt stuff.
(defun smerge-resolve (&optional safe)
"Resolve the conflict at point intelligently.
-This relies on mode-specific knowledge and thus only works in
-some major modes. Uses `smerge-resolve-function' to do the actual work."
+This relies on mode-specific knowledge and thus only works in some
+major modes. Uses `smerge-resolve-function' to do the actual work."
(interactive)
(smerge-match-conflict)
(smerge-remove-props (match-beginning 0) (match-end 0))
This only matters if `smerge-refine-weight-hack' is nil.")
(defvar smerge-refine-ignore-whitespace t
- "If non-nil,Indicate that smerge-refine should try to ignore change in whitespace.")
+ "If non-nil, indicate that `smerge-refine' should try to ignore change in whitespace.")
(defvar smerge-refine-weight-hack t
"If non-nil, pass to diff as many lines as there are chars in the region.
I.e. each atomic element (e.g. word) will be copied as many times (on different
-lines) as it has chars. This has 2 advantages:
+lines) as it has chars. This has two advantages:
- if `diff' tries to minimize the number *lines* (rather than chars)
added/removed, this adjust the weights so that adding/removing long
symbols is considered correspondingly more costly.
"Show fine differences in the two regions BEG1..END1 and BEG2..END2.
PROPS is an alist of properties to put (via overlays) on the changes.
If non-nil, PREPROC is called with no argument in a buffer that contains
-a copy of a region, just before preparing it to for `diff'. It can be used to
-replace chars to try and eliminate some spurious differences."
+a copy of a region, just before preparing it to for `diff'. It can be
+used to replace chars to try and eliminate some spurious differences."
(let* ((buf (current-buffer))
(pos (point))
(file1 (make-temp-file "diff1"))
(defun smerge-refine (&optional part)
"Highlight the words of the conflict that are different.
-For 3-way conflicts, highlights only 2 of the 3 parts.
-A numeric argument PART can be used to specify which 2 parts;
-repeating the command will highlight other 2 parts."
+For 3-way conflicts, highlights only two of the three parts.
+A numeric argument PART can be used to specify which two parts;
+repeating the command will highlight other two parts."
(interactive
(if (integerp current-prefix-arg) (list current-prefix-arg)
(smerge-match-conflict)
(defun smerge-makeup-conflict (pt1 pt2 pt3 &optional pt4)
"Insert diff3 markers to make a new conflict.
-Uses point and mark for 2 of the relevant positions and previous marks
+Uses point and mark for two of the relevant positions and previous marks
for the other ones.
By default, makes up a 2-way conflict,
with a \\[universal-argument] prefix, makes up a 3-way conflict."
(insert "<<<<<<< MINE\n"))
(if smerge-mode nil (smerge-mode 1))
(smerge-refine))
-
+
(defconst smerge-parsep-re
(concat smerge-begin-re "\\|" smerge-end-re "\\|"
(make-obsolete-variable 'default-line-spacing 'line-spacing "23.2")
(make-obsolete-variable 'default-abbrev-mode 'abbrev-mode "23.2")
(make-obsolete-variable 'default-ctl-arrow 'ctl-arrow "23.2")
-(make-obsolete-variable 'default-direction-reversed 'direction-reversed "23.2")
(make-obsolete-variable 'default-truncate-lines 'truncate-lines "23.2")
(make-obsolete-variable 'default-left-margin 'left-margin "23.2")
(make-obsolete-variable 'default-tab-width 'tab-width "23.2")
(let ((rest (cdr found)))
(setcdr found nil)
(nconc found (list (list toggle name)) rest))
- (setq minor-mode-alist (cons (list toggle name)
- minor-mode-alist)))))))
+ (push (list toggle name) minor-mode-alist))))))
;; Add the toggle to the minor-modes menu if requested.
(when (get toggle :included)
(define-key mode-line-mode-menu
(let ((rest (cdr found)))
(setcdr found nil)
(nconc found (list (cons toggle keymap)) rest))
- (setq minor-mode-map-alist (cons (cons toggle keymap)
- minor-mode-map-alist))))))))
+ (push (cons toggle keymap) minor-mode-map-alist)))))))
\f
;;; Load history
;; digits of precision, it doesn't really matter here. On the other
;; hand, it greatly simplifies the code.
-(defsubst progress-reporter-update (reporter value)
+(defsubst progress-reporter-update (reporter &optional value)
"Report progress of an operation in the echo area.
-However, if the change since last echo area update is too small
-or not enough time has passed, then do nothing (see
-`make-progress-reporter' for details).
-
-First parameter, REPORTER, should be the result of a call to
-`make-progress-reporter'. Second, VALUE, determines the actual
-progress of operation; it must be between MIN-VALUE and MAX-VALUE
-as passed to `make-progress-reporter'.
-
-This function is very inexpensive, you may not bother how often
-you call it."
- (when (>= value (car reporter))
- (progress-reporter-do-update reporter value)))
+REPORTER should be the result of a call to `make-progress-reporter'.
+
+If REPORTER is a numerical progress reporter---i.e. if it was
+ made using non-nil MIN-VALUE and MAX-VALUE arguments to
+ `make-progress-reporter'---then VALUE should be a number between
+ MIN-VALUE and MAX-VALUE.
-(defun make-progress-reporter (message min-value max-value
- &optional current-value
- min-change min-time)
- "Return progress reporter object to be used with `progress-reporter-update'.
-
-MESSAGE is shown in the echo area. When at least 1% of operation
-is complete, the exact percentage will be appended to the
-MESSAGE. When you call `progress-reporter-done', word \"done\"
-is printed after the MESSAGE. You can change MESSAGE of an
-existing progress reporter with `progress-reporter-force-update'.
-
-MIN-VALUE and MAX-VALUE designate starting (0% complete) and
-final (100% complete) states of operation. The latter should be
-larger; if this is not the case, then simply negate all values.
-Optional CURRENT-VALUE specifies the progress by the moment you
-call this function. You should omit it or set it to nil in most
-cases since it defaults to MIN-VALUE.
-
-Optional MIN-CHANGE determines the minimal change in percents to
-report (default is 1%.) Optional MIN-TIME specifies the minimal
-time before echo area updates (default is 0.2 seconds.) If
-`float-time' function is not present, then time is not tracked
-at all. If OS is not capable of measuring fractions of seconds,
-then this parameter is effectively rounded up."
+If REPORTER is a non-numerical reporter, VALUE should be nil.
+This function is relatively inexpensive. If the change since
+last update is too small or insufficient time has passed, it does
+nothing."
+ (when (or (not (numberp value)) ; For pulsing reporter
+ (>= value (car reporter))) ; For numerical reporter
+ (progress-reporter-do-update reporter value)))
+
+(defun make-progress-reporter (message &optional min-value max-value
+ current-value min-change min-time)
+ "Return progress reporter object for use with `progress-reporter-update'.
+
+MESSAGE is shown in the echo area, with a status indicator
+appended to the end. When you call `progress-reporter-done', the
+word \"done\" is printed after the MESSAGE. You can change the
+MESSAGE of an existing progress reporter by calling
+`progress-reporter-force-update'.
+
+MIN-VALUE and MAX-VALUE, if non-nil, are starting (0% complete)
+and final (100% complete) states of operation; the latter should
+be larger. In this case, the status message shows the percentage
+progress.
+
+If MIN-VALUE and/or MAX-VALUE is omitted or nil, the status
+message shows a \"spinning\", non-numeric indicator.
+
+Optional CURRENT-VALUE is the initial progress; the default is
+MIN-VALUE.
+Optional MIN-CHANGE is the minimal change in percents to report;
+the default is 1%.
+CURRENT-VALUE and MIN-CHANGE do not have any effect if MIN-VALUE
+and/or MAX-VALUE are nil.
+
+Optional MIN-TIME specifies the minimum interval time between
+echo area updates (default is 0.2 seconds.) If the function
+`float-time' is not present, time is not tracked at all. If the
+OS is not capable of measuring fractions of seconds, this
+parameter is effectively rounded up."
(unless min-time
(setq min-time 0.2))
(let ((reporter
- (cons min-value ;; Force a call to `message' now
+ ;; Force a call to `message' now
+ (cons (or min-value 0)
(vector (if (and (fboundp 'float-time)
(>= min-time 0.02))
(float-time) nil)
(progress-reporter-update reporter (or current-value min-value))
reporter))
-(defun progress-reporter-force-update (reporter value &optional new-message)
+(defun progress-reporter-force-update (reporter &optional value new-message)
"Report progress of an operation in the echo area unconditionally.
-First two parameters are the same as for
-`progress-reporter-update'. Optional NEW-MESSAGE allows you to
-change the displayed message."
+The first two arguments are the same as in `progress-reporter-update'.
+NEW-MESSAGE, if non-nil, sets a new message for the reporter."
(let ((parameters (cdr reporter)))
(when new-message
(aset parameters 3 new-message))
(aset parameters 0 (float-time)))
(progress-reporter-do-update reporter value)))
+(defvar progress-reporter--pulse-characters ["-" "\\" "|" "/"]
+ "Characters to use for pulsing progress reporters.")
+
(defun progress-reporter-do-update (reporter value)
(let* ((parameters (cdr reporter))
+ (update-time (aref parameters 0))
(min-value (aref parameters 1))
(max-value (aref parameters 2))
- (one-percent (/ (- max-value min-value) 100.0))
- (percentage (if (= max-value min-value)
- 0
- (truncate (/ (- value min-value) one-percent))))
- (update-time (aref parameters 0))
+ (text (aref parameters 3))
(current-time (float-time))
(enough-time-passed
;; See if enough time has passed since the last update.
(when (>= current-time update-time)
;; Calculate time for the next update
(aset parameters 0 (+ update-time (aref parameters 5)))))))
- ;;
- ;; Calculate NEXT-UPDATE-VALUE. If we are not going to print
- ;; message this time because not enough time has passed, then use
- ;; 1 instead of MIN-CHANGE. This makes delays between echo area
- ;; updates closer to MIN-TIME.
- (setcar reporter
- (min (+ min-value (* (+ percentage
- (if enough-time-passed
- (aref parameters 4) ;; MIN-CHANGE
- 1))
- one-percent))
- max-value))
- (when (integerp value)
- (setcar reporter (ceiling (car reporter))))
- ;;
- ;; Only print message if enough time has passed
- (when enough-time-passed
- (if (> percentage 0)
- (message "%s%d%%" (aref parameters 3) percentage)
- (message "%s" (aref parameters 3))))))
+ (cond ((and min-value max-value)
+ ;; Numerical indicator
+ (let* ((one-percent (/ (- max-value min-value) 100.0))
+ (percentage (if (= max-value min-value)
+ 0
+ (truncate (/ (- value min-value)
+ one-percent)))))
+ ;; Calculate NEXT-UPDATE-VALUE. If we are not printing
+ ;; message because not enough time has passed, use 1
+ ;; instead of MIN-CHANGE. This makes delays between echo
+ ;; area updates closer to MIN-TIME.
+ (setcar reporter
+ (min (+ min-value (* (+ percentage
+ (if enough-time-passed
+ ;; MIN-CHANGE
+ (aref parameters 4)
+ 1))
+ one-percent))
+ max-value))
+ (when (integerp value)
+ (setcar reporter (ceiling (car reporter))))
+ ;; Only print message if enough time has passed
+ (when enough-time-passed
+ (if (> percentage 0)
+ (message "%s%d%%" text percentage)
+ (message "%s" text)))))
+ ;; Pulsing indicator
+ (enough-time-passed
+ (let ((index (mod (1+ (car reporter)) 4))
+ (message-log-max nil))
+ (setcar reporter index)
+ (message "%s %s"
+ text
+ (aref progress-reporter--pulse-characters
+ index)))))))
(defun progress-reporter-done (reporter)
"Print reporter's message followed by word \"done\" in echo area."
(prin1-to-string (make-hash-table)))))
(provide 'hashtable-print-readable))
+;; Moving with arrows in bidi-sensitive direction.
+(defun right-arrow-command (&optional n)
+ "Move point N characters to the right (to the left if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either forward
+or backward in the buffer. This is in contrast with \\[forward-char]
+and \\[backward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (forward-char n)
+ (backward-char n)))
+
+(defun left-arrow-command ( &optional n)
+ "Move point N characters to the left (to the right if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either backward
+or forward in the buffer. This is in contrast with \\[backward-char]
+and \\[forward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (backward-char n)
+ (forward-char n)))
+
;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc
;;; subr.el ends here
(defvar tar-parse-info nil)
(defvar tar-superior-buffer nil)
(defvar tar-superior-descriptor nil)
-(defvar tar-subfile-mode nil)
(defvar tar-file-name-coding-system nil)
(put 'tar-superior-buffer 'permanent-local t)
(signal (car err) (cdr err)))))
-(defun tar-subfile-mode (p)
+(define-minor-mode tar-subfile-mode
"Minor mode for editing an element of a tar-file.
This mode arranges for \"saving\" this buffer to write the data
into the tar-file buffer that it came from. The changes will actually
appear on disk when you save the tar-file's buffer."
- (interactive "P")
+ ;; Don't do this, because it is redundant and wastes mode line space.
+ ;; :lighter " TarFile"
+ nil nil nil
(or (and (boundp 'tar-superior-buffer) tar-superior-buffer)
(error "This buffer is not an element of a tar file"))
- ;; Don't do this, because it is redundant and wastes mode line space.
- ;; (or (assq 'tar-subfile-mode minor-mode-alist)
- ;; (setq minor-mode-alist (append minor-mode-alist
- ;; (list '(tar-subfile-mode " TarFile")))))
- (make-local-variable 'tar-subfile-mode)
- (setq tar-subfile-mode
- (if (null p)
- (not tar-subfile-mode)
- (> (prefix-numeric-value p) 0)))
(cond (tar-subfile-mode
(add-hook 'write-file-functions 'tar-subfile-save-buffer nil t)
;; turn off auto-save.
(auto-save-mode -1)
- (setq buffer-auto-save-file-name nil)
- (run-hooks 'tar-subfile-mode-hook))
+ (setq buffer-auto-save-file-name nil))
(t
(remove-hook 'write-file-functions 'tar-subfile-save-buffer t))))
(set (make-local-variable 'tar-superior-descriptor) descriptor)
(setq buffer-read-only read-only-p)
(tar-subfile-mode 1)))
- (if view-p
- (view-buffer
- buffer (and just-created 'kill-buffer-if-not-modified))
- (if (eq other-window-p 'display)
- (display-buffer buffer)
- (if other-window-p
- (switch-to-buffer-other-window buffer)
- (switch-to-buffer buffer)))))))
+ (cond
+ (view-p
+ (view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
+ ((eq other-window-p 'display) (display-buffer buffer))
+ (other-window-p (switch-to-buffer-other-window buffer))
+ (t (switch-to-buffer buffer))))))
(defun tar-extract-other-window ()
;;; Code:
+(eval-when-compile (require 'cl))
+
(defvar tvi970-terminal-map
(let ((map (make-sparse-keymap)))
\f
;; Should keypad numbers send ordinary digits or distinct escape sequences?
-(defun tvi970-set-keypad-mode (&optional arg)
+(define-minor-mode tvi970-set-keypad-mode
"Set the current mode of the TVI 970 numeric keypad.
In ``numeric keypad mode'', the number keys on the keypad act as
ordinary digits. In ``alternate keypad mode'', the keys send distinct
With no argument, toggle between the two possible modes.
With a positive argument, select alternate keypad mode.
With a negative argument, select numeric keypad mode."
- (interactive "P")
- (let ((newval (if (null arg)
- (not (terminal-parameter nil 'tvi970-keypad-numeric))
- (> (prefix-numeric-value arg) 0))))
- (set-terminal-parameter nil 'tvi970-keypad-numeric newval)
- (send-string-to-terminal (if newval "\e=" "\e>"))))
+ :variable (terminal-parameter nil 'tvi970-keypad-numeric)
+ (send-string-to-terminal
+ (if (terminal-parameter nil 'tvi970-keypad-numeric) "\e=" "\e>")))
;; arch-tag: c1334cf0-1462-41c3-a963-c077d175f8f0
;;; tvi970.el ends here
(tty-run-terminal-initialization (selected-frame) "lk201"))
;;; Controlling the screen width.
-(defvar vt100-wide-mode (= (frame-width) 132)
- "t if vt100 is in 132-column mode.")
-
-(defun vt100-wide-mode (&optional arg)
+(define-minor-mode vt100-wide-mode
"Toggle 132/80 column mode for vt100s.
With positive argument, switch to 132-column mode.
With negative argument, switch to 80-column mode."
- (interactive "P")
- (setq vt100-wide-mode
- (if (null arg) (not vt100-wide-mode)
- (> (prefix-numeric-value arg) 0)))
- (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l"))
- (set-frame-width terminal-frame (if vt100-wide-mode 132 80)))
+ :global t :initial-value (= (frame-width) 132)
+ (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l"))
+ (set-frame-width terminal-frame (if vt100-wide-mode 132 80)))
;; arch-tag: 9ff41f24-a7c9-4dee-9cf2-fbaa951eb840
;;; vt100.el ends here
(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
(defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*"))
+(defconst css-proprietary-nmstart-re ;; Vendor-specific properties.
+ "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-")
(defconst css-name-re (concat css-nmchar-re "+"))
(defface css-selector '((t :inherit font-lock-function-name-face))
(defface css-property '((t :inherit font-lock-variable-name-face))
"Face to use for properties."
:group 'css)
+(defface css-proprietary-property '((t :inherit (css-property italic)))
+ "Face to use for vendor-specific properties.")
(defvar css-font-lock-keywords
`(("!\\s-*important" . font-lock-builtin-face)
;; No face.
nil)))
;; Properties. Again, we don't limit ourselves to css-property-ids.
- (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:")
- (1 'css-property))))
+ (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\("
+ "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"
+ css-nmstart-re "\\)" css-nmchar-re "*"
+ "\\)\\s-*:")
+ (1 (if (match-end 2) 'css-proprietary-property 'css-property)))))
(defvar css-font-lock-defaults
'(css-font-lock-keywords nil t))
(easy-menu-add dns-mode-menu dns-mode-map))
;;;###autoload (defalias 'zone-mode 'dns-mode)
+;;;###autoload (add-to-list 'auto-mode-alist (purecopy '("\\.zone\\'" . zone-mode)))
;; Tools.
(defvar ispell-process-directory nil
"The directory where `ispell-process' was started.")
+(defvar ispell-process-buffer-name nil
+ "The buffer where `ispell-process' was started.")
+
(defvar ispell-filter nil
"Output filter from piped calls to Ispell.")
"Check status of Ispell process and start if necessary."
(if (and ispell-process
(eq (ispell-process-status) 'run)
- ;; If we're using a personal dictionary, ensure
- ;; we're in the same default directory!
- (or (not ispell-personal-dictionary)
+ ;; Unless we are using an explicit personal dictionary,
+ ;; ensure we're in the same default directory!
+ ;; Restart check for personal dictionary is done in
+ ;; `ispell-internal-change-dictionary', called from `ispell-buffer-local-dict'
+ (or (or ispell-local-pdict ispell-personal-dictionary)
(equal ispell-process-directory default-directory)))
(setq ispell-filter nil ispell-filter-continue nil)
;; may need to restart to select new personal dictionary.
(or ispell-local-dictionary ispell-dictionary "default"))
(sit-for 0)
(setq ispell-library-directory (ispell-check-version)
- ispell-process-directory default-directory
ispell-process (ispell-start-process)
ispell-filter nil
ispell-filter-continue nil)
+ ;; When spellchecking minibuffer contents, make sure ispell process
+ ;; is not restarted every time the minibuffer is killed.
+ (if (window-minibuffer-p)
+ (if (fboundp 'minibuffer-selected-window)
+ ;; Assign ispell process to parent buffer
+ (setq ispell-process-directory default-directory
+ ispell-process-buffer-name (window-buffer (minibuffer-selected-window)))
+ ;; Force `ispell-process-directory' to $HOME and use a dummy name
+ (setq ispell-process-directory (expand-file-name "~/")
+ ispell-process-buffer-name " * Minibuffer-has-spellcheck-enabled"))
+ ;; Not in a minibuffer
+ (setq ispell-process-directory default-directory
+ ispell-process-buffer-name (buffer-name)))
(if ispell-async-processp
(set-process-filter ispell-process 'ispell-filter))
;; protect against bogus binding of `enable-multibyte-characters' in XEmacs
(kill-buffer ispell-session-buffer)
(setq ispell-output-buffer nil
ispell-session-buffer nil))
+ (setq ispell-process-buffer-name nil)
(setq ispell-process nil)
(message "Ispell process killed")
nil))
+;; Kill ispell process when killing its associated buffer
+(add-hook 'kill-buffer-hook
+ '(lambda ()
+ (if (equal ispell-process-buffer-name (buffer-name))
+ (ispell-kill-ispell t))))
;;; ispell-change-dictionary is set in some people's hooks. Maybe this should
;;; call ispell-init-process rather than wait for a spell checking command?
(defgroup picture nil
"Picture mode --- editing using quarter-plane screen model."
:prefix "picture-"
- :group 'editing)
+ :group 'wp)
(defcustom picture-rectangle-ctl ?+
"*Character `picture-draw-rectangle' uses for top left corners."
(defconst reftex-version "RefTeX version 4.31"
"Version string for RefTeX.")
-(defvar reftex-mode nil
- "Determines if RefTeX mode is active.")
-(make-variable-buffer-local 'reftex-mode)
-
(defvar reftex-mode-map (make-sparse-keymap)
"Keymap for RefTeX mode.")
"Turn on RefTeX mode."
(reftex-mode t))
+(put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
+(put 'reftex-mode :menu-tag "RefTeX Mode")
;;;###autoload
-(defun reftex-mode (&optional arg)
+(define-minor-mode reftex-mode
"Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX.
\\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing
on the menu bar.
------------------------------------------------------------------------------"
-
- (interactive "P")
- (setq reftex-mode (not (or (and (null arg) reftex-mode)
- (<= (prefix-numeric-value arg) 0))))
-
+ :lighter " Ref" :keymap reftex-mode-map
(if reftex-mode
(progn
;; Mode was turned on
(modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
- (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
-
- (run-hooks 'reftex-mode-hook))
+ (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib))
;; Mode was turned off
(easy-menu-remove reftex-mode-menu)))
-(if (fboundp 'add-minor-mode)
- ;; Use it so that we get the extras
- (progn
- (put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
- (put 'reftex-mode :menu-tag "RefTeX Mode")
- (add-minor-mode 'reftex-mode " Ref" reftex-mode-map))
- ;; The standard way
- (unless (assoc 'reftex-mode minor-mode-alist)
- (push '(reftex-mode " Ref") minor-mode-alist))
- (unless (assoc 'reftex-mode minor-mode-map-alist)
- (push (cons 'reftex-mode reftex-mode-map) minor-mode-map-alist)))
-
(defvar reftex-docstruct-symbol)
(defun reftex-kill-buffer-hook ()
"Save RefTeX's parse file for this buffer if the information has changed."
;;;
;;; Multibuffer Variables
;;;
-;;; Technical notes: These work as follows: We keep just one list
-;;; of labels for each master file - this can save a lot of memory.
-;;; `reftex-master-index-list' is an alist which connects the true file name
-;;; of each master file with the symbols holding the information on that
-;;; document. Each buffer has local variables which point to these symbols.
+;; Technical notes: These work as follows: We keep just one list
+;; of labels for each master file - this can save a lot of memory.
+;; `reftex-master-index-list' is an alist which connects the true file name
+;; of each master file with the symbols holding the information on that
+;; document. Each buffer has local variables which point to these symbols.
;; List of variables which handle the multifile stuff.
;; This list is used to tie, untie, and reset these symbols.
:group 'faces
:version "21.1")
-(defcustom rst-block-face 'font-lock-keyword-face
+(defface rst-block '((t :inherit font-lock-keyword-face))
+ "Face used for all syntax marking up a special block."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-block-face 'rst-block
"All syntax marking up a special block."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-block-face
+ "customize the face `rst-block' instead."
+ "24.1")
+
+(defface rst-external '((t :inherit font-lock-type-face))
+ "Face used for field names and interpreted text."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-external-face 'font-lock-type-face
+(defcustom rst-external-face 'rst-external
"Field names and interpreted text."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-external-face
+ "customize the face `rst-external' instead."
+ "24.1")
-(defcustom rst-definition-face 'font-lock-function-name-face
+(defface rst-definition '((t :inherit font-lock-function-name-face))
+ "Face used for all other defining constructs."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-definition-face 'rst-definition
"All other defining constructs."
+ :version "24.1"
:group 'rst-faces
:type '(face))
-
-(defcustom rst-directive-face
- ;; XEmacs compatibility
- (if (boundp 'font-lock-builtin-face)
- 'font-lock-builtin-face
- 'font-lock-preprocessor-face)
+(make-obsolete-variable 'rst-definition-face
+ "customize the face `rst-definition' instead."
+ "24.1")
+
+;; XEmacs compatibility (?).
+(defface rst-directive (if (boundp 'font-lock-builtin-face)
+ '((t :inherit font-lock-builtin-face))
+ '((t :inherit font-lock-preprocessor-face)))
+ "Face used for directives and roles."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-directive-face 'rst-directive
"Directives and roles."
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-directive-face
+ "customize the face `rst-directive' instead."
+ "24.1")
-(defcustom rst-comment-face 'font-lock-comment-face
+(defface rst-comment '((t :inherit font-lock-comment-face))
+ "Face used for comments."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-comment-face 'rst-comment
"Comments."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-comment-face
+ "customize the face `rst-comment' instead."
+ "24.1")
+
+(defface rst-emphasis1 '((t :inherit italic))
+ "Face used for simple emphasis."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-emphasis1-face
- ;; XEmacs compatibility
- (if (facep 'italic)
- ''italic
- 'italic)
+(defcustom rst-emphasis1-face 'rst-emphasis1
"Simple emphasis."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-emphasis1-face
+ "customize the face `rst-emphasis1' instead."
+ "24.1")
-(defcustom rst-emphasis2-face
- ;; XEmacs compatibility
- (if (facep 'bold)
- ''bold
- 'bold)
+(defface rst-emphasis2 '((t :inherit bold))
+ "Face used for double emphasis."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-emphasis2-face 'rst-emphasis2
"Double emphasis."
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-emphasis2-face
+ "customize the face `rst-emphasis2' instead."
+ "24.1")
+
+(defface rst-literal '((t :inherit font-lock-string-face))
+ "Face used for literal text."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-literal-face 'font-lock-string-face
+(defcustom rst-literal-face 'rst-literal
"Literal text."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-literal-face
+ "customize the face `rst-literal' instead."
+ "24.1")
-(defcustom rst-reference-face 'font-lock-variable-name-face
+(defface rst-reference '((t :inherit font-lock-variable-name-face))
+ "Face used for references to a definition."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-reference-face 'rst-reference
"References to a definition."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-reference-face
+ "customize the face `rst-reference' instead."
+ "24.1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Simple `Body Elements`_
;; `Bullet Lists`_
- (list
- (concat re-bol "\\([-*+]" re-blksep1 "\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\([-*+]" re-blksep1 "\\)")
+ 1 rst-block-face)
;; `Enumerated Lists`_
- (list
- (concat re-bol "\\((?\\(#\\|[0-9]+\\|[A-Za-z]\\|[IVXLCMivxlcm]+\\)[.)]"
- re-blksep1 "\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\((?\\(#\\|[0-9]+\\|[A-Za-z]\\|[IVXLCMivxlcm]+\\)[.)]"
+ re-blksep1 "\\)")
+ 1 rst-block-face)
;; `Definition Lists`_ FIXME: missing
;; `Field Lists`_
- (list
- (concat re-bol "\\(:[^:\n]+:\\)" re-blksep1)
- 1 rst-external-face)
+ `(,(concat re-bol "\\(:[^:\n]+:\\)" re-blksep1)
+ 1 rst-external-face)
;; `Option Lists`_
- (list
- (concat re-bol "\\(\\(\\(\\([-+/]\\|--\\)\\sw\\(-\\|\\sw\\)*"
- "\\([ =]\\S +\\)?\\)\\(,[\t ]\\)?\\)+\\)\\($\\|[\t ]\\{2\\}\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\(\\(\\(\\([-+/]\\|--\\)\\sw\\(-\\|\\sw\\)*"
+ "\\([ =]\\S +\\)?\\)\\(,[\t ]\\)?\\)+\\)\\($\\|[\t ]\\{2\\}\\)")
+ 1 rst-block-face)
;; `Tables`_ FIXME: missing
;; All the `Explicit Markup Blocks`_
;; `Footnotes`_ / `Citations`_
- (list
- (concat re-bol "\\(" re-ems "\\[[^[\n]+\\]\\)" re-blksep1)
+ `(,(concat re-bol "\\(" re-ems "\\[[^[\n]+\\]\\)" re-blksep1)
1 rst-definition-face)
;; `Directives`_ / `Substitution Definitions`_
- (list
- (concat re-bol "\\(" re-ems "\\)\\(\\(|[^|\n]+|[\t ]+\\)?\\)\\("
- re-sym1 "+::\\)" re-blksep1)
- (list 1 rst-directive-face)
- (list 2 rst-definition-face)
- (list 4 rst-directive-face))
+ `(,(concat re-bol "\\(" re-ems "\\)\\(\\(|[^|\n]+|[\t ]+\\)?\\)\\("
+ re-sym1 "+::\\)" re-blksep1)
+ (1 rst-directive-face)
+ (2 rst-definition-face)
+ (4 rst-directive-face))
;; `Hyperlink Targets`_
- (list
- (concat re-bol "\\(" re-ems "_\\([^:\\`\n]\\|\\\\.\\|`[^`\n]+`\\)+:\\)"
- re-blksep1)
- 1 rst-definition-face)
- (list
- (concat re-bol "\\(__\\)" re-blksep1)
- 1 rst-definition-face)
+ `(,(concat re-bol "\\(" re-ems "_\\([^:\\`\n]\\|\\\\.\\|`[^`\n]+`\\)+:\\)"
+ re-blksep1)
+ 1 rst-definition-face)
+ `(,(concat re-bol "\\(__\\)" re-blksep1)
+ 1 rst-definition-face)
;; All `Inline Markup`_
;; FIXME: Condition 5 preventing fontification of e.g. "*" not implemented
;; `Strong Emphasis`_
- (list
- (concat re-imp1 "\\(\\*\\*" re-ima2 "\\*\\*\\)" re-ims1)
- 2 rst-emphasis2-face)
+ `(,(concat re-imp1 "\\(\\*\\*" re-ima2 "\\*\\*\\)" re-ims1)
+ 2 rst-emphasis2-face)
;; `Emphasis`_
- (list
- (concat re-imp1 "\\(\\*" re-ima2 "\\*\\)" re-ims1)
- 2 rst-emphasis1-face)
+ `(,(concat re-imp1 "\\(\\*" re-ima2 "\\*\\)" re-ims1)
+ 2 rst-emphasis1-face)
;; `Inline Literals`_
- (list
- (concat re-imp1 "\\(``" re-imb2 "``\\)" re-ims1)
- 2 rst-literal-face)
+ `(,(concat re-imp1 "\\(``" re-imb2 "``\\)" re-ims1)
+ 2 rst-literal-face)
;; `Inline Internal Targets`_
- (list
- (concat re-imp1 "\\(_`" re-imb2 "`\\)" re-ims1)
- 2 rst-definition-face)
+ `(,(concat re-imp1 "\\(_`" re-imb2 "`\\)" re-ims1)
+ 2 rst-definition-face)
;; `Hyperlink References`_
;; FIXME: `Embedded URIs`_ not considered
- (list
- (concat re-imp1 "\\(\\(`" re-imb2 "`\\|\\(\\sw\\(\\sw\\|-\\)+\\sw\\)\\)__?\\)" re-ims1)
+ `(,(concat re-imp1 "\\(\\(`" re-imb2 "`\\|\\(\\sw\\(\\sw\\|-\\)+\\sw\\)\\)__?\\)" re-ims1)
2 rst-reference-face)
;; `Interpreted Text`_
- (list
- (concat re-imp1 "\\(\\(:" re-sym1 "+:\\)?\\)\\(`" re-imb2 "`\\)\\(\\(:"
- re-sym1 "+:\\)?\\)" re-ims1)
- (list 2 rst-directive-face)
- (list 5 rst-external-face)
- (list 8 rst-directive-face))
+ `(,(concat re-imp1 "\\(\\(:" re-sym1 "+:\\)?\\)\\(`" re-imb2 "`\\)\\(\\(:"
+ re-sym1 "+:\\)?\\)" re-ims1)
+ (2 rst-directive-face)
+ (5 rst-external-face)
+ (8 rst-directive-face))
;; `Footnote References`_ / `Citation References`_
- (list
- (concat re-imp1 "\\(\\[[^]]+\\]_\\)" re-ims1)
- 2 rst-reference-face)
+ `(,(concat re-imp1 "\\(\\[[^]]+\\]_\\)" re-ims1)
+ 2 rst-reference-face)
;; `Substitution References`_
- (list
- (concat re-imp1 "\\(|" re-imv2 "|\\)" re-ims1)
- 2 rst-reference-face)
+ `(,(concat re-imp1 "\\(|" re-imv2 "|\\)" re-ims1)
+ 2 rst-reference-face)
;; `Standalone Hyperlinks`_
- (list
- ;; FIXME: This takes it easy by using a whitespace as delimiter
- (concat re-imp1 "\\(" re-uris1 ":\\S +\\)" re-ims1)
- 2 rst-definition-face)
- (list
- (concat re-imp1 "\\(" re-sym1 "+@" re-sym1 "+\\)" re-ims1)
- 2 rst-definition-face)
+ `(;; FIXME: This takes it easy by using a whitespace as delimiter
+ ,(concat re-imp1 "\\(" re-uris1 ":\\S +\\)" re-ims1)
+ 2 rst-definition-face)
+ `(,(concat re-imp1 "\\(" re-sym1 "+@" re-sym1 "+\\)" re-ims1)
+ 2 rst-definition-face)
;; Do all block fontification as late as possible so 'append works
(list
re-ado2)
(if (not rst-mode-lazy)
- (list 1 rst-block-face)
+ '(1 rst-block-face)
(list
(list 'rst-font-lock-handle-adornment
'(progn
(list
(concat re-bol "\\(" re-ems "\\)\[^[|_]\\([^:\n]\\|:\\([^:\n]\\|$\\)\\)*$")
- (list 1 rst-comment-face))
+ '(1 rst-comment-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
(setq rst-font-lock-indentation-point (match-end 1))
(point-max))
nil
- (list 0 rst-comment-face 'append)))))
+ '(0 rst-comment-face append)))))
(append
(list
(concat re-bol "\\(" re-emt "\\)\\(\\s *\\)$")
- (list 1 rst-comment-face)
- (list 2 rst-comment-face))
+ '(1 rst-comment-face)
+ '(2 rst-comment-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
(setq rst-font-lock-indentation-point 'next)
(point-max))
nil
- (list 0 rst-comment-face 'append)))))
+ '(0 rst-comment-face append)))))
;; `Literal Blocks`_
(append
(list
(concat re-bol "\\(\\([^.\n]\\|\\.[^.\n]\\).*\\)?\\(::\\)$")
- (list 3 rst-block-face))
+ '(3 rst-block-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
(setq rst-font-lock-indentation-point t)
(point-max))
nil
- (list 0 rst-literal-face 'append)))))
+ '(0 rst-literal-face append)))))
;; `Doctest Blocks`_
(append
(list
(concat re-bol "\\(>>>\\|\\.\\.\\.\\)\\(.+\\)")
- (list 1 rst-block-face)
- (list 2 rst-literal-face)))
+ '(1 rst-block-face)
+ '(2 rst-literal-face)))
)))
(define-key map "\C-c\^?" 'sgml-delete-tag)
(define-key map "\C-c?" 'sgml-tag-help)
(define-key map "\C-c/" 'sgml-close-tag)
+
+ ;; Redundant keybindings, for consistency with TeX mode.
+ (define-key map "\C-c\C-o" 'sgml-tag)
+ (define-key map "\C-c\C-e" 'sgml-close-tag)
+
(define-key map "\C-c8" 'sgml-name-8bit-mode)
(define-key map "\C-c\C-v" 'sgml-validate)
(when sgml-quick-keys
;;;
(defgroup table nil
- "Text based table manipulation utilities.
-See `table-insert' for examples about how to use."
+ "Text based table manipulation utilities."
:tag "Table"
:prefix "table-"
- :group 'editing
:group 'wp
- :group 'paragraphs
- :group 'fill
:version "22.1")
(defgroup table-hooks nil
(define-key map "\C-c\C-c" 'tex-compile)
(define-key map "\C-c\C-i" 'tex-bibtex-file)
(define-key map "\C-c\C-o" 'latex-insert-block)
+
+ ;; Redundant keybindings, for consistency with SGML mode.
+ (define-key map "\C-c\C-t" 'latex-insert-block)
+ (define-key map "\C-c/" 'latex-close-block)
+
(define-key map "\C-c\C-e" 'latex-close-block)
(define-key map "\C-c\C-u" 'tex-goto-last-unclosed-latex-block)
(define-key map "\C-c\C-m" 'tex-feed-input)
"Normal hook run when entering Text mode and many related modes."
:type 'hook
:options '(turn-on-auto-fill turn-on-flyspell)
- :group 'data)
+ :group 'wp)
(defvar text-mode-variant nil
"Non-nil if this buffer's major mode is a variant of Text mode.
submap key)
;; We'll pick up the last valid entry in the list of keys if
;; there's more than one.
+ ;; FIXME: Aren't they *all* "valid"?? --Stef
(dolist (k keys)
;; We're looking for a binding of the command in a submap of
;; the menu bar map, so the key sequence must be two or more
;; People say it's bad to have EXIT on the tool bar, since users
;; might inadvertently click that button.
;;(tool-bar-add-item-from-menu 'save-buffers-kill-emacs "exit")
- (tool-bar-add-item-from-menu 'find-file "new")
+ (tool-bar-add-item-from-menu 'find-file "new" nil :label "New File")
(tool-bar-add-item-from-menu 'menu-find-file-existing "open")
(tool-bar-add-item-from-menu 'dired "diropen")
(tool-bar-add-item-from-menu 'kill-this-buffer "close")
"paste" nil
:visible '(not (eq 'special (get major-mode
'mode-class))))
- (tool-bar-add-item-from-menu 'nonincremental-search-forward "search")
+ (tool-bar-add-item-from-menu 'nonincremental-search-forward "search"
+ nil :label "Search")
;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
;; There's no icon appropriate for News and we need a command rather
;; than a lambda for Read Mail.
;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
- (tool-bar-add-item-from-menu 'print-buffer "print")
+ (tool-bar-add-item-from-menu 'print-buffer "print" nil :label "Print")
;; tool-bar-add-item-from-menu itself operates on
;; (default-value 'tool-bar-map), but when we don't use that function,
(save-buffers-kill-terminal [?\C-x ?\C-c])
;; * SUMMARY
- (scroll-up [?\C-v])
- (scroll-down [?\M-v])
+ (scroll-up-command [?\C-v])
+ (scroll-down-command [?\M-v])
(recenter-top-bottom [?\C-l])
;; * BASIC CURSOR CONTROL
:type 'sexp
:group 'type-break)
-(defcustom type-break-query-mode t
- "Non-nil means ask whether or not to prompt user for breaks.
-If so, call the function specified in the value of the variable
-`type-break-query-function' to do the asking."
- :type 'boolean
- :group 'type-break)
-
(defcustom type-break-query-function 'yes-or-no-p
"Function to use for making query for a typing break.
It should take a string as an argument, the prompt.
\f
;; Mode line frobs
-(defcustom type-break-mode-line-message-mode nil
- "Non-nil means put type-break related messages in the mode line.
-Otherwise, messages typically go in the echo area.
-
-See also `type-break-mode-line-format' and its members."
- :type 'boolean
- :group 'type-break)
-
(defvar type-break-mode-line-format
'(type-break-mode-line-message-mode
(""
(message "Type Break mode is disabled")))))
type-break-mode)
-(defun type-break-mode-line-message-mode (&optional prefix)
+(define-minor-mode type-break-mode-line-message-mode
"Enable or disable warnings in the mode line about typing breaks.
A negative PREFIX argument disables this mode.
`global-mode-string'
`type-break-mode-line-break-message'
`type-break-mode-line-warning'"
- (interactive "P")
- (setq type-break-mode-line-message-mode
- (>= (prefix-numeric-value prefix) 0))
- (and (called-interactively-p 'interactive)
- (if type-break-mode-line-message-mode
- (message "type-break-mode-line-message-mode is enabled")
- (message "type-break-mode-line-message-mode is disabled")))
- type-break-mode-line-message-mode)
-
-(defun type-break-query-mode (&optional prefix)
+ :global t)
+
+(define-minor-mode type-break-query-mode
"Enable or disable warnings in the mode line about typing breaks.
When enabled, the user is periodically queried about whether to take a
The user may also enable or disable this mode simply by setting the
variable of the same name."
- (interactive "P")
- (setq type-break-query-mode
- (>= (prefix-numeric-value prefix) 0))
- (and (called-interactively-p 'interactive)
- (if type-break-query-mode
- (message "type-break-query-mode is enabled")
- (message "type-break-query-mode is disabled")))
- type-break-query-mode)
+ :global t)
\f
;;; session file functions
(defgroup uniquify nil
"Unique buffer names dependent on file name."
- :group 'applications)
+ :group 'files)
(defcustom uniquify-buffer-name-style nil
* Version 23.2 released.
+2010-05-03 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * url-dired.el (url-dired-minor-mode): Use define-minor-mode.
+
+2010-03-24 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * url-http.el (url-http-parse-headers): Fix wrong variable name.
+
+2010-03-24 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * url-http.el (url-http-codes): New variable to hold a mapping of
+ HTTP status codes' numbers, their symbolic name, and their text.
+ (url-http-parse-headers): Use it, leaving the original numeric
+ code in a comment.
+
+2010-03-19 Glenn Morris <rgm@gnu.org>
+
+ * url.el: Move mailcap require earlier in the file.
+
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * url-vars.el (url): Put in comm group.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-01-23 Chong Yidong <cyd@stupidchicken.com>
* url-util.el: Require url-vars (Bug#5459).
2009-09-12 Chong Yidong <cyd@stupidchicken.com>
* url-methods.el (url-scheme--registering-proxy): New variable.
- (url-scheme-register-proxy, url-scheme-get-property): Avoid
- calling url-scheme-register-proxy in an infloop (Bug#4191).
+ (url-scheme-register-proxy, url-scheme-get-property):
+ Avoid calling url-scheme-register-proxy in an infloop (Bug#4191).
2009-08-22 Glenn Morris <rgm@gnu.org>
map)
"Keymap used when browsing directories.")
-(defvar url-dired-minor-mode nil
- "Whether we are in url-dired-minor-mode.")
-
-(make-variable-buffer-local 'url-dired-minor-mode)
-
(defun url-dired-find-file ()
"In dired, visit the file or directory named on this line."
(interactive)
(mouse-set-point event)
(url-dired-find-file))
-(defun url-dired-minor-mode (&optional arg)
+(define-minor-mode url-dired-minor-mode
"Minor mode for directory browsing."
- (interactive "P")
- (cond
- ((null arg)
- (setq url-dired-minor-mode (not url-dired-minor-mode)))
- ((equal 0 arg)
- (setq url-dired-minor-mode nil))
- (t
- (setq url-dired-minor-mode t))))
-
-(if (not (fboundp 'add-minor-mode))
- (defun add-minor-mode (toggle name &optional keymap after toggle-fun)
- "Add a minor mode to `minor-mode-alist' and `minor-mode-map-alist'.
-TOGGLE is a symbol which is used as the variable which toggle the minor mode,
-NAME is the name that should appear in the modeline (it should be a string
-beginning with a space), KEYMAP is a keymap to make active when the minor
-mode is active, and AFTER is the toggling symbol used for another minor
-mode. If AFTER is non-nil, then it is used to position the new mode in the
-minor-mode alists. TOGGLE-FUN specifies an interactive function that
-is called to toggle the mode on and off; this affects what appens when
-button2 is pressed on the mode, and when button3 is pressed somewhere
-in the list of modes. If TOGGLE-FUN is nil and TOGGLE names an
-interactive function, TOGGLE is used as the toggle function.
-
-Example: (add-minor-mode 'view-minor-mode \" View\" view-mode-map)"
- (if (not (assq toggle minor-mode-alist))
- (setq minor-mode-alist (cons (list toggle name) minor-mode-alist)))
- (if (and keymap (not (assq toggle minor-mode-map-alist)))
- (setq minor-mode-map-alist (cons (cons toggle keymap)
- minor-mode-map-alist)))))
-
-(add-minor-mode 'url-dired-minor-mode " URL" url-dired-minor-mode-map)
+ :lighter " URL" :keymap url-dired-minor-mode-map)
(defun url-find-file-dired (dir)
"\"Edit\" directory DIR, but with additional URL-friendly bindings."
nil will explicitly close the connection to the server after every
request.")
+(defconst url-http-codes
+ '((100 continue "Continue with request")
+ (101 switching-protocols "Switching protocols")
+ (102 processing "Processing (Added by DAV)")
+ (200 OK "OK")
+ (201 created "Created")
+ (202 accepted "Accepted")
+ (203 non-authoritative "Non-authoritative information")
+ (204 no-content "No content")
+ (205 reset-content "Reset content")
+ (206 partial-content "Partial content")
+ (207 multi-status "Multi-status (Added by DAV)")
+ (300 multiple-choices "Multiple choices")
+ (301 moved-permanently "Moved permanently")
+ (302 found "Found")
+ (303 see-other "See other")
+ (304 not-modified "Not modified")
+ (305 use-proxy "Use proxy")
+ (307 temporary-redirect "Temporary redirect")
+ (400 bad-request "Bad Request")
+ (401 unauthorized "Unauthorized")
+ (402 payment-required "Payment required")
+ (403 forbidden "Forbidden")
+ (404 not-found "Not found")
+ (405 method-not-allowed "Method not allowed")
+ (406 not-acceptable "Not acceptable")
+ (407 proxy-authentication-required "Proxy authentication required")
+ (408 request-timeout "Request time-out")
+ (409 conflict "Conflict")
+ (410 gone "Gone")
+ (411 length-required "Length required")
+ (412 precondition-failed "Precondition failed")
+ (413 request-entity-too-large "Request entity too large")
+ (414 request-uri-too-large "Request-URI too large")
+ (415 unsupported-media-type "Unsupported media type")
+ (416 requested-range-not-satisfiable "Requested range not satisfiable")
+ (417 expectation-failed "Expectation failed")
+ (422 unprocessable-entity "Unprocessable Entity (Added by DAV)")
+ (423 locked "Locked")
+ (424 failed-Dependency "Failed Dependency")
+ (500 internal-server-error "Internal server error")
+ (501 not-implemented "Not implemented")
+ (502 bad-gateway "Bad gateway")
+ (503 service-unavailable "Service unavailable")
+ (504 gateway-timeout "Gateway time-out")
+ (505 http-version-not-supported "HTTP version not supported")
+ (507 insufficient-storage "Insufficient storage")
+"The HTTP return codes and their text."))
+
;(eval-when-compile
;; These are all macros so that they are hidden from external sight
;; when the file is byte-compiled.
(delete-process url-http-process)))))
(let ((buffer (current-buffer))
(class nil)
- (success nil))
+ (success nil)
+ ;; other status symbols: jewelry and luxury cars
+ (status-symbol (cadr (assq url-http-response-status url-http-codes))))
(setq class (/ url-http-response-status 100))
(url-http-debug "Parsed HTTP headers: class=%d status=%d" class url-http-response-status)
(url-http-handle-cookies)
;; 205 Reset content
;; 206 Partial content
;; 207 Multi-status (Added by DAV)
- (case url-http-response-status
- ((204 205)
+ (case status-symbol
+ ((no-content reset-content)
;; No new data, just stay at the same document
(url-mark-buffer-as-dead buffer)
(setq success t))
;; 307 Temporary redirect
(let ((redirect-uri (or (mail-fetch-field "Location")
(mail-fetch-field "URI"))))
- (case url-http-response-status
- (300
+ (case status-symbol
+ (multiple-choices ; 300
;; Quoth the spec (section 10.3.1)
;; -------------------------------
;; The requested resource corresponds to any one of a set of
;; We do not support agent-driven negotiation, so we just
;; redirect to the preferred URI if one is provided.
nil)
- ((301 302 307)
+ ((moved-permanently found temporary-redirect) ; 301 302 307
;; If the 301|302 status code is received in response to a
;; request other than GET or HEAD, the user agent MUST NOT
;; automatically redirect the request unless it can be
url-http-method url-http-response-status)
(setq url-http-method "GET"
url-http-data nil)))
- (303
+ (see-other ; 303
;; The response to the request can be found under a different
;; URI and SHOULD be retrieved using a GET method on that
;; resource.
(setq url-http-method "GET"
url-http-data nil))
- (304
+ (not-modified ; 304
;; The 304 response MUST NOT contain a message-body.
(url-http-debug "Extracting document from cache... (%s)"
(url-cache-create-filename (url-view-url t)))
(url-cache-extract (url-cache-create-filename (url-view-url t)))
(setq redirect-uri nil
success t))
- (305
+ (use-proxy ; 305
;; The requested resource MUST be accessed through the
;; proxy given by the Location field. The Location field
;; gives the URI of the proxy. The recipient is expected
;; 422 Unprocessable Entity (Added by DAV)
;; 423 Locked
;; 424 Failed Dependency
- (case url-http-response-status
- (401
+ (case status-symbol
+ (unauthorized ; 401
;; The request requires user authentication. The response
;; MUST include a WWW-Authenticate header field containing a
;; challenge applicable to the requested resource. The
;; client MAY repeat the request with a suitable
;; Authorization header field.
(url-http-handle-authentication nil))
- (402
+ (payment-required ; 402
;; This code is reserved for future use
(url-mark-buffer-as-dead buffer)
(error "Somebody wants you to give them money"))
- (403
+ (forbidden ; 403
;; The server understood the request, but is refusing to
;; fulfill it. Authorization will not help and the request
;; SHOULD NOT be repeated.
(setq success t))
- (404
+ (not-found ; 404
;; Not found
(setq success t))
- (405
+ (method-not-allowed ; 405
;; The method specified in the Request-Line is not allowed
;; for the resource identified by the Request-URI. The
;; response MUST include an Allow header containing a list of
;; valid methods for the requested resource.
(setq success t))
- (406
+ (not-acceptable ; 406
;; The resource identified by the request is only capable of
;; generating response entities which have content
;; characteristics nota cceptable according to the accept
;; headers sent in the request.
(setq success t))
- (407
+ (proxy-authentication-required ; 407
;; This code is similar to 401 (Unauthorized), but indicates
;; that the client must first authenticate itself with the
;; proxy. The proxy MUST return a Proxy-Authenticate header
;; field containing a challenge applicable to the proxy for
;; the requested resource.
(url-http-handle-authentication t))
- (408
+ (request-timeout ; 408
;; The client did not produce a request within the time that
;; the server was prepared to wait. The client MAY repeat
;; the request without modifications at any later time.
(setq success t))
- (409
+ (conflict ; 409
;; The request could not be completed due to a conflict with
;; the current state of the resource. This code is only
;; allowed in situations where it is expected that the user
;; information for the user to recognize the source of the
;; conflict.
(setq success t))
- (410
+ (gone ; 410
;; The requested resource is no longer available at the
;; server and no forwarding address is known.
(setq success t))
- (411
+ (length-required ; 411
;; The server refuses to accept the request without a defined
;; Content-Length. The client MAY repeat the request if it
;; adds a valid Content-Length header field containing the
;; `url-http-create-request' automatically calculates the
;; content-length.
(setq success t))
- (412
+ (precondition-failed ; 412
;; The precondition given in one or more of the
;; request-header fields evaluated to false when it was
;; tested on the server.
(setq success t))
- ((413 414)
+ ((request-entity-too-large request-uri-too-large) ; 413 414
;; The server is refusing to process a request because the
;; request entity|URI is larger than the server is willing or
;; able to process.
(setq success t))
- (415
+ (unsupported-media-type ; 415
;; The server is refusing to service the request because the
;; entity of the request is in a format not supported by the
;; requested resource for the requested method.
(setq success t))
- (416
+ (requested-range-not-satisfiable ; 416
;; A server SHOULD return a response with this status code if
;; a request included a Range request-header field, and none
;; of the range-specifier values in this field overlap the
;; current extent of the selected resource, and the request
;; did not include an If-Range request-header field.
(setq success t))
- (417
+ (expectation-failed ; 417
;; The expectation given in an Expect request-header field
;; could not be met by this server, or, if the server is a
;; proxy, the server has unambiguous evidence that the
;; 507 Insufficient storage
(setq success t)
(case url-http-response-status
- (501
+ (not-implemented ; 501
;; The server does not support the functionality required to
;; fulfill the request.
nil)
- (502
+ (bad-gateway ; 502
;; The server, while acting as a gateway or proxy, received
;; an invalid response from the upstream server it accessed
;; in attempting to fulfill the request.
nil)
- (503
+ (service-unavailable ; 503
;; The server is currently unable to handle the request due
;; to a temporary overloading or maintenance of the server.
;; The implication is that this is a temporary condition
;; header. If no Retry-After is given, the client SHOULD
;; handle the response as it would for a 500 response.
nil)
- (504
+ (gateway-timeout ; 504
;; The server, while acting as a gateway or proxy, did not
;; receive a timely response from the upstream server
;; specified by the URI (e.g. HTTP, FTP, LDAP) or some other
;; auxiliary server (e.g. DNS) it needed to access in
;; attempting to complete the request.
nil)
- (505
+ (http-version-not-supported ; 505
;; The server does not support, or refuses to support, the
;; HTTP protocol version that was used in the request
;; message.
nil)
- (507 ; DAV
+ (insufficient-storage ; 507 (DAV)
;; The method could not be performed on the resource
;; because the server is unable to store the representation
;; needed to successfully complete the request. This
(defgroup url nil
"Uniform Resource Locator tool."
:version "22.1"
- :group 'hypermedia)
+ :group 'comm)
(defgroup url-file nil
"URL storage."
;;; url.el --- Uniform Resource Locator retrieval tool
-;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2006, 2007,
+;; 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Bill Perry <wmperry@gnu.org>
;; Keywords: comm, data, processes, hypermedia
(eval-when-compile (require 'cl))
+(require 'mailcap)
+
(eval-when-compile
(require 'mm-decode)
(require 'mm-view))
-(require 'mailcap)
(require 'url-vars)
(require 'url-cookie)
(require 'url-history)
(remove-from-invisibility-spec 'foo)
(set (make-local-variable 'truncate-lines) t)
(set (make-local-variable 'font-lock-defaults)
- '(vc-annotate-font-lock-keywords t)))
+ '(vc-annotate-font-lock-keywords t))
+ (hack-dir-local-variables-non-file-buffer))
(defun vc-annotate-toggle-annotation-visibility ()
"Toggle whether or not the annotation is visible."
(buffer-substring (point-min) (1- (point-max)))))))))
(defun vc-arch-workfile-unchanged-p (file)
- "Check if FILE is unchanged by diffing against the master version.
-Return non-nil if FILE is unchanged."
+ "Stub: arch workfiles are always considered to be in a changed state,"
nil)
(defun vc-arch-state (file)
(message "There are unresolved conflicts in %s"
(file-name-nondirectory rej))))))
-(defun vc-arch-checkin (files rev comment)
+(defun vc-arch-checkin (files rev comment &optional extra-args-ignored)
(if rev (error "Committing to a specific revision is unsupported"))
;; FIXME: This implementation probably only works for singleton filesets
(let ((summary (file-relative-name (car files) (vc-arch-root (car files)))))
"Unregister FILE from bzr."
(vc-bzr-command "remove" nil 0 file "--keep"))
+(declare-function log-edit-extract-headers "log-edit" (headers string))
+
(defun vc-bzr-checkin (files rev comment)
"Check FILE in to bzr with log message COMMENT.
REV non-nil gets an error."
(if rev (error "Can't check in a specific revision with bzr"))
- (vc-bzr-command "commit" nil 0 files "-m" comment))
+ (apply 'vc-bzr-command "commit" nil 0
+ files (cons "-m" (log-edit-extract-headers '(("Author" . "--author")
+ ("Fixes" . "--fixes"))
+ comment))))
(defun vc-bzr-find-revision (file rev buffer)
"Fetch revision REV of file FILE and put it into BUFFER."
(defvar log-view-font-lock-keywords)
(defvar log-view-current-tag-function)
(defvar log-view-per-file-logs)
-(defvar vc-short-log)
(define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View"
(remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack.
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-message-re)
- (if vc-short-log
+ (if (eq vc-log-view-type 'short)
"^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
"^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)"))
(set (make-local-variable 'log-view-font-lock-keywords)
;; log-view-font-lock-keywords is careful to use the buffer-local
;; value of log-view-message-re only since Emacs-23.
- (if vc-short-log
+ (if (eq vc-log-view-type 'short)
(append `((,log-view-message-re
(1 'log-view-message-face)
(2 'change-log-name)
(list vc-bzr-log-switches)
vc-bzr-log-switches)))))
+(defun vc-bzr-log-incoming (buffer remote-location)
+ (apply 'vc-bzr-command "missing" buffer 'async nil
+ (list "--theirs-only" (unless (string= remote-location "") remote-location))))
+
+(defun vc-bzr-log-outgoing (buffer remote-location)
+ (apply 'vc-bzr-command "missing" buffer 'async nil
+ (list "--mine-only" (unless (string= remote-location "") remote-location))))
+
(defun vc-bzr-show-log-entry (revision)
"Find entry for patch name REVISION in bzr change log buffer."
(goto-char (point-min))
(define-key map [down-mouse-3] 'vc-bzr-shelve-menu)
(define-key map "\C-k" 'vc-bzr-shelve-delete-at-point)
- ;; (define-key map "=" 'vc-bzr-shelve-show-at-point)
- ;; (define-key map "\C-m" 'vc-bzr-shelve-show-at-point)
+ (define-key map "=" 'vc-bzr-shelve-show-at-point)
+ (define-key map "\C-m" 'vc-bzr-shelve-show-at-point)
+ (define-key map "A" 'vc-bzr-shelve-apply-and-keep-at-point)
(define-key map "P" 'vc-bzr-shelve-apply-at-point)
+ (define-key map "S" 'vc-bzr-shelve-snapshot)
map))
(defvar vc-bzr-shelve-menu-map
(define-key map [de]
'(menu-item "Delete shelf" vc-bzr-shelve-delete-at-point
:help "Delete the current shelf"))
+ (define-key map [ap]
+ '(menu-item "Apply and keep shelf" vc-bzr-shelve-apply-and-keep-at-point
+ :help "Apply the current shelf and keep it"))
(define-key map [po]
'(menu-item "Apply and remove shelf (pop)" vc-bzr-shelve-apply-at-point
:help "Apply the current shelf and remove it"))
- ;; (define-key map [sh]
- ;; '(menu-item "Show shelve" vc-bzr-shelve-show-at-point
- ;; :help "Show the contents of the current shelve"))
+ (define-key map [sh]
+ '(menu-item "Show shelve" vc-bzr-shelve-show-at-point
+ :help "Show the contents of the current shelve"))
map))
(defvar vc-bzr-extra-menu-map
(let ((map (make-sparse-keymap)))
+ (define-key map [bzr-sn]
+ '(menu-item "Shelve a snapshot" vc-bzr-shelve-snapshot
+ :help "Shelve the current state of the tree and keep the current state"))
(define-key map [bzr-sh]
'(menu-item "Shelve..." vc-bzr-shelve
:help "Shelve changes"))
(vc-bzr-command "shelve" nil 0 nil "--all" "-m" name)
(vc-resynch-buffer root t t))))
-;; (defun vc-bzr-shelve-show (name)
-;; "Show the contents of shelve NAME."
-;; (interactive "sShelve name: ")
-;; (vc-setup-buffer "*vc-bzr-shelve*")
-;; ;; FIXME: how can you show the contents of a shelf?
-;; (vc-bzr-command "shelve" "*vc-bzr-shelve*" 'async nil name)
-;; (set-buffer "*vc-bzr-shelve*")
-;; (diff-mode)
-;; (setq buffer-read-only t)
-;; (pop-to-buffer (current-buffer)))
+(defun vc-bzr-shelve-show (name)
+ "Show the contents of shelve NAME."
+ (interactive "sShelve name: ")
+ (vc-setup-buffer "*vc-diff*")
+ ;; FIXME: how can you show the contents of a shelf?
+ (vc-bzr-command "unshelve" "*vc-diff*" 'async nil "--preview" name)
+ (set-buffer "*vc-diff*")
+ (diff-mode)
+ (setq buffer-read-only t)
+ (pop-to-buffer (current-buffer)))
(defun vc-bzr-shelve-apply (name)
"Apply shelve NAME and remove it afterwards."
(interactive "sApply (and remove) shelf: ")
- (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name)
+ (vc-bzr-command "unshelve" nil 0 nil "--apply" name)
+ (vc-resynch-buffer (vc-bzr-root default-directory) t t))
+
+(defun vc-bzr-shelve-apply-and-keep (name)
+ "Apply shelve NAME and keep it afterwards."
+ (interactive "sApply (and keep) shelf: ")
+ (vc-bzr-command "unshelve" nil 0 nil "--apply" "--keep" name)
+ (vc-resynch-buffer (vc-bzr-root default-directory) t t))
+
+(defun vc-bzr-shelve-snapshot ()
+ "Create a stash with the current tree state."
+ (interactive)
+ (vc-bzr-command "shelve" nil 0 nil "--all" "-m"
+ (let ((ct (current-time)))
+ (concat
+ (format-time-string "Snapshot on %Y-%m-%d" ct)
+ (format-time-string " at %H:%M" ct))))
+ (vc-bzr-command "unshelve" nil 0 nil "--apply" "--keep")
(vc-resynch-buffer (vc-bzr-root default-directory) t t))
(defun vc-bzr-shelve-list ()
(vc-bzr-command "unshelve" nil 0 nil "--delete-only" shelve)
(vc-dir-refresh))))
-;; (defun vc-bzr-shelve-show-at-point ()
-;; (interactive)
-;; (vc-bzr-shelve-show (vc-bzr-shelve-get-at-point (point))))
+(defun vc-bzr-shelve-show-at-point ()
+ (interactive)
+ (vc-bzr-shelve-show (vc-bzr-shelve-get-at-point (point))))
(defun vc-bzr-shelve-apply-at-point ()
(interactive)
(vc-bzr-shelve-apply (vc-bzr-shelve-get-at-point (point))))
+(defun vc-bzr-shelve-apply-and-keep-at-point ()
+ (interactive)
+ (vc-bzr-shelve-apply-and-keep (vc-bzr-shelve-get-at-point (point))))
+
(defun vc-bzr-shelve-menu (e)
(interactive "e")
(vc-dir-at-event e (popup-menu vc-bzr-shelve-menu-map e)))
(setq loglines (buffer-substring-no-properties start (point-max))))))
vc-bzr-revisions))
+(defun vc-bzr-conflicted-files (dir)
+ (let ((default-directory (vc-bzr-root dir))
+ (files ()))
+ (with-temp-buffer
+ (vc-bzr-command "status" t 0 default-directory)
+ (goto-char (point-min))
+ (when (re-search-forward "^conflicts:\n" nil t)
+ (while (looking-at " \\(?:Text conflict in \\(.*\\)\\|.*\\)\n")
+ (if (match-end 1)
+ (push (expand-file-name (match-string 1)) files))
+ (goto-char (match-end 0)))))
+ files))
+
;;; Revision completion
(eval-and-compile
(directory-file-name dir))))
(eq dir t)))
-(defun vc-cvs-checkin (files rev comment)
+(defun vc-cvs-checkin (files rev comment &optional extra-args-ignored)
"CVS-specific version of `vc-backend-checkin'."
(unless (or (not rev) (vc-cvs-valid-revision-number-p rev))
(if (not (vc-cvs-valid-symbolic-tag-name-p rev))
(define-key map [mouse-2] 'vc-dir-toggle-mark)
(define-key map [follow-link] 'mouse-face)
(define-key map "x" 'vc-dir-hide-up-to-date)
+ (define-key map [?\C-k] 'vc-dir-kill-line)
(define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired?
(define-key map "Q" 'vc-dir-query-replace-regexp)
(define-key map (kbd "M-s a C-s") 'vc-dir-isearch)
map vc-dir-mode-map)
(tool-bar-local-item "bookmark_add"
'vc-dir-toggle-mark 'vc-dir-toggle-mark map
- :help "Toggle mark on current item")
+ :help "Toggle mark on current item"
+ :label "Toggle Mark")
(tool-bar-local-item-from-menu 'vc-dir-previous-line "left-arrow"
map vc-dir-mode-map
:rtl "right-arrow")
(tool-bar-local-item-from-menu 'revert-buffer "refresh"
map vc-dir-mode-map)
(tool-bar-local-item-from-menu 'nonincremental-search-forward
- "search" map)
+ "search" map nil
+ :label "Search")
(tool-bar-local-item-from-menu 'vc-dir-query-replace-regexp
- "search-replace" map vc-dir-mode-map)
+ "search-replace" map vc-dir-mode-map
+ :label "Replace")
(tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel"
- map vc-dir-mode-map)
+ map vc-dir-mode-map
+ :label "Cancel")
(tool-bar-local-item-from-menu 'quit-window "exit"
map vc-dir-mode-map)
map))
;; Make sure that if the directory buffer is killed, the update
;; process running in the background is also killed.
(add-hook 'kill-buffer-query-functions 'vc-dir-kill-query nil t)
+ (hack-dir-local-variables-non-file-buffer)
(vc-dir-refresh)))
(defun vc-dir-headers (backend dir)
(propertize "VC backend : " 'face 'font-lock-type-face)
(propertize (format "%s\n" backend) 'face 'font-lock-variable-name-face)
(propertize "Working dir: " 'face 'font-lock-type-face)
- (propertize (format "%s\n" dir) 'face 'font-lock-variable-name-face)
+ (propertize (format "%s\n" (abbreviate-file-name dir))
+ 'face 'font-lock-variable-name-face)
;; Then the backend specific ones.
(vc-call-backend backend 'dir-extra-headers dir)
"\n"))
(ewoc-delete vc-ewoc crt))
(setq crt prev)))))
+(defun vc-dir-kill-line ()
+ "Remove the current line from display."
+ (interactive)
+ (let ((crt (ewoc-locate vc-ewoc))
+ (inhibit-read-only t))
+ (ewoc-delete vc-ewoc crt)))
+
(defun vc-dir-printer (fileentry)
(vc-call-backend vc-dir-backend 'dir-printer fileentry))
nil t nil nil)))))
(unless backend
(setq backend (vc-responsible-backend dir)))
- (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend))
+ (let (pop-up-windows) ; based on cvs-examine; bug#6204
+ (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend)))
(if (derived-mode-p 'vc-dir-mode)
(vc-dir-refresh)
;; FIXME: find a better way to pass the backend to `vc-dir-mode'.
(defvar vc-log-operation nil)
(defvar vc-log-after-operation-hook nil)
(defvar vc-log-fileset)
-(defvar vc-log-extra)
;; In a log entry buffer, this is a local variable
;; that points to the buffer for which it was made
(status 0))
(when files
(setq squeezed (nconc squeezed files)))
- (let ((exec-path (append vc-path exec-path))
- ;; Add vc-path to PATH for the execution of this command.
- ;; Also, since some functions need to parse the output
+ (let (;; Since some functions need to parse the output
;; from external commands, set LC_MESSAGES to C.
- (process-environment
- (cons (concat "PATH=" (getenv "PATH")
- path-separator
- (mapconcat 'identity vc-path path-separator))
- (cons "LC_MESSAGES=C"
- process-environment)))
+ (process-environment (cons "LC_MESSAGES=C" process-environment))
(w32-quote-process-args t))
(if (eq okstatus 'async)
;; Run asynchronously.
;; Set up key bindings for use while editing log messages
-(defun vc-log-edit (fileset)
+(defun vc-log-edit (fileset mode)
"Set up `log-edit' for use on FILE."
(setq default-directory
(with-current-buffer vc-parent-buffer default-directory))
(log-edit 'vc-finish-logentry
nil
- `((log-edit-listfun . (lambda () ',fileset))
- (log-edit-diff-function . (lambda () (vc-diff nil)))))
+ `((log-edit-listfun . (lambda ()
+ ;; FIXME: Should expand the list
+ ;; for directories.
+ (mapcar 'file-relative-name
+ ',fileset)))
+ (log-edit-diff-function . (lambda () (vc-diff nil))))
+ nil
+ mode)
(set (make-local-variable 'vc-log-fileset) fileset)
- (make-local-variable 'vc-log-extra)
(set-buffer-modified-p nil)
(setq buffer-file-name nil))
-(defun vc-start-logentry (files extra comment initial-contents msg logbuf action &optional after-hook)
- "Accept a comment for an operation on FILES with extra data EXTRA.
+(defun vc-start-logentry (files comment initial-contents msg logbuf mode action &optional after-hook)
+ "Accept a comment for an operation on FILES.
If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
action on close to ACTION. If COMMENT is a string and
INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
INITIAL-CONTENTS is nil, do action immediately as if the user had
entered COMMENT. If COMMENT is t, also do action immediately with an
empty comment. Remember the file's buffer in `vc-parent-buffer'
-\(current one if no file). AFTER-HOOK specifies the local value
-for `vc-log-after-operation-hook'."
+\(current one if no file). Puts the log-entry buffer in major-mode
+MODE, defaulting to `log-edit-mode' if MODE is nil.
+AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'."
(let ((parent
(if (vc-dispatcher-browsing)
;; If we are called from a directory browser, the parent buffer is
(set (make-local-variable 'vc-parent-buffer) parent)
(set (make-local-variable 'vc-parent-buffer-name)
(concat " from " (buffer-name vc-parent-buffer)))
- (vc-log-edit files)
+ (vc-log-edit files mode)
(make-local-variable 'vc-log-after-operation-hook)
(when after-hook
(setq vc-log-after-operation-hook after-hook))
(setq vc-log-operation action)
- (setq vc-log-extra extra)
(when comment
(erase-buffer)
(when (stringp comment) (insert comment)))
(vc-finish-logentry (eq comment t)))))
(declare-function vc-dir-move-to-goal-column "vc-dir" ())
-
+;; vc-finish-logentry is typically called from a log-edit buffer (see
+;; vc-start-logentry).
(defun vc-finish-logentry (&optional nocomment)
"Complete the operation implied by the current log entry.
Use the contents of the current buffer as a check-in or registration
(or (vc-dispatcher-browsing) (vc-buffer-sync)))
(unless vc-log-operation
(error "No log operation is pending"))
+
;; save the parameters held in buffer-local variables
(let ((logbuf (current-buffer))
(log-operation vc-log-operation)
+ ;; FIXME: When coming from VC-Dir, we should check that the
+ ;; set of selected files is still equal to vc-log-fileset,
+ ;; to avoid surprises.
(log-fileset vc-log-fileset)
- (log-extra vc-log-extra)
(log-entry (buffer-string))
- (after-hook vc-log-after-operation-hook)
- (tmp-vc-parent-buffer vc-parent-buffer))
+ (after-hook vc-log-after-operation-hook))
(pop-to-buffer vc-parent-buffer)
;; OK, do it to it
(save-excursion
(funcall log-operation
log-fileset
- log-extra
log-entry))
;; Remove checkin window (after the checkin so that if that fails
;; we don't zap the log buffer and the typing therein).
(delete-windows-on logbuf (selected-frame))
;; Kill buffer and delete any other dedicated windows/frames.
(kill-buffer logbuf))
- (logbuf (pop-to-buffer logbuf)
- (bury-buffer)
- (pop-to-buffer tmp-vc-parent-buffer)))
+ (logbuf
+ (with-selected-window (or (get-buffer-window logbuf 0)
+ (selected-window))
+ (with-current-buffer logbuf
+ (bury-buffer)))))
;; Now make sure we see the expanded headers
(when log-fileset
(mapc
:version "23.1"
:group 'vc)
-(defvar git-commits-coding-system 'utf-8
+(defvar vc-git-commits-coding-system 'utf-8
"Default coding system for git commits.")
;;; BACKEND PROPERTIES
(defun vc-git-state (file)
"Git-specific version of `vc-state'."
- ;; FIXME: This can't set 'ignored yet
+ ;; FIXME: This can't set 'ignored or 'conflict yet
+ ;; The 'ignored state could be detected with `git ls-files -i -o
+ ;; --exclude-standard` It also can't set 'needs-update or
+ ;; 'needs-merge. The rough equivalent would be that upstream branch
+ ;; for current branch is in fast-forward state i.e. current branch
+ ;; is direct ancestor of corresponding upstream branch, and the file
+ ;; was modified upstream. But we can't check that without a network
+ ;; operation.
(if (not (vc-git-registered file))
'unregistered
(vc-git--call nil "add" "--refresh" "--" (file-relative-name file))
(defun vc-git-unregister (file)
(vc-git-command nil 0 file "rm" "-f" "--cached" "--"))
+(declare-function log-edit-extract-headers "log-edit" (headers string))
(defun vc-git-checkin (files rev comment)
- (let ((coding-system-for-write git-commits-coding-system))
- (vc-git-command nil 0 files "commit"
- "-m" comment "--only" "--")))
+ (let ((coding-system-for-write vc-git-commits-coding-system))
+ (apply 'vc-git-command nil 0 files
+ (nconc (list "commit" "-m")
+ (log-edit-extract-headers '(("Author" . "--author"))
+ comment)
+ (list "--only" "--")))))
(defun vc-git-find-revision (file rev buffer)
(let* (process-file-side-effects
"Get change log associated with FILES.
Note that using SHORTLOG requires at least Git version 1.5.6,
for the --graph option."
- (let ((coding-system-for-read git-commits-coding-system))
+ (let ((coding-system-for-read vc-git-commits-coding-system))
;; `vc-do-command' creates the buffer, but we need it before running
;; the command.
(vc-setup-buffer buffer)
(when start-revision (list start-revision))
'("--")))))))
+(defun vc-git-log-outgoing (buffer remote-location)
+ (interactive)
+ (vc-git-command
+ buffer 0 nil
+ "log" (if (string= remote-location "")
+ ;; FIXME: this hardcodes the location, it should compute
+ ;; it properly.
+ "origin/master..HEAD"
+ remote-location)))
+
(defvar log-view-message-re)
(defvar log-view-file-re)
(defvar log-view-font-lock-keywords)
(defvar log-view-per-file-logs)
-;; Dynamically bound.
-(defvar vc-short-log)
-
(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
(require 'add-log) ;; We need the faces add-log.
;; Don't have file markers, so use impossible regexp.
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
- (if vc-short-log
+ (if (eq vc-log-view-type 'short)
"^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
"^commit *\\([0-9a-z]+\\)"))
(set (make-local-variable 'log-view-font-lock-keywords)
- (if vc-short-log
+ (if (eq vc-log-view-type 'short)
'(
;; Same as log-view-message-re, except that we don't
;; want the shy group for the tag name.
(with-temp-buffer
(vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
(goto-char (point-min))
- (while (re-search-forward "^refs/\\(heads\\|tags\\)/\\(.*\\)$" nil t)
+ (while (re-search-forward "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$"
+ nil t)
(push (match-string 2) table)))
table))
(with-current-buffer
buffer
(apply 'vc-hg-command buffer 0 files "log"
- (append
+ (nconc
(when start-revision (list (format "-r%s:" start-revision)))
(when limit (list "-l" (format "%s" limit)))
- (when shortlog '("--style" "compact"))
+ (when shortlog (list "--style" "compact"))
vc-hg-log-switches)))))
(defvar log-view-message-re)
(defvar log-view-file-re)
(defvar log-view-font-lock-keywords)
(defvar log-view-per-file-logs)
-(defvar vc-short-log)
(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
(require 'add-log) ;; we need the add-log faces
(set (make-local-variable 'log-view-file-re) "\\`a\\`")
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
- (if vc-short-log
- "^\\([0-9]+\\)\\(?:\\[.*\\]\\)? +\\([0-9a-z]\\{12\\}\\) +\\(\\(?:[0-9]+\\)-\\(?:[0-9]+\\)-\\(?:[0-9]+\\) \\(?:[0-9]+\\):\\(?:[0-9]+\\) \\(?:[-+0-9]+\\)\\) +\\(.*\\)$"
+ (if (eq vc-log-view-type 'short)
+ "^\\([0-9]+\\)\\(\\[.*\\]\\)? +\\([0-9a-z]\\{12\\}\\) +\\(\\(?:[0-9]+\\)-\\(?:[0-9]+\\)-\\(?:[0-9]+\\) \\(?:[0-9]+\\):\\(?:[0-9]+\\) \\(?:[-+0-9]+\\)\\) +\\(.*\\)$"
"^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)"))
(set (make-local-variable 'log-view-font-lock-keywords)
- (if vc-short-log
+ (if (eq vc-log-view-type 'short)
(append `((,log-view-message-re
(1 'log-view-message-face)
- (2 'log-view-message-face)
- (3 'change-log-date)
- (4 'change-log-name))))
+ (2 'highlight nil lax)
+ (3 'log-view-message-face)
+ (4 'change-log-date)
+ (5 'change-log-name))))
(append
log-view-font-lock-keywords
'(
("^user:[ \t]+\\([A-Za-z0-9_.+-]+\\(?:@[A-Za-z0-9_.-]+\\)?\\)"
(1 'change-log-email))
("^date: \\(.+\\)" (1 'change-log-date))
- ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))))
+ ("^tag: +\\([^ ]+\\)$" (1 'highlight))
+ ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))))
+
+(declare-function log-edit-extract-headers "log-edit" (headers string))
(defun vc-hg-diff (files &optional oldvers newvers buffer)
"Get a difference report using hg between two revisions of FILES."
;; "Unregister FILE from hg."
;; (vc-hg-command nil nil file "remove"))
+(declare-function log-edit-extract-headers "log-edit" (headers string))
+
(defun vc-hg-checkin (files rev comment)
"Hg-specific version of `vc-backend-checkin'.
REV is ignored."
- (vc-hg-command nil 0 files "commit" "-m" comment))
+ (apply 'vc-hg-command nil 0 files
+ (nconc (list "commit" "-m")
+ (log-edit-extract-headers '(("Author" . "--user"))
+ comment))))
(defun vc-hg-find-revision (file rev buffer)
(let ((coding-system-for-read 'binary)
(defvar vc-hg-extra-menu-map
(let ((map (make-sparse-keymap)))
- (define-key map [incoming] '(menu-item "Show incoming" vc-hg-incoming))
- (define-key map [outgoing] '(menu-item "Show outgoing" vc-hg-outgoing))
map))
(defun vc-hg-extra-menu () vc-hg-extra-menu-map)
(defvar log-view-vc-backend)
-(define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing"
- "Mode for browsing Hg outgoing changes."
- (set (make-local-variable 'log-view-vc-backend) 'Hg))
-
-(define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming"
- "Mode for browsing Hg incoming changes."
- (set (make-local-variable 'log-view-vc-backend) 'Hg))
-
(defstruct (vc-hg-extra-fileinfo
(:copier nil)
(:constructor vc-hg-create-extra-fileinfo (rename-state extra-name))
;; (vc-hg-dir-extra-header "Global id : " "id" "-i")
)))
-;; FIXME: this adds another top level menu, instead figure out how to
-;; replace the Log-View menu.
-(easy-menu-define log-view-mode-menu vc-hg-outgoing-mode-map
- "Hg-outgoing Display Menu"
- `("Hg-outgoing"
- ["Push selected" vc-hg-push]))
+(defun vc-hg-log-incoming (buffer remote-location)
+ (vc-hg-command buffer 1 nil "incoming" "-n" (unless (string= remote-location "")
+ remote-location)))
-(easy-menu-define log-view-mode-menu vc-hg-incoming-mode-map
- "Hg-incoming Display Menu"
- `("Hg-incoming"
- ["Pull selected" vc-hg-pull]))
-
-(defun vc-hg-outgoing ()
- (interactive)
- (let ((bname "*Hg outgoing*")
- (vc-short-log nil))
- (vc-hg-command bname 1 nil "outgoing" "-n")
- (pop-to-buffer bname)
- (vc-hg-outgoing-mode)))
-
-(defun vc-hg-incoming ()
- (interactive)
- (let ((bname "*Hg incoming*")
- (vc-short-log nil))
- (vc-hg-command bname 0 nil "incoming" "-n")
- (pop-to-buffer bname)
- (vc-hg-incoming-mode)))
+(defun vc-hg-log-outgoing (buffer remote-location)
+ (vc-hg-command buffer 1 nil "outgoing" "-n" (unless (string= remote-location "")
+ remote-location)))
(declare-function log-view-get-marked "log-view" ())
(interactive)
(let ((marked-list (log-view-get-marked)))
(if marked-list
- (vc-hg-command
- nil 0 nil
- (cons "push"
+ (apply #'vc-hg-command
+ nil 0 nil
+ "push"
(apply 'nconc
- (mapcar (lambda (arg) (list "-r" arg)) marked-list))))
- (error "No log entries selected for push"))))
+ (mapcar (lambda (arg) (list "-r" arg)) marked-list)))
+ (error "No log entries selected for push"))))
(defun vc-hg-pull ()
(interactive)
(let ((marked-list (log-view-get-marked)))
(if marked-list
- (vc-hg-command
- nil 0 nil
- (cons "pull"
+ (apply #'vc-hg-command
+ nil 0 nil
+ "pull"
(apply 'nconc
- (mapcar (lambda (arg) (list "-r" arg)) marked-list))))
+ (mapcar (lambda (arg) (list "-r" arg)) marked-list)))
(error "No log entries selected for pull"))))
;;; Internal functions
:type '(repeat string)
:group 'vc)
-(defcustom vc-path nil
- "List of extra directories to search for version control commands."
- :type '(repeat directory)
- :group 'vc)
-
-(make-obsolete-variable 'vc-path "should not be necessary anymore." "23.2")
-
(defcustom vc-make-backup-files nil
"If non-nil, backups of registered files are made as with other files.
If nil (the default), files covered by version control don't get backups."
(defun vc-backend-subdirectory-name (file)
- "Return where the master and lock FILEs for the current directory are kept."
+ "Return where the repository for the current directory is kept."
(symbol-name (vc-backend file)))
(defun vc-name (file)
'edited The working file has been edited by the user. If
locking is used for the file, this state means that
the current version is locked by the calling user.
+ This status should *not* be reported for files
+ which have a changed mtime but the same content
+ as the repo copy.
USER The current version of the working file is locked by
some other USER (a string).
- 'needs-update The file has not been edited by the user, but there is
+ 'needs-update The file has not been edited by the user, but there is
a more recent version on the current branch stored
- in the master file.
+ in the repository.
'needs-merge The file has been edited by the user, and there is also
a more recent version on the current branch stored in
- the master file. This state can only occur if locking
+ the repository. This state can only occur if locking
is not used for the file.
'unlocked-changes The working version of the file is not locked,
unchanged))))
(defun vc-default-workfile-unchanged-p (backend file)
- "Check if FILE is unchanged by diffing against the master version.
+ "Check if FILE is unchanged by diffing against the repository version.
Return non-nil if FILE is unchanged."
(zerop (condition-case err
;; If the implementation supports it, let the output
(define-key map [vc-update-change-log]
`(menu-item ,(purecopy "Update ChangeLog") vc-update-change-log
:help ,(purecopy "Find change log file and add entries from recent version control logs")))
+ (define-key map [vc-log-out]
+ `(menu-item ,(purecopy "Show Outgoing Log") vc-log-outgoing
+ :help ,(purecopy "Show a log of changes that will be sent with a push operation")))
+ (define-key map [vc-log-in]
+ `(menu-item ,(purecopy "Show Incoming Log") vc-log-incoming
+ :help ,(purecopy "Show a log of changes that will be received with a pull operation")))
(define-key map [vc-print-log]
`(menu-item ,(purecopy "Show History") vc-print-log
:help ,(purecopy "List the change log of the current file set in a window")))
(defun vc-mtn-responsible-p (file) (vc-mtn-root file))
(defun vc-mtn-could-register (file) (vc-mtn-root file))
-(defun vc-mtn-checkin (files rev comment)
+(defun vc-mtn-checkin (files rev comment &optional extra-args-ignored)
(vc-mtn-command nil 0 files "commit" "-m" comment))
(defun vc-mtn-find-revision (file rev buffer)
(yes-or-no-p (format "Directory %s is empty; remove it? " dir))
(delete-directory dir))))
-(defun vc-rcs-checkin (files rev comment)
+(defun vc-rcs-checkin (files rev comment &optional extra-args-ignored)
"RCS-specific version of `vc-backend-checkin'."
(let ((switches (vc-switches 'RCS 'checkin)))
;; Now operate on the files
(stringp (vc-sccs-search-project-dir (or (file-name-directory file) "")
(file-name-nondirectory file)))))
-(defun vc-sccs-checkin (files rev comment)
+(defun vc-sccs-checkin (files rev comment &optional extra-args-ignored)
"SCCS-specific version of `vc-backend-checkin'."
(dolist (file (vc-expand-dirs files))
(apply 'vc-sccs-do-command nil 0 "delta" (vc-name file)
"Return non-nil if FILE could be registered in SVN.
This is only possible if SVN is responsible for FILE's directory.")
-(defun vc-svn-checkin (files rev comment)
+(defun vc-svn-checkin (files rev comment &optional extra-args-ignored)
"SVN-specific version of `vc-backend-checkin'."
(if rev (error "Committing to a specific revision is unsupported in SVN"))
(let ((status (apply
;; although you might prefer to use C-c C-a (i.e. `log-edit-insert-changelog')
;; from the commit buffer instead or to set `log-edit-setup-invert'.
;;
-;; The vc code maintains some internal state in order to reduce expensive
-;; version-control operations to a minimum. Some names are only computed
-;; once. If you perform version control operations with the backend while
-;; vc's back is turned, or move/rename master files while vc is running,
-;; vc may get seriously confused. Don't do these things!
+;; When using SCCS, RCS, CVS: be careful not to do repo surgery, or
+;; operations like registrations and deletions and renames, outside VC
+;; while VC is running. The support for these systems was designed
+;; when disks were much slower, and the code maintains a lot of
+;; internal state in order to reduce expensive operations to a
+;; minimum. Thus, if you mess with the repo while VC's back is turned,
+;; VC may get seriously confused.
+;;
+;; When using Subversion or a later system, anything you do outside VC
+;; *through the VCS tools* should safely interlock with VC
+;; operations. Under these VC does little state caching, because local
+;; operations are assumed to be fast. The dividing line is
;;
;; ADDING SUPPORT FOR OTHER BACKENDS
;;
;;
;; Return non-nil if FILE is unchanged from the working revision.
;; This function should do a brief comparison of FILE's contents
-;; with those of the repository master of the working revision. If
+;; with those of the repository copy of the working revision. If
;; the backend does not have such a brief-comparison feature, the
;; default implementation of this function can be used, which
;; delegates to a full vc-BACKEND-diff. (Note that vc-BACKEND-diff
;;
;; * checkin (files rev comment)
;;
-;; Commit changes in FILES to this backend. If REV is non-nil, that
-;; should become the new revision number (not all backends do
-;; anything with it). COMMENT is used as a check-in comment. The
-;; implementation should pass the value of vc-checkin-switches to
-;; the backend command. (Note: in older versions of VC, this
-;; command took a single file argument and not a list.)
+;; Commit changes in FILES to this backend. REV is a historical artifact
+;; and should be ignored. COMMENT is used as a check-in comment.
+;; The implementation should pass the value of vc-checkin-switches to
+;; the backend command.
;;
;; * find-revision (file rev buffer)
;;
;; revision. At this point START-REVISION is only required to work
;; in conjunction with LIMIT = 1.
;;
+;; * log-outgoing (backend remote-location)
+;;
+;; Insert in BUFFER the revision log for the changes that will be
+;; sent when performing a push operation to REMOTE-LOCATION.
+;;
+;; * log-incoming (backend remote-location)
+;;
+;; Insert in BUFFER the revision log for the changes that will be
+;; received when performing a pull operation from REMOTE-LOCATION.
+;;
;; - log-view-mode ()
;;
;; Mode to use for the output of print-log. This defaults to
;; Return the revision number that follows REV for FILE, or nil if no such
;; revision exists.
;;
+;; - log-edit-mode ()
+;;
+;; Turn on the mode used for editing the check in log. This
+;; defaults to `log-edit-mode'. If changed, it should use a mode
+;; derived from`log-edit-mode'.
+;;
;; - check-headers ()
;;
;; Return non-nil if the current buffer contains any version headers.
;; makes it possible to provide menu entries for functionality that
;; is specific to a backend and which does not map to any of the VC
;; generic concepts.
+;;
+;; - conflicted-files (dir)
+;;
+;; Return the list of files where conflict resolution is needed in
+;; the project that contains DIR.
+;; FIXME: what should it do with non-text conflicts?
;;; Todo:
(defcustom vc-checkout-carefully (= (user-uid) 0)
"Non-nil means be extra-careful in checkout.
Verify that the file really is not locked
-and that its contents match what the master file says."
+and that its contents match what the repository version says."
:type 'boolean
:group 'vc)
(make-obsolete-variable 'vc-checkout-carefully
(state (nth 3 vc-fileset))
;; The backend should check that the checkout-model is consistent
;; among all the `files'.
- (model (nth 4 vc-fileset))
- revision)
+ (model (nth 4 vc-fileset)))
;; Do the right thing
(cond
(cond
(verbose
;; go to a different revision
- (setq revision (read-string "Branch, revision, or backend to move to: "))
- (let ((revision-downcase (downcase revision)))
+ (let* ((revision
+ (read-string "Branch, revision, or backend to move to: "))
+ (revision-downcase (downcase revision)))
(if (member
revision-downcase
- (mapcar (lambda (arg) (downcase (symbol-name arg))) vc-handled-backends))
+ (mapcar (lambda (arg) (downcase (symbol-name arg)))
+ vc-handled-backends))
(let ((vsym (intern-soft revision-downcase)))
(dolist (file files) (vc-transfer-file file vsym)))
(dolist (file files)
(message "No files remain to be committed")
(if (not verbose)
(vc-checkin ready-for-commit backend)
- (setq revision (read-string "New revision or backend: "))
- (let ((revision-downcase (downcase revision)))
+ (let* ((revision (read-string "New revision or backend: "))
+ (revision-downcase (downcase revision)))
(if (member
revision-downcase
(mapcar (lambda (arg) (downcase (symbol-name arg)))
(defun vc-checkin (files backend &optional rev comment initial-contents)
"Check in FILES.
The optional argument REV may be a string specifying the new revision
-level (if nil increment the current level). COMMENT is a comment
+level (strongly deprecated). COMMENT is a comment
string; if omitted, a buffer is popped up to accept a comment. If
INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial contents
of the log entry buffer.
(lexical-let
((backend backend))
(vc-start-logentry
- files rev comment initial-contents
+ files comment initial-contents
"Enter a change comment."
"*VC-log*"
- (lambda (files rev comment)
- (message "Checking in %s..." (vc-delistify files))
- ;; "This log message intentionally left almost blank".
- ;; RCS 5.7 gripes about white-space-only comments too.
- (or (and comment (string-match "[^\t\n ]" comment))
- (setq comment "*** empty log message ***"))
- (with-vc-properties
- files
- ;; We used to change buffers to get local value of vc-checkin-switches,
- ;; but 'the' local buffer is not a well-defined concept for filesets.
- (progn
- (vc-call-backend backend 'checkin files rev comment)
- (mapc 'vc-delete-automatic-version-backups files))
- `((vc-state . up-to-date)
- (vc-checkout-time . ,(nth 5 (file-attributes file)))
- (vc-working-revision . nil)))
- (message "Checking in %s...done" (vc-delistify files)))
+ (lambda ()
+ (vc-call-backend backend 'log-edit-mode))
+ (lexical-let ((rev rev))
+ (lambda (files comment)
+ (message "Checking in %s..." (vc-delistify files))
+ ;; "This log message intentionally left almost blank".
+ ;; RCS 5.7 gripes about white-space-only comments too.
+ (or (and comment (string-match "[^\t\n ]" comment))
+ (setq comment "*** empty log message ***"))
+ (with-vc-properties
+ files
+ ;; We used to change buffers to get local value of
+ ;; vc-checkin-switches, but 'the' local buffer is
+ ;; not a well-defined concept for filesets.
+ (progn
+ (vc-call-backend backend 'checkin files rev comment)
+ (mapc 'vc-delete-automatic-version-backups files))
+ `((vc-state . up-to-date)
+ (vc-checkout-time . ,(nth 5 (file-attributes file)))
+ (vc-working-revision . nil)))
+ (message "Checking in %s...done" (vc-delistify files))))
'vc-checkin-hook)))
;;; Additional entry points for examining version histories
(not (string= (vc-working-revision file) "0")))
(push file filtered)
;; This file is added but not yet committed;
- ;; there is no master file to diff against.
+ ;; there is no repository version to diff against.
(if (or rev1 rev2)
(error "No revisions of %s exist" file)
;; We regard this as "changed".
(error "Buffer is not version controlled"))
(setq rootdir (vc-call-backend backend 'root default-directory))
(setq working-revision (vc-working-revision rootdir))
- (vc-diff-internal
- t (list backend (list rootdir) working-revision) nil nil
- (called-interactively-p 'interactive)))))
+ ;; VC diff for the root directory produces output that is
+ ;; relative to it. Bind default-directory to the root directory
+ ;; here, this way the *vc-diff* buffer is setup correctly, so
+ ;; relative file names work.
+ (let ((default-directory rootdir))
+ (vc-diff-internal
+ t (list backend (list rootdir) working-revision) nil nil
+ (called-interactively-p 'interactive))))))
;;;###autoload
(defun vc-revision-other-window (rev)
(defun vc-modify-change-comment (files rev oldcomment)
"Edit the comment associated with the given files and revision."
- (vc-start-logentry
- files rev oldcomment t
- "Enter a replacement change comment."
- "*VC-log*"
- (lambda (files rev comment)
- (vc-call-backend
- ;; Less of a kluge than it looks like; log-view mode only passes
- ;; this function a singleton list. Arguments left in this form in
- ;; case the more general operation ever becomes meaningful.
- (vc-responsible-backend (car files))
- 'modify-change-comment files rev comment))))
+ ;; Less of a kluge than it looks like; log-view mode only passes
+ ;; this function a singleton list. Arguments left in this form in
+ ;; case the more general operation ever becomes meaningful.
+ (let ((backend (vc-responsible-backend (car files))))
+ (vc-start-logentry
+ files oldcomment t
+ "Enter a replacement change comment."
+ "*VC-log*"
+ (lambda () (vc-call-backend backend 'log-edit-mode))
+ (lexical-let ((rev rev))
+ (lambda (files comment)
+ (vc-call-backend backend
+ 'modify-change-comment files rev comment))))))
;;;###autoload
(defun vc-merge ()
;;;###autoload
(defalias 'vc-resolve-conflicts 'smerge-ediff)
+;; TODO: This is OK but maybe we could integrate it better.
+;; E.g. it could be run semi-automatically (via a prompt?) when saving a file
+;; that was conflicted (i.e. upon mark-resolved).
+;; FIXME: should we add an "other-window" version? Or maybe we should
+;; hook it inside find-file so it automatically works for
+;; find-file-other-window as well. E.g. find-file could use a new
+;; `default-next-file' variable for its default file (M-n), and
+;; we could then set it upon mark-resolve, so C-x C-s C-x C-f M-n would
+;; automatically offer the next conflicted file.
+(defun vc-find-conflicted-file ()
+ "Visit the next conflicted file in the current project."
+ (interactive)
+ (let* ((backend (or (if buffer-file-name (vc-backend buffer-file-name))
+ (vc-responsible-backend default-directory)
+ (error "No VC backend")))
+ (files (vc-call-backend backend
+ 'conflicted-files default-directory)))
+ ;; Don't try and visit the current file.
+ (if (equal (car files) buffer-file-name) (pop files))
+ (if (null files)
+ (message "No more conflicted files")
+ (find-file (pop files))
+ (message "%s more conflicted files after this one"
+ (if files (length files) "No")))))
+
;; Named-configuration entry points
(defun vc-tag-precondition (dir)
(defvar log-view-vc-backend)
(defvar log-view-vc-fileset)
+(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return)
+ (when (and limit (not (eq 'limit-unsupported pl-return))
+ (not is-start-revision))
+ (goto-char (point-max))
+ (lexical-let ((working-revision working-revision)
+ (limit limit))
+ (widget-create 'push-button
+ :notify (lambda (&rest ignore)
+ (vc-print-log-internal
+ log-view-vc-backend log-view-vc-fileset
+ working-revision nil (* 2 limit)))
+ :help-echo "Show the log again, and double the number of log entries shown"
+ "Show 2X entries")
+ (widget-insert " ")
+ (widget-create 'push-button
+ :notify (lambda (&rest ignore)
+ (vc-print-log-internal
+ log-view-vc-backend log-view-vc-fileset
+ working-revision nil nil))
+ :help-echo "Show the log again, showing all entries"
+ "Show unlimited entries"))
+ (widget-setup)))
+
(defun vc-print-log-internal (backend files working-revision
&optional is-start-revision limit)
;; Don't switch to the output buffer before running the command,
;; buffer can be accessed by the command.
(let ((dir-present nil)
(vc-short-log nil)
+ (buffer-name "*vc-change-log*")
+ type
pl-return)
(dolist (file files)
(when (file-directory-p file)
(not (null (if dir-present
(memq 'directory vc-log-short-style)
(memq 'file vc-log-short-style)))))
-
- (setq pl-return (vc-call-backend
- backend 'print-log files "*vc-change-log*"
- vc-short-log (when is-start-revision working-revision) limit))
- (pop-to-buffer "*vc-change-log*")
+ (setq type (if vc-short-log 'short 'long))
+ (lexical-let
+ ((working-revision working-revision)
+ (limit limit)
+ (shortlog vc-short-log)
+ (is-start-revision is-start-revision))
+ (vc-log-internal-common
+ backend buffer-name files type
+ (lambda (bk buf type-arg files-arg)
+ (vc-call-backend bk 'print-log files-arg buf
+ shortlog (when is-start-revision working-revision) limit))
+ (lambda (bk files-arg ret)
+ (vc-print-log-setup-buttons working-revision
+ is-start-revision limit ret))
+ (lambda (bk)
+ (vc-call-backend bk 'show-log-entry working-revision))))))
+
+(defvar vc-log-view-type nil
+ "Set this to differentiate the different types of logs.")
+(put 'vc-log-view-type 'permanent-local t)
+
+(defun vc-log-internal-common (backend
+ buffer-name
+ files
+ type
+ backend-func
+ setup-buttons-func
+ goto-location-func)
+ (let (retval)
+ (with-current-buffer (get-buffer-create buffer-name)
+ (set (make-local-variable 'vc-log-view-type) type))
+ (setq retval (funcall backend-func backend buffer-name type files))
+ (pop-to-buffer buffer-name)
(let ((inhibit-read-only t))
;; log-view-mode used to be called with inhibit-read-only bound
;; to t, so let's keep doing it, just in case.
- (vc-call-backend backend 'log-view-mode))
- (set (make-local-variable 'log-view-vc-backend) backend)
- (set (make-local-variable 'log-view-vc-fileset) files)
-
+ (vc-call-backend backend 'log-view-mode)
+ (set (make-local-variable 'log-view-vc-backend) backend)
+ (set (make-local-variable 'log-view-vc-fileset) files))
(vc-exec-after
`(let ((inhibit-read-only t))
- (when (and ,limit (not ,(eq 'limit-unsupported pl-return))
- (not ,is-start-revision))
- (goto-char (point-max))
- (widget-create 'push-button
- :notify (lambda (&rest ignore)
- (vc-print-log-internal
- ',backend ',files ',working-revision nil (* 2 ,limit)))
- :help-echo "Show the log again, and double the number of log entries shown"
- "Show 2X entries")
- (widget-insert " ")
- (widget-create 'push-button
- :notify (lambda (&rest ignore)
- (vc-print-log-internal
- ',backend ',files ',working-revision nil nil))
- :help-echo "Show the log again, showing all entries"
- "Show unlimited entries")
- (widget-setup))
-
+ (funcall ',setup-buttons-func ',backend ',files ',retval)
(shrink-window-if-larger-than-buffer)
- ;; move point to the log entry for the working revision
- (vc-call-backend ',backend 'show-log-entry ',working-revision)
+ (funcall ',goto-location-func ',backend)
(setq vc-sentinel-movepoint (point))
(set-buffer-modified-p nil)))))
+(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type)
+ (vc-log-internal-common
+ backend buffer-name nil type
+ (lexical-let
+ ((remote-location remote-location))
+ (lambda (bk buf type-arg files)
+ (vc-call-backend bk type-arg buf remote-location)))
+ (lambda (bk files-arg ret))
+ (lambda (bk)
+ (goto-char (point-min)))))
+
;;;###autoload
(defun vc-print-log (&optional working-revision limit)
"List the change log of the current fileset in a window.
(setq working-revision (vc-working-revision rootdir))
(vc-print-log-internal backend (list rootdir) working-revision nil limit)))
+;;;###autoload
+(defun vc-log-incoming (&optional remote-location)
+ "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION."
+ (interactive "sRemote location (empty for default): ")
+ (let ((backend
+ (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend)
+ ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
+ (vc-mode (vc-backend buffer-file-name))))
+ rootdir working-revision)
+ (unless backend
+ (error "Buffer is not version controlled"))
+ (vc-incoming-outgoing-internal backend remote-location "*vc-incoming*" 'log-incoming)))
+
+;;;###autoload
+(defun vc-log-outgoing (&optional remote-location)
+ "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION."
+ (interactive "sRemote location (empty for default): ")
+ (let ((backend
+ (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend)
+ ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
+ (vc-mode (vc-backend buffer-file-name))))
+ rootdir working-revision)
+ (unless backend
+ (error "Buffer is not version controlled"))
+ (vc-incoming-outgoing-internal backend remote-location "*vc-outgoing*" 'log-outgoing)))
+
;;;###autoload
(defun vc-revert ()
"Revert working copies of the selected fileset to their repository contents.
(if unmodified-file
(copy-file unmodified-file file
'ok-if-already-exists 'keep-date)
- (when (y-or-n-p "Get base revision from master? ")
+ (when (y-or-n-p "Get base revision from repository? ")
(vc-revert-file file))))
(vc-call-backend new-backend 'receive-file file rev))
(when modified-file
;;;###autoload
(defun vc-rename-file (old new)
- "Rename file OLD to NEW, and rename its master file likewise."
+ "Rename file OLD to NEW in both work area and repository."
(interactive "fVC rename file: \nFRename to: ")
;; in CL I would have said (setq new (merge-pathnames new old))
(let ((old-base (file-name-nondirectory old)))
(defalias 'vc-default-check-headers 'ignore)
+(declare-function log-edit-mode "log-edit" ())
+
+(defun vc-default-log-edit-mode (backend) (log-edit-mode))
+
(defun vc-default-log-view-mode (backend) (log-view-mode))
(defun vc-default-show-log-entry (backend rev)
(defgroup vcursor nil
"Manipulate an alternative (\"virtual\") cursor."
:prefix "vcursor-"
- :group 'editing)
+ :group 'convenience)
(defface vcursor
'((((class color)) (:foreground "blue" :background "cyan" :underline t))
;;; Code:
-(defconst emacs-copyright "Copyright (C) 2010 Free Software Foundation, Inc." "\
-Short copyright string for this version of Emacs.")
-
-(defconst emacs-version "23.2.50" "\
-Version numbers of this version of Emacs.")
-
(defconst emacs-major-version (progn (string-match "^[0-9]+" emacs-version) (string-to-number (match-string 0 emacs-version))) "\
Major version number of this version of Emacs.
This variable first existed in version 19.23.")
"Peruse file or buffer without editing."
:link '(function-link view-mode)
:link '(custom-manual "(emacs)Misc File Ops")
- :group 'wp
- :group 'editing)
+ :group 'wp)
(defcustom view-highlight-face 'highlight
"The face used for highlighting the match found by View mode search."
"Overlay used to display where a search operation found its match.
This is local in each buffer, once it is used.")
(make-variable-buffer-local 'view-overlay)
-
-(unless (assq 'view-mode minor-mode-alist)
- (setq minor-mode-alist
- (cons (list 'view-mode
- (propertize " View"
- 'local-map mode-line-minor-mode-keymap
- 'help-echo "mouse-3: minor mode menu"))
- minor-mode-alist)))
\f
;; Define keymap inside defvar to make it easier to load changes.
;; Some redundant "less"-like key bindings below have been commented out.
(define-key map "?" 'describe-mode) ; Maybe do as less instead? See above.
(define-key map "h" 'describe-mode)
map))
-
-(or (assq 'view-mode minor-mode-map-alist)
- (setq minor-mode-map-alist
- (cons (cons 'view-mode view-mode-map) minor-mode-map-alist)))
\f
;;; Commands that enter or exit view mode.
(unless (file-exists-p file) (error "%s does not exist" file))
(let ((had-a-buf (get-file-buffer file))
(buffer (find-file-noselect file)))
- (if (eq (with-current-buffer buffer
- (get major-mode 'mode-class))
- 'special)
- (progn
- (switch-to-buffer buffer)
- (message "Not using View mode because the major mode is special"))
- (view-buffer buffer (and (not had-a-buf) 'kill-buffer-if-not-modified)))))
+ (view-buffer buffer (and (not had-a-buf) 'kill-buffer-if-not-modified))))
;;;###autoload
(defun view-file-other-window (file)
Exiting View mode will then discard the user's edits. Setting
EXIT-ACTION to `kill-buffer-if-not-modified' avoids this."
(interactive "bView buffer: ")
- (let ((undo-window (list (window-buffer) (window-start) (window-point))))
- (switch-to-buffer buffer)
- (view-mode-enter (cons (selected-window) (cons nil undo-window))
- exit-action)))
+ (if (eq (with-current-buffer buffer
+ (get major-mode 'mode-class))
+ 'special)
+ (progn
+ (switch-to-buffer buffer)
+ (message "Not using View mode because the major mode is special"))
+ (let ((undo-window (list (window-buffer) (window-start) (window-point))))
+ (switch-to-buffer buffer)
+ (view-mode-enter (cons (selected-window) (cons nil undo-window))
+ exit-action))))
;;;###autoload
(defun view-buffer-other-window (buffer &optional not-return exit-action)
exit-action)))
\f
;;;###autoload
-(defun view-mode (&optional arg)
+(define-minor-mode view-mode
;; In the following documentation string we have to use some explicit key
;; bindings instead of using the \\[] construction. The reason for this
;; is that most commands have more than one key binding.
then \\[View-leave], \\[View-quit] and \\[View-kill-and-leave] will return to that buffer.
Entry to view-mode runs the normal hook `view-mode-hook'."
- (interactive "P")
- (unless (and arg ; Do nothing if already OK.
- (if (> (prefix-numeric-value arg) 0) view-mode (not view-mode)))
- (if view-mode (view-mode-disable)
- (view-mode-enable))))
+ :lighter " View" :keymap view-mode-map
+ (if view-mode (view-mode-enable) (view-mode-disable)))
\f
(defun view-mode-enable ()
"Turn on View mode."
;; (setq source-directory (file-name-as-directory
;; (expand-file-name ".." exec-directory)))))
-(defun convert-standard-filename (filename)
- "Convert a standard file's name to something suitable for the current OS.
+(defun w32-convert-standard-filename (filename)
+ "Convert a standard file's name to something suitable for the MS-Windows.
This means to guarantee valid names and perhaps to canonicalize
certain patterns.
-On Windows and DOS, replace invalid characters. On DOS, make
-sure to obey the 8.3 limitations. On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+This function is called by `convert-standard-filename'.
+
+Replace invalid characters and turn Cygwin names into native
+names, and also turn slashes into backslashes if the shell
+requires it (see `w32-shell-dos-semantics')."
(save-match-data
(let ((name
(if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)
"Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
:link '(emacs-library-link :tag "Source Lisp File" "whitespace.el")
:version "23.1"
- :group 'wp
- :group 'data)
+ :group 'convenience)
(defcustom whitespace-style
:link '(custom-manual "(widget)Top")
:link '(emacs-library-link :tag "Lisp File" "widget.el")
:prefix "widget-"
- :group 'extensions
- :group 'hypermedia)
+ :group 'extensions)
(defgroup widget-documentation nil
"Options controlling the display of documentation strings."
;; Allocate digits to disabled alternatives
;; so that the digit of a given alternative never varies.
(setq next-digit (1+ next-digit)))
- (insert "\nC-g = Quit"))
+ (insert "\nC-g = Quit")
+ (goto-char (point-min))
+ (forward-line))
(or some-choice-enabled
(error "None of the choices is currently meaningful"))
(define-key map [?\C-g] 'keyboard-quit)
(dolist (elt widget-image-conversion)
(dolist (ext (cdr elt))
(push (list :type (car elt) :file (concat image ext)) specs)))
- (setq specs (nreverse specs))
- (find-image specs)))
+ (find-image (nreverse specs))))
(t
;; Oh well.
nil)))
Optional arguments DOWN and INACTIVE are used instead of IMAGE when the
button is pressed or inactive, respectively. These are currently ignored."
- (if (and (display-graphic-p)
+ (if (and (featurep 'image)
(setq image (widget-image-find image)))
(progn (widget-put widget :suppress-face t)
(insert-image image tag))
:valid-regexp ""
:error "Field's value doesn't match allowed forms"
:value-create 'widget-field-value-create
+ :value-set 'widget-field-value-set
:value-delete 'widget-field-value-delete
:value-get 'widget-field-value-get
:match 'widget-field-match)
(widget-apply widget :value-get))
widget))
+(defun widget-field-value-set (widget value)
+ "Set an editable text field WIDGET to VALUE"
+ (let ((from (widget-field-start widget))
+ (to (widget-field-text-end widget))
+ (buffer (widget-field-buffer widget))
+ (size (widget-get widget :size)))
+ (when (and from to (buffer-live-p buffer))
+ (with-current-buffer buffer
+ (goto-char from)
+ (delete-char (- to from))
+ (insert value)))))
+
(defun widget-field-value-create (widget)
"Create an editable text field."
(let ((size (widget-get widget :size))
(let ((from (widget-field-start widget))
(to (widget-field-text-end widget))
(buffer (widget-field-buffer widget))
- (size (widget-get widget :size))
(secret (widget-get widget :secret))
(old (current-buffer)))
(if (and from to)
;;; The `visibility' Widget.
(define-widget 'visibility 'item
- "An indicator and manipulator for hidden items."
+ "An indicator and manipulator for hidden items.
+
+The following properties have special meanings for this widget:
+:on-image Image filename or spec to display when the item is visible.
+:on Text shown if the \"on\" image is nil or cannot be displayed.
+:off-image Image filename or spec to display when the item is hidden.
+:off Text shown if the \"off\" image is nil cannot be displayed."
:format "%[%v%]"
:button-prefix ""
:button-suffix ""
+ :on-image "down"
:on "Hide"
+ :off-image "right"
:off "Show"
:value-create 'widget-visibility-value-create
:action 'widget-toggle-action
(defun widget-visibility-value-create (widget)
;; Insert text representing the `on' and `off' states.
- (let ((on (widget-get widget :on))
- (off (widget-get widget :off)))
- (if on
- (setq on (concat widget-push-button-prefix
- on
- widget-push-button-suffix))
- (setq on ""))
- (if off
- (setq off (concat widget-push-button-prefix
- off
- widget-push-button-suffix))
- (setq off ""))
- (if (widget-value widget)
- (widget-image-insert widget on "down" "down-pushed")
- (widget-image-insert widget off "right" "right-pushed"))))
+ (let* ((val (widget-value widget))
+ (text (widget-get widget (if val :on :off)))
+ (img (widget-image-find
+ (widget-get widget (if val :on-image :off-image)))))
+ (widget-image-insert widget
+ (if text
+ (concat widget-push-button-prefix text
+ widget-push-button-suffix)
+ "")
+ (if img
+ (append img '(:ascent center))))))
;;; The `documentation-link' Widget.
;;
(widget-create-child-and-convert
widget (widget-get widget :visibility-widget)
:help-echo "Show or hide rest of the documentation."
- :on "Hide Rest"
+ :on "Hide"
:off "More"
:always-active t
:action 'widget-parent-action
(define-widget 'color 'editable-field
"Choose a color name (with sample)."
:format "%{%t%}: %v (%{sample%})\n"
+ :value-create 'widget-color-value-create
:size 10
:tag "Color"
:value "black"
:notify 'widget-color-notify
:action 'widget-color-action)
+(defun widget-color-value-create (widget)
+ (widget-field-value-create widget)
+ (widget-insert " ")
+ (widget-create-child-and-convert
+ widget 'push-button
+ :tag "Choose" :action 'widget-color--choose-action)
+ (widget-insert " "))
+
+(defun widget-color--choose-action (widget &optional event)
+ (list-colors-display
+ nil nil
+ `(lambda (color)
+ (when (buffer-live-p ,(current-buffer))
+ (widget-value-set ',(widget-get widget :parent) color)
+ (let* ((buf (get-buffer "*Colors*"))
+ (win (get-buffer-window buf 0)))
+ (bury-buffer buf)
+ (and win (> (length (window-list)) 1)
+ (delete-window win)))
+ (pop-to-buffer ,(current-buffer))))))
+
(defun widget-color-complete (widget)
"Complete the color in WIDGET."
(require 'facemenu) ; for facemenu-color-alist
(kill-buffer buffer)
(bury-buffer buffer))))
+\f
(defvar recenter-last-op nil
"Indicates the last recenter operation performed.
Possible values: `top', `middle', `bottom', integer or float numbers.")
(define-key global-map [?\M-r] 'move-to-window-line-top-bottom)
\f
+;;; Scrolling commands.
+
+;;; Scrolling commands which does not signal errors at top/bottom
+;;; of buffer at first key-press (instead moves to top/bottom
+;;; of buffer).
+
+(defcustom scroll-error-top-bottom nil
+ "Move point to top/bottom of buffer before signalling a scrolling error.
+A value of nil means just signal an error if no more scrolling possible.
+A value of t means point moves to the beginning or the end of the buffer
+\(depending on scrolling direction) when no more scrolling possible.
+When point is already on that position, then signal an error."
+ :type 'boolean
+ :group 'scrolling
+ :version "24.1")
+
+(defun scroll-up-command (&optional arg)
+ "Scroll text of selected window upward ARG lines; or near full screen if no ARG.
+If `scroll-error-top-bottom' is non-nil and `scroll-up' cannot
+scroll window further, move cursor to the bottom line.
+When point is already on that position, then signal an error.
+A near full screen is `next-screen-context-lines' less than a full screen.
+Negative ARG means scroll downward.
+If ARG is the atom `-', scroll downward by nearly full screen."
+ (interactive "^P")
+ (cond
+ ((null scroll-error-top-bottom)
+ (scroll-up arg))
+ ((eq arg '-)
+ (scroll-down-command nil))
+ ((< (prefix-numeric-value arg) 0)
+ (scroll-down-command (- (prefix-numeric-value arg))))
+ ((eobp)
+ (scroll-up arg)) ; signal error
+ (t
+ (condition-case nil
+ (scroll-up arg)
+ (end-of-buffer
+ (if arg
+ ;; When scrolling by ARG lines can't be done,
+ ;; move by ARG lines instead.
+ (forward-line arg)
+ ;; When ARG is nil for full-screen scrolling,
+ ;; move to the bottom of the buffer.
+ (goto-char (point-max))))))))
+
+(put 'scroll-up-command 'scroll-command t)
+
+(defun scroll-down-command (&optional arg)
+ "Scroll text of selected window down ARG lines; or near full screen if no ARG.
+If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot
+scroll window further, move cursor to the top line.
+When point is already on that position, then signal an error.
+A near full screen is `next-screen-context-lines' less than a full screen.
+Negative ARG means scroll upward.
+If ARG is the atom `-', scroll upward by nearly full screen."
+ (interactive "^P")
+ (cond
+ ((null scroll-error-top-bottom)
+ (scroll-down arg))
+ ((eq arg '-)
+ (scroll-up-command nil))
+ ((< (prefix-numeric-value arg) 0)
+ (scroll-up-command (- (prefix-numeric-value arg))))
+ ((bobp)
+ (scroll-down arg)) ; signal error
+ (t
+ (condition-case nil
+ (scroll-down arg)
+ (beginning-of-buffer
+ (if arg
+ ;; When scrolling by ARG lines can't be done,
+ ;; move by ARG lines instead.
+ (forward-line (- arg))
+ ;; When ARG is nil for full-screen scrolling,
+ ;; move to the top of the buffer.
+ (goto-char (point-min))))))))
+
+(put 'scroll-down-command 'scroll-command t)
+
+;;; Scrolling commands which scroll a line instead of full screen.
+
+(defun scroll-up-line (&optional arg)
+ "Scroll text of selected window upward ARG lines; or one line if no ARG.
+If ARG is omitted or nil, scroll upward by one line.
+This is different from `scroll-up-command' that scrolls a full screen."
+ (interactive "p")
+ (scroll-up (or arg 1)))
+
+(put 'scroll-up-line 'scroll-command t)
+
+(defun scroll-down-line (&optional arg)
+ "Scroll text of selected window down ARG lines; or one line if no ARG.
+If ARG is omitted or nil, scroll down by one line.
+This is different from `scroll-down-command' that scrolls a full screen."
+ (interactive "p")
+ (scroll-down (or arg 1)))
+
+(put 'scroll-down-line 'scroll-command t)
+
+\f
+(defun scroll-other-window-down (lines)
+ "Scroll the \"other window\" down.
+For more details, see the documentation for `scroll-other-window'."
+ (interactive "P")
+ (scroll-other-window
+ ;; Just invert the argument's meaning.
+ ;; We can do that without knowing which window it will be.
+ (if (eq lines '-) nil
+ (if (null lines) '-
+ (- (prefix-numeric-value lines))))))
+
+(defun beginning-of-buffer-other-window (arg)
+ "Move point to the beginning of the buffer in the other window.
+Leave mark at previous position.
+With arg N, put point N/10 of the way from the true beginning."
+ (interactive "P")
+ (let ((orig-window (selected-window))
+ (window (other-window-for-scrolling)))
+ ;; We use unwind-protect rather than save-window-excursion
+ ;; because the latter would preserve the things we want to change.
+ (unwind-protect
+ (progn
+ (select-window window)
+ ;; Set point and mark in that window's buffer.
+ (with-no-warnings
+ (beginning-of-buffer arg))
+ ;; Set point accordingly.
+ (recenter '(t)))
+ (select-window orig-window))))
+
+(defun end-of-buffer-other-window (arg)
+ "Move point to the end of the buffer in the other window.
+Leave mark at previous position.
+With arg N, put point N/10 of the way from the true end."
+ (interactive "P")
+ ;; See beginning-of-buffer-other-window for comments.
+ (let ((orig-window (selected-window))
+ (window (other-window-for-scrolling)))
+ (unwind-protect
+ (progn
+ (select-window window)
+ (with-no-warnings
+ (end-of-buffer arg))
+ (recenter '(t)))
+ (select-window orig-window))))
+
+\f
(defvar mouse-autoselect-window-timer nil
"Timer used by delayed window autoselection.")
(setq woman-emulation value)
(woman-reformat-last-file))
+(defvar bookmark-make-record-function)
(put 'woman-mode 'mode-class 'special)
(defun woman-mode ()
;; `make-local-variable' in case imenu not yet loaded!
woman-imenu-generic-expression)
(set (make-local-variable 'imenu-space-replacement) " ")
+ ;; Bookmark support.
+ (set (make-local-variable 'bookmark-make-record-function)
+ 'woman-bookmark-make-record)
;; For reformat ...
;; necessary when reformatting a file in its old buffer:
(setq imenu--last-menubar-index-alist nil)
(recenter 0))))))))
nil) ; for woman-file-readable-p etc.
+;;; Bookmark Woman support.
+(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-prop-get "bookmark" (bookmark prop))
+(declare-function bookmark-default-handler "bookmark" (bmk))
+(declare-function bookmark-get-bookmark-record "bookmark" (bmk))
+
+;; FIXME: woman.el and man.el should be better integrated so, for
+;; example, bookmarks of one can be used with the other.
+
+(defun woman-bookmark-make-record ()
+ "Make a bookmark entry for a Woman buffer."
+ `(,(Man-default-bookmark-title)
+ ,@(bookmark-make-record-default 'point-only)
+ (location . ,(concat "woman " woman-last-file-name))
+ ;; Use the same form as man's bookmarks, as much as possible.
+ (man-args . ,woman-last-file-name)
+ (handler . woman-bookmark-jump)))
+
+;;;###autoload
+(defun woman-bookmark-jump (bookmark)
+ "Default bookmark handler for Woman buffers."
+ (let* ((file (bookmark-prop-get bookmark 'man-args))
+ ;; FIXME: we need woman-find-file-noselect, since
+ ;; save-window-excursion can't protect us from the case where
+ ;; woman-find-file creates a new frame.
+ (buf (save-window-excursion
+ (woman-find-file file) (current-buffer))))
+ (bookmark-default-handler
+ `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark)))))
+
(provide 'woman)
;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (mostlyclean): Remove references to non-existent files.
+
+2010-05-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * lwlib-Xaw.c (make_dialog): Remove extra arg to XtVaGetSubresources.
+
+2010-05-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xlwmenu.c (XlwMenuDestroy): Remove XtDestroyWidget on subwidgets
+ (Bug #6127).
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (CPP, LN_S, TOP, LN): Remove unused variables.
+
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE):
+ Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ instead of
+ @c_switch_system@, @c_switch_machine@.
+
+2010-04-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf.
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xlwmenu.c (expose_cb):
+ * lwlib-Xaw.c (fill_xft_data): Declarations before code.
+
+2010-04-17 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xlwmenu.c: Include Shell.h, remove duplicate declaration of
+ XlwMenuRedisplay.
+ (display_menu_item): Replace ws->window with ws->pixmap, remove
+ call to XftDrawRect.
+ (display_menu): Remove this and that argument.
+ Remove just_compute_this_one_p. Fill pixmap at start and copy it to
+ window at end.
+ (expose_cb): New function.
+ (make_windows_if_needed): Replace XCreateWindow with XtCreatePopup.
+ Add eventhandler for expose to expose_cb. Remove creation of xft_draw.
+ (create_pixmap_for_menu): New function.
+ (remap_menubar): Pop down menus that aren't the same as in old_stack.
+ Set width, heigh, x, y on widget with XtVaSetValues.
+ Call create_pixmap_for_menu.
+ Replace XUnmapWindow with XtPopdown.
+ Remowe two last parameters to display_menu.
+ (map_event_to_widget_value, XlwMenuRedisplay, Key, Select)
+ (pop_up_menu): Remowe two last parameters to display_menu.
+ (XlwMenuRealize): Call create_pixmap_for_menu, set w and pixmap.
+ Remove call to XftDrawCreate.
+ (XlwMenuDestroy): Free pixmap. Call XtDestroyWidget instead of
+ XDestroyWindow.
+ (handle_motion_event): Only call handle_single_motion_event once.
+ (set_window_type): New function.
+ (make_windows_if_needed, XlwMenuRealize): Call set_window_type.
+
+ * xlwmenuP.h (window_state): Add pixmap and w.
+
+2010-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xlwmenu.c (facename_changed): Put function in #ifdef HAVE_XFT.
+
+2010-04-11 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE)
+ (C_SWITCH_X_SITE): Define using autoconf.
+
+2010-04-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * lwlib-Xaw.c (widget_xft_data): New for Xft data.
+ (fill_xft_data, openFont, get_text_width_and_height)
+ (draw_text, set_text, find_xft_data, command_press)
+ (command_reset): New functions.
+ (xaw_update_one_widget): Call set_text for dialog and buttons
+ if HAVE_XFT. Also set internalHeight for buttons.
+ (xaw_destroy_instance): Free all Xft related data.
+ (button_actions, buttonTrans): New structures.
+ (make_dialog): Call XtAppAddActions for button_actions.
+ Find xft font to use and call fill_xft_data for widgets.
+ (xaw_create_dialog): Pass instance parameter to make_dialog.
+
+ * lwlib-int.h (_widget_instance): Add Xft data if HAVE_XFT.
+ Override translations for buttons. If depth is 16 or more, tell
+ Xaw3d to not be nice to colormap.
+ Remove separator widget, use XtNhorizDistance on first right button
+ instead.
+
+2010-04-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xlwmenu.c (xlwmenu_default_font): Make static.
+ (xlwMenuResources): Add XtNfaceName and XtNdefaultFace.
+ (string_width): Use XftTextExtentsUtf8 if HAVE_XFT.
+ (MENU_FONT_HEIGHT, MENU_FONT_ASCENT): Add versions for
+ HAVE_XFT.
+ (size_menu): Set max_rest_width in window_state structure.
+ (display_menu_item): If HAVE_XFT and xft_draw is set, use
+ XftDrawRect and XftDrawStringUtf8 to draw text.
+ (make_windows_if_needed): Set max_rest_width and xft_draw
+ in windows[i].
+ (openXftFont): New.
+ (XlwMenuInitialize): Call openXftFont if HAVE_XFT. If mw->menu.font
+ is not set, load font fixed and save it in xlwmenu_default_font.
+ (XlwMenuInitialize): Set max_rest_width and xft_draw in windows[0].
+ (XlwMenuClassInitialize): Initialize xlwmenu_default_font.
+ (XlwMenuRealize): Set xft_fg, xft_bg, xft_disabled_fg and
+ windows[0].xft_draw if xft_font is set.
+ (XlwMenuDestroy): Destroy all xft_draw and close xft_font.
+ (facename_changed): New.
+ (XlwMenuSetValues): Call facename_changed. If face name did change,
+ close old fonts and destroy xft_draw:s. Then create new ones.
+
+ * xlwmenu.h (XtNfaceName, XtCFaceName, XtNdefaultFace,
+ XtCDefaultFace): New.
+
+ * xlwmenuP.h (_window_state): Add max_rest_width and xft_draw.
+ (_XlwMenu_part): Add faceName,xft_fg, xft_bg, xft_disabled_fg and
+ xft_font.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2009-10-19 Dan Nicolaescu <dann@ics.uci.edu>
* xlwmenu.c:
# Copyright (C) 1992, 1993 Lucid, Inc.
-# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+# 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of the Lucid Widget Library.
#
srcdir=@srcdir@
VPATH=@srcdir@
C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
+C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
CC=@CC@
CFLAGS=@CFLAGS@
-CPP=@CPP@
CPPFLAGS=@CPPFLAGS@
-LN_S=@LN_S@
RANLIB=@RANLIB@
# See below--@X_TOOLKIT_TYPE@ is used below.
USE_X_TOOLKIT=@X_TOOLKIT_TYPE@
- TOP = .
+AR = ar cq
+RM = rm -f
- AR = ar cq
-
- LN = ln -s
- RM = rm -f
-
- LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
- MOTIF_OBJS = lwlib-Xm.o
+LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
+MOTIF_OBJS = lwlib-Xm.o
TOOLKIT_DEFINES =
- TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
+TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
- OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
+OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
# ../src is needed to find config.h.
ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
xlwmenu.o: xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h
mostlyclean:
- $(RM) *.o core errs ,* *.a .emacs_* make.log MakeOut \#*
+ $(RM) *.o core liblw.a \#*
clean: mostlyclean
distclean: clean
#include <X11/Xatom.h>
+#ifdef HAVE_XFT
+#include <X11/Xft/Xft.h>
+
+struct widget_xft_data
+{
+ Widget widget;
+ XftFont *xft_font;
+ XftDraw *xft_draw;
+ XftColor xft_fg, xft_bg;
+ int p_width, p_height;
+ Pixmap p;
+};
+
+
+#endif
+
static void xaw_generic_callback (/*Widget, XtPointer, XtPointer*/);
}
#endif
+#ifdef HAVE_XFT
+static void
+fill_xft_data (struct widget_xft_data *data, Widget widget, XftFont *font)
+{
+ Pixel bg, fg;
+ XColor colors[2];
+ int screen = XScreenNumberOfScreen (XtScreen (widget));
+
+ data->widget = widget;
+ data->xft_font = font;
+ XtVaGetValues (widget,
+ XtNbackground, &bg,
+ XtNforeground, &fg,
+ NULL);
+
+ colors[0].pixel = data->xft_fg.pixel = fg;
+ colors[1].pixel = data->xft_bg.pixel = bg;
+ XQueryColors (XtDisplay (widget),
+ DefaultColormapOfScreen (XtScreen (widget)),
+ colors, 2);
+
+ data->xft_fg.color.alpha = 0xFFFF;
+ data->xft_fg.color.red = colors[0].red;
+ data->xft_fg.color.green = colors[0].green;
+ data->xft_fg.color.blue = colors[0].blue;
+ data->xft_bg.color.alpha = 0xFFFF;
+ data->xft_bg.color.red = colors[1].red;
+ data->xft_bg.color.green = colors[1].green;
+ data->xft_bg.color.blue = colors[1].blue;
+
+ data->p = None;
+ data->xft_draw = 0;
+ data->p_width = data->p_height = 0;
+}
+
+static XftFont*
+openFont (Widget widget, char *name)
+{
+ char *fname = name;
+ int screen = XScreenNumberOfScreen (XtScreen (widget));
+ int len = strlen (fname), i = len-1;
+ XftFont *fn;
+
+ /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
+ while (i > 0 && isdigit (fname[i]))
+ --i;
+ if (fname[i] == ' ')
+ {
+ fname = xstrdup (name);
+ fname[i] = '-';
+ }
+
+ fn = XftFontOpenName (XtDisplay (widget), screen, fname);
+ if (fname != name) free (fname);
+
+ return fn;
+}
+
+static int
+get_text_width_and_height (Widget widget, char *text,
+ XftFont *xft_font,
+ int *height)
+{
+ int w = 0, h = 0;
+ char *bp = text;
+
+ while (bp && *bp != '\0')
+ {
+ XGlyphInfo gi;
+ char *cp = strchr (bp, '\n');
+ XftTextExtentsUtf8 (XtDisplay (widget), xft_font,
+ (FcChar8 *) bp,
+ cp ? cp - bp : strlen (bp),
+ &gi);
+ bp = cp ? cp + 1 : NULL;
+ h += xft_font->height;
+ if (w < gi.width) w = gi.width;
+ }
+
+ *height = h;
+ return w;
+}
+
+static void
+draw_text (struct widget_xft_data *data, char *lbl, int inverse)
+{
+ Screen *sc = XtScreen (data->widget);
+ int screen = XScreenNumberOfScreen (sc);
+ int y = data->xft_font->ascent;
+ int x = inverse ? 0 : 2;
+ char *bp = lbl;
+
+ data->xft_draw = XftDrawCreate (XtDisplay (data->widget),
+ data->p,
+ DefaultVisual (XtDisplay (data->widget),
+ screen),
+ DefaultColormapOfScreen (sc));
+ XftDrawRect (data->xft_draw,
+ inverse ? &data->xft_fg : &data->xft_bg,
+ 0, 0, data->p_width, data->p_height);
+
+ if (!inverse) y += 2;
+ while (bp && *bp != '\0')
+ {
+ char *cp = strchr (bp, '\n');
+ XftDrawStringUtf8 (data->xft_draw,
+ inverse ? &data->xft_bg : &data->xft_fg,
+ data->xft_font, x, y, bp, cp ? cp - bp : strlen (bp));
+ bp = cp ? cp + 1 : NULL;
+ /* 1.2 gives reasonable line spacing. */
+ y += data->xft_font->height * 1.2;
+ }
+
+}
+
+
+static void
+set_text (struct widget_xft_data *data, Widget toplevel, char *lbl, int margin)
+{
+ int screen = XScreenNumberOfScreen (XtScreen (data->widget));
+ int width, height;
+
+ width = get_text_width_and_height (data->widget, lbl, data->xft_font,
+ &height);
+ data->p_width = width + margin;
+ data->p_height = height + margin;
+
+ data->p = XCreatePixmap (XtDisplay (data->widget),
+ XtWindow (toplevel),
+ data->p_width,
+ data->p_height,
+ DefaultDepthOfScreen (XtScreen (data->widget)));
+ draw_text (data, lbl, 0);
+ XtVaSetValues (data->widget, XtNbitmap, data->p, NULL);
+}
+
+static struct widget_xft_data *
+find_xft_data (Widget widget)
+{
+ widget_instance *inst = NULL;
+ Widget parent = XtParent (widget);
+ struct widget_xft_data *data = NULL;
+ int nr;
+ while (parent && !inst)
+ {
+ inst = lw_get_widget_instance (parent);
+ parent = XtParent (parent);
+ }
+ if (!inst || !inst->xft_data || !inst->xft_data[0].xft_font) return;
+
+ for (nr = 0; data == NULL && nr < inst->nr_xft_data; ++nr)
+ {
+ if (inst->xft_data[nr].widget == widget)
+ data = &inst->xft_data[nr];
+ }
+
+ return data;
+}
+
+static void
+command_press (Widget widget,
+ XEvent* event,
+ String *params,
+ Cardinal *num_params)
+{
+ struct widget_xft_data *data = find_xft_data (widget);
+ if (data)
+ {
+ char *lbl;
+ /* Since this isn't used for rectangle buttons, use it to for armed. */
+ XtVaSetValues (widget, XtNcornerRoundPercent, 1, NULL);
+
+ XtVaGetValues (widget, XtNlabel, &lbl, NULL);
+ draw_text (data, lbl, 1);
+ }
+}
+
+static void
+command_reset (Widget widget,
+ XEvent* event,
+ String *params,
+ Cardinal *num_params)
+{
+ struct widget_xft_data *data = find_xft_data (widget);
+ if (data)
+ {
+ Dimension cr;
+ XtVaGetValues (widget, XtNcornerRoundPercent, &cr, NULL);
+ if (cr == 1)
+ {
+ char *lbl;
+ XtVaSetValues (widget, XtNcornerRoundPercent, 0, NULL);
+ XtVaGetValues (widget, XtNlabel, &lbl, NULL);
+ draw_text (data, lbl, 0);
+ }
+ }
+}
+
+
+#endif
+
void
#ifdef PROTOTYPES
xaw_update_one_widget (widget_instance *instance, Widget widget,
#endif
if (XtIsSubclass (widget, dialogWidgetClass))
{
- Arg al[1];
- int ac = 0;
- XtSetArg (al[ac], XtNlabel, val->contents->value); ac++;
- XtSetValues (widget, al, ac);
+
+#ifdef HAVE_XFT
+ if (instance->xft_data && instance->xft_data[0].xft_font)
+ {
+ set_text (&instance->xft_data[0], instance->parent,
+ val->contents->value, 10);
+ }
+#endif
+ XtVaSetValues (widget, XtNlabel, val->contents->value, NULL);
}
else if (XtIsSubclass (widget, commandWidgetClass))
{
Dimension bw = 0;
- Arg al[3];
+ Arg al[10];
+ int ac = 0;
XtVaGetValues (widget, XtNborderWidth, &bw, NULL);
if (bw == 0)
}
XtSetSensitive (widget, val->enabled);
- XtSetArg (al[0], XtNlabel, val->value);
+ XtSetArg (al[ac], XtNlabel, val->value);ac++;
/* Force centered button text. Se above. */
- XtSetArg (al[1], XtNjustify, XtJustifyCenter);
- XtSetValues (widget, al, 2);
+ XtSetArg (al[ac], XtNjustify, XtJustifyCenter);ac++;
+#ifdef HAVE_XFT
+ if (instance->xft_data && instance->xft_data[0].xft_font)
+ {
+ int th;
+ int nr;
+ for (nr = 0; nr < instance->nr_xft_data; ++nr)
+ if (instance->xft_data[nr].widget == widget)
+ break;
+ if (nr < instance->nr_xft_data)
+ {
+ set_text (&instance->xft_data[nr], instance->parent,
+ val->value, 6);
+
+ /* Must set internalHeight to twice the highlight thickness,
+ or else it gets overwritten by our pixmap. Probably a bug. */
+ XtVaGetValues (widget, XtNhighlightThickness, &th, NULL);
+ XtSetArg (al[ac], XtNinternalHeight, 2*th);ac++;
+ }
+ }
+#endif
+ XtSetValues (widget, al, ac);
XtRemoveAllCallbacks (widget, XtNcallback);
XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance);
}
xaw_destroy_instance (instance)
widget_instance *instance;
{
+#ifdef HAVE_XFT
+ if (instance->xft_data)
+ {
+ int i;
+ for (i = 0; i < instance->nr_xft_data; ++i)
+ {
+ if (instance->xft_data[i].xft_draw)
+ XftDrawDestroy (instance->xft_data[i].xft_draw);
+ if (instance->xft_data[i].p != None)
+ {
+ XtVaSetValues (instance->xft_data[i].widget, XtNbitmap, None,
+ NULL);
+ XFreePixmap (XtDisplay (instance->widget),
+ instance->xft_data[i].p);
+ }
+ }
+ if (instance->xft_data[0].xft_font)
+ XftFontClose (XtDisplay (instance->widget),
+ instance->xft_data[0].xft_font);
+ free (instance->xft_data);
+ }
+#endif
if (XtIsSubclass (instance->widget, dialogWidgetClass))
/* Need to destroy the Shell too. */
XtDestroyWidget (XtParent (instance->widget));
};
static Boolean actions_initted = False;
+#ifdef HAVE_XFT
+static XtActionsRec button_actions[] =
+ {
+ { "my_reset", command_reset },
+ { "my_press", command_press },
+ };
+char buttonTrans[] =
+ "<Leave>: reset() my_reset()\n"
+ "<Btn1Down>: set() my_press()\n"
+ "<Btn1Up>: my_reset() notify() unset()\n";
+#endif
+
static Widget
-make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, radio_box, list, left_buttons, right_buttons)
+make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
+ radio_box, list, left_buttons, right_buttons, instance)
char* name;
Widget parent;
Boolean pop_up_p;
Boolean list;
int left_buttons;
int right_buttons;
+ widget_instance *instance;
{
Arg av [20];
int ac = 0;
Widget dialog;
Widget button;
XtTranslations override;
+#ifdef HAVE_XFT
+ XftFont *xft_font = 0;
+ XtTranslations button_override;
+#endif
if (! pop_up_p) abort (); /* not implemented */
if (text_input_slot) abort (); /* not implemented */
XtAppContext app = XtWidgetToApplicationContext (parent);
XtAppAddActions (app, xaw_actions,
sizeof (xaw_actions) / sizeof (xaw_actions[0]));
+#ifdef HAVE_XFT
+ XtAppAddActions (app, button_actions,
+ sizeof (button_actions) / sizeof (button_actions[0]));
+#endif
actions_initted = True;
}
override = XtParseTranslationTable (dialogOverride);
XtOverrideTranslations (dialog, override);
+#ifdef HAVE_XFT
+ {
+ int num;
+ Widget *ch = NULL;
+ Widget w = 0;
+ XtVaGetValues (dialog,
+ XtNnumChildren, &num,
+ XtNchildren, &ch, NULL);
+ for (i = 0; i < num; ++i)
+ {
+ if (!XtIsSubclass (ch[i], commandWidgetClass)
+ && XtIsSubclass (ch[i], labelWidgetClass))
+ {
+ w = ch[i];
+ break;
+ }
+ }
+ instance->xft_data = 0;
+ instance->nr_xft_data = 0;
+ if (w)
+ {
+ XtResource rec[] =
+ { { "faceName", "FaceName", XtRString, sizeof(String), 0, XtRString,
+ (XtPointer)"Sans-14" }};
+ char *faceName;
+ XtVaGetSubresources (dialog, &faceName, "Dialog", "dialog",
+ rec, 1, (String)NULL);
+ if (strcmp ("none", faceName) != 0)
+ xft_font = openFont (dialog, faceName);
+ if (xft_font)
+ {
+ instance->nr_xft_data = left_buttons + right_buttons + 1;
+ instance->xft_data = calloc (instance->nr_xft_data,
+ sizeof(*instance->xft_data));
+
+ fill_xft_data (&instance->xft_data[0], w, xft_font);
+ }
+ }
+
+ button_override = XtParseTranslationTable (buttonTrans);
+ }
+#endif
+
bc = 0;
button = 0;
for (i = 0; i < left_buttons; i++)
XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
XtSetArg (av [ac], XtNresizable, True); ac++;
+#ifdef HAVE_XAW3D
+ if (DefaultDepthOfScreen (XtScreen (dialog)) >= 16)
+ {
+ /* Turn of dithered shadow if we can. Looks bad */
+ XtSetArg (av [ac], "beNiceToColormap", False); ac++;
+ }
+#endif
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
+#ifdef HAVE_XFT
+ if (xft_font)
+ {
+ fill_xft_data (&instance->xft_data[bc], button, xft_font);
+ XtOverrideTranslations (button, button_override);
+ }
+#endif
}
- if (right_buttons)
- {
- /* Create a separator
- I want the separator to take up the slack between the buttons on
- the right and the buttons on the left (that is I want the buttons
- after the separator to be packed against the right edge of the
- window) but I can't seem to make it do it.
- */
- ac = 0;
- XtSetArg (av [ac], XtNfromHoriz, button); ac++;
-/* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */
- XtSetArg (av [ac], XtNleft, XtChainLeft); ac++;
- XtSetArg (av [ac], XtNright, XtChainRight); ac++;
- XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
- XtSetArg (av [ac], XtNlabel, ""); ac++;
- XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */
- XtSetArg (av [ac], XtNborderWidth, 0); ac++;
- XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++;
- XtSetArg (av [ac], XtNresizable, False); ac++;
- XtSetArg (av [ac], XtNsensitive, False); ac++;
- button = XtCreateManagedWidget ("separator",
- /* labelWidgetClass, */
- /* This has to be Command to fake out
- the Dialog widget... */
- commandWidgetClass,
- dialog, av, ac);
- }
for (i = 0; i < right_buttons; i++)
{
ac = 0;
XtSetArg (av [ac], XtNfromHoriz, button); ac++;
+ if (i == 0)
+ {
+ /* Separator to the other buttons. */
+ XtSetArg (av [ac], XtNhorizDistance, 30); ac++;
+ }
XtSetArg (av [ac], XtNleft, XtChainRight); ac++;
XtSetArg (av [ac], XtNright, XtChainRight); ac++;
XtSetArg (av [ac], XtNtop, XtChainBottom); ac++;
XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++;
XtSetArg (av [ac], XtNresizable, True); ac++;
+#ifdef HAVE_XAW3D
+ if (DefaultDepthOfScreen (XtScreen (dialog)) >= 16)
+ {
+ /* Turn of dithered shadow if we can. Looks bad */
+ XtSetArg (av [ac], "beNiceToColormap", False); ac++;
+ }
+#endif
sprintf (button_name, "button%d", ++bc);
button = XtCreateManagedWidget (button_name, commandWidgetClass,
dialog, av, ac);
+#ifdef HAVE_XFT
+ if (xft_font)
+ {
+ fill_xft_data (&instance->xft_data[bc], button, xft_font);
+ XtOverrideTranslations (button, button_override);
+ }
+#endif
}
return dialog;
widget = make_dialog (name, parent, pop_up_p,
shell_name, icon_name, text_input_slot, radio_box,
- list, left_buttons, right_buttons);
-
+ list, left_buttons, right_buttons, instance);
return widget;
}
extern char *safe_strdup __P ((const char *));
+struct widget_xft_data;
+
typedef struct _widget_instance
{
Widget widget;
Widget parent;
Boolean pop_up_p;
+#ifdef HAVE_XFT
+ struct widget_xft_data *xft_data;
+ int nr_xft_data;
+#endif
struct _widget_info* info;
struct _widget_instance* next;
} widget_instance;
#include "lisp.h"
#include <stdio.h>
+#include <ctype.h>
#include <sys/types.h>
#if (defined __sun) && !(defined SUNOS41)
#include <X11/ObjectP.h>
#include <X11/StringDefs.h>
#include <X11/cursorfont.h>
+#include <X11/Shell.h>
#include "xlwmenuP.h"
#ifdef emacs
static int pointer_grabbed;
static XEvent menu_post_event;
-XFontStruct *xlwmenu_default_font;
+static XFontStruct *xlwmenu_default_font;
static char
xlwMenuTranslations [] =
#ifdef HAVE_X_I18N
{XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
offset(menu.fontSet), XtRFontSet, NULL},
+#endif
+#ifdef HAVE_XFT
+#define DEFAULT_FACENAME "Sans-10"
+ {XtNfaceName, XtCFaceName, XtRString, sizeof(String),
+ offset(menu.faceName), XtRString, DEFAULT_FACENAME},
+ {XtNdefaultFace, XtCDefaultFace, XtRInt, sizeof(int),
+ offset(menu.default_face), XtRImmediate, (XtPointer)1},
#endif
{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
offset(menu.font), XtRString, "XtDefaultFont"},
static Boolean XlwMenuSetValues();
static void XlwMenuRealize();
-static void XlwMenuRedisplay();
static void XlwMenuResize();
static void XlwMenuInitialize();
static void XlwMenuRedisplay();
{
XCharStruct xcs;
int drop;
+#ifdef HAVE_XFT
+ if (mw->menu.xft_font)
+ {
+ XGlyphInfo gi;
+ XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.xft_font,
+ (FcChar8 *) s,
+ strlen (s), &gi);
+ return gi.width;
+ }
+#endif
#ifdef HAVE_X_I18N
- XRectangle ink, logical;
if (mw->menu.fontSet)
{
+ XRectangle ink, logical;
XmbTextExtents (mw->menu.fontSet, s, strlen (s), &ink, &logical);
return logical.width;
}
}
+#ifdef HAVE_XFT
+#define MENU_FONT_HEIGHT(mw) \
+ ((mw)->menu.xft_font != NULL \
+ ? (mw)->menu.xft_font->height \
+ : ((mw)->menu.fontSet != NULL \
+ ? (mw)->menu.font_extents->max_logical_extent.height \
+ : (mw)->menu.font->ascent + (mw)->menu.font->descent))
+#define MENU_FONT_ASCENT(mw) \
+ ((mw)->menu.xft_font != NULL \
+ ? (mw)->menu.xft_font->ascent \
+ : ((mw)->menu.fontSet != NULL \
+ ? - (mw)->menu.font_extents->max_logical_extent.y \
+ : (mw)->menu.font->ascent))
+#else
#ifdef HAVE_X_I18N
#define MENU_FONT_HEIGHT(mw) \
((mw)->menu.fontSet != NULL \
((mw)->menu.font->ascent + (mw)->menu.font->descent)
#define MENU_FONT_ASCENT(mw) ((mw)->menu.font->ascent)
#endif
+#endif
static int
arrow_width (mw)
ws->width += 2 * mw->menu.shadow_thickness;
ws->height += 2 * mw->menu.shadow_thickness;
+ ws->max_rest_width = max_rest_width;
if (horizontal_p)
{
int width;
enum menu_separator separator;
int separator_p = lw_separator_p (val->name, &separator, 0);
+#ifdef HAVE_XFT
+ XftColor *xftfg;
+#endif
/* compute the sizes of the item */
size_menu_item (mw, val, horizontal_p, &label_width, &rest_width,
else
text_gc = mw->menu.disabled_gc;
deco_gc = mw->menu.foreground_gc;
+#ifdef HAVE_XFT
+ xftfg = val->enabled ? &mw->menu.xft_fg : &mw->menu.xft_disabled_fg;
+#endif
if (separator_p)
{
- draw_separator (mw, ws->window, x, y, width, separator);
+ draw_separator (mw, ws->pixmap, x, y, width, separator);
}
else
{
int x_offset = x + h_spacing + shadow;
char* display_string = resource_widget_value (mw, val);
- draw_shadow_rectangle (mw, ws->window, x, y, width, height, True,
+ draw_shadow_rectangle (mw, ws->pixmap, x, y, width, height, True,
False);
/* Deal with centering a menu title. */
x_offset += ws->button_width;
+#ifdef HAVE_XFT
+ if (ws->xft_draw)
+ {
+ int draw_y = y + v_spacing + shadow;
+ XftDrawStringUtf8 (ws->xft_draw, xftfg,
+ mw->menu.xft_font,
+ x_offset, draw_y + font_ascent,
+ (unsigned char *) display_string,
+ strlen (display_string));
+ }
+ else
+#endif
#ifdef HAVE_X_I18N
if (mw->menu.fontSet)
- XmbDrawString (XtDisplay (mw), ws->window, mw->menu.fontSet,
+ XmbDrawString (XtDisplay (mw), ws->pixmap, mw->menu.fontSet,
text_gc, x_offset,
y + v_spacing + shadow + font_ascent,
display_string, strlen (display_string));
else
#endif
- XDrawString (XtDisplay (mw), ws->window,
+ XDrawString (XtDisplay (mw), ws->pixmap,
text_gc, x_offset,
y + v_spacing + shadow + font_ascent,
display_string, strlen (display_string));
if (!horizontal_p)
{
if (val->button_type == BUTTON_TYPE_TOGGLE)
- draw_toggle (mw, ws->window, x, y + v_spacing + shadow,
+ draw_toggle (mw, ws->pixmap, x, y + v_spacing + shadow,
val->selected);
else if (val->button_type == BUTTON_TYPE_RADIO)
- draw_radio (mw, ws->window, x, y + v_spacing + shadow,
+ draw_radio (mw, ws->pixmap, x, y + v_spacing + shadow,
val->selected);
if (val->contents)
{
int a_w = arrow_width (mw);
- draw_arrow (mw, ws->window, deco_gc,
+ draw_arrow (mw, ws->pixmap, deco_gc,
x + width - a_w
- mw->menu.horizontal_spacing
- mw->menu.shadow_thickness,
}
else if (val->key)
{
+#ifdef HAVE_XFT
+ if (ws->xft_draw)
+ {
+ XGlyphInfo gi;
+ int draw_x = ws->width - ws->max_rest_width
+ + mw->menu.arrow_spacing;
+ int draw_y = y + v_spacing + shadow + font_ascent;
+ XftDrawStringUtf8 (ws->xft_draw, xftfg,
+ mw->menu.xft_font,
+ draw_x, draw_y,
+ (unsigned char *) val->key,
+ strlen (val->key));
+ }
+ else
+#endif
#ifdef HAVE_X_I18N
if (mw->menu.fontSet)
- XmbDrawString (XtDisplay (mw), ws->window,
+ XmbDrawString (XtDisplay (mw), ws->pixmap,
mw->menu.fontSet,
text_gc,
x + label_width + mw->menu.arrow_spacing,
val->key, strlen (val->key));
else
#endif
- XDrawString (XtDisplay (mw), ws->window,
+ XDrawString (XtDisplay (mw), ws->pixmap,
text_gc,
x + label_width + mw->menu.arrow_spacing,
y + v_spacing + shadow + font_ascent,
}
else
{
- XDrawRectangle (XtDisplay (mw), ws->window,
+ XDrawRectangle (XtDisplay (mw), ws->pixmap,
mw->menu.background_gc,
x + shadow, y + shadow,
label_width + h_spacing - 1,
font_height + 2 * v_spacing - 1);
- draw_shadow_rectangle (mw, ws->window, x, y, width, height,
+ draw_shadow_rectangle (mw, ws->pixmap, x, y, width, height,
True, False);
}
if (highlighted_p)
- draw_shadow_rectangle (mw, ws->window, x, y, width, height, False,
+ draw_shadow_rectangle (mw, ws->pixmap, x, y, width, height, False,
False);
}
}
}
static void
-display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return,
- this, that)
+display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return)
XlwMenuWidget mw;
int level;
Boolean just_compute_p;
XPoint* highlighted_pos;
XPoint* hit;
widget_value** hit_return;
- widget_value* this;
- widget_value* that;
{
widget_value* val;
widget_value* following_item;
XPoint where;
int horizontal_p = mw->menu.horizontal && (level == 0);
int highlighted_p;
- int just_compute_this_one_p;
- /* This is set nonzero if the element containing HIGHLIGHTED_POS
- is disabled, so that we do not return any subsequent element either. */
int no_return = 0;
enum menu_separator separator;
where.y = 0;
ws = &mw->menu.windows [level];
+
+ if (!just_compute_p)
+ XFillRectangle (XtDisplay (mw), ws->pixmap, mw->menu.background_gc,
+ 0, 0, ws->width, ws->height);
+
for (val = mw->menu.old_stack [level]->contents; val; val = val->next)
{
highlighted_p = val == following_item;
highlighted_pos->y = where.y;
}
- just_compute_this_one_p =
- just_compute_p || ((this || that) && val != this && val != that);
-
display_menu_item (mw, val, ws, &where, highlighted_p, horizontal_p,
- just_compute_this_one_p);
+ just_compute_p);
if (highlighted_p && highlighted_pos)
{
}
if (!just_compute_p)
- draw_shadow_rectangle (mw, ws->window, 0, 0, ws->width, ws->height,
- False, False);
+ {
+ draw_shadow_rectangle (mw, ws->pixmap, 0, 0, ws->width, ws->height,
+ False, False);
+ XCopyArea (XtDisplay (mw), ws->pixmap, ws->window,
+ mw->menu.foreground_gc, 0, 0, ws->width, ws->height, 0, 0);
+ }
}
\f/* Motion code */
push_new_stack (mw, val);
}
+static void
+expose_cb (Widget widget,
+ XtPointer closure,
+ XEvent* event,
+ Boolean* continue_to_dispatch)
+{
+ XlwMenuWidget mw = (XlwMenuWidget) closure;
+ int i;
+
+ *continue_to_dispatch = False;
+ for (i = 0; i < mw->menu.windows_length; ++i)
+ if (mw->menu.windows [i].w == widget) break;
+ if (i < mw->menu.windows_length && i < mw->menu.old_depth)
+ display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL);
+}
+
+static void
+set_window_type (Widget w, XlwMenuWidget mw)
+{
+ int popup_menu_p = mw->menu.top_depth == 1;
+ Atom type = XInternAtom (XtDisplay (w),
+ popup_menu_p
+ ? "_NET_WM_WINDOW_TYPE_POPUP_MENU"
+ : "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
+ False);
+
+ XChangeProperty (XtDisplay (w), XtWindow (w),
+ XInternAtom (XtDisplay (w), "_NET_WM_WINDOW_TYPE", False),
+ XA_ATOM, 32, PropModeReplace,
+ (unsigned char *)&type, 1);
+}
+
+
static void
make_windows_if_needed (mw, n)
XlwMenuWidget mw;
{
int i;
int start_at;
- XSetWindowAttributes xswa;
- int mask;
- Window root = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
window_state* windows;
+#ifdef HAVE_XFT
+ int screen = XScreenNumberOfScreen (mw->core.screen);
+#endif
if (mw->menu.windows_length >= n)
return;
- xswa.save_under = True;
- xswa.override_redirect = True;
- xswa.background_pixel = mw->core.background_pixel;
- xswa.border_pixel = mw->core.border_pixel;
- xswa.event_mask =
- ExposureMask | PointerMotionMask | PointerMotionHintMask
- | ButtonReleaseMask | ButtonPressMask;
- xswa.cursor = mw->menu.cursor_shape;
- mask = CWSaveUnder | CWOverrideRedirect | CWBackPixel | CWBorderPixel
- | CWEventMask | CWCursor;
-
if (!mw->menu.windows)
{
mw->menu.windows =
for (i = start_at; i < n; i++)
{
+ Arg av[10];
+ int ac = 0;
windows [i].x = 0;
windows [i].y = 0;
windows [i].width = 1;
windows [i].height = 1;
- windows [i].window =
- XCreateWindow (XtDisplay (mw), root, 0, 0, 1, 1,
- 0, 0, CopyFromParent, CopyFromParent, mask, &xswa);
- }
+ windows [i].max_rest_width = 0;
+ XtSetArg (av[ac], XtNwidth, 1); ++ac;
+ XtSetArg (av[ac], XtNheight, 1); ++ac;
+ XtSetArg (av[ac], XtNsaveUnder, True); ++ac;
+ XtSetArg (av[ac], XtNbackground, mw->core.background_pixel); ++ac;
+ XtSetArg (av[ac], XtNborderColor, mw->core.border_pixel); ++ac;
+ XtSetArg (av[ac], XtNborderWidth, mw->core.border_width); ++ac;
+ XtSetArg (av[ac], XtNcursor, mw->menu.cursor_shape); ++ac;
+ windows [i].w =
+ XtCreatePopupShell ("sub", overrideShellWidgetClass,
+ (Widget) mw, av, ac);
+ XtRealizeWidget (windows [i].w);
+ XtAddEventHandler (windows [i].w, ExposureMask, False, expose_cb, mw);
+ windows [i].window = XtWindow (windows [i].w);
+ windows [i].pixmap = None;
+#ifdef HAVE_XFT
+ windows [i].xft_draw = 0;
+#endif
+ set_window_type (windows [i].w, mw);
+ }
}
/* Value is non-zero if WINDOW is part of menu bar widget W. */
}
}
+static void
+create_pixmap_for_menu (window_state* ws, XlwMenuWidget mw)
+{
+ if (ws->pixmap != None)
+ {
+ XFreePixmap (XtDisplay (ws->w), ws->pixmap);
+ ws->pixmap = None;
+ }
+ ws->pixmap = XCreatePixmap (XtDisplay (ws->w), ws->window,
+ ws->width, ws->height,
+ DefaultDepthOfScreen (XtScreen (ws->w)));
+#ifdef HAVE_XFT
+ if (ws->xft_draw)
+ XftDrawDestroy (ws->xft_draw);
+ if (mw->menu.xft_font)
+ {
+ int screen = XScreenNumberOfScreen (mw->core.screen);
+ ws->xft_draw = XftDrawCreate (XtDisplay (ws->w),
+ ws->pixmap,
+ DefaultVisual (XtDisplay (ws->w), screen),
+ mw->core.colormap);
+ }
+ else
+ ws->xft_draw = 0;
+#endif
+}
+
/* Updates old_stack from new_stack and redisplays. */
static void
remap_menubar (mw)
/* updates old_state from new_state. It has to be done now because
display_menu (called below) uses the old_stack to know what to display. */
for (i = last_same + 1; i < new_depth; i++)
- old_stack [i] = new_stack [i];
+ {
+ XtPopdown (mw->menu.windows [i].w);
+ old_stack [i] = new_stack [i];
+ }
mw->menu.old_depth = new_depth;
/* refresh the last selection */
selection_position.x = 0;
selection_position.y = 0;
display_menu (mw, last_same, new_selection == old_selection,
- &selection_position, NULL, NULL, old_selection, new_selection);
+ &selection_position, NULL, NULL);
/* Now place the new menus. */
for (i = last_same + 1; i < new_depth && new_stack[i]->contents; i++)
fit_to_screen (mw, ws, previous_ws, mw->menu.horizontal && i == 1);
- XClearWindow (XtDisplay (mw), ws->window);
- XMoveResizeWindow (XtDisplay (mw), ws->window, ws->x, ws->y,
- ws->width, ws->height);
- XMapRaised (XtDisplay (mw), ws->window);
- display_menu (mw, i, False, &selection_position, NULL, NULL, NULL, NULL);
+ XtVaSetValues (ws->w, XtNwidth, ws->width, XtNheight, ws->height,
+ XtNx, ws->x, XtNy, ws->y, NULL);
+ create_pixmap_for_menu (ws, mw);
+ XtPopup (ws->w, XtGrabNone);
+ display_menu (mw, i, False, &selection_position, NULL, NULL);
}
/* unmap the menus that popped down */
for (i = new_depth - 1; i < old_depth; i++)
if (i >= new_depth || (i > 0 && !new_stack[i]->contents))
- XUnmapWindow (XtDisplay (mw), windows[i].window);
+ XtPopdown (windows[i].w);
}
static Boolean
if (ws && motion_event_is_in_menu (mw, ev, i, &relative_pos))
{
inside = 1;
- display_menu (mw, i, True, NULL, &relative_pos, val, NULL, NULL);
+ display_menu (mw, i, True, NULL, &relative_pos, val);
if (*val)
{
XtReleaseGC ((Widget) mw, mw->menu.shadow_bottom_gc);
}
+#ifdef HAVE_XFT
+static int
+openXftFont (mw)
+ XlwMenuWidget mw;
+{
+ char *fname = mw->menu.faceName;
+
+ mw->menu.xft_font = 0;
+ mw->menu.default_face = fname && strcmp (fname, DEFAULT_FACENAME) == 0;
+
+ if (fname && strcmp (fname, "none") != 0)
+ {
+ int screen = XScreenNumberOfScreen (mw->core.screen);
+ int len = strlen (fname), i = len-1;
+ /* Try to convert Gtk-syntax (Sans 9) to Xft syntax Sans-9. */
+ while (i > 0 && isdigit (fname[i]))
+ --i;
+ if (fname[i] == ' ')
+ {
+ fname = xstrdup (mw->menu.faceName);
+ fname[i] = '-';
+ }
+
+ mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname);
+ if (!mw->menu.xft_font)
+ {
+ fprintf (stderr, "Can't find font '%s'\n", fname);
+ mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen,
+ DEFAULT_FACENAME);
+ }
+ }
+
+ if (fname != mw->menu.faceName) free (fname);
+
+ return mw->menu.xft_font != 0;
+}
+#endif
+
static void
XlwMenuInitialize (request, mw, args, num_args)
Widget request;
mw->menu.contents = tem;
#endif
-/* mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */
+ /* mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */
mw->menu.cursor = mw->menu.cursor_shape;
mw->menu.gray_pixmap
gray_bitmap_width, gray_bitmap_height,
(unsigned long)1, (unsigned long)0, 1);
- /* I don't understand why this ends up 0 sometimes,
- but it does. This kludge works around it.
- Can anyone find a real fix? -- rms. */
- if (mw->menu.font == 0)
- mw->menu.font = xlwmenu_default_font;
+#ifdef HAVE_XFT
+ if (openXftFont (mw))
+ ;
+ else
+#endif
+
+ if (!mw->menu.font)
+ {
+ if (!xlwmenu_default_font)
+ xlwmenu_default_font = XLoadQueryFont (display, "fixed");
+ mw->menu.font = xlwmenu_default_font;
+ if (!mw->menu.font)
+ {
+ fprintf (stderr, "Menu font fixed not found, can't continue.\n");
+ abort ();
+ }
+ }
+
#ifdef HAVE_X_I18N
if (mw->menu.fontSet)
mw->menu.font_extents = XExtentsOfFontSet (mw->menu.fontSet);
mw->menu.windows [0].y = 0;
mw->menu.windows [0].width = 0;
mw->menu.windows [0].height = 0;
+ mw->menu.windows [0].max_rest_width = 0;
+ mw->menu.windows [0].pixmap = None;
+#ifdef HAVE_XFT
+ mw->menu.windows [0].xft_draw = 0;
+#endif
size_menu (mw, 0);
mw->core.width = mw->menu.windows [0].width;
static void
XlwMenuClassInitialize ()
{
+ xlwmenu_default_font = 0;
}
static void
x_uncatch_errors ();
#endif
+ mw->menu.windows [0].w = w;
mw->menu.windows [0].window = XtWindow (w);
mw->menu.windows [0].x = w->core.x;
mw->menu.windows [0].y = w->core.y;
mw->menu.windows [0].width = w->core.width;
mw->menu.windows [0].height = w->core.height;
+
+ set_window_type (mw->menu.windows [0].w, mw);
+ create_pixmap_for_menu (&mw->menu.windows [0], mw);
+
+#ifdef HAVE_XFT
+ if (mw->menu.xft_font)
+ {
+ XColor colors[3];
+ colors[0].pixel = mw->menu.xft_fg.pixel = mw->menu.foreground;
+ colors[1].pixel = mw->menu.xft_bg.pixel = mw->core.background_pixel;
+ colors[2].pixel = mw->menu.xft_disabled_fg.pixel
+ = mw->menu.disabled_foreground;
+ XQueryColors (XtDisplay (mw), mw->core.colormap, colors, 3);
+ mw->menu.xft_fg.color.alpha = 0xFFFF;
+ mw->menu.xft_fg.color.red = colors[0].red;
+ mw->menu.xft_fg.color.green = colors[0].green;
+ mw->menu.xft_fg.color.blue = colors[0].blue;
+ mw->menu.xft_bg.color.alpha = 0xFFFF;
+ mw->menu.xft_bg.color.red = colors[1].red;
+ mw->menu.xft_bg.color.green = colors[1].green;
+ mw->menu.xft_bg.color.blue = colors[1].blue;
+ mw->menu.xft_disabled_fg.color.alpha = 0xFFFF;
+ mw->menu.xft_disabled_fg.color.red = colors[2].red;
+ mw->menu.xft_disabled_fg.color.green = colors[2].green;
+ mw->menu.xft_disabled_fg.color.blue = colors[2].blue;
+ }
+#endif
}
/* Only the toplevel menubar/popup is a widget so it's the only one that
submenu_destroyed = 0;
}
- for (i = 0; i < mw->menu.old_depth; i++)
- display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL);
+ display_menu (mw, 0, False, NULL, NULL, NULL);
}
client exits. Nice, eh?
*/
+#ifdef HAVE_XFT
+ if (mw->menu.windows [0].xft_draw)
+ XftDrawDestroy (mw->menu.windows [0].xft_draw);
+ if (mw->menu.xft_font)
+ XftFontClose (XtDisplay (mw), mw->menu.xft_font);
+#endif
+
+ if (mw->menu.windows [0].pixmap != None)
+ XFreePixmap (XtDisplay (mw), mw->menu.windows [0].pixmap);
/* start from 1 because the one in slot 0 is w->core.window */
for (i = 1; i < mw->menu.windows_length; i++)
- XDestroyWindow (XtDisplay (mw), mw->menu.windows [i].window);
+ {
+ if (mw->menu.windows [i].pixmap != None)
+ XFreePixmap (XtDisplay (mw), mw->menu.windows [i].pixmap);
+#ifdef HAVE_XFT
+ if (mw->menu.windows [i].xft_draw)
+ XftDrawDestroy (mw->menu.windows [i].xft_draw);
+#endif
+ }
+
if (mw->menu.windows)
XtFree ((char *) mw->menu.windows);
}
+#ifdef HAVE_XFT
+static int
+facename_changed (XlwMenuWidget newmw,
+ XlwMenuWidget oldmw)
+{
+ /* This will fore a new XftFont even if the same string is set.
+ This is good, as rendering parameters may have changed and
+ we just want to do a redisplay. */
+ return newmw->menu.faceName != oldmw->menu.faceName;
+}
+#endif
+
static Boolean
XlwMenuSetValues (current, request, new)
Widget current;
if (newmw->core.background_pixel != oldmw->core.background_pixel
|| newmw->menu.foreground != oldmw->menu.foreground
+#ifdef HAVE_XFT
+ || facename_changed (newmw, oldmw)
+#endif
#ifdef HAVE_X_I18N
|| newmw->menu.fontSet != oldmw->menu.fontSet
|| (newmw->menu.fontSet == NULL && newmw->menu.font != oldmw->menu.font)
}
}
+#ifdef HAVE_XFT
+ if (facename_changed (newmw, oldmw))
+ {
+ int i;
+ int screen = XScreenNumberOfScreen (newmw->core.screen);
+ if (newmw->menu.xft_font)
+ XftFontClose (XtDisplay (newmw), newmw->menu.xft_font);
+ openXftFont (newmw);
+ for (i = 0; i < newmw->menu.windows_length; i++)
+ {
+ if (newmw->menu.windows [i].xft_draw)
+ XftDrawDestroy (newmw->menu.windows [i].xft_draw);
+ newmw->menu.windows [i].xft_draw = 0;
+ }
+ if (newmw->menu.xft_font)
+ for (i = 0; i < newmw->menu.windows_length; i++)
+ newmw->menu.windows [i].xft_draw
+ = XftDrawCreate (XtDisplay (newmw),
+ newmw->menu.windows [i].window,
+ DefaultVisual (XtDisplay (newmw), screen),
+ newmw->core.colormap);
+ }
+#endif
#ifdef HAVE_X_I18N
if (newmw->menu.fontSet != oldmw->menu.fontSet && newmw->menu.fontSet != NULL)
{
/* Don't allow the popup menu to resize itself. */
mw->core.width = mw->menu.windows [0].width;
mw->core.height = mw->menu.windows [0].height;
- mw->core.parent->core.width = mw->core.width ;
- mw->core.parent->core.height = mw->core.height ;
+ mw->core.parent->core.width = mw->core.width;
+ mw->core.parent->core.height = mw->core.height;
}
else
{
mw->menu.windows [0].width = mw->core.width;
mw->menu.windows [0].height = mw->core.height;
+ create_pixmap_for_menu (&mw->menu.windows [0], mw);
}
}
int x = ev->x_root;
int y = ev->y_root;
int state = ev->state;
-
- handle_single_motion_event (mw, ev);
+ XMotionEvent oldev = *ev;
/* allow motion events to be generated again */
if (ev->is_hint
&& ev->state == state
&& (ev->x_root != x || ev->y_root != y))
handle_single_motion_event (mw, ev);
+ else
+ handle_single_motion_event (mw, &oldev);
}
static void
else
{
XtRemoveGrab ((Widget) mw);
- display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL);
+ display_menu (mw, 0, False, NULL, NULL, NULL);
}
}
else
{
XtRemoveGrab ((Widget) mw);
- display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL);
+ display_menu (mw, 0, False, NULL, NULL, NULL);
}
}
XtConfigureWidget (XtParent ((Widget)mw), x, y, w, h,
XtParent ((Widget)mw)->core.border_width);
XtPopup (XtParent ((Widget)mw), XtGrabExclusive);
- display_menu (mw, 0, False, NULL, NULL, NULL, NULL, NULL);
+ display_menu (mw, 0, False, NULL, NULL, NULL);
mw->menu.windows [0].x = x + borderwidth;
mw->menu.windows [0].y = y + borderwidth;
mw->menu.top_depth = 1; /* Popup menus don't have a bar so top is 1 */
#define XtCResizeToPreferred "ResizeToPreferred"
#define XtNallowResize "allowResize"
#define XtCAllowResize "AllowResize"
+#define XtNfaceName "faceName"
+#define XtCFaceName "FaceName"
+#define XtNdefaultFace "defaultFace"
+#define XtCDefaultFace "DefaultFace"
/* Motif-compatible resource names */
#define XmNshadowThickness "shadowThickness"
#include "xlwmenu.h"
#include <X11/CoreP.h>
+#ifdef HAVE_XFT
+#include <X11/Xft/Xft.h>
+#endif
/* Elements in the stack arrays. */
typedef struct _window_state
{
+ Widget w;
Window window;
+ Pixmap pixmap;
Position x;
Position y;
Dimension width;
Dimension height;
Dimension label_width;
+ int max_rest_width;
/* Width of toggle buttons or radio buttons. */
Dimension button_width;
+#ifdef HAVE_XFT
+ XftDraw* xft_draw;
+#endif
} window_state;
#ifdef HAVE_X_I18N
XFontSet fontSet;
XFontSetExtents *font_extents;
+#endif
+#ifdef HAVE_XFT
+ String faceName;
+ int default_face;
+ XftFont* xft_font;
+ XftColor xft_fg, xft_bg, xft_disabled_fg;
#endif
XFontStruct* font;
Pixel foreground;
done
### Make sure we're running in the right place.
-if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
- echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2
+if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/subr.el ]; then
+ echo "${progname}: Can't find \`src/lisp.h' and \`lisp/subr.el'." >&2
echo "${progname} must be run in the top directory of the Emacs" >&2
echo "distribution tree. cd to that directory and try again." >&2
exit 1
fi
### Find out which version of Emacs this is.
-shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \
+shortversion=`grep 'char emacs_version' src/emacs.c \
| sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
-version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
+version=`grep 'char emacs_version' src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
if [ ! "${version}" ]; then
- echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
+ echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2
exit 1
fi
ln [a-zA-Z]*.h ../${tempdir}/src
ln [a-zA-Z]*.m ../${tempdir}/src
ln [a-zA-Z]*.in ../${tempdir}/src
+ ln [a-zA-Z]*.mk ../${tempdir}/src
## If we ended up with a symlink, or if we did not get anything
## due to a cross-device symlink, copy the file.
for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in; do
echo "Making links to \`src/m'"
(cd src/m
- # We call files for miscellaneous input (to linker etc) .inp.
- ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m)
+ ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/m)
echo "Making links to \`src/s'"
(cd src/s
echo "Making links to \`msdos'"
(cd msdos
ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos
- ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos
+ ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos
cd ../${tempdir}/msdos
rm -f =*)
+2010-05-21 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp(@ns_frag@): Edit to nothing.
+
+ * sed1x.inp (OLDXMENU): Replace any initial value.
+ * sed1v2.inp (OLDXMENU): Edit to "nothing".
+
+ * sed1v2.inp (CANNOT_DUMP): Edit to no.
+
+2010-05-20 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (DEPFLAGS, deps_frag): Edit to empty.
+ (MKDEPDIR): Edit to ':'.
+
+2010-05-19 Glenn Morris <rgm@gnu.org>
+
+ * sed2v2.inp (ORDINARY_LINK): Set here rather than in s/msdos.h.
+
+ * sed1v2.inp (LD): Edit to $(CC).
+ (YMF_PASS_LDFLAGS): Edit to `flags'.
+
+2010-05-18 Eli Zaretskii <eliz@gnu.org>
+
+ * sed1x.inp: Add copyright notice.
+
+2010-05-18 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (RALLOC_OBJ): Edit to ralloc.o.
+
+ * sed1v2.inp (GMALLOC_OBJ): Edit to gmalloc.o.
+ (VMLIMIT_OBJ): Edit to vm-limit.o.
+
+2010-05-17 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (OLDXMENU_DEPS): Edit to empty.
+ * sed1x.inp (OLDXMENU_DEPS): Edit to ${OLDXMENU} ../src/${OLDXMENU}.
+
+2010-05-16 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (TEMACS_LDFLAGS2): Edit to $(LDFLAGS).
+
+ * sed1v2.inp (GNUSTEP_SYSTEM_LIBRARIES): Remove.
+ (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): Edit to empty.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (LIBXMENU): Edit to empty.
+ * sed1x.inp (LIBXMENU): Expect empty initial value.
+
+ * sed1v2.inp (OLDXMENU): Edit to empty.
+ * sed1x.inp (OLDXMENU): Expect empty initial value.
+
+ * sed1v2.inp (LIBX_OTHER): Edit to empty.
+ * sed1x.inp (LIBX_OTHER): Expect empty initial value.
+
+ * sed1v2.inp (FONT_OBJ): Edit to empty for non-X case.
+ * sed1x.inp (FONT_OBJ): Edit to xfont.o for X case.
+
+2010-05-15 Eli Zaretskii <eliz@gnu.org>
+
+ * sed3v2.inp (INSTALLABLES): Edit out extra ${EXEEXT} after
+ "emacsclient".
+ (emacsserver, timer, wakeup): Remove edit-out commands.
+
+ * sed1v2.inp (MSDOS_OBJ): Add w16select.o.
+ (TERMCAP_OBJ): Add termcap.o.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (OLDXMENU_TARGET): Edit to empty.
+ * sed1x.inp (OLDXMENU_TARGET): Edit to really-oldxmenu.
+
+ * sed1v2.inp (LIBXT_OTHER): Edit to empty.
+
+2010-05-14 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (ns_appdir, ns_appbindir, ns_appsrc): Edit to empty.
+
+ * sed1v2.inp (MSDOS_OBJ): Edit to dosfns.o msdos.o.
+ (MSDOS_SUPPORT): Edit to $(MSDOS_SUPPORT_REAL).
+ * sed1x.inp (MSDOS_X_OBJ): Edit to w16select.o termcap.o.
+
+ * sed2x.inp (HAVE_WINDOW_SYSTEM): Define.
+ * sed1x.inp (TOOLTIP_SUPPORT): Edit to ${lispsource}tooltip.elc.
+ (WINDOW_SUPPORT): Edit to $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT).
+ * sed1v2.inp (MOUSE_SUPPORT): Edit to $(REAL_MOUSE_SUPPORT).
+ (TOOLTIP_SUPPORT, WINDOW_SUPPORT): Edit to empty.
+
+ * sed1v2.inp (FONT_OBJ): Use the plain X version (no XFT, Freetype).
+
+ * sed1v2.inp (@NS_IMPL_GNUSTEP_INC@): Edit to nil.
+
+2010-05-13 Glenn Morris <rgm@gnu.org>
+
+ * sed1x.inp (OLDXMENU): Edit to ${oldXMenudir}libXMenu11.a.
+ (LIBXMENU): Edit to ${OLDXMENU}.
+ (LIBX_OTHER): Edit to ${LIBXT} ${LIBX_EXTRA}.
+
+ * sed1v2.inp (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD)
+ (FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS, FREETYPE_LIBS)
+ (LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS, M17N_FLT_LIBS)
+ (GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBRESOLV, LIBGPM):
+ Edit to empty,
+ (LIB_MATH): Edit to -lm.
+ (UNEXEC_OBJ): Edit to unexec.o.
+
+2010-05-12 Glenn Morris <rgm@gnu.org>
+
+ * sed3v2.inp (INSTALLABLES): No more @LIB_SRC_EXTRA_INSTALLABLES@.
+
+ * sed1v2.inp (LIB_GCC): Edit to -Lgcc.
+
+2010-05-11 Glenn Morris <rgm@gnu.org>
+
+ * sed1x.inp (LIBS_SYSTEM): Edit to -lxext -lsys.
+ * sed3x.inp: New file.
+
+2010-05-10 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp, sed3v2.inp (LIBS_SYSTEM): Edit to empty.
+
+ * sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
+2010-05-08 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp (LIBS_TERMCAP): Edit to empty.
+ (TERMCAP_OBJ): Edit to tparam.o.
+
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ Fix breakage due to autoconfiscation of Makefile.in files.
+
+ * sed3v2.inp (C_SWITCH_MACHINE): Edit to empty.
+
+ * sed1v2.inp (@LIB_MATH@): Edit to -lm.
+ (C_SWITCH_MACHINE, C_SWITCH_SYSTEM, LD_SWITCH_SYSTEM_TEMACS)
+ (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH)
+ (LD_SWITCH_SYSTEM, LD_SWITCH_SYSTEM_EXTRA, LIBTIFF, LIBJPEG)
+ (LIBPNG, LIBGIF, LIBXPM, XFT_LIBS, DBUS_CFLAGS, DBUS_LIBS)
+ (DBUS_OBJ, GCONF_CFLAGS, GCONF_LIBS, GTK_OBJ, LIBXMU, LIBXSM)
+ (LIBXTR6, XOBJ, TOOLKIT_LIBW, WIDGET_OBJ, CYGWIN_OBJ, NS_OBJ)
+ (NS_SUPPORT, LIBSELINUX_LIBS, START_FILES): Edit to empty.
+ (XMENU_OBJ): Edit to xmenu.o.
+ (FONT_OBJ): Edit to value used for X on Unix.
+ (PRE_ALLOC_OBJ): Edit to lastfile.o.
+ (POST_ALLOC_OBJ): Edit to $(vmlimitobj).
+ (@unexec@): Edit to unexec.o.
+
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * sed1v2.inp, sed5x.inp: Remove LN_S, unused.
+
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ Remove support for DJGPP v1.x.
+
+ * sed3.inp:
+ * sed2.inp:
+ * sed1.inp:
+ * mainmake: Files removed.
+
+2010-03-27 Eli Zaretskii <eliz@gnu.org>
+
+ * sedlisp.inp (VPATH): Don't edit, no longer needed.
+ (lisp, srcdir): Adapt to lisp/Makefile.in changes.
+ (abs_top_builddir): New edit.
+
+ * sed3v2.inp (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+ (LIBHESIOD, LIBRESOLV, LIBS_MAIL): Edit to empty values.
+
+ * sed3.inp (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+ (LIBHESIOD, LIBRESOLV, LIBS_MAIL): Edit to empty values.
+
+ * sed1v2.inp (abs_builddir): Edit into "../src".
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-02-19 Eli Zaretskii <eliz@gnu.org>
* INSTALL: Remove a CVS-specific note. Update for latest versions
+++ /dev/null
-# Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 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/>.
-
-# make all to compile and build Emacs.
-# make install to install it.
-# make TAGS to update tags tables.
-#
-# make clean or make mostlyclean
-# Delete all files from the current directory that are normally
-# created by building the program. Don't delete the files that
-# record the configuration. Also preserve files that could be made
-# by building, but normally aren't because the distribution comes
-# with them.
-#
-# Delete `.dvi' files here if they are not part of the distribution.
-#
-# make distclean
-# Delete all files from the current directory that are created by
-# configuring or building the program. If you have unpacked the
-# source and built the program without creating any other files,
-# `make distclean' should leave only the files that were in the
-# distribution.
-#
-# make realclean
-# Delete everything from the current directory that can be
-# reconstructed with this Makefile. This typically includes
-# everything deleted by distclean, plus more: C source files
-# produced by Bison, tags tables, info files, and so on.
-#
-# make extraclean
-# Still more severe - delete backup and autosave files, too.
-
-all: lib-src src
-
-lib-src: FRC
- cd lib-src
- $(MAKE)
- cd ..
-
-src: FRC
- cd src
- $(MAKE)
- cd ..
-
-install: all
- -md bin
- cd lib-src
- coff2exe hexl
- coff2exe etags
- coff2exe ctags
- coff2exe b2m
- mv -f hexl.exe etags.exe ctags.exe b2m.exe ../bin/
- cd ..
- cd src
- coff2exe emacs
- stubedit emacs.exe minstack=512k
- mv -f emacs.exe ../bin/
- cd ..
-
-FRC:
-
-TAGS tags: lib-src
- cd src
- go32 ../lib-src/etags *.[ch] ../lisp/*.el ../lisp/term/*.el
- cd ..
-
-check:
- @echo "We don't have any tests for GNU Emacs yet."
-
-clean:
- cd lib-src
- $(MAKE) clean
- cd ..
- cd src
- $(MAKE) clean
- cd ..
- cd oldxmenu
- -$(MAKE) clean
- cd ..
-
-# arch-tag: d5a489bc-818e-4c3c-8040-b5205ed0602f
version := ${shell sed -n -e '/(defconst emacs-version/s/^[^"]*\("[^"]*"\).*/\1/p' lisp/version.el}
# Q: Do we need to bootstrap?
-# A: Only if we find admin/admin.el, i.e. we are building out of CVS,
-# and src/b-emacs.exe does not exist. This avoids building a
-# bootstrap-emacs and recompiling Lisp files when building a
-# pretest/release tarball.
+# A: Only if we find admin/admin.el, i.e. we are building out of
+# a VCS-checkout (not a release) and src/b-emacs.exe does not exist.
+# This avoids building a bootstrap-emacs and recompiling Lisp files
+# when building a pretest/release tarball.
boot :=
ifneq ($(wildcard admin/admin.el),)
ifeq ($(wildcard src/b-emacs.exe),)
+++ /dev/null
-# -sed1.inp-------------------------------------------------------------
-# Configuration script for src/makefile
-# ----------------------------------------------------------------------
-#
-# Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Emacs.
-#
-# This file is free software; as a special exception, the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program 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.
-#
-# ----------------------------------------------------------------------
-# In case src/Makefile needs to rebuild `make-doc.exe' (might happen under
-# Windows 95), make sure it gets built with commands that DOS
-# understands (one command per line).
-s/^#.*//
-s/^[ \f\t][ \f\t]*$//
-s/^ / /
-s/\.h\.in/.h-in/
-s!^ \./temacs! go32 temacs!
-s!/bin/sh!command.com!
-/^MAKE *=/s/^/# /
-/^SHELL *=/s/^/# /
-/^srcdir *=/s/@[^@\n]*@/./
-/^VPATH *=/s/@[^@\n]*@/./
-/^CC *=/s/@[^@\n]*@/gcc/
-/^CPP *=/s/@[^@\n]*@/gcc -e/
-/^CFLAGS *=/s/@[^@\n]*@/-O2 -g/
-/^LIBS *=/s/@[^@\n]*@//
-/^LIBOBJS *=/s/@[^@\n]*@//
-/^LN_S *=/s/@[^@\n]*@/ln -s/
-/^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
-/^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
-/^@SET_MAKE@$/s/@SET_MAKE@//
-/^.\${libsrc}make-docfile.*>/s!make-docfile!make-doc.exe -o ../etc/DOC!
-/^.\${libsrc}make-doc/s!>.*$!!
-/^\${libsrc}make-docfile:/c\
-${libsrc}make-doc.exe:\
- cd ..\
- cd lib-src\
- $(MAKE) ${MFLAGS} make-docfile -W make-docfile.c\
- cd ..\
- cd src
-/^ cd \${libsrc}; \${MAKE} \${MFLAGS} make-docfile/d
-/\${libsrc}make-docfile/s/-docfile[ ]/-doc.exe /
-/^[\f ]*$/d
-/^temacs:/s/prefix-args//
-/^temacs:/s/stamp-oldxmenu//
-/^ #/d
-
-# arch-tag: 246725c1-79de-4d03-a080-8f19329fa35e
# Configuration script for src/Makefile under DJGPP v2.x
# ----------------------------------------------------------------------
#
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
/^MAKE *=/s/^/# /
/^SHELL *=/s/^/# /
/^srcdir *=/s/@[^@\n]*@/./
+/^abs_builddir *=/s|@abs_builddir@|../src|
/^VPATH *=/s/@[^@\n]*@/./
/^CC *=/s/@[^@\n]*@/gcc/
/^CPP *=/s/@[^@\n]*@/gcc -e/
s/@[^@\n]*@//g
}
/^LIBOBJS *=/s/@[^@\n]*@/getloadavg.o/
-/^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
+/^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
+/^C_SWITCH_SYSTEM *=/s/@C_SWITCH_SYSTEM@//
+/^C_SWITCH_X_SYSTEM *=/s/@C_SWITCH_X_SYSTEM@//
+/^C_SWITCH_X_SITE *=/s/@C_SWITCH_X_SITE@//
+#/^LD_SWITCH_X_SITE *=/s/@LD_SWITCH_X_SITE@//
+/^LD_SWITCH_SYSTEM_TEMACS *=/s/@LD_SWITCH_SYSTEM_TEMACS@//
+/^LD_SWITCH_X_SITE_AUX *=/s/@LD_SWITCH_X_SITE_AUX@//
+/^LD_SWITCH_X_SITE_AUX_RPATH *=/s/@LD_SWITCH_X_SITE_AUX_RPATH@//
+/^LD_SWITCH_SYSTEM *=/s/@LD_SWITCH_SYSTEM@//
+/^LD_SWITCH_SYSTEM_EXTRA *=/s/@LD_SWITCH_SYSTEM_EXTRA@//
+/^TEMACS_LDFLAGS2 *=/s/@TEMACS_LDFLAGS2@/$(LDFLAGS)/
+/^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@//
+/^LIB_GCC *=/s/@LIB_GCC@/-Lgcc/
+/^LD *=/s/@LINKER@/$(CC)/
+/^LIB_STANDARD *=/s/@LIB_STANDARD@//
+/^LIB_MATH *=/s/@LIB_MATH@/-lm/
+/^LIBTIFF *=/s/@LIBTIFF@//
+/^LIBJPEG *=/s/@LIBJPEG@//
+/^LIBPNG *=/s/@LIBPNG@//
+/^LIBGIF *=/s/@LIBGIF@//
+/^LIBXPM *=/s/@LIBXPM@//
+/^XFT_LIBS *=/s/@XFT_LIBS@//
+/^FONTCONFIG_CFLAGS *=/s/@FONTCONFIG_CFLAGS@//
+/^FONTCONFIG_LIBS *=/s/@FONTCONFIG_LIBS@//
+/^FREETYPE_CFLAGS *=/s/@FREETYPE_CFLAGS@//
+/^FREETYPE_LIBS *=/s/@FREETYPE_LIBS@//
+/^LIBOTF_CFLAGS *=/s/@LIBOTF_CFLAGS@//
+/^LIBOTF_LIBS *=/s/@LIBOTF_LIBS@//
+/^M17N_FLT_CFLAGS *=/s/@M17N_FLT_CFLAGS@//
+/^M17N_FLT_LIBS *=/s/@M17N_FLT_LIBS@//
+/^DBUS_CFLAGS *=/s/@DBUS_CFLAGS@//
+/^DBUS_LIBS *=/s/@DBUS_LIBS@//
+/^DBUS_OBJ *=/s/@DBUS_OBJ@//
+/^GCONF_CFLAGS *=/s/@GCONF_CFLAGS@//
+/^GCONF_LIBS *=/s/@GCONF_LIBS@//
+/^GTK_OBJ *=/s/@GTK_OBJ@//
+/^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@//
+/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/
+/^LIBXMU *=/s/@LIBXMU@//
+/^LIBXSM *=/s/@LIBXSM@//
+/^LIBXTR6 *=/s/@LIBXTR6@//
+/^LIBXT_OTHER *=/s/@LIBXT_OTHER@//
+/^OLDXMENU_TARGET *=/s/@OLDXMENU_TARGET@//
+/^OLDXMENU_DEPS *=/s/@OLDXMENU_DEPS@//
+/^XOBJ *=/s/@XOBJ@//
+/^TOOLKIT_LIBW *=/s/@TOOLKIT_LIBW@//
/^LIBSOUND *=/s/@LIBSOUND@//
/^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@//
/^RSVG_LIBS *=/s/@RSVG_LIBS@//
/^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@//
+/^WIDGET_OBJ *=/s/@WIDGET_OBJ@//
+/^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@//
+/^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/
+/^MSDOS_SUPPORT *=/s/= */= $(MSDOS_SUPPORT_REAL)/
+/^ns_appdir *=/s/@ns_appdir@//
+/^ns_appbindir *=/s/@ns_appbindir@//
+/^ns_appsrc *=/s/@ns_appsrc@//
+/^NS_OBJ *=/s/@NS_OBJ@//
+/^NS_SUPPORT *=/s/@NS_SUPPORT@//
+/^GNU_OBJC_CFLAGS*=/s/@GNU_OBJC_CFLAGS@//
+/^LIBRESOLV *=/s/@LIBRESOLV@//
+/^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@//
+/^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
+/^START_FILES *=/s/@START_FILES@//
/^OTHER_FILES *=/s/@OTHER_FILES@//
+/^XMENU_OBJ *=/s/@XMENU_OBJ@/xmenu.o/
+/^FONT_OBJ *=/s/@FONT_OBJ@//
+/^MOUSE_SUPPORT *=/s/@MOUSE_SUPPORT@/$(REAL_MOUSE_SUPPORT)/
+/^TOOLTIP_SUPPORT *=/s/@TOOLTIP_SUPPORT@//
+/^WINDOW_SUPPORT *=/s/@WINDOW_SUPPORT@//
+/^LIBGPM *=/s/@LIBGPM@//
/^EXEEXT *=/s/@EXEEXT@/.exe/
+/^OLDXMENU *=/s/@OLDXMENU@/nothing/
+/^LIBXMENU *=/s/@LIBXMENU@//
+/^LIBX_OTHER *=/s/@LIBX_OTHER@//
+/^GMALLOC_OBJ *=/s/@GMALLOC_OBJ@/gmalloc.o/
+/^VMLIMIT_OBJ *=/s/@VMLIMIT_OBJ@/vm-limit.o/
+/^RALLOC_OBJ *=/s/@RALLOC_OBJ@/ralloc.o/
+/^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/
+/^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/
+/^UNEXEC_OBJ *=/s/@unexec@/unexec.o/
+/^CANNOT_DUMP *=/s/@cannot_dump@/no/
+/^DEPFLAGS *=/s/@DEPFLAGS@//
+/^MKDEPDIR *=/s/@MKDEPDIR@/:/
/^version *=/s/@[^@\n]*@//
-/^LN_S *=/s/@[^@\n]*@/ln -s/
/^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
/^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
/^@SET_MAKE@$/s/@SET_MAKE@//
+/^@NS_IMPL_GNUSTEP_INC@/s/@NS_IMPL_GNUSTEP_INC@//
+/^NS_IMPL_GNUSTEP_TEMACS_LDFLAGS *=/s/@NS_IMPL_GNUSTEP_TEMACS_LDFLAGS@//
/^.\${libsrc}make-docfile.*>/s!make-docfile!make-docfile -o ../etc/DOC!
/^.\${libsrc}make-doc/s!>.*$!!
/^[\f ]*$/d
/^ @: /d
/^ -\{0,1\}ln -/s/ln -f/cp -pf/
/^[ ]touch /s/touch/djecho $@ >/
+s/@YMF_PASS_LDFLAGS@/flags/
+s/@deps_frag@//
+s/@ns_frag@//
s/bootstrap-emacs/b-emacs/
s/bootstrap-temacs/b-temacs/
s/bootstrap-doc/b-doc/
# -sed1x.inp------------------------------------------------------------
# Extra configuration script for src/makefile for DesqView/X
# ----------------------------------------------------------------------
+#
+# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#
+# This file is part of GNU Emacs.
+#
+# This file is free software; as a special exception, the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program 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.
+#
+# ----------------------------------------------------------------------
s!^ cd \${oldXMenudir}; \${MAKE}.*$! ${MAKE} -C ${oldXMenudir}.!
s!^ @true *$! @rem!
s/DOC/DOC-X/g
-#/^LIBXMENU *=/s!= *!= ../oldxmenu/!
+/^OLDXMENU *=/s!=.*!= ${oldXMenudir}libXMenu11.a!
+/^LIBXMENU *=/s!= *!= ${OLDXMENU}!
+/^LIBX_OTHER *=/s!= *!= ${LIBXT} ${LIBX_EXTRA}!
+/^OLDXMENU_TARGET *=/s!= *!= really-oldxmenu!
+/^OLDXMENU_DEPS *=/s!= *!= ${OLDXMENU} ../src/${OLDXMENU}!
+/^LIBS_SYSTEM *=/s!= *!= -lxext -lsys!
+/^MSDOS_X_OBJ *=/s!= *!= w16select.o termcap.o!
+/^FONT_OBJ *=/s!= *!= xfont.o!
+/^TOOLTIP_SUPPORT *=/s!= *!= ${lispsource}tooltip.elc!
+/^WINDOW_SUPPORT *=/s!= *!= $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT)!
/^temacs *:/s!OLDXMENU!LIBXMENU!
# arch-tag: 3e8a78f2-3dec-44f3-81f6-3785a562da19
+++ /dev/null
-# -sed2.inp-------------------------------------------------------------
-# Configuration script for src/config.h
-# ----------------------------------------------------------------------
-#
-# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Emacs.
-#
-# This file is free software; as a special exception, the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program 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.
-#
-# ----------------------------------------------------------------------
-/^#undef LISP_FLOAT_TYPE *$/s/undef/define/
-/^#undef GNU_MALLOC *$/s/undef/define/
-/^#undef REL_ALLOC *$/s/undef/define/
-/^#undef HAVE_SYS_SELECT/i\
-/^#undef STDC_HEADERS *$/s/undef/define/
-/^#undef HAVE_SYS_TIMEB_H *$/s/undef/define/
-/^#undef HAVE_SYS_TIME_H *$/s/undef/define/
-# /^#undef HAVE_UNISTD_H *$/s/undef/define/
-/^#undef HAVE_GETTIMEOFDAY *$/s/undef/define/
-/^#undef HAVE_GETHOSTNAME *$/s/undef/define/
-/^#undef HAVE_DUP2 *$/s/undef/define/
-/^#undef HAVE_TM_ZONE *$/s/undef/define/
-/^#undef LOCALTIME_CACHE *$/s/undef/define/
-/^#undef HAVE_TZSET *$/s/undef/define/
-/^#undef TM_IN_SYS_TIME *$/s/undef/define/
-/^#undef TIME_WITH_SYS_TIME *$/s/undef/define/
-/^#undef HAVE_RENAME *$/s/undef/define/
-/^#undef HAVE_CLOSEDIR *$/s/undef/define/
-/^#undef HAVE_RANDOM *$/s/undef/define/
-/^#undef HAVE_MKDIR *$/s/undef/define/
-/^#undef HAVE_RMDIR *$/s/undef/define/
-/^#undef HAVE_BCMP *$/s/undef/define/
-/^#undef HAVE_BCOPY *$/s/undef/define/
-/^#undef HAVE_FREXP *$/s/undef/define/
-/^#undef HAVE_FTIME *$/s/undef/define/
-/^#undef HAVE_MKTIME *$/s/undef/define/
-/^#undef HAVE_STRERROR *$/s/undef/define/
-/^#undef HAVE_TIMEVAL *$/s/undef/define/
-s/^#define USER_FULL_NAME .*$/#define USER_FULL_NAME (getenv ("NAME"))/
-s/^#undef STACK_DIRECTION *$/#define STACK_DIRECTION -1/
-s/^#undef EMACS_CONFIGURATION *$/#define EMACS_CONFIGURATION "i386-pc-msdosdjgpp"/
-s/^#undef EMACS_CONFIG_OPTIONS *$/#define EMACS_CONFIG_OPTIONS "-"/
-s!^#undef config_opsysfile *$!#define config_opsysfile "s/msdos.h"!
-s!^#undef config_machfile *$!#define config_machfile "m/intel386.h"!
-s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
-s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/
-
-# arch-tag: 31840234-109a-41ab-a675-7a3844978299
/^#undef HAVE_MKSTEMP *$/s/^.*$/#define HAVE_MKSTEMP 1/
/^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/
/^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/
+/^#undef ORDINARY_LINK/s/^.*$/#define ORDINARY_LINK 1/
/^#undef PACKAGE_BUGREPORT/s/^.*$/#define PACKAGE_BUGREPORT ""/
/^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/
/^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/
# Extra configuration script for src/config.h for DesqView/X
# ----------------------------------------------------------------------
#
-# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+# 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
#
# ----------------------------------------------------------------------
/^#undef HAVE_X_WINDOWS *$/s/undef/define/
+/^#undef HAVE_WINDOW_SYSTEM *$/s/undef/define/
/^#undef HAVE_X11 *$/s/undef/define/
/^#undef HAVE_X_MENU *$/s/undef/define/
/^#undef HAVE_XSCREENNUMBEROFSCREEN *$/s/undef/define/
+++ /dev/null
-# -sed3.inp-------------------------------------------------------------
-# Configuration script for lib-src/makefile
-# ----------------------------------------------------------------------
-#
-# Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Emacs.
-#
-# This file is free software; as a special exception, the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program 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.
-#
-# ----------------------------------------------------------------------
-/^# DIST: /d
-/^SHELL *=/s/^/# /
-/^CC *=/s/=.*$/=gcc/
-# Actually, here we should patch in the exact version number, but only
-# [ce]tags uses it. Don't pass it. This is more update-resistant.
-/-DVERSION=/s/-DVERSION="\\"\${version}\\""//
-/^configname *=/s/=.*$/=msdos/
-/^archlibdir *=/s!=.*$!=/emacs/bin!
-/^bindir *=/s!=.*$!=/emacs/bin!
-/^libdir *=/s!=.*$!=/emacs/bin!
-/^srcdir *=/s!=.*$!=.!
-/^VPATH *=/s!=.*$!=.!
-/^CFLAGS *=/s!=.*$!=-O2 -g!
-/^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
-/^LOADLIBES *=/s!=.*$!=!
-/^ALLOCA *=/s!=.*$!=alloca.o!
-/^INSTALLABLES/s/emacsclient *//
-s!^ \./! go32 ./!
-/^UTILITIES=/s/ wakeup//
-/^UTILITIES=/s/ movemail//
-/^UTILITIES=/s/ emacsserver//
-/^UTILITIES=/s/ timer//
-/^all *:/s/$/ make-docfile/
-s!^ go32 ./test-distrib! go32 ./test-dis!
-/-o make-docfile/a\
- coff2exe make-docfile
-
-# arch-tag: cac6f5c7-3dbf-4e84-9d0c-44f0126f0ea8
/^libdir *=/s!=.*$!=/emacs/bin!
/^srcdir=/s!srcdir=@srcdir@!srcdir := $(subst \\,/,$(shell command.com /c cd))!
/^VPATH *=/s!=.*$!=.!
+/^BLESSMAIL_TARGET *=/s!@BLESSMAIL_TARGET@!need-blessmail!
+/^KRB4LIB *=/s/@[^@\n]*@//g
+/^DESLIB *=/s/@[^@\n]*@//g
+/^KRB5LIB *=/s/@[^@\n]*@//g
+/^CRYPTOLIB *=/s/@[^@\n]*@//g
+/^COM_ERRLIB *=/s/@[^@\n]*@//g
+/^LIBHESIOD *=/s/@[^@\n]*@//g
+/^LIBRESOLV *=/s/@[^@\n]*@//g
+/^LIBS_MAIL *=/s/@[^@\n]*@//g
+/^LIBS_SYSTEM *=/s/@[^@\n]*@//g
/^CFLAGS *=/s!=.*$!=-O2 -g!
/^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
+/^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
/^LOADLIBES *=/s!=.*$!=!
/^ALLOCA *=/s!@ALLOCA@!!
/^EXEEXT *=/s!@EXEEXT@!!
/^GETOPT_H *=/s!@GETOPT_H@!getopt.h!
/^GETOPTOBJS *=/s!@GETOPTOBJS@!getopt.o getopt1.o!
-/^INSTALLABLES/s/emacsclient *//
-/^INSTALLABLES/s/ @LIB_SRC_EXTRA_INSTALLABLES@//
+/^INSTALLABLES/s/emacsclient[^ ]* *//
s!^ \./! !
-/^UTILITIES=/s/ wakeup//
-/^UTILITIES=/s/ movemail//
-/^UTILITIES=/s/ emacsserver//
-/^UTILITIES=/s/ timer//
+/^UTILITIES *=/,/^$/{
+ s/movemail[^ ]* *//
+}
# arch-tag: 16f3be18-a45b-496c-b19c-e43840359de8
--- /dev/null
+# -sed3x.inp------------------------------------------------------------
+# Extra configuration script for lib-src/makefile for DesqView/X
+# ----------------------------------------------------------------------
+/^LIBS_SYSTEM *=/s!= *!= -lxext -lsys!
+
# Configuration script for oldxmenu/makefile for DesqView/X
# ----------------------------------------------------------------------
#
-# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+# 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
/^CC *=/s/@[^@\n]*@/gcc/
/^CPP *=/s/@[^@\n]*@/gcc -e/
/^CFLAGS *=/s/@[^@\n]*@/-O2 -g/
-/^LN_S *=/s/@[^@\n]*@/ln -s/
s/|| true//
# arch-tag: 612a79be-2a02-4cb0-8dec-779aac0a2f4f
/^SHELL *=/i\
export FNCASE=y
-/^lisp=/s|@srcdir@|$(CURDIR)|
-/^VPATH=/s|@srcdir@|.|
-/^srcdir=/s|@srcdir@|.|
+/^lisp *=/s|\$(srcdir)|$(CURDIR)|
+/^srcdir *=/s|@srcdir@|.|
+/^top_srcdir *=/s|@top_srcdir@|./..|
+/^abs_top_builddir *=/s|@abs_top_builddir@|$(CURDIR)/..|
# arch-tag: da7a3cff-4839-4ad7-bbe3-e2b61c84c38e
* Version 23.2 released.
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-01-11 Glenn Morris <rgm@gnu.org>
* Cocoa/Emacs.base/Contents/Info.plist:
<!--
-Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
<key>CFBundleExecutable</key>
<string>Emacs</string>
<key>CFBundleGetInfoString</key>
- <string>Emacs 23.2.50 Copyright (C) 2010 Free Software Foundation, Inc.</string>
+ <string>Emacs 24.0.50 Copyright (C) 2010 Free Software Foundation, Inc.</string>
<key>CFBundleIconFile</key>
<string>Emacs.icns</string>
<key>CFBundleIdentifier</key>
<string>APPL</string>
<!-- This should be the emacs version number. -->
<key>CFBundleShortVersionString</key>
- <string>23.2.50</string>
+ <string>24.0.50</string>
<key>CFBundleSignature</key>
<string>EMAx</string>
<!-- This SHOULD be a build number. -->
/* Localized versions of Info.plist keys */
CFBundleName = "Emacs";
-CFBundleShortVersionString = "Version 23.2.50";
-CFBundleGetInfoString = "Emacs version 23.2.50, NS Windowing";
+CFBundleShortVersionString = "Version 24.0.50";
+CFBundleGetInfoString = "Emacs version 24.0.50, NS Windowing";
NSHumanReadableCopyright = "Copyright (C) 2010 Free Software Foundation, Inc.";
[Desktop Entry]
Encoding=UTF-8
Type=Application
-Version=23.2.50
+Version=24.0.50
Categories=GNUstep
Name=Emacs
Comment=GNU Emacs for NeXT/Open/GNUstep and OS X
ApplicationDescription = "GNU Emacs for GNUstep / OS X";
ApplicationIcon = emacs.tiff;
ApplicationName = Emacs;
- ApplicationRelease = "23.2.50";
+ ApplicationRelease = "24.0.50";
Authors = (
"Adrian Robert (GNUstep)",
"Christophe de Dinechin (MacOS X)",
);
Copyright = "Copyright (C) 2010 Free Software Foundation, Inc.";
CopyrightDescription = "Released under the GNU General Public License Version 3 or later";
- FullVersionID = "Emacs 23.2.50, NS Windowing";
+ FullVersionID = "Emacs 24.0.50, NS Windowing";
NSExecutable = Emacs;
NSIcon = emacs.tiff;
NSPrincipalClass = NSApplication;
+++ /dev/null
-source ^subdirs\.el$
-
-# arch-tag: 01b87183-9d94-4b6b-93cb-fece25c4eec9
+2010-05-13 Glenn Morris <rgm@gnu.org>
+
+ * config.nt (LD_SWITCH_X_SITE, C_SWITCH_X_SITE): Remove undefs.
+
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * config.nt (LD_SWITCH_X_SITE_AUX): Remove.
+
+2010-04-20 Lewis Perin <perin@panix.com> (tiny change)
+
+ * emacs.manifest: Add trustInfo section to Windows manifest.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2010-01-13 Martin Rudalics <rudalics@gmx.at>
* emacsclient.rc: Fix format of "LegalCopyright" value.
2009-01-26 Jason Rumney <jasonr@gnu.org>
- * emacsclient.rc, emacs.rc: Swap name and description. Remove
- Windows versions.
+ * emacsclient.rc, emacs.rc: Swap name and description.
+ Remove Windows versions.
2009-01-15 Jason Rumney <jasonr@gnu.org>
* config.nt (HAVE_FACES): Remove, unused.
2008-06-26 Juanma Barranquero <lekktu@gmail.com>
- Eli Zaretskii <eliz@gnu.org>
+ Eli Zaretskii <eliz@gnu.org>
* nmake.defs (FONT_CFLAGS):
* gmake.defs (FONT_CFLAGS): Remove.
* config.nt: Remove reference to UNEXEC_SRC.
2008-06-23 Juanma Barranquero <lekktu@gmail.com>
- Eli Zaretskii <eliz@gnu.org>
+ Eli Zaretskii <eliz@gnu.org>
* gmake.defs (DEBUG_FLAG, DEBUG_LINK) [!NODEBUG]:
Don't hardcode -gstabs+, use DEBUG_INFO.
/* GNU Emacs site configuration template file. -*- C -*-
- Copyright (C) 1988, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1988, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#define subprocesses
-/* Define LD_SWITCH_X_SITE to contain any special flags your loader
- may need to deal with X Windows. For instance, if you've defined
- HAVE_X_WINDOWS above and your X libraries aren't in a place that
- your loader can find on its own, you might want to add "-L/..." or
- something similar. */
-#undef LD_SWITCH_X_SITE
-
-/* Define LD_SWITCH_X_SITE_AUX with an -R option
- in case it's needed (for Solaris, for example). */
-#undef LD_SWITCH_X_SITE_AUX
-
-/* Define C_SWITCH_X_SITE to contain any special flags your compiler
- may need to deal with X Windows. For instance, if you've defined
- HAVE_X_WINDOWS above and your X include files aren't in a place
- that your compiler can find on its own, you might want to add
- "-I/..." or something similar. */
-#undef C_SWITCH_X_SITE
-
/* Define STACK_DIRECTION here, but not if m/foo.h did. */
#ifndef STACK_DIRECTION
#undef STACK_DIRECTION
language="*"/>
</dependentAssembly>
</dependency>
-</assembly>
\ No newline at end of file
+ <assemblyIdentity version="1.0.0.0" processorArchitecture="X86"
+ name="emacs" type="win32"/>
+ <description>GNU Emacs</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 23,2,50,0
- PRODUCTVERSION 23,2,50,0
+ FILEVERSION 24,0,50,0
+ PRODUCTVERSION 24,0,50,0
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0"
- VALUE "FileVersion", "23, 2, 50, 0\0"
+ VALUE "FileVersion", "24, 0, 50, 0\0"
VALUE "InternalName", "Emacs\0"
VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010\0"
VALUE "OriginalFilename", "emacs.exe"
VALUE "ProductName", "Emacs\0"
- VALUE "ProductVersion", "23, 2, 50, 0\0"
+ VALUE "ProductVersion", "24, 0, 50, 0\0"
VALUE "OLESelfRegister", "\0"
END
END
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 23,2,50,0
- PRODUCTVERSION 23,2,50,0
+ FILEVERSION 24,0,50,0
+ PRODUCTVERSION 24,0,50,0
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0"
- VALUE "FileVersion", "23, 2, 50, 0\0"
+ VALUE "FileVersion", "24, 0, 50, 0\0"
VALUE "InternalName", "EmacsClient\0"
VALUE "LegalCopyright", "Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010\0"
VALUE "OriginalFilename", "emacsclientw.exe"
VALUE "ProductName", "EmacsClient\0"
- VALUE "ProductVersion", "23, 2, 50, 0\0"
+ VALUE "ProductVersion", "24, 0, 50, 0\0"
VALUE "OLESelfRegister", "\0"
END
END
* Version 23.2 released.
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (RANLIB): Let configure set it.
+ (libXMenu11.a): Configure sets RANLIB = : on systems without it.
+
+ * Makefile.in (CPP, LN_S, AS, LD, MV, LS, LINTOPTS, LINTLIBFLAG, MAKE)
+ (STD_DEFINES, CDEBUGFLAGS, RM_CMD): Remove unused variables.
+
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE):
+ Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
+ @c_switch_system@, @c_switch_machine@.
+
+2010-04-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf.
+
+2010-04-23 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (ALL_CFLAGS): Remove C_SWITCH_X_MACHINE, unused.
+
+2010-04-11 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE)
+ (C_SWITCH_X_SITE): Define using autoconf.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
2009-06-21 Chong Yidong <cyd@stupidchicken.com>
* Branch for 23.1.
## without express or implied warranty.
-## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-## Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+## 2010 Free Software Foundation, Inc.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## To the best of our knowledge, this code was originally based on the
## X11 oldXMenu Makefile, which was automatically generated from the
-## X11 oldXMenu Imakefile. There was no explicit copyright information
+## X11 oldXMenu Imakefile. There was no explicit copyright information
## in the Imakefile, therefore we have added the same MIT license as
## used by the rest of the oldXMenu code.
srcdir=@srcdir@
VPATH=@srcdir@
C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
+C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
EXTRA=insque.o
CC=@CC@
CFLAGS=@CFLAGS@
-CPP=@CPP@
-LN_S=@LN_S@
- AS = as
- LD = ld
- TAGS = etags
- RM = rm -f
- MV = mv
- RANLIB = ranlib
+TAGS = etags
+RM = rm -f
+RANLIB = @RANLIB@
# Solaris 2.1 ar doesn't accept the 'l' option.
- AR = ar cq
- LS = ls
- LINTOPTS = -axz
- LINTLIBFLAG = -C
- MAKE = make
- STD_DEFINES =
- CDEBUGFLAGS = -O
- RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
- tags TAGS make.log
+AR = ar cq
OBJS = Activate.o \
AddPane.o \
all:: libXMenu11.a
ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
- $(C_SWITCH_X_SITE) $(C_SWITCH_X_SYSTEM) $(C_SWITCH_X_MACHINE) \
+ $(C_SWITCH_X_SITE) $(C_SWITCH_X_SYSTEM) \
$(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \
-I../src -I${srcdir} -I${srcdir}/../src
libXMenu11.a: $(OBJS) $(EXTRA)
$(RM) $@
$(AR) $@ $(OBJS) $(EXTRA)
- @echo Do not be alarmed if the following ranlib command
- @echo fails due to the absence of a ranlib program on your system.
- -$(RANLIB) $@ || true
-#If running ranlib fails, probably there is none.
-#That's ok. So don't stop the build.
+ $(RANLIB) $@
Activate.o: Activate.c XMenuInt.h XMenu.h X10.h
AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h
+++ /dev/null
-# Source files which don't match the usual naming conventions, mostly dot files
-source ^\.(gdbinit|dbxinit)$
-
-# Auto-generated files, which ignore
-precious ^(config\.stamp|config\.h|epaths\.h|buildobj\.lst)$
-precious ^(TAGS-LISP)$
-precious ^(buildobj\.lst)$
-
-backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$
-backup ^(bootstrap-emacs)$
-
-# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543
# Force loading of symbols, enough to give us gdb_valbits etc.
set main
+# With some compilers, we need this to give us struct Lisp_Symbol etc.:
+set Fmake_symbol
# Find lwlib source files too.
dir ../lwlib
end
end
printf "\n"
+ if ($it->bidi_p)
+ printf "BIDI: base_stop=%d prev_stop=%d level=%d\n", $it->base_level_stop, $it->prev_stop, $it->bidi_it.resolved_level
+ end
if ($it->region_beg_charpos >= 0)
printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos
end
Pretty print window structure w.
end
+define pbiditype
+ if ($arg0 == 0)
+ printf "UNDEF"
+ end
+ if ($arg0 == 1)
+ printf "L"
+ end
+ if ($arg0 == 2)
+ printf "R"
+ end
+ if ($arg0 == 3)
+ printf "EN"
+ end
+ if ($arg0 == 4)
+ printf "AN"
+ end
+ if ($arg0 == 5)
+ printf "BN"
+ end
+ if ($arg0 == 6)
+ printf "B"
+ end
+ if ($arg0 < 0 || $arg0 > 6)
+ printf "%d??", $arg0
+ end
+end
+document pbiditype
+Print textual description of bidi type given as first argument.
+end
+
define pgx
set $g = $arg0
# CHAR_GLYPH
else
printf " pos=%d", $g->charpos
end
+ # For characters, print their resolved level and bidi type
+ if ($g->type == 0)
+ printf " blev=%d,btyp=", $g->resolved_level
+ pbiditype $g->bidi_type
+ end
printf " w=%d a+d=%d+%d", $g->pixel_width, $g->ascent, $g->descent
# If not DEFAULT_FACE_ID
if ($g->face_id != 0)
Pretty print all glyphs in it->glyph_row.
end
+define prowlims
+ printf "edges=(%d,%d),r2l=%d,cont=%d,trunc=(%d,%d),at_zv=%d\n", $arg0->minpos.charpos, $arg0->maxpos.charpos, $arg0->reversed_p, $arg0->continued_p, $arg0->truncated_on_left_p, $arg0->truncated_on_right_p, $arg0->ends_at_zv_p
+end
+document prowlims
+Print important attributes of a glyph_row structure.
+Takes one argument, a pointer to a glyph_row structure.
+end
+
+define pmtxrows
+ set $mtx = $arg0
+ set $gl = $mtx->rows
+ set $glend = $mtx->rows + $mtx->nrows - 1
+ set $i = 0
+ while ($gl < $glend)
+ printf "%d: ", $i
+ prowlims $gl
+ set $gl = $gl + 1
+ set $i = $i + 1
+ end
+end
+document pmtxrows
+Print data about glyph rows in a glyph matrix.
+Takes one argument, a pointer to a glyph_matrix structure.
+end
+
define xtype
xgettype $
output $type
This command assumes that $ is an Emacs Lisp char-table value.
end
+define xsubchartable
+ xgetptr $
+ print (struct Lisp_Sub_Char_Table *) $ptr
+ xgetint $->depth
+ set $depth = $int
+ xgetint $->min_char
+ printf "Depth: %d, Min char: %d (0x%x)\n", $depth, $int, $int
+end
+document xsubchartable
+Print the address of the sub-char-table $, its depth and min-char.
+This command assumes that $ is an Emacs Lisp sub-char-table value.
+end
+
define xboolvector
xgetptr $
print (struct Lisp_Bool_Vector *) $ptr
-2010-05-20 enami tsugutomo <tsugutomo.enami@jp.sony.com>
+2010-05-24 Stefan Monnier <monnier@iro.umontreal.ca>
- * s/netbsd.h: If terminfo is found, use it in preference to
- termcap. (Bug#6190) [Backport from trunk]
+ * editfns.c (Fbyte_to_string): New function.
+
+2010-05-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * process.c (Fmake_network_process): Set :host to nil if it's not used.
+ Suggested by Masatake YAMATO <yamato@redhat.com>.
+
+2010-05-23 Eli Zaretskii <eliz@gnu.org>
+
+ * dispextern.h (init_iterator): Sync prototype with changed definition.
+
+2010-05-19 Eli Zaretskii <eliz@gnu.org>
+
+ Redesign and reimplement bidi-aware edge positions of glyph rows.
+
+ * dispextern.h (struct glyph_row): New members minpos and maxpos.
+ (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
+ (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
+ and maxpos members instead of start.pos and end.pos, respectively.
+
+ * xdisp.c (display_line): Compare IT_CHARPOS with the position in
+ row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
+ (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
+ (try_window_reusing_current_matrix, try_window_id):
+ Use ROW->minpos rather than ROW->start.pos.
+ (init_from_display_pos, init_iterator): Use EMACS_INT for
+ character and byte positions.
+ (find_row_edges): Rename from find_row_end. Accept additional
+ arguments for minimum and maximum buffer positions seen by
+ display_line for this row. Don't use iterator to find the
+ position following the maximum one; instead, increment the
+ position found by display_line directly. Fix logic; eol_pos
+ should be tested before the rest. Handle the case of characters
+ delivered from display vector (bug#6036). Fix tests related to
+ it->method. Handle the truncated_on_right_p rows.
+ (RECORD_MAX_MIN_POS): New macro.
+ (display_line): Use it to record the minimum and maximum buffer
+ positions for glyphs in the row being assembled. Record the
+ position of the newline that terminates the line. If word wrap is
+ in effect, restore minimum and maximum positions seen up to the
+ wrap point, when iterator returns to it.
+ (try_window_reusing_current_matrix): Give up if in bidi-reordered
+ row and cursor not already at point. Restore original pre-bidi
+ code for unidirectional buffers.
+
+ * dispnew.c (increment_row_positions, check_matrix_invariants):
+ Increment and check row->start.pos and row->end.pos, in addition
+ to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
+
+ * .gdbinit (prowlims): Display row->minpos and row->maxpos.
+ Display truncated_on_left_p and truncated_on_right_p flags.
+ Formatting fixes.
+ (pmtxrows): Display the ordinal number of each row. Don't display
+ rows beyond the last one.
+
+ * bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
+ it is not copied by bidi_copy_it.
+
+2010-05-22 Eli Zaretskii <eliz@gnu.org>
+
+ * w32.c (sys_write): Break writes into chunks smaller than 32MB.
+ (Bug#6237)
+
+2010-05-22 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.c (Fimage_flush): Rename from image-refresh.
+
+2010-05-21 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (redisplay_internal): Clear caches even if redisplaying
+ just one window.
+
+ * image.c (Vimage_cache_eviction_delay): Decrease to 300.
+ (clear_image_cache): If the number of cached images is unusually
+ large, decrease the cache eviction delay (Bug#6230).
+
+2010-05-21 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (${ns_appdir}, ${ns_appbindir}Emacs, ns-app):
+ Move these rules to ns.mk.
+ * ns.mk: New file.
+
+ * Makefile.in (../src/$(OLDXMENU), $(OLDXMENU)): Always define rules.
+
+ * Makefile.in (CANNOT_DUMP): New, set by configure.
+ (emacs${EXEEXT}, bootstrap-emacs${EXEEXT}): Use $CANNOT_DUMP.
+
+2010-05-20 Juri Linkov <juri@jurta.org>
+
+ * fileio.c (Fdelete_file): Change interative spec to use
+ `read-file-name' like in `find-file-read-args' where the default
+ value is `default-directory' instead of `buffer-file-name'.
+ http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html
2010-05-20 Kevin Ryde <user42@zip.com.au>
(Voverriding_terminal_local_map, Vsystem_key_alist)
(Vlocal_function_key_map): Fix manual link in docstring (Bug#6224).
-2010-05-19 Stefan Monnier <monnier@iro.umontreal.ca>
+2010-05-20 Glenn Morris <rgm@gnu.org>
- * editfns.c (Fbyte_to_string): New function.
+ * Makefile.in (DEPDIR): New constant.
+ (DEPFLAGS): Set with configure, not cpp.
+ (MKDEPDIR): New, set by configure.
+ (.c.o, .m.o, ecrt0.o): Use $MKDEPDIR.
+ (clean): Use $DEPDIR.
+ (deps_frag): Include from configure.
+ Move static/dynamic dependency stuff to deps.mk/autodeps.mk.
+ * deps.mk, autodeps.mk: New files, extracted from Makefile.in.
+
+ * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix
+ reallocation of the cache. (Bug#6210)
+
+2010-05-19 Glenn Morris <rgm@gnu.org>
+
+ * s/msdos.h (ORDINARY_LINK): Move to sed2v2.inp.
+
+ * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
+ (GNULIB_VAR): Remove.
+ (LIBES): Use LIB_GCC instead of GNULIB_VAR.
+
+ * m/ibms390x.h (LINKER):
+ * m/macppc.h (LINKER) [GNU_LINUX]:
+ * s/aix4-2.h (ORDINARY_LINK):
+ * s/cygwin.h (LINKER):
+ * s/darwin.h (ORDINARY_LINK):
+ * s/gnu.h (ORDINARY_LINK):
+ * s/netbsd.h (LINKER):
+ * s/usg5-4.h (ORDINARY_LINK):
+ Move to configure.
+
+ * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK.
2010-05-18 Chong Yidong <cyd@stupidchicken.com>
prevent stack overflow if number of arguments is too large
(Bug#6214).
-2010-05-11 Eli Zaretskii <eliz@gnu.org>
+2010-05-18 Juanma Barranquero <lekktu@gmail.com>
- * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h.
+ * charset.c (load_charset_map_from_file): Don't call close after fclose.
- * w32fns.c: Include w32.h.
- (Fw32_shell_execute): Decode the error message before passing it
- to `error'. (Bug#6126)
+2010-05-18 Glenn Morris <rgm@gnu.org>
+
+ * s/gnu-linux.h: Combine two conditionals.
+
+ * Makefile.in (otherobj): Include $(VMLIMIT_OBJ) separately from
+ $(POST_ALLOC_OBJ).
+
+ * Makefile.in (RALLOC_OBJ): New, set by configure.
+ (rallocobj): Replace with the previous variable.
+ (otherobj): Use $RALLOC_OBJ.
+
+ * s/gnu.h (REL_ALLOC) [DOUG_LEA_MALLOC]:
+ * s/gnu-linux.h (REL_ALLOC) [DOUG_LEA_MALLOC]: Move undef to configure.
+
+ * Makefile.in (GMALLOC_OBJ, VMLIMIT_OBJ): New, set by configure.
+ (gmallocobj, vmlimitobj): Replace with previous two variables.
+ (otherobj): Use $GMALLOC_OBJ, $VMLIMIT_OBJ.
+
+2010-05-17 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (OLDXMENU_DEPS): New, set by configure.
+ (stamp-oldxmenu): Use $OLDXMENU_DEPS.
+
+2010-05-16 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (${ns_appbindir}Emacs, ns-app): Always define these rules.
+
+ * Makefile.in (clean): Get rid of HAVE_NS conditional.
+
+ * Makefile.in (ns_appdir, ns_appbindir): Now configure adds the
+ trailing "/".
+
+ * Makefile.in (TEMACS_LDFLAGS2): New, set by configure.
+ (temacs${EXEEXT}): Combine the NS_IMPL_GNUSTEP case with the default.
+
+ * Makefile.in (GNUSTEP_SYSTEM_LIBRARIES): Remove, unused.
+ (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New, set by configure.
+ (LD) [NS_IMPL_GNUSTEP]: Set to $(CC) -rdynamic.
+ (temacs${EXEEXT}): Remove $LOCALCPP, never defined or referenced.
+ Make most of the NS_IMPL_GNUSTEP case the same as the default case.
+
+ * Makefile.in (temacs${EXEEXT}) [!NS_IMPL_GNUSTEP]:
+ Remove ${STARTFLAGS}, nothing ever sets it.
+
+2010-05-16 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * m/ia64.h (UNEXEC): Remove, set in s/*.h.
+
+2010-05-16 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBX_BASE): Always define.
+
+ * Makefile.in (LIBX_OTHER): Move out of cpp section.
+
+ * Makefile.in (LIBXT): Always define.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define.
+
+ * Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ.
+ (obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ.
+
+2010-05-15 Ken Raeburn <raeburn@raeburn.org>
+
+ * lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue. (Bug#5916)
+ (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
+
+ * emacs.c (main): Initialize initial-environment and
+ process-environment before generating from env, not after.
+
+ Handle --version reasonably in CANNOT_DUMP configuration.
+ * emacs.c (emacs_version, emacs_copyright): New string variables.
+ (Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
+ (syms_of_emacs): Defvar them, and initialize them from the C
+ string variables.
+ (main): If initialization hasn't been done, print initial version
+ info from the C strings, instead of starting an interactive session.
+
+2010-05-15 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_paragraph_init): Don't leave alone garbage values
+ of bidi_it->paragraph_dir. Call bidi_initialize if needed.
+ (bidi_paragraph_init): Remove redundant assertion that we are at
+ the beginning of a line after call to bidi_find_paragraph_start.
+
+ * xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
+ (syms_of_xdisp): Defsubr it.
+
+ * cmds.c (Fforward_char, Fbackward_char): Doc fix.
+
+ * Makefile.in: Fix MSDOS-related comments.
+
+2010-05-15 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (OLDXMENU_TARGET): New, set by configure.
+ (really-lwlib, really-oldXMenu): Always define.
+ ($OLDXMENU): Depend on $OLDXMENU_TARGET.
+
+ * Makefile.in: Simplify cpp conditional.
+
+ * Makefile.in (${ns_appdir}): Simplify using umask.
+
+ * Makefile.in (${ns_appdir}): Remove references to CVS-related files.
+
+2010-05-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (specbind): Remove left-over duplicate test.
+ Disallow let-binding frame-local vars. Add comment.
+
+2010-05-14 Eli Zaretskii <eliz@gnu.org>
+
+ Make the cache of bidi iterator states dynamically allocated.
+ * bidi.c (bidi_cache_shrink): New function.
+ (bidi_init_it): Call it.
+ (bidi_cache_iterator_state): Enlarge the cache if needed.
+
+ * bidi.c (bidi_move_to_visually_next): Rename from
+ bidi_get_next_char_visually. All callers changed.
+
+2010-05-14 Kenichi Handa <handa@m17n.org>
+
+ * dispextern.h (struct composition_it): New member reversed_p.
+
+ * composite.c (composition_compute_stop_pos): Search backward if
+ ENDPOS < CHARPOS.
+ (composition_reseat_it): Handle the case that ENDPOS < CHARPOS.
+ Set CMP_IT->reversed_p.
+ (composition_update_it): Pay attention to CMP_IT->reversed_p.
+
+ * xdisp.c (set_iterator_to_next):
+ Call composition_compute_stop_pos with negative ENDPOS if we are
+ scanning backward. Call composition_compute_stop_pos if scan
+ direction is changed.
+ (next_element_from_buffer): Call composition_compute_stop_pos with
+ negative ENDPOS if we are scanning backward.
+ (next_element_from_composition): Pay attention to
+ IT->cmp_it.reversed_p.
+
+2010-05-14 Kenichi Handa <handa@m17n.org>
+
+ * font.c (font_range): Return the range for the font found at first.
+
+2010-05-14 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Always define.
+
+ * Makefile.in (mktime, X11, register): Move undefs to configure.
+
+ * Makefile.in (MSDOS_OBJ): Default to empty, let msdos scripts set it.
+ (MSDOS_X_OBJ): New variable.
+ (MSDOS_SUPPORT_REAL): New constant.
+ (MSDOS_SUPPORT): Set as a variable, not with cpp.
+ (obj): Use MSDOS_X_OBJ.
+ (lisp): Use MSDOS_SUPPORT as a variable.
+
+ * Makefile.in (REAL_MOUSE_SUPPORT): New constant.
+ (GPM_MOUSE_SUPPORT): Now it's a constant.
+ (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure,
+ not cpp.
+
+ * Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef.
+ (ns_appresdir): Remove, unused.
+
+ * Makefile.in (SHELL): Move outside cpp section.
+
+ * s/netbsd.h (AMPERSAND_FULL_NAME): Remove (defined in AH_BOTTOM).
+
+2010-05-13 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (FONT_DRIVERS): Place with other HAVE_X_WINDOWS stuff.
+ (TOOLTIP_SUPPORT): Place with other HAVE_WINDOW_SYSTEM stuff.
+
+ * Makefile.in (FONT_DRIVERS): If HAVE_X_WINDOWS is defined,
+ HAVE_WINDOW_SYSTEM must be too.
+
+ * Makefile.in (WINNT_SUPPORT): Remove, nt build does not use this file.
+ (lisp): Remove WINNT_SUPPORT.
+
+ * Makefile.in (OLDXMENU, LIBXMENU) [!HAVE_MENUS]:
+ Let configure set these variables (to empty) in this case as well.
+
+ * Makefile.in (LD_SWITCH_X_SITE): Define as a variable, not via cpp.
+ (LIBX_BASE): Use $LD_SWITCH_X_SITE.
+
+ * Makefile.in (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD)
+ (LIB_MATH, FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS)
+ (FREETYPE_LIBS, LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS)
+ (M17N_FLT_LIBS, GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBGPM)
+ (LIBRESOLV, UNEXEC_OBJ): For clarity, define variables to hold
+ the values output by configure.
+ (ALL_CFLAGS, obj, LIBES, temacs${EXEEXT}): Use the above variables.
+
+2010-05-12 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
+ (LINKER_WAS_SPECIFIED): Remove.
+
+ * Makefile.in (LIB_GCC): Set using configure, not cpp.
+ (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
+ * m/arm.h (LIB_GCC) [GNU_LINUX]:
+ * s/cygwin.h (LIB_GCC):
+ * s/freebsd.h (LIB_GCC):
+ * s/gnu-linux.h (LIB_GCC):
+ * s/msdos.h (LIB_GCC):
+ * s/netbsd.h (LIB_GCC):
+ Move to configure.
2010-05-11 Karel Klic <kklic@redhat.com>
* ftfont.c: Fix incorrect parentheses of #if condition for
definining M17N_FLT_USE_NEW_FEATURE.
-2010-05-07 Chong Yidong <cyd@stupidchicken.com>
+2010-05-11 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBS_SYSTEM) [MSDOS]: Do not reset.
+ * s/msdos.h (MSDOS_LIBS_SYSTEM): Remove.
+
+2010-05-10 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (init_iterator): Don't turn on bidi reordering in
+ unibyte buffers. See
+ http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00263.html.
+
+2010-05-10 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBS_SYSTEM): Set using configure, not cpp.
+ (LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM.
+ (LIBES): Use LIBS_SYSTEM as a variable.
+ * s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM. Always define.
+ * s/aix4-2.h (LIBS_SYSTEM):
+ * s/freebsd.h (LIBS_SYSTEM):
+ * s/hpux10-20.h (LIBS_SYSTEM):
+ * s/sol2-6.h (LIBS_SYSTEM):
+ * s/unixware.h (LIBS_SYSTEM):
+ Move to configure.
+
+ * s/aix4-2.h (MAIL_USE_LOCKF):
+ * s/bsd-common.h (MAIL_USE_FLOCK):
+ * s/darwin.h (MAIL_USE_FLOCK):
+ * s/gnu-linux.h (MAIL_USE_FLOCK):
+ * s/irix6-5.h (MAIL_USE_FLOCK):
+ * s/template.h (MAIL_USE_FLOCK):
+ Move to configure.
+
+2010-05-08 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
-2010-04-30 Andreas Schwab <schwab@linux-m68k.org>
+2010-05-08 Andreas Schwab <schwab@linux-m68k.org>
* composite.c (autocmp_chars): Save point as marker before calling
auto-composition-function (Bug#5984).
* fileio.c (restore_point_unwind): Remove static attribute.
-2010-04-23 Kenichi Handa <handa@m17n.org>
+2010-05-08 Kenichi Handa <handa@m17n.org>
* ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the
new feature of libotf and m17n-flt.
- (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]: Call
- OTF_check_features even if no specific feature is given.
+ (ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]:
+ Call OTF_check_features even if no specific feature is given.
(PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro.
(ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case
that OUT is NULL. Use OTF_drive_gsub_with_log and
OTF_drive_gpos_with_log instead of OTF_drive_gsub and
OTF_drive_gpos.
(ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function.
- (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]: Setup
- mflt_enable_new_feature and mflt_try_otf.
+ (ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]:
+ Setup mflt_enable_new_feature and mflt_try_otf.
+
+2010-05-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c (Ftool_bar_get_system_style): Correct comment.
+
+ * gtkutil.c (xg_pack_tool_bar): Change show_all to show for handle
+ box and toolbar (Bug #6139).
+ (xg_create_tool_bar): Remove comment (Bug #6139).
+ (xg_make_tool_item): Remove gtk_widget_show_all (Bug #6139).
+ (xg_show_toolbar_item): Add gtk_widget_show for weventbox (Bug #6139).
+
+2010-05-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/eval.$(O), $(BLD)/w32fns.$(O)):
+ Update dependencies.
+
+2010-05-08 Eli Zaretskii <eliz@gnu.org>
+
+ * fringe.c (update_window_fringes): Set up truncation bitmaps for
+ R2L lines.
+
+2010-05-08 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (THIS_IS_MAKEFILE): Remove, unused.
+
+ * Makefile.in (LIBS_TERMCAP): Set with configure, not cpp.
+ (TERMCAP_OBJ): New, set by configure, replacing termcapobj.
+ (termcapobj): Replace with TERMCAP_OBJ.
+ (otherobj): Use $TERMCAP_OBJ instead of $termcapobj.
+ (LIBES): Use LIBS_TERMCAP as a variable.
+
+ * s/freebsd.h (osreldate.h): No longer include, since this file
+ does not use __FreeBSD_version any more.
+
+ * s/aix4-2.h (TERMINFO):
+ * s/cygwin.h (TERMINFO):
+ * s/darwin.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+ * s/freebsd.h (TERMINFO, LIBS_TERMCAP):
+ * s/gnu-linux.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+ * s/gnu.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+ * s/hpux10-20.h (TERMINFO, LIBS_TERMCAP):
+ * s/irix6-5.h (TERMINFO):
+ * s/netbsd.h (LIBS_TERMCAP):
+ * s/openbsd.h (TERMINFO, LIBS_TERMCAP):
+ * s/sol2-6.h (LIBS_TERMCAP) [!TERMINFO]:
+ * s/usg5-4.h (TERMINFO):
+ Move to configure.
+
+2010-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (unbind_to): Don't unbind a local binding into the global
+ binding when the local binding disappeared. Inversely, don't unbind
+ a global binding into a newly created local binding.
+ * data.c (set_internal): Make its `buf' arg into a `where' arg so we
+ can specify the frame to use, when applicable. Adjust callers.
+
+2010-05-07 Vincent Belaïche <vincent.belaiche@gmail.com>
+ Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * floatfns.c (Fisnan, Fcopysign, Ffrexp, Fldexp): New functions.
+
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ * w32fns.c: Include w32.h.
+ (Fw32_shell_execute): Decode the error message before passing it
+ to `error'. (Bug#6126)
+
+ * msdos.c (dos_set_window_size):
+ * w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)'
+ instead of `XSYMBOL (foo)->value'.
+
+2010-05-07 Eli Zaretskii <eliz@gnu.org>
+
+ Fix the MS-DOS build, broken by autoconfiscation.
+
+ * Makefile.in: Don't use Make-style comments past the "start of
+ cpp stuff" line.
+ (MSDOS_OBJ): Remove xmenu.o (it is now defined by XMENU_OBJ).
+
+ * s/msdos.h (UNEXEC): Don't define (@unexec@ in Makefile.in is
+ edited directly by msdos/sed1v2.inp).
+
+2010-05-07 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+ (LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure.
+ (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA,
+ move out of cpp section.
+ * s/freebsd.h (LD_SWITCH_SYSTEM):
+ * s/gnu-linux.h (LD_SWITCH_SYSTEM):
+ * s/netbsd.h (LD_SWITCH_SYSTEM):
+ * s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in.
+
+2010-05-07 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Define LIB_STANDARD and START_FILES using autoconf.
+ * s/usg5-4.h (LIB_STANDARD):
+ * s/netbsd.h (START_FILES):
+ * s/irix6-5.h (LIB_STANDARD):
+ * s/hpux10-20.h (LIB_STANDARD, START_FILES):
+ * s/gnu-linux.h (START_FILES, LIB_STANDARD):
+ * s/freebsd.h (START_FILES):
+ * s/darwin.h (START_FILES):
+ * s/cygwin.h (START_FILES):
+ * s/aix4-2.h (LIB_STANDARD):
+ * m/ibmrs6000.h (START_FILES): Remove, move logic to configure.in.
+ * Makefile.in (STARTFILES): Rename to START_FILES, define using
+ autoconf, not cpp.
+
+2010-05-06 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove NEED_BSDTTY and NEED_UNISTD_H.
+ * s/hpux10-20.h (NEED_BSDTTY): Remove.
+ * s/aix4-2.h (NEED_UNISTD_H): Remove.
+ * systty.h: Simplify conditionals for including <sys/bsdtty.h>,
+ <sys/ptyio.h> and <unistd.h>.
+
+ * emacs.c (main): Remove NO_DIR_LIBRARY conditional, unused.
+
+ * Makefile.in (STARTFILES): Conditionally define to make the usage clear.
+ * s/gnu.h (START_FILES): Remove empty definition.
+
+2010-05-06 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (x_draw_image_relief): Move declaration of extra to beginning.
+
+2010-05-06 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (CPP, LN_S): Remove unused variables.
+
+2010-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * syntax.c (Fchar_syntax): Check the arg is a character (bug#6080).
+
+2010-05-05 Lawrence Mitchell <wence@gmx.li>
+
+ * m/sparc.h: Fix typo in earlier change.
+
+2010-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Misc tweaks.
+ * eval.c (Fdefvaralias): Remove unintended nested if.
+ (internal_condition_case_2, internal_condition_case_n): Use ANSI type.
+
+2010-05-04 Bernhard Herzog <bh@intevation.de> (tiny change)
+
+ * xsmfns.c (smc_save_yourself_CB): strlen(client_id) => strlen(cwd).
+
+2010-05-04 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove BSD_PGRPS.
+ * s/bsd-common.h (BSD_PGRPS): Remove undef.
+ * s/gnu-linux.h (BSD_PGRPS): Remove.
+ * term.c (dissociate_if_controlling_tty):
+ * sysdep.c (narrow_foreground_group, widen_foreground_group)
+ (init_sys_modes, reset_sys_modes):
+ * emacs.c (main):
+ * callproc.c (Fcall_process, child_setup): Remove code depending
+ on BSD_PGRPS.
+
+ Remove POSIX_SIGNALS.
+ * s/usg5-4.h (POSIX_SIGNALS):
+ * s/netbsd.h (POSIX_SIGNALS):
+ * s/msdos.h (POSIX_SIGNALS):
+ * s/ms-w32.h (POSIX_SIGNALS):
+ * s/hpux11.h (POSIX_SIGNALS):
+ * s/gnu.h (POSIX_SIGNALS):
+ * s/gnu-linux.h (POSIX_SIGNALS):
+ * s/freebsd.h (POSIX_SIGNALS):
+ * s/darwin.h (POSIX_SIGNALS):
+ * s/cygwin.h (POSIX_SIGNALS):
+ * s/aix4-2.h (POSIX_SIGNALS): Remove definition.
+ * s/unixware.h:
+ * s/sol2-6.h: Remove comments on POSIX_SIGNALS.
+ * process.c (create_process):
+ * syssignal.h:
+ * sysdep.c (wait_for_termination, init_signals):
+ * process.c (create_process):
+ * msdos.c: POSIX_SIGNALS is always defined on all platforms,
+ remove all code that assumes the contrary.
+
+2010-05-04 Glenn Morris <rgm@gnu.org>
+
+ * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell
+ variable.
+ * s/netbsd.h (LD_SWITCH_SYSTEM_tmp): Remove.
+ (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH.
+ * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Remove.
+ (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH instead of
+ LD_SWITCH_SYSTEM_tmp.
+ * Makefile.in (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH):
+ New variables, set by configure.
+
+ * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in.
+ * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove.
+ (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in.
+ * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure.
+ (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS.
+
+ * s/aix4-2.h (C_SWITCH_SYSTEM):
+ * m/alpha.h (C_SWITCH_MACHINE):
+ Move to configure.in.
+ * Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM):
+ New variables, set by configure.
+ (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of
+ $c_switch_machine and $c_switch_system.
+
+2010-05-04 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/hpux10-20.h (LIB_STANDARD): New definition.
+ * Makefile.in (ORDINARY_LINK): Remove setting LIB_STANDARD based
+ on it, not used anymore.
+
+2010-05-03 Chong Yidong <cyd@stupidchicken.com>
+
+ * eval.c (internal_condition_case_n): Rename from
+ internal_condition_case_2.
+ (internal_condition_case_2): New function.
+
+ * xdisp.c (safe_call): Use internal_condition_case_n.
+
+ * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE.
+ (internal_delete_file, Frename_file): Callers changed.
+
+ * buffer.c (Fkill_buffer):
+ * callproc.c (delete_temp_file): Callers changed (Bug#6070).
+
+ * lisp.h: Update prototypes.
+
+2010-05-03 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBX_EXTRA, LIBX_BASE): New variables.
+ (LIBXT_OTHER, LIBX_OTHER): New, set by configure.
+ (LIBXT): Set with configure, not cpp.
+ (LIBX): Remove.
+ (LIBES): Replace $LIBX with $LIBX_BASE and $LIBX_OTHER.
+
+2010-05-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * m/amdx86-64.h (START_FILES, LIB_STANDARD): Remove.
+ The FreeBSD is not needed, the default works, Solaris version is
+ not needed, and the remaining case is not supported by configure.
+
+2010-05-02 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsmfns.c (CHDIR_OPT): New define.
+ (smc_save_yourself_CB): Add CHDIR_OPT to options to use when
+ restarting emacs.
+
+ * xterm.c (x_connection_closed): Call Fkill_emacs instead of
+ shut_down_emacs.
+
+ * emacs.c (USAGE1): Mention --chdir.
+ (main): Handle --chdir.
+ (standard_args): Add --chdir.
+ (fatal_error_signal): Call Fkill_emacs for SIGTERM and SIGHUP (Bug
+ #5552).
+
+2010-05-01 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove LD_SWITCH_MACHINE.
+ * Makefile.in (LD_SWITCH_MACHINE): Remove definition, unused.
+ (TEMACS_LDFLAGS): Do not use LD_SWITCH_MACHINE.
+
+ Clean up IRIX code.
+ * m/iris4d.h (TERMINFO, FIRST_PTY_LETTER): Move definitions ...
+ * s/irix6-5.h (TERMINFO, FIRST_PTY_LETTER): ... here.
+
+ Clean up AIX code.
+ * m/ibmrs6000.inp: Remove file, unused.
+ * m/ibmrs6000.h (IBMR2AIX): Remove, unused.
+ (LD_SWITCH_MACHINE): Rename to LD_SWITCH_SYSTEM_TEMACS, and move
+ definition ...
+ * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): ... here.
+
+ * sysdep.c (child_setup_tty, init_sys_modes): Remove !IBMR2AIX code,
+ unused.
+
+2010-05-01 Eli Zaretskii <eliz@gnu.org>
+
+ Emulate POSIX_SIGNALS on MS-Windows.
+
+ * s/ms-w32.h (POSIX_SIGNALS, struct sigaction, SIG_BLOCK)
+ (SIG_SETMASK, SIG_UNBLOCK): Define.
+
+ * sysdep.c (sys_signal) [WINDOWSNT]: #ifdef away.
+ (wait_for_termination) [WINDOWSNT]: Move MS-Windows specific code
+ from non-POSIX_SIGNALS section to POSIX_SIGNALS section.
+
+ * w32.c (sigemptyset, sigaddset, sigfillset, sigprocmask):
+ New stubs.
+
+ Miscellaneous fixes of bidi display.
+
+ * xdisp.c (find_row_end): New function, refactored from display_line.
+ (display_line): Use it.
+ (extend_face_to_end_of_line): In almost-filled rows, extend only
+ if the row is R2L and not continued.
+ (display_line): Fix prepending of truncation glyphs to R2L rows.
+ Preserve overlay and string info in row->end.
+ (insert_left_trunc_glyphs): Support addition of left truncation
+ glyphs to R2L rows.
+ (set_cursor_from_row): Don't place cursor on the vertical border
+ glyph between adjacent windows. Fix a crash when a display string
+ is continued to the next line. Don't return zero if cursor was
+ found by `cursor' property of a display string.
+ (try_cursor_movement): Don't assume that row->end == (row+1)->start,
+ test for that explicitly.
+
+2010-05-01 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (gmallocobj, rallocobj, vmlimitobj): Initialize to null,
+ for clarity.
+ (OTHER_OBJ): Remove.
+ (PRE_ALLOC_OBJ, POST_ALLOC_OBJ): New, set by configure.
+ (otherobj): Use PRE_ALLOC_OBJ, POST_ALLOC_OBJ rather than OTHER_OBJ.
+
+2010-05-01 Karel Klíč <kklic@redhat.com>
+
+ * fileio.c (Ffile_selinux_context): Context functions may return null.
+
+2010-04-30 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/gnu.h (POSIX_SIGNALS, START_FILES): New definitions.
+
+2010-04-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (vmlimitobj) [!SYSTEM_MALLOC]: New variable. (Bug#6065)
+ (OTHER_OBJ): Define as a separate variable, for clarity.
+
+2010-04-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c: include limits.h and update file comment.
+
+2010-04-30 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (OLDXMENU, LIBXMENU) [HAVE_MENUS]:
+ Set with configure, not cpp.
+ (LIBW): Remove, replace with $TOOLKIT_LIBW.
+
+ * Makefile.in (mallocobj): Remove.
+ (otherobj): Simplify using @OTHER_OBJ@.
+
+ * Makefile.in (dispnew.o, frame.o, fringe.o, font.o, fontset.o)
+ (keyboard.o, window.o, xdisp.o, xfaces.o, menu.o):
+ Don't bother making nsgui.h dependency platform-specific.
+
+ * Makefile.in (nsfns.o): Remove duplicate nsgui.h dependency.
+
+2010-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * process.c (read_process_output, exec_sentinel): Don't burp if the
+ sentinel/filter kills the current buffer (bug#6060).
+
+ Fix wrong-docstring problem introduced with hash-consing. (Bug#6008)
+ * eval.c (Fautoload): Set doc to a unique number rather than to 0.
+ Remove unused var `args'.
+ * lisp.h (XSETCARFASTINT, XSETCDRFASTINT): Remove.
+ (LOADHIST_ATTACH): Wrap with do...while to avoid surprises for callers.
+ * doc.c (store_function_docstring): Use XSETCAR.
+
+2010-04-28 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT): New variables.
+ (WINDOW_SUPPORT) [HAVE_WINDOW_SYSTEM]: Use them.
+
+ * Makefile.in (CYGWIN_OBJ): Set with configure, not cpp.
+
+ * Makefile.in (GPM_MOUSE_SUPPORT): New, set by configure.
+ (MOUSE_SUPPORT) [!HAVE_MOUSE]: Use $GPM_MOUSE_SUPPORT.
+
+ * Makefile.in (FONT_OBJ): New, set by configure.
+ (FONT_DRIVERS): Use $FONT_OBJ.
+
+ * Makefile.in (LIBXMU): Set with configure, not cpp.
+ * s/aix4-2.h (LIBXMU):
+ * s/hpux10-20.h (LIBXMU):
+ Remove definition, now set in configure.
+
+ * Makefile.in (NS_OBJ, NS_SUPPORT): Set with configure, not cpp.
+
+ * m/amdx86-64.h [i386]: Move this test to configure.in.
+
+2010-04-27 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBXTR6): Set with configure, not cpp.
+ * s/unixware.h (NEED_LIBW): Remove definition.
+
+ * Makefile.in (LUCID_LIBW, MOTIF_LIBW): Remove, replacing by...
+ (TOOLKIT_LIBW): New, set by configure.
+ (@X_TOOLKIT_TYPE@): No longer define it.
+
+ * Makefile.in (LIBXP): Remove, since included in MOTIF_LIBW.
+ (MOTIF_LIBW): Set with configure, not cpp.
+ * s/aix4-2.h (LIB_MOTIF):
+ * s/gnu-linux.h (LIB_MOTIF):
+ * s/unixware.h (LIB_MOTIF): Move to configure.in.
+
+2010-04-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Reduce CPP usage.
+ * Makefile.in (LIB_X11_LIB): Remove, inline in the only user.
+ (obj): Use autoconf for unexec instead of cpp.
+ (C_SWITCH_SYSTEM, C_SWITCH_MACHINE, C_SWITCH_X_SITE): Remove
+ definitions and undefs. Inline definitions in the only user.
+ (ALL_CFLAGS): Substitute C_SWITCH_X_SYSTEM using autoconf.
+
+2010-04-27 Glenn Morris <rgm@gnu.org>
+
+ * m/amdx86-64.h (START_FILES, LIB_STANDARD): Change the logic around,
+ since the defaults (set by the system file) are fine in most cases.
+ [GNU_LINUX, __OpenBSD__, __NetBSD__, __APPLE__]: Remove sections.
+ * m/ibms390x.h (START_FILES, LIB_STANDARD):
+ * m/macppc.h (START_FILES, LIB_STANDARD) [GNU_LINUX]:
+ * m/sparc.h (START_FILES, LIB_STANDARD) [__linux__]:
+ Remove definitions, since they are set correctly in s/gnu-linux.h.
+ * s/freebsd.h (START_FILES, LIB_STANDARD):
+ * s/gnu-linux.h (START_FILES, LIB_STANDARD):
+ * s/hpux10-20.h (START_FILES):
+ * s/netbsd.h (START_FILES, LIB_STANDARD, START_FILES_1, END_FILES_1):
+ Use $CRT_DIR in place of fixed /usr/lib, /lib directories.
+
+ * Makefile.in (LIBXP, LUCID_LIBW, WIDGET_OBJ): Set via configure.
+ (MOTIF_LIBW): Use $LIBXP.
+ (otherobj): Use $WIDGET_OBJ.
+
+2010-04-26 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (LIBS_MACHINE): Remove, unused.
+
+ Use autoconf instead of cpp for LIB_MATH.
+ * s/darwin.h (LIB_MATH): Do not define here, move to configure.
+ * s/cygwin.h (LIB_MATH): Likewise.
+ * Makefile.in (LIB_MATH): Do not define with cpp.
+ (LIBES): Use autoconf for LIB_MATH.
+
+2010-04-26 Kenichi Handa <handa@m17n.org>
+
+ * composite.c (Ffind_composition_internal): Fix the return value
+ for an automatic composition.
+
+2010-04-25 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove all NO_ARG_ARRAY uses.
+ * fns.c (concat2, concat3, nconc2):
+ * eval.c (apply1, call1, call2, call3, call4, call5, call6)
+ (call7): Remove NO_ARG_ARRAY usage, assume it's always true.
+ * m/xtensa.h (NO_ARG_ARRAY):
+ * m/template.h (NO_ARG_ARRAY):
+ * m/sparc.h (NO_ARG_ARRAY):
+ * m/sh3.h (NO_ARG_ARRAY):
+ * m/mips.h (NO_ARG_ARRAY):
+ * m/macppc.h (NO_ARG_ARRAY):
+ * m/iris4d.h (NO_ARG_ARRAY):
+ * m/intel386.h (NO_ARG_ARRAY):
+ * m/ibms390x.h (NO_ARG_ARRAY):
+ * m/ibms390.h (NO_ARG_ARRAY):
+ * m/ibmrs6000.h (NO_ARG_ARRAY):
+ * m/ia64.h (NO_ARG_ARRAY):
+ * m/hp800.h (NO_ARG_ARRAY):
+ * m/arm.h (NO_ARG_ARRAY):
+ * m/amdx86-64.h (NO_ARG_ARRAY):
+ * m/alpha.h (NO_ARG_ARRAY): Remove definition.
+
+2010-04-25 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (display_line): Don't assume 2nd call to
+ get_next_display_element cannot return zero. (Bug#6030)
+ (iterate_out_of_display_property): New function, body from pop_it.
+ (pop_it): Use it.
+
+2010-04-24 Glenn Morris <rgm@gnu.org>
+
+ * m/amdx86-64.h (START_FILES, LIB_STANDARD) [__OpenBSD__]:
+ For clarity, revert to using fixed /usr/lib rather than $CRT_DIR.
+ (START_FILES, LIB_STANDARD) [__FreeBSD__]: Merge into the generic case,
+ since CRT_DIR defaults to /usr/lib. Suggested by Dan Nicolaescu.
+
+2010-04-24 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (display_line): Use `reseat' instead of `reseat_1', and
+ use `get_next_display_element' and `set_iterator_to_next' to
+ advance to the next character, when looking for the character that
+ begins the next row.
+
+ * .gdbinit: Add a "set Fmake_symbol" line to force GDB to load the
+ definition of "struct Lisp_Symbol".
+
+2010-04-24 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (CRT_DIR): New variable, set by configure.
+ * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
+ Use $CRT_DIR rather than HAVE_LIB64_DIR. (Bug#5655)
+
+2010-04-23 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in: Remove C_SWITCH_X_MACHINE, unused.
+
+ * s/cygwin.h (LIBS_DEBUG): Remove, unused.
+
+ Remove redundant flags.
+ * s/freebsd.h (C_SWITCH_SYSTEM):
+ * s/hpux10-20.h (C_SWITCH_X_SYSTEM, LD_SWITCH_X_DEFAULT):
+ * s/netbsd.h (C_SWITCH_SYSTEM):
+ * s/openbsd.h (LD_SWITCH_X_DEFAULT): Remove, configure takes care
+ of these.
+
+ Simplify m/intel386.h.
+ * m/intel386.h (CRT0_DUMMIES): Remove, inline value in the only
+ user: ecrt0.c.
+ (SOLARIS2): Remove LOAD_AVE_TYPE, LOAD_AVE_CVT, LIBS_MACHINE, unused.
+ (USG5_4): Move LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE definitions to
+ the only user: s/unixware.h.
+ * ecrt0.c: Remove #ifndef static. Inline CRT0_DUMMIES definition
+ from m/intel386.h.
+ * s/unixware.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, FSCALE): Definitions
+ moved here from m/intel386.h.
+
+ * m/mips.h: Remove #if 0 code.
+
+2010-04-23 Eli Zaretskii <eliz@gnu.org>
+
+ Fix display of composed characters from L2R scripts in bidi buffers.
+ * xdisp.c (set_iterator_to_next, next_element_from_composition):
+ After advancing IT past the composition, resync the bidi iterator
+ with IT's position. (Bug#5977)
+
+2010-04-23 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (LD_SWITCH_MACHINE_TEMACS): Remove, unused.
+ (TEMACS_LDFLAGS): Don't use LD_SWITCH_SYSTEM_TEMACS.
+
+2010-04-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * gtkutil.c: Include xsettings.h for Ftool_bar_get_system_style.
+
+2010-04-23 Eli Zaretskii <eliz@gnu.org>
+
+ Support `display' text properties and overlay strings in bidi buffers.
+ * xdisp.c (pop_it): When the stack is popped after displaying
+ from a string, bidi-iterate to exit from the text portion covered
+ by the `display' property or overlay. (Bug#5988, bug#5920)
+
+2010-04-23 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * m/macppc.h (LD_SWITCH_SYSTEM_TEMACS): Remove #undef.
+ (LD_SWITCH_MACHINE_TEMACS): Remove, configure sets nocombreloc.
+
+ * s/netbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure sets nocombreloc.
+ * s/openbsd.h (LD_SWITCH_SYSTEM_TEMACS): Remove.
+
+ Simplify STARTFILES definition.
+ * s/hpux10-20.h (START_FILES): Explicitly define here instead of
+ relying on Makefile.in to define it.
+ * s/cygwin.h (START_FILES): Likewise.
+ * Makefile.in (STARTFILES): Remove conditional code, not needed anymore.
+
+ Clean up Solaris code.
+ * s/sol2-6.h (LD_SWITCH_SYSTEM_TEMACS, C_SWITCH_X_SYSTEM)
+ (LIB_MOTIF): Remove, configure takes care of this.
+ (NOT_USING_MOTIF): Remove, unused.
+ * xrdb.c: Remove #if 0-ed #include.
+ (SYSV): Remove conditional for old SysV.
+ * sysdep.c (closedir): Remove conditional code for Solaris,
+ Solaris has closedir.
+
+2010-04-22 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c (read_and_apply_settings): Check if current_font is
+ NULL before strcmp (Bug#6001).
+
+2010-04-21 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Clean up HP-UX files.
+ * m/hp800.h (NO_REMAP, VIRT_ADDR_VARIES, DATA_SEG_BITS)
+ (DATA_START, TEXT_START, LOAD_AVE_TYPE, LOAD_AVE_CVT)
+ (LDAV_SYMBOL, index, rindex): Move definitions only used in HP-UX ...
+ * s/hpux10-20.h: ... to the only user, here.
+
+2010-04-21 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_find_paragraph_start, bidi_at_paragraph_end): Don't
+ use buffer-local values of paragraph-start and paragraph-separate.
+ <paragraph_start_re, paragraph_separate_re>: Rename from
+ fallback_paragraph_start_re and fallback_paragraph_separate_re.
+ (Bug#5992)
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c: Qmonospace_font_name, Qtool_bar_style and
+ current_tool_bar_style are new.
+ (store_config_changed_event): Rename from store_font_changed_event.
+ (XSETTINGS_TOOL_BAR_STYLE): New define.
+ (SEEN_FONT, SEEN_TB_STYLE): New enum values.
+ (struct xsettings): Add font and tb_style, set xft stuff inside #ifdef
+ HAVE_XFT.
+ (something_changedCB): store_font_changed_event is now
+ store_config_changed_event
+ (parse_settings): Rename from parse_xft_settings. Read
+ non-xft xsettings outside #ifdef HAVE_XFT.
+ (read_settings): Renamed from read_xft_settings.
+ (apply_xft_settings): Take current settings as parameter. Do not
+ call read_(xft)_settings.
+ (read_and_apply_settings): New function.
+ (xft_settings_event): Do non-xft stuff out of HAVE_XFT. Call
+ read_and_apply_settings if there are settings to be read.
+ (init_xsettings): Renamed from init_xfd_settings.
+ Call read_and_apply_settings unconditionally.
+ (xsettings_initialize): Call init_xsettings.
+ (Ftool_bar_get_system_style): New function.
+ (syms_of_xsettings): Define Qmonospace_font_name and
+ Qtool_bar_style. Initialize current_tool_bar_style to nil.
+ defsubr Stool_bar_get_system_style. Fprovide on
+ dynamic-setting.
+ Move misplaced HAVE_GCONF
+
+ * xsettings.h (Ftool_bar_get_system_style): Declare.
+
+ * xdisp.c: Vtool_bar_style, tool_bar_max_label_size,
+ Qtext, Qboth, Qboth_horiz are new.
+ (syms_of_xdisp): Intern Qtext, Qboth, Qboth_horiz, DEFVAR
+ Vtool_bar_style, tool_bar_max_label_size.
+
+ * lisp.h: Extern declare Qtext, Qboth, Qboth_horiz.
+
+ * keyboard.c: QClabel is new.
+ (parse_tool_bar_item): Take out QClabel from tool bar items.
+ Try to construct a label if ther is no QClabel.
+ (syms_of_keyboard): Intern :label as QClabel.
+
+ * dispextern.h (tool_bar_item_idx): TOOL_BAR_ITEM_LABEL is new.
+ (Vtool_bar_style, tool_bar_max_label_size, DEFAULT_TOOL_BAR_LABEL_SIZE):
+ New.
+
+ * Makefile.in (SOME_MACHINE_LISP): font-setting.el renamed to
+ dynamic-setting.el.
+
+ * gtkutil.c (xg_tool_bar_menu_proxy): Handle label in tool bar item.
+ (xg_make_tool_item, xg_show_toolbar_item): New function.
+ (update_frame_tool_bar): Take label from TOOL_BAR_ITEM_LABEL.
+ Call xg_make_tool_item to make a tool bar item.
+ Call xg_show_toolbar_item. Use wtoolbar instead of x->toolbar_widget.
+
+ * xterm.c (x_draw_image_relief): Take Vtool_bar_button_margin
+ into account for toolbars.
+
+2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * data.c (make_blv): Declarations before code (Bug#5993).
+
+2010-04-21 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (DBUS_OBJ, GTK_OBJ, XMENU_OBJ, XOBJ):
+ Define using autoconf, not cpp.
+ (LIBXSM): New variable, set by autoconf.
+ (LIBXT): Use $LIBXSM.
+
+2010-04-21 Dan Nicolaescu <local_user@dannlt>
+
+ Remove NOMULTIPLEJOBS, unused.
+ * s/template.h (NOMULTIPLEJOBS):
+ * s/msdos.h (NOMULTIPLEJOBS): Remove, unused.
+
+ Simplify LD_SWITCH_SYSTEM_TEMACS usage.
+ * s/freebsd.h (LD_SWITCH_SYSTEM_TEMACS):
+ * s/gnu-linux.h (LD_SWITCH_SYSTEM_TEMACS): Remove, configure
+ detects -znocombreloc and passes it to the linker
+ * s/hpux10-20.h (LD_SWITCH_SYSTEM_TEMACS): Remove, empty.
+
+2010-04-21 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBSELINUX_LIBS): Move out of #ifdef.
+
+2010-04-21 Karel Klíč <kklic@redhat.com>
+
+ * Makefile.in (LIBSELINUX_LIBS): New.
+ (LIBES): Add $LIBSELINUX_LIBS.
+ * eval.c, lisp.h (call7): New function.
+ * fileio.c [HAVE_LIBSELINUX]: Include selinux headers.
+ (Ffile_selinux_context, Fset_file_selinux_context):
+ New functions.
+ (Fcopy_file): New parameter preserve-selinux-context.
+ (Frename_file): Preserve selinux context when renaming by copy-file.
+
+2010-04-21 Juanma Barranquero <lekktu@gmail.com>
+ Eli Zaretskii <eliz@gnu.org>
+
+ Don't depend on cm.c or termcap.c on Windows, use stubs.
+ * makefile.w32-in (OBJ1): Remove cm.$(O) and termcap.$(O).
+ ($(BLD)/cm.$(O), $(BLD)/termcap.$(O)): Remove.
+ * w32console.c (current_tty, cost): New vars; lifted from cm.c.
+ (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear)
+ (sys_tputs, sys_tgetstr): New stubs.
+ * s/ms-w32.h (chcheckmagic, cmcostinit, cmgoto, cmputc, Wcm_clear)
+ (tputs, tgetstr): New; define to sys_*.
+
+2010-04-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * buffer.c (syms_of_buffer) <bidi-display-reordering>: Doc fix.
+
+2010-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
+ Just signal a warning rather than an error when inside a let.
+ (Fmake_variable_frame_local): Add the same test.
+
+ * font.c (syms_of_font): Make the style table vars read-only.
+
+ * buffer.h (struct buffer): Remove unused var `direction_reversed'.
+ * buffer.c (init_buffer_once, syms_of_buffer): Remove its initialization.
+
+ * bidi.c (bidi_initialize): Simplify fallback_paragraph_*_re init.
+
+2010-04-20 Eli Zaretskii <eliz@gnu.org>
+
+ Fix R2L paragraph display on TTY.
+
+ * xdisp.c (unproduce_glyphs): New function.
+ (display_line): Use it when produced glyphs are discarded from R2L
+ glyph rows.
+ (append_composite_glyph): In R2L rows, prepend the glyph rather
+ than appending it.
+
+ * term.c (append_composite_glyph): In R2L rows, prepend the glyph
+ rather than append it. Set up the resolved_level and bidi_type
+ attributes of the appended glyph.
+ (produce_special_glyphs): Mirror the backslash continuation
+ character in R2L lines.
+
+ Implement display of R2L paragraphs in GUI sessions.
+
+ * xdisp.c [HAVE_WINDOW_SYSTEM]: Add prototype for
+ append_stretch_glyph.
+ (set_cursor_from_row) <cursor_x>: Remove unused variable. Fix
+ off-by-one error in computing x at end of text in the row.
+ (append_stretch_glyph): In reversed row, prepend the glyph rather
+ than append it. Set resolved_level and bidi_type of the glyph.
+ (extend_face_to_end_of_line): If the row is reversed, prepend a
+ stretch glyph whose width is such that the rightmost glyph will be
+ drawn at the right margin of the window. Fix off-by-one error on
+ TTY frames in testing whether a line needs face extension. Fix
+ face extension at ZV. If this is the last glyph row, use
+ DEFAULT_FACE_ID, to avoid painting the rest of the window with the
+ region face.
+ (set_cursor_from_row, display_line): Use
+ MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
+ row->continuation_lines_width.
+ (next_element_from_buffer): Don't call bidi_paragraph_init if we
+ are at ZV. Fixes a crash when reseated to ZV by
+ try_window_reusing_current_matrix.
+ (display_and_set_cursor, erase_phys_cursor): Handle negative HPOS,
+ which happens with R2L glyph rows. Fixes a crash when inserting a
+ character at end of an R2L line.
+ (set_cursor_from_row): Don't be fooled by truncated rows: don't
+ treat them as having zero-width characters. Improve comments.
+ Don't reverse pos_before and pos_after for reversed glyph rows.
+ Set cursor.x to negative value when the cursor might be on the
+ left fringe.
+ (IT_OVERFLOW_NEWLINE_INTO_FRINGE): For R2L lines, consider the
+ left fringe, not the right one.
+ (notice_overwritten_cursor, draw_phys_cursor_glyph)
+ (erase_phys_cursor): For reversed cursor_row, support cursor on
+ the left fringe.
+
+ * fringe.c (update_window_fringes): For R2L rows, swap the bitmaps
+ of continuation indicators on the fringes.
+ (draw_fringe_bitmap): For reversed glyph rows, allow cursor on the
+ left fringe.
+
+ * w32term.c (w32_draw_window_cursor): For reversed glyph rows,
+ draw cursor on the left fringe.
+
+ * xterm.c (x_draw_window_cursor): For reversed glyph rows, draw
+ cursor on the left fringe.
+
+ * dispnew.c (update_text_area): Handle reversed desired rows when
+ the cursor is on the left fringe.
+ (set_window_cursor_after_update): Limit cursor's hpos by -1 from
+ below, not by 0, for when the cursor is on the left fringe.
+
+2010-04-20 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_event_is_for_scrollbar): Check if grabbed
+ widget is a scrollbar.
+
+2010-04-20 Kenichi Handa <handa@m17n.org>
+
+ * charset.c (char_charset): Consider Vcharset_non_preferred_head
+ only when the arg CHARSET_LIST is nil.
+
+2010-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Make variable forwarding explicit rather the using special values.
+ Basically, this makes the structure of buffer-local values and object
+ forwarding explicit in the type of Lisp_Symbols rather than use
+ special Lisp_Objects for that. This tends to lead to slightly more
+ verbose code, but is more C-like, simpler, and makes it easier to make
+ sure we handled all cases, among other things by letting the compiler
+ help us check it.
+ * lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
+ Removing forwarding objects.
+ (enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
+ (struct Lisp_Symbol): Make the various forms of variable-forwarding
+ explicit rather than hiding them inside Lisp_Object "values".
+ (XFWDTYPE): New macro.
+ (XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
+ (XBUFFER_LOCAL_VALUE): Remove.
+ (SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
+ (SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
+ (SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
+ (struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
+ (struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
+ Remove the Lisp_Misc_* header.
+ (struct Lisp_Buffer_Local_Value): Redefine.
+ (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
+ (struct Lisp_Misc_Any): Add filler to get the right size.
+ (struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
+ Lisp_Intfwd.
+ (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
+ (DEFVAR_KBOARD): Allocate a forwarding object.
+ * data.c (do_blv_forwarding, store_blv_forwarding): New macros.
+ (let_shadows_global_binding_p): New function.
+ (union Lisp_Val_Fwd): New type.
+ (make_blv): New function.
+ (swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
+ (store_symval_forwarding, swap_in_global_binding, Fboundp)
+ (swap_in_symval_forwarding, find_symbol_value, Fset)
+ (let_shadows_buffer_binding_p, set_internal, default_value)
+ (Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
+ (Fkill_local_variable, Fmake_variable_frame_local)
+ (Flocal_variable_p, Flocal_variable_if_set_p)
+ (Fvariable_binding_locus):
+ * xdisp.c (select_frame_for_redisplay):
+ * lread.c (Fintern, Funintern, init_obarray, defvar_int)
+ (defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
+ * frame.c (store_frame_param):
+ * eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
+ * bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
+ value structure.
+ * buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
+ (clone_per_buffer_values): Only adjust markers into the current buffer.
+ (reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
+ (Fbuffer_local_value, set_buffer_internal_1)
+ (swap_out_buffer_local_variables):
+ Adapt to the new symbol value structure.
+ (DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
+ (defvar_per_buffer): Take a new arg for the fwd object.
+ (buffer_lisp_local_variables): Return a proper alist (different fix
+ for bug#4138).
+ * alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
+ (Fgarbage_collect): Don't handle buffer_defaults specially.
+ (mark_object): Handle new symbol value structure rather than the old
+ special Lisp_Misc_* objects.
+ (gc_sweep) <symbols>: Free also the buffer-local-value objects.
+ * term.c (set_tty_color_mode):
+ * bidi.c (bidi_initialize): Don't access the ->value field directly.
+ * buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
+ a buffer_local_flags.
+ * print.c (print_object): Get rid of impossible forwarding objects.
+
+2010-04-19 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_get_type, bidi_get_category)
+ (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral)
+ (bidi_type_of_next_char, bidi_level_of_next_char):
+ Declare static. Use `INLINE' rather than `inline'.
2010-04-19 Juanma Barranquero <lekktu@gmail.com>
* dired.c (Ffile_attributes): Fix typo in docstring.
-2010-04-13 Adrian Robert <Adrian.B.Robert@gmail.com>
+2010-04-19 Adrian Robert <Adrian.B.Robert@gmail.com>
* nsmenu.m (EmacsDialog-runDialogAt:): Declare ret as
NSInteger (Bug#5811).
-2010-04-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+2010-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* s/darwin.h (PTY_ITERATION, PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF)
(PTY_OPEN): New defines. Use openpty (Bug#726, Bug#5819).
-2010-04-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+2010-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* frame.h (FRAME_LINE_TO_PIXEL_Y): Add missing parenthesis.
+2010-04-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for
+ terminal frames (Bug#5837).
+
+2010-04-19 Eli Zaretskii <eliz@gnu.org>
+
+ * .gdbinit (xsubchartable): New command.
+
+2010-04-19 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (display_line): Don't write beyond the last glyph row in
+ the desired matrix. Fixes a crash in "emacs -nw" (bug#5972), see
+ http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html
+ and
+ http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html
+
+2010-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * alloc.c (Fpurecopy): Hash-cons if requested.
+ (syms_of_alloc): Update purify-flag docstring.
+
+2010-04-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_set_geometry): Set size in geometry string also.
+ (x_wm_set_size_hint): Set USER_POS in hint_flags (Bug#5968).
+
+2010-04-17 Eli Zaretskii <eliz@gnu.org>
+
+ Fix a crash when an NSM character is inserted at BEGV.
+
+ * bidi.c (bidi_init_it): Fix initialization of bidi_it->prev.
+ (bidi_resolve_weak): Don't use prev.type_after_w1 if it is
+ NEUTRAL_B or UNKNOWN_BT.
+
+2010-04-16 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Don't consider possibility of
+ other rows with cursor unless they are different from this row and
+ this row is part of a continued line. (Bug#5943)
+
+2010-04-16 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/freebsd.h: Restore osreldate.h include.
+ Suggested by Naohiro Aota.
+
+2010-04-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (apply_systemfont_to_menu): *childs was incorrectly used.
+
+2010-04-16 Ken Brown <kbrown@cornell.edu> (tiny change)
+
+ * s/cygwin.h: Avoid linking against static libgcc.
+
+2010-04-15 Juri Linkov <juri@jurta.org>
+
+ * window.c: Add Qscroll_command.
+ Remove Vscroll_preserve_screen_position_commands.
+ (window_scroll_pixel_based, window_scroll_line_based): Check the
+ `scroll-command' property on the last command instead of searching
+ the last command in Vscroll_preserve_screen_position_commands.
+ (syms_of_window): Initialize and staticpro `Qscroll_command'.
+ Put Qscroll_command property on Qscroll_up and Qscroll_down.
+ (scroll-preserve-screen-position): Doc fix.
+ (Vscroll_preserve_screen_position_commands): Remove variable.
+
+2010-04-15 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xdisp.c (message): Do not use NO_ARG_ARRAY.
+
+2010-04-14 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Reduce cpp use in Makefile.in.
+ * Makefile.in (DBUS_CFLAGS, DBUS_LIBS, GCONF_CFLAGS, GCONF_LIBS)
+ (LIBSOUND, CFLAGS_SOUND, RSVG_LIBS, RSVG_CFLAGS, INTERVALS_H)
+ (GETLOADAVG_LIBS, RUN_TEMACS): Move to the autoconf section.
+ (ORDINARY_LINK): Remove, defined in src/s/gnu.h.
+ (CRT0_COMPILE): Remove, inline it in the only user.
+
+2010-04-14 Juri Linkov <juri@jurta.org>
+
+ * window.c (keys_of_window): Rebind `C-v' from `scroll-up' to
+ `scroll-up-command' and `M-v' from `scroll-down' to
+ `scroll-down-command'.
+
+2010-04-14 Juri Linkov <juri@jurta.org>
+
+ * window.c (Vscroll_preserve_screen_position_commands): New variable
+ with the default value as the list of Qscroll_down and Qscroll_up.
+ (window_scroll_pixel_based, window_scroll_line_based): Search the
+ last command in the list Vscroll_preserve_screen_position_commands
+ instead of comparing with Qscroll_up and Qscroll_down.
+
+2010-04-13 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_set_geometry): Set geometry for PPosition also.
+ (x_wm_set_size_hint): Dont set position flags, gtk_window_parse_geometry
+ does that.
+
+ * xfns.c (Fx_create_frame, x_create_tip_frame): Set default border width
+ to zero.
+
+2010-04-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * term.c (init_tty): Move common text outside of #ifdef TERMINFO.
+
+ Try to solve the problem of spurious EOF chars in long lines of text
+ sent to interactive subprocesses.
+ * sysdep.c (child_setup_tty): Do not enable ICANON any more.
+ (system_process_attributes): Remove unused var `ttotal'.
+ * process.c (send_process): Don't bother breaking long line with EOF
+ chars when talking to ttys any more.
+ (wait_reading_process_output): Output a warning when called in such
+ a way that it could block without being interruptible.
+
+ Try to detect file modification within the same second.
+ * buffer.h (struct buffer): New field modtime_size.
+ * buffer.c (reset_buffer): Initialize it.
+ * fileio.c (Finsert_file_contents, Fwrite_region): Set it.
+ (Fverify_visited_file_modtime): Check it.
+ (Fclear_visited_file_modtime, Fset_visited_file_modtime): Clear it.
+ (Fset_visited_file_modtime): Set (or clear) it.
+
+2010-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * process.c (status_notify): Remove unused var `ro'.
+
+2010-04-12 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xfns.c (select_visual): Don't call error if XGetVisualInfo returns
+ more than one visual (Bug#5938).
+
+2010-04-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * Makefile.in (C_SWITCH_SYSTEM,C_SWITCH_MACHINE,C_SWITCH_X_SITE):
+ Undefine.
+
+2010-04-11 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove C_SWITCH_SYSTEM_TEMACS.
+ * s/darwin.h (C_SWITCH_SYSTEM_TEMACS): Remove.
+ (malloc, realloc, free): Use emacs, not temacs for conditional
+ definition.
+
+ * Makefile.in (C_SWITCH_SYSTEM_TEMACS): Remove.
+ (ALL_CFLAGS): Do not use C_SWITCH_SYSTEM_TEMACS.
+
+ Use autoconf, not cpp for some variables.
+ * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE)
+ (C_SWITCH_X_SITE): Define using autoconf, not cpp.
+ (ALL_CFLAGS): Use them as make variables.
+ (really-lwlib, really-oldXMenu): Do not pass them.
+
+2010-04-11 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (apply_systemfont_to_dialog): New.
+ (create_and_show_dialog): Call apply_systemfont_to_dialog if HAVE_XFT.
+
+2010-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * process.c (exec_sentinel): Preserve current-buffer.
+
+ * process.c (read_process_output): Move the save-current-buffer to
+ apply to both the filter and the non-filter branches.
+
+2010-04-10 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/msdos.h (UNEXEC): New definition.
+
+2010-04-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * dispextern.h (TRY_WINDOW_CHECK_MARGINS)
+ (TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.
+
+ * xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
+ Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
+ set in FLAGS. Callers with non-zero CHECK_MARGINS changed to use
+ TRY_WINDOW_CHECK_MARGINS.
+
+ * xfns.c (Fx_show_tip): Undo last change. Call try_window with
+ TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423). Subtract last glyph's
+ width only when it is for padding.
+
+2010-04-09 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xfns.c (Fx_show_tip): Call try_window in a loop until
+ fonts_changed_p is zero (Bug#2423).
+
+2010-04-08 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Don't dereference glyphs beyond
+ the end of TEXT_AREA. (Bug#5856)
+
+2010-04-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c (XSETTINGS_FONT_NAME): Move XSETTINGS_FONT_NAME out of
+ HAVE_GCONF.
+
+2010-04-08 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of
+ prev.orig_type, for resolving type of NSM. (Bug#5858)
+
+2010-04-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New.
+ (parse_xft_settings): Also check for XSETTINGS_FONT_NAME and save that
+ in current_font.
+ (init_gconf): Read value of SYSTEM_FONT and save it in current_font.
+ (Ffont_get_system_normal_font, xsettings_get_system_normal_font):
+ New functions.
+ (syms_of_xsettings): Initialize current_font.
+ defsubr Sfont_get_system_normal_font.
+
+ * xsettings.h (Ffont_get_system_normal_font,
+ xsettings_get_system_normal_font): Declare.
+
+ * xfns.c (extern xlwmenu_default_font): Remove.
+ (Fx_create_frame): Remove setting of xlwmenu_default_font, moved
+ to xlwmenu.c.
+
+ * menu.c (digest_single_submenu): If USE_LUCID and HAVE_XFT, encode
+ menu items in UTF-8.
+
+ * xmenu.c: include xsettings.h and xlwmenu.h if USE_LUCID.
+ (apply_systemfont_to_menu): New function.
+ (set_frame_menubar, create_and_show_popup_menu): Call
+ apply_systemfont_to_menu.
+
2010-04-07 Jan Djärv <jan.h.d@swipnet.se>
* frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use
* xterm.c (x_set_window_size_1): Don't add border_width/height to
pixelwidth/height.
+2010-04-07 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Simplify code for HP machines.
+ * m/hp800.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, NO_REMAP): Do not define
+ for GNU_LINUX, not needed.
+ (UNEXEC, NEED_BSDTTY): Move definitions...
+ * s/hpux10-20.h (UNEXEC, NEED_BSDTTY): ... here.
+
+ * m/iris4d.h (UNEXEC): Move definition ...
+ * s/irix6-5.h (UNEXEC): ... here.
+
+2010-04-04 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xfns.c (set_machine_and_pid_properties): New function.
+ (Fx_create_frame): Call set_machine_and_pid_properties.
+
+2010-04-03 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check
+ bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
+ BIDI_EOB. Fixes infloop with vertical cursor motion at ZV.
+
+ * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
+ in this function. (Bug#5703)
+
+2010-04-03 Chong Yidong <cyd@stupidchicken.com>
+
+ * nsterm.h: Fix last change.
+
+2010-04-03 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * m/intel386.h (NO_REMAP): Move definition ...
+ * s/msdos.h (NO_REMAP): ... here.
+
+ * m/vax.h (CRT0_DUMMIES): Remove, unused.
+
+ * ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
+ used on those platforms.
+
+2010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove extern errno declarations.
+ * xterm.c:
+ * xrdb.c:
+ * w32term.c:
+ * unexec.c:
+ * unexaix.c:
+ * sysdep.c:
+ * process.c:
+ * lread.c:
+ * keyboard.c:
+ * floatfns.c:
+ * filelock.c:
+ * fileio.c:
+ * emacs.c (main):
+ * ecrt0.c:
+ * dispnew.c:
+ * callproc.c:
+ * buffer.c: Remove errno extern declarations.
+ * s/netbsd.h (NEED_ERRNO): Remove.
+
+2010-04-01 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove all uses of LIBX11_SYSTEM.
+ * Makefile.in (LIBX11_SYSTEM): Remove.
+ * s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
+ instead.
+
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ Remove support for DJGPP v1.x (bug#5813).
+
+ * w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
+ * s/msdos.h:
+ * unexec.c (make_hdr, copy_text_and_data):
+ * sysdep.c (wait_for_termination, sys_subshell):
+ * msdos.c (dos_set_window_size, msdos_set_cursor_shape)
+ (IT_set_terminal_modes, __write, _rename, gethostname)
+ (gettimeofday, alarm, fork, kill, dos_ttraw, dos_ttcooked)
+ (run_msdos_command, abort): Remove DJGPP v1.x code and tests of
+ the value of __DJGPP__.
+ (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
+ compatibility code.
+ * lread.c:
+ * gmalloc.c (memalign):
+ * fileio.c (Fcopy_file, check_executable, Ffile_modes):
+ * emacs.c (main):
+ * dosfns.c (init_dosfns):
+ * dired.c (file_name_completion_stat): Remove tests of __DJGPP__.
+
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Fix cursor positioning when the
+ string with `cursor' property comes from an `after-string'
+ overlay. (Bug#5816)
+
+2010-04-01 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS):
+ Define as Makefile variables.
+ (LIBX): Use above variables rather than directly using autoconf.
+
+2010-03-31 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Clean up BSD_SYSTEM use.
+ * xterm.c:
+ * process.c:
+ * emacs.c: Use HAVE_SYS_IOCTL_H instead of BSD_SYSTEM as a guard
+ for including <sys/ioctl.h>.
+ * sysdep.c (wait_without_blocking): Remove BSD_SYSTEM case, this
+ code is only used for MSDOS.
+
+2010-03-31 Juri Linkov <juri@jurta.org>
+
+ * image.c: Add `Qextension_data'.
+ (syms_of_image): Initialize and staticpro `Qextension_data'.
+ (Fimage_metadata): Rename from `Fimage_extension_data'.
+ (gif_load): Put GIF extension data to the property
+ `Qextension_data'.
+
2010-04-05 Chong Yidong <cyd@stupidchicken.com>
* xdisp.c (prepare_menu_bars): Don't call ns_set_doc_edited for
2010-03-31 Eli Zaretskii <eliz@gnu.org>
- * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
- in this function. (Bug#5703)
+ * xdisp.c (highlight_trailing_whitespace): Support highlight of
+ trailing whitespace in right-to-left rows.
-2010-03-31 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
- * nsterm.h: Fix last change.
+ Get rid of the direct_output optimizations.
+ * keyboard.c (nonundocount): Remove extern declaration.
+ (command_loop_1): Remove brittle optimisation for cheap and
+ common operations.
+ * xdisp.c (redisplay_internal): Don't bother checking
+ redisplay_performed_directly_p any more.
+ * sysdep.c (init_sys_modes): Don't call direct_output_forward_char
+ any more.
+ * dispnew.c (redisplay_performed_directly_p)
+ (direct_output_for_insert, direct_output_forward_char):
+ * dispextern.h (redisplay_performed_directly_p)
+ (direct_output_for_insert, direct_output_forward_char): Remove.
+ * cmds.c (nonundocount): Make it static.
-2010-03-30 Bernhard Herzog <bh@intevation.de> (tiny change)
+2010-03-31 Bernhard Herzog <bh@intevation.de> (tiny change)
* menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
-2010-03-30 Jan Djärv <jan.h.d@swipnet.se>
+2010-03-31 Jan Djärv <jan.h.d@swipnet.se>
* xdisp.c (note_mouse_highlight): Don't do highlight if pointer is
invisible (Bug#5766).
-2010-03-29 Adrian Robert <adrian.b.robert@gmail.com>
+2010-03-31 Adrian Robert <adrian.b.robert@gmail.com>
- * xdisp.c (x_consider_frame_title, update_window_cursor): Remove
- HAVE_NS conditionals.
+ * xdisp.c (x_consider_frame_title, update_window_cursor):
+ Remove HAVE_NS conditionals.
(prepare_menu_bars) [HAVE_NS]: Call ns_set_doc_edited.
* nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
* nsterm.m: Remove unneeded prototype.
-2010-03-28 Glenn Morris <rgm@gnu.org>
+2010-03-31 Glenn Morris <rgm@gnu.org>
* Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always
in the DOC file. (Bug#5336)
-2010-03-24 Chong Yidong <cyd@stupidchicken.com>
+2010-03-31 Chong Yidong <cyd@stupidchicken.com>
* xdisp.c (pos_visible_p): Revert 2008-01-25 change (Bug#5730).
-2010-03-20 Jan Djärv <jan.h.d@swipnet.se>
+2010-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * window.c (keys_of_window): Remove redundant/overridden bindings.
+
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
+ Restore original behavior when the iterator is not bidi_p.
+
+2010-03-30 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xdisp.c (syms_of_xdisp): Use intern_c_string instead of intern.
+
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_cache_iterator_state): Invalidate the cache if we
+ are outside the range of cached character positions.
+
+2010-03-30 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/bidi.$(O)): Add dependency on w32gui.h.
+
+2010-03-30 Eli Zaretskii <eliz@gnu.org>
+
+ Initial support for bidirectional editing.
+
+ * Makefile.in (obj): Include bidi.o.
+ (bidi.o): New target.
+
+ * makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
+ ($(BLD)/bidi.$(O)): New target.
+
+ * bidi.c: New file.
+
+ * buffer.h (struct buffer): New members bidi_display_reordering
+ and bidi_paragraph_direction.
+
+ * buffer.c (init_buffer_once): Initialize bidi_display_reordering
+ and bidi_paragraph_direction.
+ (syms_of_buffer): Declare Lisp variables bidi-display-reordering
+ and bidi-paragraph-direction.
+ (Fbuffer_swap_text): Swap the values of
+ bidi_display_reordering and bidi_paragraph_direction.
+
+ * dispextern.h (BIDI_MAXLEVEL, BIDI_AT_BASE_LEVEL): New macros.
+ (bidi_type_t, bidi_dir_t): New types.
+ (bidi_saved_info, bidi_stack, bidi_it): New structures.
+ (struct it): New members bidi_p, bidi_it, paragraph_embedding,
+ prev_stop, base_level_stop, and eol_pos.
+ (bidi_init_it, bidi_get_next_char_visually): New prototypes.
+ (IT_STACK_SIZE): Enlarge to 5.
+ (struct glyph_row): New member reversed_p.
+ <string_buffer_position>: Update prototype.
+ (PRODUCE_GLYPHS): Set the reversed_p flag in the iterator's
+ glyph_row if bidi_it.paragraph_dir == R2L.
+ (struct glyph): New members resolved_level and bidi_type.
+
+ * dispnew.c (direct_output_forward_char): Give up if we need bidi
+ processing or buffer's direction is right-to-left.
+ (prepare_desired_row): Preserve the reversed_p flag.
+ (row_equal_p): Compare the reversed_p attributes as well.
+
+ * xdisp.c (init_iterator): Initialize it->bidi_p. Call
+ bidi_init_it and set it->paragraph_embedding from the current
+ buffer's value of bidi_paragraph_direction.
+ (reseat_1): Initialize bidi_it.first_elt.
+ (set_iterator_to_next, next_element_from_buffer): Use the value of
+ paragraph_embedding to determine the paragraph direction.
+ (set_iterator_to_next): Under bidi reordering, call
+ bidi_get_next_char_visually. Call bidi_paragraph_init if the
+ new_paragraph flag is set in the bidi iterator.
+ (next_element_from_buffer): If bidi_it.first_elt is set,
+ initialize paragraph direction and find the first character to
+ display in the visual order. If reseated to a middle of a line,
+ prime the bidi iterator starting at the line's beginning. Handle
+ the situation where we overstepped stop_charpos due to
+ non-linearity of the bidi iteration. Likewise for when we back up
+ beyond the previous stop_charpos. When moving across stop_charpos,
+ record it in prev_stop.
+ (display_line): Set row->end and it->start for the next row to the
+ next character in logical order. Always extend reversed_p rows to
+ the end of line, even if they end at ZV. Copy the reversed_p flag
+ to the next glyph row. Keep calling set_cursor_from_row for
+ bidi-reordered rows even if we already have a possible candidate
+ for cursor position. Set row_end after all the row's glyphs have
+ been produced, by looping over the glyphs. Record the position
+ after EOL in it->eol_pos, and use it to set end_pos of the last
+ row produced for a continued line.
+ <Qright_to_left, Qleft_to_right>: New variables.
+ (syms_of_xdisp): Initialize and staticpro them.
+ (string_buffer_position_lim): New function.
+ (string_buffer_position): Most of code moved to
+ string_buffer_position_lim. Last argument and return value are
+ now EMACS_INT; all callers changed.
+ (set_cursor_from_row): Rewritten to support bidirectional text and
+ reversed glyph rows.
+ (text_outside_line_unchanged_p, try_window_id): Disable
+ optimizations if we are reordering bidirectional text and the
+ paragraph direction can be affected by the change.
+ (append_glyph, append_composite_glyph)
+ (produce_image_glyph, append_stretch_glyph): Set the
+ resolved_level and bidi_type members of each glyph.
+ (append_glyph): If the glyph row is reversed, prepend the glyph
+ rather than appending it.
+ (handle_stop_backwards): New function.
+ (reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
+ (reseat): call handle_stop_backwards to recompute prev_stop and
+ base_level_stop for the new position.
+ (handle_invisible_prop): Under bidi iteration, skip invisible text
+ using bidi_get_next_char_visually. If we are `reseat'ed, init the
+ paragraph direction. Update IT->prev_stop after skipping
+ invisible text.
+ (move_it_in_display_line_to): New variables prev_method
+ and prev_pos. Compare for strict equality in
+ BUFFER_POS_REACHED_P.
+ (try_cursor_movement): Examine all the candidate rows that occlude
+ point, to return the best match. If rows are bidi-reordered
+ and point moved backwards, back up to the row that is not a
+ continuation line, and start looking for a suitable row from
+ there.
+
+ * term.c (append_glyph): Reverse glyphs by pre-pending them,
+ rather than appending, if the glyph_row's reversed_p flag is set.
+ Set the resolved_level and bidi_type members of each glyph.
+
+ * .gdbinit (pbiditype): New command.
+ (pgx): Use it to display bidi level and type of the glyph.
+ (pitx): Display some bidi information about the iterator.
+ (prowlims, pmtxrows): New commands.
+
+2010-03-30 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove all uses of C_DEBUG_SWITCH and LIBS_DEBUG.
+ * s/usg5-4.h (LIBS_DEBUG):
+ * s/irix6-5.h (C_DEBUG_SWITCH):
+ * s/gnu-linux.h (LIBS_DEBUG):
+ * s/darwin.h (LIBS_DEBUG):
+ * s/bsd-common.h (LIBS_DEBUG):
+ * s/aix4-2.h (LIBS_DEBUG, C_DEBUG_SWITCH):
+ * m/iris4d.h (LIBS_DEBUG):
+ * m/hp800.h (LIBS_DEBUG): Remove definitions.
+
+ * Makefile.in (LIBES): Remove reference to LIBS_DEBUG.
+ (LIBS_DEBUG): Remove definition.
+
+2010-03-27 Chong Yidong <cyd@stupidchicken.com>
+
+ * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
+ Windows.
+
+2010-03-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * process.c (Fmake_network_process): Don't call turn_on_atimers around
+ `connect' (Bug#5723).
+
+2010-03-25 Helmut Eller <eller.helmut@gmail.com>
+
+ * process.c (Fmake_network_process): Call `select' for interrupted
+ `connect' rather than creating new socket (Bug#5173).
+
+2010-03-24 Jan Djärv <jan.h.d@swipnet.se>
* frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736).
* dispextern.h (resource_types): RES_TYPE_BOOLEAN_NUMBER is new.
-2010-03-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+2010-03-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* xfns.c (Fx_create_frame) [USE_LUCID]: Add BLOCK_INPUT around
XLoadQueryFont.
-2010-03-16 Kenichi Handa <handa@m17n.org>
+2010-03-24 Kenichi Handa <handa@m17n.org>
* coding.c (decode_coding_ccl): Fix previous change for the
multibyte case.
case that the output buffer is fullfilled.
(encode_coding): Setup ccl program here.
-2010-03-15 Andreas Politz <politza@fh-trier.de> (tiny change)
+2010-03-24 Andreas Politz <politza@fh-trier.de> (tiny change)
+
+ * editfns.c (Fformat): Account for string precision when computing
+ field width (Bug#5710).
+
+2010-03-23 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/gnu-linux.h (LIBS_SYSTEM): Remove, same as default.
+
+ Simplify LIBS_MACHINE definitions.
+ * m/hp800.h (LIBS_MACHINE): Remove, same as default.
+ * m/iris4d.h (LIBS_MACHINE): Likewise.
+ * m/ibmrs6000.h (LIBS_MACHINE): Rename to LIBS_SYSTEM and move ...
+ * s/aix4-2.h (LIBS_SYSTEM): ... here.
+ * s/netbsd.h: Remove commented out code.
+
+2010-03-22 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove dead code dealing with POSIX_SIGNALS.
+ * atimer.c (set_alarm): Remove dead code, all USG systems define
+ POSIX_SIGNALS.
+ * data.c (arith_error): Likewise.
+ * keyboard.c (input_available_signal, handle_user_signal)
+ (interrupt_signal): Likewise.
+ * process.c (sigchld_handler): Likewise.
+ (create_process): Remove if 0 code. Remove HPUX conditional when
+ !defined (POSIX_SIGNALS), it cannot be true.
+ * syssignal.h: Remove USG5_4 and USG conditionals when
+ !POSIX_SIGNALS, they cannot be true.
+
+ * keyboard.c (Fset_input_interrupt_mode): Remove code depending on
+ NO_SOCK_SIGIO, not used anymore.
+
+2010-03-21 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * m/vax.h (BSD_SYSTEM, BSD4_2): Remove conditionals, we only
+ support vax on BSDs.
+
+ * m/ibmrs6000.h (ORDINARY_LINK): Move definition ...
+ * s/aix4-2.h (ORDINARY_LINK): ... here.
+
+2010-03-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makefile.in (abs_builddir): Define.
+ (bootstrap_exe): Use it.
+ (VPATH): Use $(srcdir) instead of @srcdir@.
+
+2010-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * Makefile.in (bootstrap_exe): Use an absolute name.
+
+2010-03-20 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove support for old GNU/Linux using libc version 5.
+ * m/alpha.h (LINUX_SBRK_BUG): Remove definition.
+ * emacs.c (main): Remove code depending on LINUX_SBRK_BUG.
+
+ Consolidate redundant definitions in s/bsd-common.h.
+ * s/bsd-common.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
+ (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
+ (LDAV_SYMBOL, KERNEL_FILE): Define (or undefine) here instead of
+ doing it in all files that include this one.
+ * s/gnu.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
+ (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
+ (LDAV_SYMBOL, KERNEL_FILE): Remove.
+ * s/freebsd.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
+ (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
+ (LDAV_SYMBOL, KERNEL_FILE): Remove.
+ * s/netbsd.h (BSD4_2, TABDLY, TAB3, HAVE_TERMIOS, NO_TERMIO)
+ (LIBS_DEBUG, SYSV_SYSTEM_DIR, UNEXEC, NARROWPROTO, BSD_PGRPS)
+ (LDAV_SYMBOL, KERNEL_FILE): Remove.
+
+ Consolidate redundant definitions.
+ * s/usg5-4.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not define,
+ it's undefined in all files that include this one.
+ (POSIX_SIGNALS): Define here instead of doing it in all files that
+ include this one.
+ * s/irix6-5.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
+ (POSIX_SIGNALS): Do not define.
+ * s/sol2-6.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
+ (POSIX_SIGNALS): Do not define.
+ * s/unixware.h (sigsetmask, PTY_TTY_NAME_SPRINTF): Do not undef.
+ (POSIX_SIGNALS): Do not define.
+
+ Remove support for old UNIX System V systems.
+ * s/unixware.h: Add the contents of s/usg-5-4-2.h.
+ * s/usg-5-4-2.h: Remove.
+
+ Remove support for Solaris on PPC and for old versions.
+ * s/sol2-6.h: Add the contents of s/sol-2.3.h, s/sol-2.4.h, s/sol-2.5.h.
+ (LD_SWITCH_SYSTEM, USE_MMAP_FOR_BUFFERS): Remove #defines/#undef
+ that cancel each other.
+ * s/sol2-3.h:
+ * s/sol2-4.h:
+ * s/sol2-5.h: Remove.
+ * m/ibmrs6000.h: Remove code for USG5_4, this file is only used on AIX.
+ (NO_REMAP): Remove, unused.
+ (UNEXEC): Move definition ...
+ * s/aix4-2.h (UNEXEC): ... here.
+
+ * s/openbsd.h: Remove support for non-ELF and for systems that do
+ not support shared libraries.
+ * s/netbsd.h:
+ * s/freebsd.h: Likewise.
+
+2010-03-20 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove non-working support for lynxos 3.0.
+ * s/lynxos.h: Remove file.
+
+ * unexec.c (unexec, adjust_lnnoptrs): Do not depend on
+ COFF_BSD_SYMBOLS, nothing defines it anymore.
+
+2010-03-20 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove obsolete uses of HAVE_SHM.
+ * emacs.c (standard_args):
+ (Fdump_emacs):
+ (syms_of_emacs): Remove code depending on HAVE_SHM.
+
+ * alloc.c: Remove HAVE_SHM dependent definition.
+
+ * Makefile.in (RUN_TEMACS): Do not depend on HAVE_SHM.
+
+2010-03-18 Glenn Morris <rgm@gnu.org>
+
+ * emacs.c (USAGE4): Hard-code bug address.
+ (REPORT_EMACS_BUG_ADDRESS, REPORT_EMACS_BUG_PRETEST_ADDRESS): Remove.
+ (bug_reporting_address): Remove.
+ (main): Don't call bug_reporting_address.
+
+ * Makefile.in (XFT_LIBS, LIBXPM, LIBJPEG, LIBPNG, LIBTIFF, LIBGIF)
+ (LIBGPM, LIBRESOLV): Set using autoconf rather than cpp.
+
+2010-03-15 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfns.c (Fx_create_frame):
+ * frame.c (Vdefault_frame_scroll_bars): Put non-GTK X scroll-bars
+ on left.
+
+2010-03-13 Andreas Politz <politza@fh-trier.de> (tiny change)
* editfns.c (Fformat): Account for string precision when computing
field width (Bug#5710).
+2010-03-12 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfns.c (Fx_create_frame): Set default to Qright.
+
+ * frame.c (Vdefault_frame_scroll_bars): Set default to Qright for
+ all window systems.
+
+2010-03-12 Eli Zaretskii <eliz@gnu.org>
+
+ These changes remove termcap.c from the build on Posix platforms.
+ * Makefile.in (termcapobj): Move termcap.o from here...
+ (MSDOS_OBJ): ...to here.
+ (termcapobj) [!LIBS_TERMCAP]: Remove specialized value, as it is
+ now identical to when LIBS_TERMCAP is defined.
+
+ * term.c: Remove (ifdef'ed away) inclusion of termcap.h.
+
+ * cm.c: Remove (ifdef'ed away) inclusion of termcap.h.
+
+ * config.in: Regenerated. (See top-level ChangeLog.)
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
+
+2010-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Cleanup setup of gl_state in various parts of the code.
+ * syntax.h (SETUP_BUFFER_SYNTAX_TABLE): New macro.
+ (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
+ * syntax.c (find_defun_start, Fchar_syntax, Fmatching_paren)
+ (skip_chars):
+ * regex.c (regex_compile): Use it.
+ (re_compile_pattern): Don't set gl_state.current_syntax_table since
+ it's now set in regex_compile when/if we need it.
+
2010-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
Make it possible to C-g in a tight bytecode loop again (bug#5680).
* xterm.h: Rename x_non_menubar_window_to_frame to
x_menubar_window_to_frame.
- * xterm.c: Remove declarations also in xterm.h
+ * xterm.c: Remove declarations also in xterm.h.
(XTmouse_position): Do not return valid positions
for clicks in the menubar and the toolbar for Gtk+.
2009-07-04 Eli Zaretskii <eliz@gnu.org>
Emulation of `getloadavg' on MS-Windows.
- * w32.c: Include float.h
+ * w32.c: Include float.h.
(g_b_init_get_native_system_info, g_b_init_get_system_times)
(GetNativeSystemInfo_Proc, GetSystemTimes_Proc): Declare.
(get_native_system_info, get_system_times): New functions.
<after-change-functions>: Reflow docstrings.
2008-08-04 Adrian Robert <Adrian.B.Robert@gmail.com>
- Ken Raeburn <raeburn@gnu.org>
+ Ken Raeburn <raeburn@gnu.org>
Dock menu customization, based on a patch by Ken Raeburn, plus some
other fixes.
batch-compiling for bootstrap).
2008-07-15 Chris Hall <chris@web.workinglinux.com> (tiny change)
- YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+ YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
(make_initial_frame): Call init_frame_faces(f) in CANNOT_DUMP case --
fix crash due to different init order.
2008-07-10 Dan Nicolaescu <dann@ics.uci.edu>
* fileio.c:
- * sysdep.c
+ * sysdep.c:
* systty.h:
* m/ibmrs6000.h:
* m/iris4d.h:
(USG_SHARED_LIBRARIES): Remove duplicate definition.
2008-06-26 Juanma Barranquero <lekktu@gmail.com>
- Eli Zaretskii <eliz@gnu.org>
+ Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (LOCAL_FLAGS):
Don't include WINDOWSNT, DOS_NT and _UCHAR_T.
the property of LFACE_FONT of LFACE (if any).
2008-06-21 Seiji Zenitani <zenitani@mac.com>
- Ryo Yoshitake <ryo@shiftmode.net>
+ Ryo Yoshitake <ryo@shiftmode.net>
* xterm.c (x_set_frame_alpha): Add x_catch_errors for bug#437.
definitions from xmenu.c. Suggested by Adrian Robert.
* xmenu.c: Remove platform-independent menu definitions.
- (menu_items menu_items_inuse, menu_items_allocated)
+ (menu_items, menu_items_inuse, menu_items_allocated)
(menu_items_used, menu_items_n_panes)
(menu_items_submenu_depth): Move to keyboard.h.
(init_menu_items, finish_menu_items, unuse_menu_items)
* xterm.c (x_set_frame_alpha): Move declarations before statements.
2008-05-21 Seiji Zenitani <zenitani@mac.com>
- Ryo Yoshitake <ryo@shiftmode.net>
+ Ryo Yoshitake <ryo@shiftmode.net>
* frame.c (Qalpha): Add a new frame parameter `alpha'.
(Vframe_alpha_lower_limit): New variable.
prompt.
(various): Pass window being displayed as arg to vmotion.
(various): Compute starting-hpos arg to compute_motion
- using minibuf_prompt_width if in minibuf starting at top.
+ using minibuf_prompt_width if in minibuf starting at top.
* window.c (Fdisplay_buffer & callers):
Take second arg, non-nil means do not use selected window
Use signal, not sigset, since we simulate signal on
all system versions when nec.
- * buffer.c (syms_of_buffer, init_buffer_once,
- reset_buffer_local_variables):
+ * buffer.c (syms_of_buffer, init_buffer_once)
+ (reset_buffer_local_variables):
Define default-abbrev-mode, and init new buffers' abbrev-mode
from it. Move definition of abbrev-mode here from abbrev.c.
* keymap.c, callint.c, minibuf.c, fns.c, commands.h:
Rename MinbufLocalMap to Vminibuffer_local_map, etc.
Rename minibuf-local-{,-ns,-completion,must-match}map,
- and DefLispVar them (document even!).
+ and DefLispVar them (document even!).
=> New lisp variables minibuffer-local-map, minibuffer-local-ns-map,
minibuffer-local-completion-map, minibuffer-local-must-match-map.
1988-01-06 Richard Stallman (rms@frosted-flakes)
* s-hpux.h: Don't define nomultiplejobs, LDAV_SYMBOL, LIBS_DEBUG
- or BROKEN_FIONREAD.
+ or BROKEN_FIONREAD.
* m-hp9000s300.h: Define those four.
* s-hpux.h: Define BSTRING, and define bcopy, etc., as macros.
1986-11-26 Richard M. Stallman (rms@prep)
* sysdep.c (get_system_name):
- Eliminate internal static var in USG case.
+ Eliminate internal static var in USG case.
* lisp.h: New case testing and conversion macros
UPPERCASEP, LOWERCASEP, NOCASEP, UPCASE, DOWNCASE.
(so now (let ((case-fold-search t))) doesn't force buffer-localness)
However, setting a binding will still make it buffer-local.
(ie (let ((case-fold-search t)) (setq case-fold-search t))
- will cause case-fold-search be buffer-local even outside the let)
+ will cause case-fold-search be buffer-local even outside the let)
* xfns.c:
Preserve studlycaps: "Gnuemacs" => "GNU Emacs"
* search.c (Freplace_match): Delete unused some_multiletter_word init.
* alloc.c (gc_sweep): Delete unused next initializers.
* fns.c (concat): After error on non-int elt for string,
- do store the new value from the error handler.
+ do store the new value from the error handler.
* lread.c (read1): Comment out unused end =.
* lread.c (read_list): Delete unused tail =.
* data.c (Fmake_variable_buffer_local):
- If value type is Lisp_Some_Buffer_Local_Value,
- change it to Lisp_Buffer_Local_Value permanently.
+ If value type is Lisp_Some_Buffer_Local_Value,
+ change it to Lisp_Buffer_Local_Value permanently.
* undo.c (record_block): Delete unused cp =.
- Don't bother reallocing if n = 0 after first batch.
+ Don't bother reallocing if n = 0 after first batch.
* fileio.c (Fverify_visited_file_modtime):
- If CHECK_BUFFER changes buf, use the changed value.
+ If CHECK_BUFFER changes buf, use the changed value.
1986-07-07 Richard M. Stallman (rms@prep)
1989-12-14 Joseph Arceneaux (jla@spiff)
* xfns.c: New variable Vx_no_window_manager.
- (Fx_track_pointer): If bufp < 0, abort.
+ (Fx_track_pointer): If bufp < 0, abort.
* xterm.c (XTread_socket): When leaving window, set x_mouse_x and
x_mouse_y to -1.
1993-11-01 Richard Stallman (rms@mole.gnu.ai.mit.edu)
- * s/sunos4-1-3.h (HAVE_TERMIOS): Defined.
+ * s/sunos4-1-3.h (HAVE_TERMIOS): Define.
1993-10-25 Brian J. Fox (bfox@albert.gnu.ai.mit.edu)
* keyboard.c (read_key_sequence): Don't declare first_event; it is
no longer used. Change "#if 0" for first_event reading to
- "#if defined (GOBBLE_FIRST_EVENT)".
+ "#if defined (GOBBLE_FIRST_EVENT)".
1993-10-03 Brian J. Fox (bfox@ai.mit.edu)
* Makefile.in: File removed. It is now generated by ../configure.
- * Makefile.in.in (LIBES): Add $(GNULIB_VAR) again at end. This
- change to ymakefile was mysteriously lost. Were any others lost
- too?
+ * Makefile.in.in (LIBES): Add $(GNULIB_VAR) again at end.
+ This change to ymakefile was mysteriously lost.
+ Were any others lost too?
1993-10-02 Brian J. Fox (bfox@ai.mit.edu)
1993-09-24 Brian J. Fox (bfox@ai.mit.edu)
- * textprop.c (validate_plist): Add declaration for `list'
- argument.
+ * textprop.c (validate_plist): Add declaration for `list' argument.
* frame.c (Fhandle_switch_frame): Doc fix.
* doc.c (Fsubstitute_command_keys): Pass new arg.
* abbrev.c (Funexpand_abbrev, Fexpand_abbrev): Pass new arg.
- * s/aix3-2.h (AIX3_2): Defined.
+ * s/aix3-2.h (AIX3_2): Define.
* m/ibmrs6000.h (LIBS_MACHINE): Include -lrts, -liconv only if AIX3_2.
* xterm.h (HAVE_X11R4): If AIX, do not define HAVE_X11R4.
* xfns.c (XScreenNumberOfScreen): New function.
- * m/tek4300.h (C_DEBUG_SWITCH, SYSTEM_MALLOC): Defined.
+ * m/tek4300.h (C_DEBUG_SWITCH, SYSTEM_MALLOC): Define.
* m/iris4d.h (START_FILES, LIB_STANDARD): Don't define if USG5_4.
(DEFAULT_ENTRY_ADDRESS): Likewise.
(UNEXEC): Use unexelfsgi.o if USG5_4.
- * s/irix5-0.h (C_SWITCH_MACHINE): Deleted.
+ * s/irix5-0.h (C_SWITCH_MACHINE): Delete.
1993-08-13 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
* m/dpx2.h (HAVE_TCATTR): Macro #defined.
(HAVE_CLOSEDIR): #undef to allow use of closedir in sysdep.c.
- (SIGTSTP): Commented #undef to allow use of ^Z in shell-mode.
+ (SIGTSTP): Comment #undef to allow use of ^Z in shell-mode.
(SIGNALS_VIA_CHARACTERS): #defined.
1993-08-09 Paul Eggert (eggert@twinsun.com)
and calculate position properly.
* s/bsd4-2.h, s/bsd4-3.h, s/umax.h, s/rtu.h, s/dgux.h (HAVE_VFORK):
- Defined.
+ Define.
* ymakefile (alloc.o): Don't use DEBUG_MOLE.
- (DEBUG_MOLE): Deleted.
+ (DEBUG_MOLE): Delete.
* gnu-hp300: File deleted.
* .gdbinit: Don't put -q in args.
(main): Call init_buffer, init_callproc and init_cmdargs
before init_lread.
(syms_of_emacs): Install the function, and protect the variable.
- * lisp.h (Vinvocation_directory): Declared.
+ * lisp.h (Vinvocation_directory): Declare.
* lread.c (init_lread): Normally put Vinvocation_directory
at end of Vload_path, if not present already.
* fileio.c (Fmake_symbolic_link, Ffile_accessible_directory_p,
Finsert_file_contents, auto_save_error, Fwrite_region): Likewise.
(Fcopy_file, build_annotations, Fdo_auto_save): Delete unused
- variables.
+ variables.
1994-08-23 Richard Stallman <rms@mole.gnu.ai.mit.edu>
2001-01-05 Gerd Moellmann <gerd@gnu.org>
* sysdep.c: Don't prototype srandom; it takes an unsigned argument
- on some systems, and an unsigned long on others, like FreeBSD 4.1.
+ on some systems, and an unsigned long on others, like FreeBSD 4.1.
2001-01-04 Gerd Moellmann <gerd@gnu.org>
`vertical-line', `mode-line' and `header-line' events.
* xdisp.c (try_window_id): Avoid starting to display in the middle
- of a character, a TAB for instance. This is easier than to set
- up the iterator exactly, and it's not a frequent case, so the
- additional effort wouldn't really pay off.
+ of a character, a TAB for instance. This is easier than to set
+ up the iterator exactly, and it's not a frequent case, so the
+ additional effort wouldn't really pay off.
2000-11-26 Andrew Choi <akochoi@i-cable.com>
2000-11-24 Gerd Moellmann <gerd@gnu.org>
* xdisp.c (init_from_display_pos): If POS says we're already after
- an overlay string ending at POS, make sure to pop the iterator
- because it will be in front of that overlay string. When POS is
- ZV, we've thereby also ``processed'' overlay strings at ZV.
+ an overlay string ending at POS, make sure to pop the iterator
+ because it will be in front of that overlay string. When POS is
+ ZV, we've thereby also ``processed'' overlay strings at ZV.
* xfaces.c (lface_from_face_name): Function comment fix.
-# Makefile for GNU Emacs.
-# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-# 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/>.
-
-
-# Note that this file is edited by msdos/sed1v2.inp for MSDOS. That
-# script may need modifying in sync with changes made here. Try to
-# avoid shell-ism because the DOS build has to use the DOS shell.
-
-# Don't try to replace the cpp processing using autoconf facilities,
-# says rms.
-# Replacing a particular part of the conditionals to work via autoconf
-# is OK.
-# Some of the conditionals might be dead now. Finding them and
-# deleting them would be fine.
-
-
-# Here are the things that we expect ../configure to edit.
-# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
-srcdir=@srcdir@
-VPATH=@srcdir@
-CC=@CC@
-CPP=@CPP@
-CFLAGS=@CFLAGS@
-CPPFLAGS=@CPPFLAGS@
-LDFLAGS=@LDFLAGS@
-LN_S=@LN_S@
-EXEEXT=@EXEEXT@
-version=@version@
-# Substitute an assignment for the MAKE variable, because
-# BSD doesn't have it as a default.
-@SET_MAKE@
-# Don't use LIBS. configure puts stuff in it that either shouldn't be
-# linked with Emacs or is duplicated by the cpp stuff below.
-# LIBS = @LIBS@
-LIBOBJS = @LIBOBJS@
-
-lispsource = ${srcdir}/../lisp/
-libsrc = ../lib-src/
-etc = ../etc/
-oldXMenudir = ../oldXMenu/
-lwlibdir = ../lwlib/
-lispdir = ../lisp/
-
-# Configuration files for .o files to depend on.
-M_FILE = ${srcdir}/@machfile@
-S_FILE = ${srcdir}/@opsysfile@
-config_h = config.h $(M_FILE) $(S_FILE)
-
-bootstrap_exe = ../src/bootstrap-emacs${EXEEXT}
-
-OTHER_FILES = @OTHER_FILES@
-
-# ========================== start of cpp stuff =======================
-/* From here on, comments must be done in C syntax. */
-
-C_SWITCH_SYSTEM=
-
-/* just to be sure the sh is used */
-SHELL=/bin/sh
-
-#define THIS_IS_MAKEFILE
-#define NOT_C_CODE
-#include "config.h"
-
-#ifdef AUTO_DEPEND
-DEPFLAGS = -MMD -MF deps/$*.d
-#endif
-
-/* Do not let the file name mktime.c get messed up. */
-#ifdef mktime
-#undef mktime
-#endif
-
-/* Use HAVE_X11 as an alias for X11 in this file
- to avoid problems with X11 as a subdirectory name
- in -I and other such options which pass through this file. */
-
-#ifdef X11
-#define HAVE_X11
-#undef X11
-#endif
-
-/* On some machines #define register is done in config;
- do not let it interfere with this file. */
-#undef register
-
-/* GNU libc requires ORDINARY_LINK so that its own crt0 is used.
- GNU/Linux is an exception because it uses a funny variant of GNU libc. */
-#ifdef __GNU_LIBRARY__
-#ifndef GNU_LINUX
-#define ORDINARY_LINK
-#endif
-#endif
-
-/* Some machines do not find the standard C libraries in the usual place. */
-#ifndef ORDINARY_LINK
-#ifndef LIB_STANDARD
-#define LIB_STANDARD -lc
-#endif
-#else
-#ifndef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-#endif
-
-/* Under GNUstep, putting libc on the link line causes problems. */
-#ifdef NS_IMPL_GNUSTEP
-#undef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-
-/* Unless inhibited or changed, use -lg to link for debugging. */
-#ifndef LIBS_DEBUG
-#define LIBS_DEBUG -lg
-#endif
-
-/* Some s/SYSTEM.h files define this to request special libraries. */
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-
-/* Some m/MACHINE.h files define this to request special libraries. */
-#ifndef LIBS_MACHINE
-#define LIBS_MACHINE
-#endif
-
-#ifndef LIB_MATH
-# define LIB_MATH -lm
-#endif /* LIB_MATH */
-
-/* Some s/SYSTEM.h files define this to request special switches in ld. */
-#ifndef LD_SWITCH_SYSTEM
-#if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
-#define LD_SWITCH_SYSTEM -X
-#else /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#define LD_SWITCH_SYSTEM
-#endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#endif /* LD_SWITCH_SYSTEM */
-
-/* This holds special options for linking temacs
- that should be used for linking anything else. */
-#ifndef LD_SWITCH_SYSTEM_TEMACS
-#define LD_SWITCH_SYSTEM_TEMACS
-#endif
-
-/* Some s/SYSTEM.h files define this to request special switches
- for compiling temacs. */
-#ifndef C_SWITCH_SYSTEM_TEMACS
-#define C_SWITCH_SYSTEM_TEMACS
-#endif
-
-/* Some m/MACHINE.h files define this to request special switches in ld. */
-#ifndef LD_SWITCH_MACHINE
-#define LD_SWITCH_MACHINE
-#endif
-
-/* This holds special options for linking temacs
- that should be used for linking anything else. */
-#ifndef LD_SWITCH_MACHINE_TEMACS
-#define LD_SWITCH_MACHINE_TEMACS
-#endif
-
-/* Some m/MACHINE.h files define this to request special switches in cc. */
-#ifndef C_SWITCH_MACHINE
-#define C_SWITCH_MACHINE
-#endif
-
-/* Some s/SYSTEM.h files define this to request special switches in cc. */
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-
-/* These macros are for switches specifically related to X Windows. */
-#ifndef C_SWITCH_X_MACHINE
-#define C_SWITCH_X_MACHINE
-#endif
-
-#ifndef C_SWITCH_X_SYSTEM
-#define C_SWITCH_X_SYSTEM
-#endif
-
-#ifndef C_SWITCH_X_SITE
-#define C_SWITCH_X_SITE
-#endif
-
-#ifndef LD_SWITCH_X_SITE
-#define LD_SWITCH_X_SITE
-#endif
-
-#ifndef LD_SWITCH_X_DEFAULT
-#define LD_SWITCH_X_DEFAULT
-#endif
-
-#ifndef ORDINARY_LINK
-
-#ifndef CRT0_COMPILE
-#define CRT0_COMPILE $(CC) -c $(ALL_CFLAGS)
-#endif
-
-#ifndef START_FILES
-#ifdef NO_REMAP
-#define START_FILES pre-crt0.o /lib/crt0.o
-#else /* ! defined (NO_REMAP) */
-#define START_FILES ecrt0.o
-#endif /* ! defined (NO_REMAP) */
-#endif /* START_FILES */
-STARTFILES = START_FILES
-
-#else /* ORDINARY_LINK */
-
-/* config.h might want to force START_FILES anyway */
-#ifdef START_FILES
-STARTFILES = START_FILES
-#endif /* START_FILES */
-
-#endif /* not ORDINARY_LINK */
-
-
-#ifdef NS_IMPL_GNUSTEP
-/* Pull in stuff from GNUstep-make. */
-FOUNDATION_LIB=gnu
-GUI_LIB=gnu
-include @GNUSTEP_MAKEFILES@/Additional/base.make
-include @GNUSTEP_MAKEFILES@/Additional/gui.make
-shared=no
-#endif
-
-#ifdef HAVE_DBUS
-DBUS_CFLAGS = @DBUS_CFLAGS@
-DBUS_LIBS = @DBUS_LIBS@
-DBUS_OBJ = dbusbind.o
-#endif
-
-#ifdef HAVE_GCONF
-GCONF_CFLAGS = @GCONF_CFLAGS@
-GCONF_LIBS = @GCONF_LIBS@
-#endif
-
-/* DO NOT use -R. There is a special hack described in lastfile.c
- which is used instead. Some initialized data areas are modified
- at initial startup, then labeled as part of the text area when
- Emacs is dumped for the first time, and never changed again. */
-
-/* -Demacs is needed to make some files produce the correct version
- for use in Emacs.
-
- -DHAVE_CONFIG_H is needed for some other files to take advantage of
- the information in ``config.h''. */
-
-/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
- since it may have -I options that should override those two. */
-ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS}
-ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
-
-.SUFFIXES: .m
-.c.o:
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
-.m.o:
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
- $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
-
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-
-#ifndef LIB_X11_LIB
-#define LIB_X11_LIB -lX11
-#endif
-
-#ifdef HAVE_X_WINDOWS
-XMENU_OBJ = xmenu.o
-XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o \
- xsettings.o xgselect.o
-
-#ifdef HAVE_MENUS
-
-#ifdef USE_GTK
-GTK_OBJ= gtkutil.o
-#endif
-
-/* The X Menu stuff is present in the X10 distribution, but missing
- from X11. If we have X10, just use the installed library;
- otherwise, use our own copy. */
-#ifdef HAVE_X11
-#ifdef USE_X_TOOLKIT
-OLDXMENU=${lwlibdir}liblw.a
-LIBXMENU= $(OLDXMENU)
-#else /* not USE_X_TOOLKIT */
-OLDXMENU= ${oldXMenudir}libXMenu11.a
-LIBXMENU= $(OLDXMENU)
-#endif /* not USE_X_TOOLKIT */
-#else /* not HAVE_X11 */
-LIBXMENU= -lXMenu
-#endif /* not HAVE_X11 */
-
-#else /* not HAVE_MENUS */
-
-/* Otherwise, do not worry about the menu library at all. */
-LIBXMENU=
-#endif /* not HAVE_MENUS */
-
-#ifdef USE_X_TOOLKIT
-# define @X_TOOLKIT_TYPE@
-# if HAVE_XAW3D
-LUCID_LIBW= -lXaw3d
-# else
-LUCID_LIBW= -lXaw
-# endif
-# if defined (HAVE_MOTIF_2_1) && defined (HAVE_LIBXP)
-# define LIB_MOTIF_EXTRA -lXp
-# else
-# define LIB_MOTIF_EXTRA
-# endif
-# ifdef LIB_MOTIF
-MOTIF_LIBW= LIB_MOTIF LIB_MOTIF_EXTRA
-# else
-MOTIF_LIBW= -lXm LIB_MOTIF_EXTRA
-# endif
-LIBW=$(@X_TOOLKIT_TYPE@_LIBW)
-
-#ifdef HAVE_X11XTR6
-#ifdef NEED_LIBW
-LIBXTR6 = -lSM -lICE -lw
-#else
-LIBXTR6 = -lSM -lICE
-#endif
-#endif
-
-#ifndef LIBXMU
-#define LIBXMU -lXmu
-#endif
-
-LIBXT= $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext
-
-#else /* not USE_X_TOOLKIT */
-
-#ifdef USE_GTK
-LIBW=@GTK_LIBS@
-OLDXMENU=
-LIBXMENU=
-#endif /* USE_GTK */
-
-#ifdef HAVE_X_SM
-LIBXT=$(LIBW) -lSM -lICE
-#else
-LIBXT=$(LIBW)
-#endif
-#endif /* not USE_X_TOOLKIT */
-
-#if HAVE_XFT
-XFT_LIBS=@XFT_LIBS@
-#endif /* HAVE_XFT */
-
-#if HAVE_XPM
-#ifndef LIBXPM
-#define LIBXPM -lXpm
-#endif /* not defined LIBXPM */
-#else /* not HAVE_XPM */
-#define LIBXPM
-#endif /* not HAVE_XPM */
-
-#if HAVE_JPEG
-#ifndef LIBJPEG
-#define LIBJPEG -ljpeg
-#endif /* not defined LIBJPEG */
-#else /* not HAVE_JPEG */
-#define LIBJPEG
-#endif /* not HAVE_JPEG */
-
-#if HAVE_PNG
-#ifndef LIBPNG
-#define LIBPNG -lpng -lz -lm
-#endif /* not defined LIBPNG */
-#else /* not HAVE_PNG */
-#define LIBPNG
-#endif /* not HAVE_PNG */
-
-#if HAVE_TIFF
-#ifndef LIBTIFF
-#define LIBTIFF -ltiff
-#endif /* not defined LIBTIFF */
-#else /* not HAVE_TIFF */
-#define LIBTIFF
-#endif /* not HAVE_TIFF */
-
-#if HAVE_GIF
-#ifndef LIBGIF
-#define LIBGIF -lgif
-#endif /* not defined LIBGIF */
-#else /* not HAVE_GIF */
-#define LIBGIF
-#endif /* not HAVE_GIF */
-
-#ifdef HAVE_X11
-/* LD_SWITCH_X_DEFAULT comes after everything else that specifies
- options for where to find X libraries, but before those libraries. */
-X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
-LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) LIBTIFF LIBJPEG LIBPNG LIBGIF LIBXPM LIB_X11_LIB LIBX11_SYSTEM $(XFT_LIBS)
-#else /* not HAVE_X11 */
-LIBX= $(LIBXMENU) LD_SWITCH_X_SITE
-#endif /* not HAVE_X11 */
-#endif /* not HAVE_X_WINDOWS */
-
-#if HAVE_GPM
-#ifndef LIBGPM
-#define LIBGPM -lgpm
-#endif /* not defined LIBGPM */
-#else /* not HAVE_GPM */
-#define LIBGPM
-#endif /* not HAVE_GPM */
-
-#if HAVE_LIBRESOLV
-#ifndef LIBRESOLV
-#define LIBRESOLV -lresolv
-#endif /* not defined LIBRESOLV */
-#else /* not HAVE_LIBRESOLV */
-#define LIBRESOLV
-#endif /* not HAVE_LIBRESOLV */
-
-LIBSOUND= @LIBSOUND@
-CFLAGS_SOUND= @CFLAGS_SOUND@
-
-RSVG_LIBS= @RSVG_LIBS@
-RSVG_CFLAGS= @RSVG_CFLAGS@
-
-#ifndef ORDINARY_LINK
-/* Fix linking if compiled with GCC. */
-#ifdef __GNUC__
-
-#ifdef LINKER
-#define LINKER_WAS_SPECIFIED
-#endif
-
-/* 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. */
-
-#ifndef LINKER
-#define LINKER $(CC) -nostdlib
-#endif
-
-#ifndef LIB_GCC
-/* Ask GCC where to find libgcc.a. */
-#define LIB_GCC `$(CC) -print-libgcc-file-name`
-#endif /* not LIB_GCC */
-
-GNULIB_VAR = LIB_GCC
-
-#ifndef LINKER_WAS_SPECIFIED
-/* GCC passes any argument prefixed with -Xlinker directly to the
- linker. See prefix-args.c for an explanation of why we do not do
- this with the shell''s ``for'' construct.
- Note that some people do not have '.' in their paths, so we must
- use ./prefix-args. */
-#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
-#else
-#define YMF_PASS_LDFLAGS(flags) flags
-#endif
-
-#else /* not __GNUC__ */
-GNULIB_VAR =
-
-#endif /* not __GNUC__ */
-#endif /* not ORDINARY_LINK */
-
-#ifdef ORDINARY_LINK
-LD = $(CC)
-#else
-#ifdef LINKER
-LD=LINKER
-#else /* not LINKER */
-LD=ld
-#endif /* not LINKER */
-#endif /* not ORDINARY_LINK */
-
-/* Flags to pass to LD only for temacs. */
-/* Do not split this line with a backslash. That can cause trouble with
- some cpps. */
-TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS
-
-/* A macro which other sections of Makefile can redefine to munge the
- flags before they are passed to LD. This is helpful if you have
- redefined LD to something odd, like "gcc".
- (The YMF prefix is a holdover from the old name "ymakefile".)
- */
-#ifndef YMF_PASS_LDFLAGS
-#define YMF_PASS_LDFLAGS(flags) flags
-#endif
-
-/* Allow config.h to specify a replacement file for unexec.c. */
-#ifndef UNEXEC
-#define UNEXEC unexec.o
-#endif
-
-INTERVALS_H = dispextern.h intervals.h composite.h
-
-GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
-
-#ifdef MSDOS
-#ifdef HAVE_X_WINDOWS
-MSDOS_OBJ = dosfns.o msdos.o xmenu.o
-#else
-MSDOS_OBJ = dosfns.o msdos.o w16select.o xmenu.o
-#endif
-#endif
-
-#ifdef CYGWIN
-CYGWIN_OBJ = sheap.o
-#endif
-
-#ifdef HAVE_NS
-ns_appdir=@ns_appdir@/
-ns_appbindir=@ns_appbindir@/
-ns_appresdir=@ns_appresdir@/
-ns_appsrc=@ns_appsrc@
-/* Object files for NeXTstep */
-NS_OBJ= nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
- fontset.o fringe.o image.o
-#endif /* HAVE_NS */
-
-#ifdef HAVE_WINDOW_SYSTEM
-#ifdef HAVE_X_WINDOWS
-#if defined (HAVE_XFT)
-FONT_DRIVERS = xfont.o ftfont.o xftfont.o ftxfont.o
-#elif defined (HAVE_FREETYPE)
-FONT_DRIVERS = xfont.o ftfont.o ftxfont.o
-#else /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
-FONT_DRIVERS = xfont.o
-#endif /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
-#endif /* HAVE_X_WINDOWS */
-#endif /* HAVE_WINDOW_SYSTEM */
-
-/* lastfile must follow all files
- whose initialized data areas should be dumped as pure by dump-emacs. */
-obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
- charset.o coding.o category.o ccl.o character.o chartab.o \
- cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
- emacs.o keyboard.o macros.o keymap.o sysdep.o \
- buffer.o filelock.o insdel.o marker.o \
- minibuf.o fileio.o dired.o filemode.o \
- cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
- alloc.o data.o doc.o editfns.o callint.o \
- eval.o floatfns.o fns.o font.o print.o lread.o \
- syntax.o UNEXEC bytecode.o \
- process.o callproc.o \
- region-cache.o sound.o atimer.o \
- doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
- $(MSDOS_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_DRIVERS)
-
-/* Object files used on some machine or other.
- These go in the DOC file on all machines
- in case they are needed there. */
-SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
- xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
- fontset.o dbusbind.o \
- nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
- w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
- w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
-
-
-#ifdef TERMINFO
-/* Used to be -ltermcap here. If your machine needs that,
- define LIBS_TERMCAP in the m/MACHINE.h file. */
-#ifndef LIBS_TERMCAP
-#define LIBS_TERMCAP -lcurses
-#endif /* LIBS_TERMCAP */
-termcapobj = terminfo.o
-#else /* ! defined (TERMINFO) */
-#ifndef LIBS_TERMCAP
-#define LIBS_TERMCAP
-termcapobj = termcap.o tparam.o
-#else /* LIBS_TERMCAP */
-termcapobj = tparam.o
-#endif /* LIBS_TERMCAP */
-#endif /* ! defined (TERMINFO) */
-
-
-#ifndef SYSTEM_MALLOC
-
-#ifndef DOUG_LEA_MALLOC
-gmallocobj = gmalloc.o
-#endif
-
-#ifdef REL_ALLOC
-rallocobj = ralloc.o
-#endif
-
-mallocobj = $(gmallocobj) $(rallocobj) vm-limit.o
-
-#endif /* SYSTEM_MALLOC */
-
-
-#ifdef USE_X_TOOLKIT
-widgetobj= widget.o
-#else /* not USE_X_TOOLKIT */
-widgetobj=
-#endif /* not USE_X_TOOLKIT */
-
-
-/* define otherobj as list of object files that make-docfile
- should not be told about. */
-#ifdef CYGWIN
-/* Cygwin differs because of its unexec(). */
-otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(widgetobj) $(LIBOBJS)
-#else
-otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS)
-#endif
-
-#ifdef HAVE_MOUSE
-#define MOUSE_SUPPORT ${lispsource}mouse.elc \
- ${lispsource}select.elc ${lispsource}scroll-bar.elc
-#else
-#ifdef HAVE_GPM
-#define MOUSE_SUPPORT ${lispsource}mouse.elc
-#else
-#define MOUSE_SUPPORT
-#endif
-#endif
-
-#ifdef MSDOS
-#define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
- ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
- ${lispsource}term/internal.elc ${lispsource}term/pc-win.elc
-
-#else
-#define MSDOS_SUPPORT
-#endif
-
-#ifdef HAVE_WINDOW_SYSTEM
-#ifdef HAVE_X_WINDOWS
-#define WINDOW_SUPPORT ${lispsource}fringe.elc ${lispsource}image.elc \
- ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
- ${lispsource}tool-bar.elc ${lispsource}mwheel.elc ${lispsource}x-dnd.elc \
- ${lispsource}term/common-win.elc ${lispsource}term/x-win.elc \
- ${lispsource}font-setting.elc
-#else
-#define WINDOW_SUPPORT ${lispsource}fringe.elc ${lispsource}image.elc \
- ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
- ${lispsource}tool-bar.elc ${lispsource}mwheel.elc
-#endif
-#else
-#define WINDOW_SUPPORT
-#endif
-
-#ifdef WINDOWSNT
-#define WINNT_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
- ${lispsource}dos-w32.elc ${lispsource}w32-vars.elc \
- ${lispsource}w32-fns.elc ${lispsource}term/common-win.elc \
- ${lispsource}term/w32-win.elc
-#else
-#define WINNT_SUPPORT
-#endif
-
-#ifdef HAVE_WINDOW_SYSTEM
-#define TOOLTIP_SUPPORT ${lispsource}tooltip.elc
-#else
-#define TOOLTIP_SUPPORT
-#endif
-
-#ifdef HAVE_NS
-#define NS_SUPPORT ${lispsource}emacs-lisp/easymenu.elc \
- ${lispsource}term/ns-win.elc
-#else
-#define NS_SUPPORT
-#endif
-
-/* This is the platform-specific list of Lisp files loaded into the
- dumped Emacs. It is arranged like this because it is easier to generate
- it semi-mechanically from loadup.el this way.
-
- Note that this list should not include lisp files which might not
- be present, like site-load.el and site-init.el; this makefile
- expects them all to be either present or buildable.
-
- Files which are loaded unconditionally (i.e., on all platforms) should
- also be in shortlisp. Files which are loaded conditionally (i.e., only
- on some platforms) should instead be in SOME_MACHINE_LISP. */
-
-/* Place loaddefs.el first, so it gets generated first, since it is on
- the critical path (relevant in parallel compilations). */
-
-lisp= \
- ${lispsource}loaddefs.el \
- ${lispsource}abbrev.elc \
- ${lispsource}buff-menu.elc \
- ${lispsource}button.elc \
- ${lispsource}emacs-lisp/byte-run.elc \
- ${lispsource}composite.elc \
- ${lispsource}cus-face.elc \
- ${lispsource}cus-start.elc \
- ${lispsource}custom.elc \
- ${lispsource}emacs-lisp/backquote.elc \
- ${lispsource}emacs-lisp/lisp-mode.elc \
- ${lispsource}emacs-lisp/lisp.elc \
- ${lispsource}env.elc \
- ${lispsource}faces.elc \
- ${lispsource}files.elc \
- ${lispsource}format.elc \
- ${lispsource}facemenu.elc \
- MOUSE_SUPPORT \
- ${lispsource}emacs-lisp/float-sup.elc \
- ${lispsource}frame.elc \
- ${lispsource}help.elc \
- ${lispsource}indent.elc \
- ${lispsource}isearch.elc \
- ${lispsource}rfn-eshadow.elc \
- ${lispsource}loadup.el \
- ${lispsource}bindings.elc \
- ${lispsource}emacs-lisp/map-ynp.elc \
- ${lispsource}menu-bar.elc \
- ${lispsource}international/mule.elc \
- ${lispsource}international/mule-conf.elc \
- ${lispsource}international/mule-cmds.elc \
- ${lispsource}international/characters.elc \
- ${lispsource}international/charprop.el \
- ${lispsource}case-table.elc \
- ${lispsource}language/chinese.elc \
- ${lispsource}language/cyrillic.elc \
- ${lispsource}language/indian.elc \
- ${lispsource}language/sinhala.el \
- ${lispsource}language/english.el \
- ${lispsource}language/ethiopic.elc \
- ${lispsource}language/european.elc \
- ${lispsource}language/czech.el \
- ${lispsource}language/slovak.el \
- ${lispsource}language/romanian.el \
- ${lispsource}language/greek.el \
- ${lispsource}language/hebrew.el \
- ${lispsource}language/japanese.el \
- ${lispsource}language/korean.el \
- ${lispsource}language/lao.el \
- ${lispsource}language/cham.el \
- ${lispsource}language/tai-viet.el \
- ${lispsource}language/thai.el \
- ${lispsource}language/tibetan.elc \
- ${lispsource}language/vietnamese.elc \
- ${lispsource}language/misc-lang.el \
- ${lispsource}language/utf-8-lang.el \
- ${lispsource}language/georgian.el \
- ${lispsource}language/khmer.el \
- ${lispsource}language/burmese.el \
- ${lispsource}paths.el \
- ${lispsource}register.elc \
- ${lispsource}replace.elc \
- ${lispsource}simple.elc \
- ${lispsource}minibuffer.elc \
- ${lispsource}startup.elc \
- ${lispsource}subr.elc \
- ${lispsource}term/tty-colors.elc \
- ${lispsource}font-core.elc \
- ${lispsource}emacs-lisp/syntax.elc \
- ${lispsource}font-lock.elc \
- ${lispsource}jit-lock.elc \
- ${lispsource}textmodes/fill.elc \
- ${lispsource}textmodes/page.elc \
- ${lispsource}textmodes/paragraphs.elc \
- ${lispsource}textmodes/text-mode.elc \
- ${lispsource}emacs-lisp/timer.elc \
- ${lispsource}jka-cmpr-hook.elc \
- ${lispsource}vc-hooks.elc \
- ${lispsource}ediff-hook.elc \
- ${lispsource}epa-hook.elc \
- TOOLTIP_SUPPORT \
- MSDOS_SUPPORT \
- WINNT_SUPPORT \
- WINDOW_SUPPORT \
- NS_SUPPORT \
- ${lispsource}widget.elc \
- ${lispsource}window.elc \
- ${lispsource}version.el
-
-/* List of relative names for those files from $lisp that are loaded
- unconditionally (i.e. on all platforms). Files from $lisp that
- are only loaded on some platforms should instead be placed in
- SOME_MACHINE_LISP. The only reason this variable exists is to prevent
- the make-docfile command-line getting too long for some systems. */
-shortlisp= \
- ../lisp/loaddefs.el \
- ../lisp/abbrev.elc \
- ../lisp/buff-menu.elc \
- ../lisp/button.elc \
- ../lisp/emacs-lisp/byte-run.elc \
- ../lisp/composite.elc \
- ../lisp/cus-face.elc \
- ../lisp/cus-start.elc \
- ../lisp/custom.elc \
- ../lisp/emacs-lisp/backquote.elc \
- ../lisp/emacs-lisp/lisp-mode.elc \
- ../lisp/emacs-lisp/lisp.elc \
- ../lisp/facemenu.elc \
- ../lisp/faces.elc \
- ../lisp/files.elc \
- ../lisp/emacs-lisp/float-sup.elc \
- ../lisp/format.elc \
- ../lisp/frame.elc \
- ../lisp/help.elc \
- ../lisp/indent.elc \
- ../lisp/isearch.elc \
- ../lisp/rfn-eshadow.elc \
- ../lisp/loadup.el \
- ../lisp/bindings.elc \
- ../lisp/emacs-lisp/map-ynp.elc \
- ../lisp/env.elc \
- ../lisp/international/mule.elc \
- ../lisp/international/mule-conf.elc \
- ../lisp/international/mule-cmds.elc \
- ../lisp/international/characters.elc \
- ../lisp/case-table.elc \
- ../lisp/language/chinese.elc \
- ../lisp/language/cyrillic.elc \
- ../lisp/language/indian.elc \
- ../lisp/language/sinhala.el \
- ../lisp/language/english.el \
- ../lisp/language/ethiopic.elc \
- ../lisp/language/european.elc \
- ../lisp/language/czech.el \
- ../lisp/language/slovak.el \
- ../lisp/language/romanian.el \
- ../lisp/language/greek.el \
- ../lisp/language/hebrew.el \
- ../lisp/language/japanese.el \
- ../lisp/language/korean.el \
- ../lisp/language/lao.el \
- ../lisp/language/cham.el \
- ../lisp/language/tai-viet.el \
- ../lisp/language/thai.el \
- ../lisp/language/tibetan.elc \
- ../lisp/language/vietnamese.elc \
- ../lisp/language/misc-lang.el \
- ../lisp/language/utf-8-lang.el \
- ../lisp/language/georgian.el \
- ../lisp/language/khmer.el \
- ../lisp/language/burmese.el \
- ../lisp/menu-bar.elc \
- ../lisp/paths.el \
- ../lisp/register.elc \
- ../lisp/replace.elc \
- ../lisp/simple.elc \
- ../lisp/minibuffer.elc \
- ../lisp/startup.elc \
- ../lisp/subr.elc \
- ../lisp/term/tty-colors.elc \
- ../lisp/font-core.elc \
- ../lisp/emacs-lisp/syntax.elc \
- ../lisp/font-lock.elc \
- ../lisp/jit-lock.elc \
- ../lisp/textmodes/fill.elc \
- ../lisp/textmodes/page.elc \
- ../lisp/textmodes/paragraphs.elc \
- ../lisp/textmodes/text-mode.elc \
- ../lisp/emacs-lisp/timer.elc \
- ../lisp/vc-hooks.elc \
- ../lisp/jka-cmpr-hook.elc \
- ../lisp/ediff-hook.elc \
- ../lisp/epa-hook.elc \
- ../lisp/widget.elc \
- ../lisp/window.elc \
- ../lisp/version.el
-
-/* Like $shortlisp, but includes only those files from $lisp that are loaded
- conditionally (i.e., only on some platforms). */
-SOME_MACHINE_LISP = ../lisp/mouse.elc \
- ../lisp/select.elc ../lisp/scroll-bar.elc \
- ../lisp/ls-lisp.elc ../lisp/dos-fns.elc \
- ../lisp/w32-fns.elc ../lisp/dos-w32.elc \
- ../lisp/disp-table.elc ../lisp/dos-vars.elc \
- ../lisp/tooltip.elc ../lisp/image.elc \
- ../lisp/fringe.elc ../lisp/dnd.elc \
- ../lisp/mwheel.elc ../lisp/tool-bar.elc \
- ../lisp/x-dnd.elc ../lisp/font-setting.elc \
- ../lisp/international/ccl.elc \
- ../lisp/international/fontset.elc \
- ../lisp/mouse.elc \
- ../lisp/term/common-win.elc \
- ../lisp/term/x-win.elc \
- ../lisp/term/pc-win.elc ../lisp/term/internal.elc \
- ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc \
- ../lisp/emacs-lisp/easymenu.elc
-
-/* 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 gnulib again after them. */
-
-LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
- LIBGPM LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
- LIBS_DEBUG $(GETLOADAVG_LIBS) ${GCONF_LIBS} \
- @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
- $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
-
-#ifdef HAVE_SHM
-RUN_TEMACS = `/bin/pwd`/temacs -nl
-#else
-RUN_TEMACS = `/bin/pwd`/temacs
-#endif
-
-all: emacs${EXEEXT} $(OTHER_FILES)
-
-emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
-#ifdef CANNOT_DUMP
- rm -f emacs${EXEEXT}
- ln temacs${EXEEXT} emacs${EXEEXT}
- -EMACSLOADPATH=${lispsource} ./emacs -q -batch -f list-load-path-shadows
-#else
- LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
- @: This new Emacs is as functional and more efficient then
- @: bootstrap-emacs, so let us replace it.
- -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
- -./emacs -q -batch -f list-load-path-shadows
-#endif /* ! defined (CANNOT_DUMP) */
-
-/* We run make-docfile twice because the command line may get too long
- on some systems. */
-/* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
- or may not be included in ${obj}, but they are always included in
- ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned
- for the first time, this prevents any variation between configurations
- in the contents of the DOC file.
- Likewise for ${SOME_MACHINE_LISP}. */
-/* Most of this Makefile refers to Lisp files via ${lispsource}, so
- we also use ${lisp} rather than ${shortlisp} for the dependency since
- the Makefile uses string equality to decide when we talk about identical
- files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile
- only in order to reduce the command line length. --Stef */
-${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP}
- -rm -f ${etc}DOC
- ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
- ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
-
-${libsrc}make-docfile${EXEEXT}:
- cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT}
-
-buildobj.h: Makefile
- echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
-
-temacs${EXEEXT}: $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
-#ifdef NS_IMPL_GNUSTEP
- $(CC) -rdynamic YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
- -L@GNUSTEP_SYSTEM_LIBRARIES@ -lgnustep-gui -lgnustep-base \
- -lobjc $(CONFIG_SYSTEM_LIBS) -lpthread ) -o temacs \
- ${obj} ${otherobj} ${LIBES}
-#else
- $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
- -o temacs ${STARTFILES} ${obj} ${otherobj} \
- ${LIBES}
-#endif
-
-/* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
- often contain options that have to do with using Emacs''s crt0,
- which are only good with temacs. */
-prefix-args${EXEEXT}: prefix-args.o $(config_h)
- $(CC) $(LDFLAGS) prefix-args.o -o prefix-args
-
-#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (USE_GTK)
-
-/* We use stamp-xmenu with these two deps
- to both ensure that lwlib gets remade based on its dependencies
- in its own makefile,
- and remake temacs if lwlib gets changed by this. */
-stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU)
- touch stamp-oldxmenu
-/* Supply an ordering for parallel make. */
-../src/$(OLDXMENU): ${OLDXMENU}
-
-/* Encode the values of these two macros in Make variables,
- so we can use $(...) to substitute their values within "...". */
-C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
-C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
-C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
-C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
-C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
-
-#ifdef USE_X_TOOLKIT
-$(OLDXMENU): really-lwlib
-
-really-lwlib:
- cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
- CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
- "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
- "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
- "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
- "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
- "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
- @true /* make -t should not create really-lwlib. */
-.PHONY: really-lwlib
-#else /* not USE_X_TOOLKIT */
-$(OLDXMENU): really-oldXMenu
-
-really-oldXMenu:
- cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
- CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
- "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
- "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
- "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
- "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
- "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
- @true /* make -t should not create really-oldXMenu. */
-.PHONY: really-oldXMenu
-#endif /* not USE_X_TOOLKIT */
-#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
-
-/* We don''t really need this, but satisfy the dependency. */
-stamp-oldxmenu:
- touch stamp-oldxmenu
-#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
-
-../config.status:: epaths.in
- @echo "The file epaths.h needs to be set up from epaths.in."
- @echo "Please run the `configure' script again."
- exit 1
-
-../config.status:: config.in
- @echo "The file config.h needs to be set up from config.in."
- @echo "Please run the `configure' script again."
- exit 1
-
-ecrt0.o: ecrt0.c $(config_h)
-#ifdef AUTO_DEPEND
- @-test -d deps || mkdir deps
-#endif
- CRT0_COMPILE ${srcdir}/ecrt0.c
-doc.o: buildobj.h
-
-#ifndef AUTO_DEPEND
-
-atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
- $(config_h)
-buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
- $(INTERVALS_H) blockinput.h atimer.h systime.h character.h \
- indent.h keyboard.h coding.h keymap.h frame.h lisp.h $(config_h)
-callint.o: callint.c window.h commands.h buffer.h keymap.h \
- keyboard.h dispextern.h systime.h coding.h composite.h lisp.h $(config_h)
-callproc.o: callproc.c epaths.h buffer.h commands.h lisp.h $(config_h) \
- process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
- composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h \
- buffer.h
-casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
- composite.h keymap.h lisp.h $(config_h)
-casetab.o: casetab.c buffer.h character.h lisp.h $(config_h)
-category.o: category.c category.h buffer.h charset.h keymap.h \
- character.h lisp.h $(config_h)
-ccl.o: ccl.c ccl.h charset.h character.h coding.h composite.h lisp.h $(config_h)
-character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
- lisp.h $(config_h)
-charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
- disptab.h lisp.h $(config_h)
-chartab.o: charset.h character.h ccl.h lisp.h $(config_h)
-coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h composite.h \
- window.h dispextern.h frame.h termhooks.h lisp.h $(config_h)
-cm.o: cm.c frame.h cm.h termhooks.h termchar.h dispextern.h lisp.h $(config_h)
-cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h $(config_h) \
- msdos.h dispextern.h keyboard.h keymap.h systime.h coding.h frame.h \
- composite.h
-pre-crt0.o: pre-crt0.c
-dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
-dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
- coding.h regex.h systime.h blockinput.h atimer.h composite.h
-dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
- window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
- disptab.h indent.h $(INTERVALS_H) \
- xterm.h blockinput.h atimer.h character.h msdos.h keyboard.h \
- syssignal.h lisp.h $(config_h)
-doc.o: doc.c lisp.h $(config_h) epaths.h buffer.h keyboard.h keymap.h \
- character.h systime.h coding.h composite.h
-doprnt.o: doprnt.c character.h lisp.h $(config_h)
-dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
- msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
- lisp.h $(config_h)
-editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
- coding.h frame.h blockinput.h atimer.h lisp.h $(config_h)
-emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
- termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
- window.h dispextern.h keyboard.h keymap.h frame.h coding.h
-fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
- coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h commands.h
-filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
- lisp.h $(config_h)
-filemode.o: filemode.c $(config_h)
-frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
- blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \
- msdos.h dosfns.h dispextern.h w32term.h termchar.h coding.h composite.h \
- lisp.h $(config_h) termhooks.h ccl.h
-fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhooks.h \
- blockinput.h atimer.h systime.h lisp.h $(config_h)
-font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
- font.h lisp.h $(config_h) buffer.h composite.h fontset.h xterm.h
-ftfont.o: dispextern.h frame.h character.h charset.h composite.h font.h \
- lisp.h $(config_h) blockinput.h atimer.h systime.h coding.h fontset.h \
- ccl.h ftfont.h
-fontset.o: fontset.c fontset.h ccl.h buffer.h character.h \
- charset.h frame.h keyboard.h termhooks.h font.h lisp.h $(config_h) \
- blockinput.h atimer.h systime.h coding.h $(INTERVALS_H) window.h xterm.h
-getloadavg.o: getloadavg.c $(config_h)
-gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h lisp.h $(config_h) \
- blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
- charset.h coding.h syssignal.h dispextern.h composite.h
-image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
- systime.h xterm.h w32term.h w32gui.h font.h epaths.h character.h coding.h \
- nsterm.h nsgui.h lisp.h $(config_h) composite.h termhooks.h ccl.h
-indent.o: indent.c frame.h window.h indent.h buffer.h lisp.h $(config_h) termchar.h \
- termopts.h disptab.h region-cache.h character.h category.h \
- keyboard.h systime.h coding.h $(INTERVALS_H)
-insdel.o: insdel.c window.h buffer.h $(INTERVALS_H) blockinput.h character.h \
- dispextern.h atimer.h systime.h region-cache.h lisp.h $(config_h)
-keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
- commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
- systime.h syntax.h $(INTERVALS_H) blockinput.h atimer.h composite.h \
- xterm.h puresize.h msdos.h keymap.h w32term.h nsterm.h coding.h \
- lisp.h $(config_h)
-keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
- atimer.h systime.h puresize.h character.h charset.h $(INTERVALS_H) keymap.h window.h \
- coding.h frame.h lisp.h $(config_h)
-lastfile.o: lastfile.c $(config_h)
-macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
- dispextern.h lisp.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 $(config_h)
-marker.o: marker.c buffer.h character.h lisp.h $(config_h)
-md5.o: md5.c md5.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 \
- termhooks.h lisp.h $(config_h) coding.h
-mktime.o: mktime.c $(config_h)
-msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
- termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
- keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h lisp.h $(config_h)
-nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
- dispextern.h nsgui.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \
- atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h)
-nsfont.o: nsterm.h dispextern.h frame.h lisp.h lisp.h $(config_h)
-nsimage.o: nsimage.m nsterm.h lisp.h $(config_h)
-nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
- nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
- nsterm.h lisp.h $(config_h)
-nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h nsterm.h \
- nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h \
- termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
- $(INTERVALS_H) process.h coding.h lisp.h $(config_h)
-nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h lisp.h $(config_h)
-process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
- commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
- blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
- keyboard.h lisp.h $(config_h) character.h xgselect.h sysselect.h
-regex.o: regex.c syntax.h buffer.h lisp.h $(config_h) regex.h category.h character.h
-region-cache.o: region-cache.c buffer.h region-cache.h lisp.h $(config_h)
-scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
- termhooks.h lisp.h $(config_h) systime.h coding.h composite.h window.h
-search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
- blockinput.h atimer.h systime.h category.h character.h charset.h \
- $(INTERVALS_H) \
- lisp.h $(config_h)
-sound.o: sound.c dispextern.h syssignal.h lisp.h $(config_h) atimer.h systime.h
-strftime.o: strftime.c $(config_h)
-syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
- keymap.h regex.h $(INTERVALS_H) lisp.h $(config_h)
-sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
- process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \
- frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h $(config_h) \
- composite.h
-term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) cm.h frame.h \
- disptab.h keyboard.h character.h charset.h coding.h ccl.h xterm.h \
- msdos.h window.h keymap.h blockinput.h atimer.h systime.h systty.h \
- syssignal.h $(INTERVALS_H) buffer.h
-termcap.o: termcap.c lisp.h $(config_h)
-terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
- keyboard.h lisp.h $(config_h) dispextern.h composite.h systime.h
-terminfo.o: terminfo.c lisp.h $(config_h)
-tparam.o: tparam.c lisp.h $(config_h)
-undo.o: undo.c buffer.h commands.h window.h dispextern.h lisp.h $(config_h)
-unexaix.o: unexaix.c lisp.h $(config_h)
-unexalpha.o: unexalpha.c $(config_h)
-unexcw.o: unexcw.c lisp.h $(config_h)
-unexec.o: unexec.c lisp.h $(config_h)
-unexelf.o: unexelf.c $(config_h)
-unexhp9k800.o: unexhp9k800.c $(config_h)
-unexmacosx.o: unexmacosx.c $(config_h)
-unexsol.o: unexsol.c lisp.h $(config_h)
-unexw32.o: unexw32.c $(config_h)
-w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
- msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
-widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
- $(srcdir)/../lwlib/lwlib.h lisp.h $(config_h)
-window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
- disptab.h keyboard.h msdos.h coding.h termhooks.h \
- keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \
- xterm.h w32term.h nsterm.h lisp.h $(config_h)
-xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
- coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
- charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h xterm.h \
- w32term.h nsterm.h msdos.h composite.h fontset.h ccl.h \
- blockinput.h atimer.h systime.h keymap.h font.h
-xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
- window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
- systime.h keyboard.h fontset.h w32term.h nsterm.h coding.h ccl.h \
- $(INTERVALS_H) termchar.h termhooks.h font.h lisp.h $(config_h)
-xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
- $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
- character.h charset.h coding.h gtkutil.h lisp.h $(config_h) termhooks.h \
- fontset.h termchar.h font.h xsettings.h $(INTERVALS_H) ccl.h
-xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
-xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h ftfont.h
-ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
- font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
-menu.o: menu.c lisp.h keyboard.h keymap.h frame.h termhooks.h blockinput.h \
- dispextern.h $(srcdir)/../lwlib/lwlib.h xterm.h gtkutil.h menu.h \
- lisp.h $(config_h) systime.h coding.h composite.h window.h atimer.h
-xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
- charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
- systime.h gtkutil.h msdos.h coding.h menu.h lisp.h $(config_h) composite.h \
- keymap.h sysselect.h
-xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
- dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
- keyboard.h emacs-icon.h character.h charset.h ccl.h fontset.h composite.h \
- coding.h process.h gtkutil.h font.h fontset.h lisp.h $(config_h) \
- xsettings.h intervals.h keymap.h xgselect.h sysselect.h
-xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
- buffer.h atimer.h systime.h termhooks.h lisp.h $(config_h) keyboard.h \
- coding.h composite.h
-xgselect.o: xgselect.h systime.h sysselect.h lisp.h $(config_h)
-xrdb.o: xrdb.c lisp.h $(config_h) epaths.h
-xsmfns.o: xsmfns.c lisp.h $(config_h) systime.h sysselect.h termhooks.h xterm.h \
- lisp.h termopts.h frame.h dispextern.h
-xsettings.o: xterm.h xsettings.h lisp.h frame.h termhooks.h $(config_h) \
- dispextern.h keyboard.h systime.h coding.h composite.h blockinput.h atimer.h \
- termopts.h
-/* The files of Lisp proper */
-
-alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h \
- keyboard.h blockinput.h atimer.h systime.h character.h lisp.h $(config_h) \
- $(INTERVALS_H) termhooks.h
-bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
- frame.h xterm.h lisp.h $(config_h)
-data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
- termhooks.h systime.h coding.h composite.h dispextern.h font.h ccl.h \
- lisp.h $(config_h)
-eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
- dispextern.h lisp.h $(config_h) coding.h composite.h xterm.h
-floatfns.o: floatfns.c syssignal.h lisp.h $(config_h)
-fns.o: fns.c commands.h lisp.h $(config_h) frame.h buffer.h character.h keyboard.h \
- keymap.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \
- blockinput.h atimer.h systime.h xterm.h
-print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
- lisp.h $(config_h) termchar.h $(INTERVALS_H) msdos.h termhooks.h \
- blockinput.h atimer.h systime.h font.h charset.h coding.h ccl.h
-lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
- charset.h lisp.h $(config_h) $(INTERVALS_H) termhooks.h coding.h msdos.h \
- systime.h frame.h blockinput.h atimer.h
-
-/* Text properties support */
-composite.o: composite.c buffer.h character.h coding.h font.h ccl.h \
- frame.h termhooks.h $(INTERVALS_H) window.h lisp.h $(config_h)
-intervals.o: intervals.c buffer.h $(INTERVALS_H) keyboard.h puresize.h \
- keymap.h lisp.h $(config_h) systime.h coding.h
-textprop.o: textprop.c buffer.h window.h $(INTERVALS_H) \
- lisp.h $(config_h)
-
-#endif /* ! AUTO_DEPEND */
-
-/* System-specific programs to be made.
- OTHER_FILES
- select which of these should be compiled. */
-
-#ifdef HAVE_NS
-/* In fact, every .o file depends directly or indirectly on dispextern.h
- and hence nsgui.h under NS. But the ones that actually use stuff there
- are more limited. */
-dispnew.o font.o fontset.o frame.o fringe.o image.o keyboard.o menu.o \
- window.o xdisp.o xfaces.o: nsgui.h
-
-${ns_appdir}: ${ns_appsrc}
- rm -fr ${ns_appdir}
- mkdir -p ${ns_appdir}
- ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; tar xf - )
- ( cd ${ns_appdir} ; for subdir in `find . -type d ! -name CVS -print` ; do \
- chmod a+rx $${subdir} ; \
- rm -rf $${subdir}/CVS ; \
- rm -f $${subdir}/.cvsignore ; done ; )
-
-${ns_appbindir}Emacs: emacs${EXEEXT}
- mkdir -p ${ns_appbindir}
- cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
-
-ns-app: ${ns_appdir} ${ns_appbindir}Emacs
-
-#endif /* HAVE_NS */
-
-mostlyclean:
- rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
- rm -f ../etc/DOC
- rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
- rm -f buildobj.h
-clean: mostlyclean
- rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
- -rm -rf deps
-#ifdef HAVE_NS
- rm -fr ${ns_appdir}
-#endif
-/* bootstrap-clean is used to clean up just before a bootstrap.
- It should remove all files generated during a compilation/bootstrap,
- but not things like config.status or TAGS. */
-bootstrap-clean: clean
- rm -f epaths.h config.h Makefile.c config.stamp stamp-oldxmenu ../etc/DOC-*
- if test -f ./.gdbinit; then \
- mv ./.gdbinit ./.gdbinit.save; \
- if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; \
- else mv ./.gdbinit.save ./.gdbinit; fi; \
- fi
-/**/# This is used in making a distribution.
-/**/# Do not use it on development directories!
-distclean: bootstrap-clean
- rm -f Makefile
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f TAGS
-versionclean:
- -rm -f emacs${EXEEXT} emacs-*.*.*${EXEEXT} ../etc/DOC*
-extraclean: distclean
- -rm -f *~ \#* m/?*~ s/?*~
-
-/* Arrange to make a tags table TAGS-LISP for ../lisp,
- plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
-
-ctagsfiles1 = [xyzXYZ]*.[hcm]
-ctagsfiles2 = [a-wA-W]*.[hcm]
-
-TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
- ../lib-src/etags --include=TAGS-LISP --include=${lwlibdir}/TAGS \
- --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
- $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
-frc:
-TAGS-LISP: frc
- $(MAKE) -f ${lispdir}Makefile TAGS-LISP ETAGS=../lib-src/etags
-
-$(lwlibdir)TAGS:
- (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)Makefile tags ETAGS=../lib-src/etags)
-
-tags: TAGS TAGS-LISP $(lwlibdir)TAGS
-.PHONY: tags
-
-
-/* Bootstrapping. */
-/* Bootstrapping right is difficult because of the circular dependencies.
- Furthermore, we have to deal with the fact that many compilation targets
- such as loaddefs.el or *.elc can typically be produced by any old
- Emacs executable, so we would like to avoid rebuilding them whenever
- we build a new Emacs executable.
- To solve the circularity, we use 2 different Emacs executables,
- "emacs" is the main target and "bootstrap-emacs" is the one used
- to build the *.elc and loaddefs.el files.
- To solve the freshness issue, we used to use a third file "witness-emacs"
- which was used to witness the fact that there is a bootstrap-emacs
- executable, and then have dependencies on witness-emacs rather than
- bootstrap-emacs, but that lead to problems in parallel builds (because
- witness-emacs needed to be free from dependencies (to avoid rebuilding
- it), so it was compiled in parallel, leading typically to having 2
- processes dumping bootstrap-emacs at the same time).
- So instead, we replace the witness-emacs dependencies by conditional
- bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do
- not want to rely on GNU Make features, we have to rely on an external
- script to do the conditional part of the dependency
- (i.e. see the ${SUBDIR} rule ../Makefile.in). */
-
-.SUFFIXES: .elc .el
-
-/* These suffix rules do not allow additional dependencies, sadly, so
- instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
- separately below.
- With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" */
-.el.elc:
- @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
- THEFILE=$< EMACS=${bootstrap_exe}
-
-/* Since the .el.elc rule cannot specify an extra dependency, we do it here. */
-${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS)
-
-${lispsource}loaddefs.el: $(BOOTSTRAPEMACS)
- cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=${bootstrap_exe}
-
-/* Dump an Emacs executable named bootstrap-emacs containing the
- files from loadup.el in source form. */
-
-bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
- cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
-#ifdef CANNOT_DUMP
- ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}
-#else
- $(RUN_TEMACS) --batch --load loadup bootstrap
- mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
-#endif /* ! defined (CANNOT_DUMP) */
- @: Compile some files earlier to speed up further compilation.
- cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
-
-#ifdef AUTO_DEPEND
-ALLOBJS=$(STARTFILES) ${obj} ${otherobj} prefix-args.o
--include $(ALLOBJS:%.o=deps/%.d)
-#endif
+# Makefile for GNU Emacs.
+# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# 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/>.
+
+
+# Note that this file is edited by msdos/sed1v2.inp for MSDOS. That
+# script may need modifying in sync with changes made here. Try to
+# avoid shell-ism because the DOS build has to use the DOS shell.
+
+# Don't try to replace the cpp processing using autoconf facilities,
+# says rms.
+# Replacing a particular part of the conditionals to work via autoconf
+# is OK.
+# Some of the conditionals might be dead now. Finding them and
+# deleting them would be fine.
+
+SHELL = /bin/sh
+
+# Here are the things that we expect ../configure to edit.
+# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
+srcdir = @srcdir@
+abs_builddir = @abs_builddir@
+VPATH = $(srcdir)
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+EXEEXT = @EXEEXT@
+version = @version@
+# Substitute an assignment for the MAKE variable, because
+# BSD doesn't have it as a default.
+@SET_MAKE@
+# Don't use LIBS. configure puts stuff in it that either shouldn't be
+# linked with Emacs or is duplicated by the cpp stuff below.
+# LIBS = @LIBS@
+LIBOBJS = @LIBOBJS@
+
+lispsource = ${srcdir}/../lisp/
+libsrc = ../lib-src/
+etc = ../etc/
+oldXMenudir = ../oldXMenu/
+lwlibdir = ../lwlib/
+lispdir = ../lisp/
+
+# Configuration files for .o files to depend on.
+M_FILE = ${srcdir}/@machfile@
+S_FILE = ${srcdir}/@opsysfile@
+config_h = config.h $(M_FILE) $(S_FILE)
+
+bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
+
+## ns-app if HAVE_NS, else empty.
+OTHER_FILES = @OTHER_FILES@
+
+CRT_DIR=@CRT_DIR@
+
+## Machine-specific CFLAGS.
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
+## System-specific CFLAGS.
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+
+## Currently only set if NS_IMPL_GNUSTEP.
+## C_SWITCH_X_SITE may override this.
+C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@
+
+## Define C_SWITCH_X_SITE to contain any special flags your compiler
+## may need to deal with X Windows. For instance, if you've defined
+## HAVE_X_WINDOWS and your X include files aren't in a place that your
+## compiler can find on its own, you might want to add "-I/..." or
+## something similar. This is normally set by configure.
+## This is used before C_SWITCH_X_SYSTEM and may override it.
+C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
+
+## Define LD_SWITCH_X_SITE to contain any special flags your loader
+## may need to deal with X Windows. For instance, if your X libraries
+## aren't in a place that your loader can find on its own, you might
+## want to add "-L/..." or something similar. Only used if
+## HAVE_X_WINDOWS.
+## FIXME? configure sets a value for this, but it has never been
+## substituted in this or any other Makefile. Cf C_SWITCH_X_SITE.
+LD_SWITCH_X_SITE=
+
+## 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.
+LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
+
+## Next two must come before LD_SWITCH_SYSTEM.
+## If needed, a -R option that says where to find X windows at run time.
+LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@
+## As above, but using -rpath instead.
+LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@
+
+## System-specific LDFLAGS.
+LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
+LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@
+
+## Flags to pass to ld only for temacs.
+TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS)
+
+## $LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
+TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
+
+## 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@
+
+LD=@LINKER@
+
+## May use $CRT_DIR.
+LIB_STANDARD=@LIB_STANDARD@
+
+## -lm, or empty.
+LIB_MATH=@LIB_MATH@
+
+LIBTIFF=@LIBTIFF@
+LIBJPEG=@LIBJPEG@
+LIBPNG=@LIBPNG@
+LIBGIF=@LIBGIF@
+LIBXPM=@LIBXPM@
+XFT_LIBS=@XFT_LIBS@
+LIBX_EXTRA=$(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS)
+
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+LIBOTF_CFLAGS = @LIBOTF_CFLAGS@
+LIBOTF_LIBS = @LIBOTF_LIBS@
+M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@
+M17N_FLT_LIBS = @M17N_FLT_LIBS@
+
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DBUS_OBJ = @DBUS_OBJ@
+
+GCONF_CFLAGS = @GCONF_CFLAGS@
+GCONF_LIBS = @GCONF_LIBS@
+
+GTK_OBJ=@GTK_OBJ@
+
+## -ltermcap, or -lncurses, or -lcurses, or "".
+LIBS_TERMCAP=@LIBS_TERMCAP@
+## terminfo.o if TERMINFO, else tparam.o.
+TERMCAP_OBJ=@TERMCAP_OBJ@
+
+LIBXMU=@LIBXMU@
+
+LIBXSM=@LIBXSM@
+
+LIBXTR6=@LIBXTR6@
+
+## $(LIBXMU) -lXt $(LIBXTR6) -lXext if USE_X_TOOLKIT, else $(LIBXSM).
+## Only used if HAVE_X_WINDOWS.
+LIBXT_OTHER=@LIBXT_OTHER@
+
+## If !HAVE_X11 || USE_GTK, empty.
+## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu.
+OLDXMENU_TARGET=@OLDXMENU_TARGET@
+
+## If !HAVE_X11 || USE_GTK, empty.
+## Else if USE_X_TOOLKIT, ${lwlibdir}liblw.a.
+## Else ${oldXMenudir}libXMenu11.a.
+## (Actually, rather than being empty, it is set to "nothing".
+## It is never actually used for anything in this case.
+## This is done because there is a rule with target $(OLDXMENU) below,
+## and I think it might be a syntax error with some makes to have
+## an empty target, even if the associated rule is never run.
+## http://lists.gnu.org/archive/html/help-make/2010-05/msg00058.html
+## The alternative would be to put that rule in a makefile fragment.)
+OLDXMENU=@OLDXMENU@
+
+## If HAVE_X11 && !USE_GTK, ${OLDXMENU} ../src/${OLDXMENU}; else empty.
+## We use stamp-xmenu with these two deps to both ensure that lwlib
+## gets remade based on its dependencies in its own makefile,
+## and remake temacs if lwlib gets changed by this.
+OLDXMENU_DEPS=@OLDXMENU_DEPS@
+
+## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
+## Else if !HAVE_X11 || USE_GTK, empty.
+## Else $(OLDXMENU).
+LIBXMENU=@LIBXMENU@
+
+XMENU_OBJ=@XMENU_OBJ@
+XOBJ=@XOBJ@
+
+TOOLKIT_LIBW=@TOOLKIT_LIBW@
+
+## Only used if HAVE_X11, in LIBX_OTHER.
+LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
+
+## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
+LIBX_OTHER=@LIBX_OTHER@
+
+## LIBXMENU is nil if !HAVE_X_WINDOWS.
+## LD_SWITCH_X_SITE should not be used if not using X, but nothing
+## sets it at present, and if something ever does, it should be
+## configure, which should set it to nil in non-X builds.
+LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
+
+LIBSOUND= @LIBSOUND@
+CFLAGS_SOUND= @CFLAGS_SOUND@
+
+RSVG_LIBS= @RSVG_LIBS@
+RSVG_CFLAGS= @RSVG_CFLAGS@
+
+## widget.o if USE_X_TOOLKIT, otherwise empty.
+WIDGET_OBJ=@WIDGET_OBJ@
+
+## sheap.o if CYGWIN, otherwise empty.
+CYGWIN_OBJ=@CYGWIN_OBJ@
+
+## dosfns.o msdos.o w16select.o if MSDOS.
+MSDOS_OBJ =
+## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
+MSDOS_X_OBJ =
+MSDOS_SUPPORT_REAL = ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
+ ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
+ ${lispsource}term/internal.elc ${lispsource}term/pc-win.elc
+## $MSDOS_SUPPORT_REAL if MSDOS.
+MSDOS_SUPPORT =
+
+ns_appdir=@ns_appdir@
+ns_appbindir=@ns_appbindir@
+ns_appsrc=@ns_appsrc@
+NS_OBJ=@NS_OBJ@
+NS_SUPPORT=@NS_SUPPORT@
+## Only set if NS_IMPL_GNUSTEP.
+GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
+
+## Empty if !HAVE_X_WINDOWS
+## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
+## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
+## else xfont.o
+FONT_OBJ=@FONT_OBJ@
+
+## Used if HAVE_MOUSE.
+REAL_MOUSE_SUPPORT=${lispsource}mouse.elc ${lispsource}select.elc \
+ ${lispsource}scroll-bar.elc
+## Used if HAVE_GPM && !HAVE_MOUSE
+GPM_MOUSE_SUPPORT=${lispsource}mouse.elc
+LIBGPM = @LIBGPM@
+## Either of the two preceding options, or empty.
+MOUSE_SUPPORT=@MOUSE_SUPPORT@
+
+## ${lispsource}tooltip.elc if HAVE_WINDOW_SYSTEM, else empty.
+TOOLTIP_SUPPORT=@TOOLTIP_SUPPORT@
+
+BASE_WINDOW_SUPPORT=${lispsource}fringe.elc ${lispsource}image.elc \
+ ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
+ ${lispsource}tool-bar.elc ${lispsource}mwheel.elc
+
+X_WINDOW_SUPPORT=${lispsource}x-dnd.elc ${lispsource}term/common-win.elc \
+ ${lispsource}term/x-win.elc ${lispsource}dynamic-setting.elc
+
+## If HAVE_X_WINDOWS, both the above
+## else if HAVE_WINDOW_SYSTEM (ie, HAVE_NS) just the former; else empty.
+WINDOW_SUPPORT=@WINDOW_SUPPORT@
+
+## -lresolv, or empty.
+LIBRESOLV = @LIBRESOLV@
+
+LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
+
+INTERVALS_H = dispextern.h intervals.h composite.h
+
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+
+RUN_TEMACS = `/bin/pwd`/temacs
+
+START_FILES = @START_FILES@
+
+UNEXEC_OBJ = @unexec@
+
+CANNOT_DUMP=@cannot_dump@
+
+DEPDIR=deps
+## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty.
+DEPFLAGS=@DEPFLAGS@
+## test -d ${DEPDIR} || mkdir ${DEPDIR} (if AUTO_DEPEND); else ':'.
+MKDEPDIR=@MKDEPDIR@
+
+# ========================== start of cpp stuff =======================
+/* From here on, comments must be done in C syntax. */
+
+#define NOT_C_CODE
+#include "config.h"
+
+/* If NS_IMPL_GNUSTEP, some definitions and includes are expanded here. */
+@NS_IMPL_GNUSTEP_INC@
+
+/* FIXME move to LD_SWITCH_SYSTEM_TEMACS?
+ This uses ${CONFIG_SYSTEM_LIBS}, presumably set by the above include. */
+NS_IMPL_GNUSTEP_TEMACS_LDFLAGS=@NS_IMPL_GNUSTEP_TEMACS_LDFLAGS@
+
+/* DO NOT use -R. There is a special hack described in lastfile.c
+ which is used instead. Some initialized data areas are modified
+ at initial startup, then labeled as part of the text area when
+ Emacs is dumped for the first time, and never changed again. */
+
+/* -Demacs is needed to make some files produce the correct version
+ for use in Emacs.
+
+ -DHAVE_CONFIG_H is needed for some other files to take advantage of
+ the information in ``config.h''. */
+
+/* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM
+ since it may have -I options that should override those. */
+/* MYCPPFLAGS only referenced in etc/DEBUG. */
+ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} ${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS}
+ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
+
+.SUFFIXES: .m
+.c.o:
+ @$(MKDEPDIR)
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
+.m.o:
+ @$(MKDEPDIR)
+ $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
+
+
+/* lastfile must follow all files whose initialized data areas should
+ be dumped as pure by dump-emacs. */
+obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
+ charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
+ cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
+ emacs.o keyboard.o macros.o keymap.o sysdep.o \
+ buffer.o filelock.o insdel.o marker.o \
+ minibuf.o fileio.o dired.o filemode.o \
+ cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
+ alloc.o data.o doc.o editfns.o callint.o \
+ eval.o floatfns.o fns.o font.o print.o lread.o \
+ syntax.o $(UNEXEC_OBJ) bytecode.o \
+ process.o callproc.o \
+ region-cache.o sound.o atimer.o \
+ doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
+ $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
+
+/* Object files used on some machine or other.
+ These go in the DOC file on all machines in case they are needed. */
+SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
+ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
+ fontset.o dbusbind.o \
+ nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
+ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
+ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_OBJ)
+
+/* gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty. */
+GMALLOC_OBJ=@GMALLOC_OBJ@
+
+/* vm-limit.o if !SYSTEM_MALLOC, else empty. */
+VMLIMIT_OBJ=@VMLIMIT_OBJ@
+
+/* ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty. */
+RALLOC_OBJ=@RALLOC_OBJ@
+
+/* Empty on Cygwin, lastfile.o elsewhere. */
+PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
+/* lastfile.o on Cygwin, empty elsewhere. */
+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)
+
+/* This is the platform-specific list of Lisp files loaded into the
+ dumped Emacs. It is arranged like this because it is easier to generate
+ it semi-mechanically from loadup.el this way.
+
+ Note that this list should not include lisp files which might not
+ be present, like site-load.el and site-init.el; this makefile
+ expects them all to be either present or buildable.
+
+ Files which are loaded unconditionally (i.e., on all platforms) should
+ also be in shortlisp. Files which are loaded conditionally (i.e., only
+ on some platforms) should instead be in SOME_MACHINE_LISP. */
+
+/* Place loaddefs.el first, so it gets generated first, since it is on
+ the critical path (relevant in parallel compilations). */
+
+lisp= \
+ ${lispsource}loaddefs.el \
+ ${lispsource}abbrev.elc \
+ ${lispsource}buff-menu.elc \
+ ${lispsource}button.elc \
+ ${lispsource}emacs-lisp/byte-run.elc \
+ ${lispsource}composite.elc \
+ ${lispsource}cus-face.elc \
+ ${lispsource}cus-start.elc \
+ ${lispsource}custom.elc \
+ ${lispsource}emacs-lisp/backquote.elc \
+ ${lispsource}emacs-lisp/lisp-mode.elc \
+ ${lispsource}emacs-lisp/lisp.elc \
+ ${lispsource}env.elc \
+ ${lispsource}faces.elc \
+ ${lispsource}files.elc \
+ ${lispsource}format.elc \
+ ${lispsource}facemenu.elc \
+ ${MOUSE_SUPPORT} \
+ ${lispsource}emacs-lisp/float-sup.elc \
+ ${lispsource}frame.elc \
+ ${lispsource}help.elc \
+ ${lispsource}indent.elc \
+ ${lispsource}isearch.elc \
+ ${lispsource}rfn-eshadow.elc \
+ ${lispsource}loadup.el \
+ ${lispsource}bindings.elc \
+ ${lispsource}emacs-lisp/map-ynp.elc \
+ ${lispsource}menu-bar.elc \
+ ${lispsource}international/mule.elc \
+ ${lispsource}international/mule-conf.elc \
+ ${lispsource}international/mule-cmds.elc \
+ ${lispsource}international/characters.elc \
+ ${lispsource}international/charprop.el \
+ ${lispsource}case-table.elc \
+ ${lispsource}language/chinese.elc \
+ ${lispsource}language/cyrillic.elc \
+ ${lispsource}language/indian.elc \
+ ${lispsource}language/sinhala.el \
+ ${lispsource}language/english.el \
+ ${lispsource}language/ethiopic.elc \
+ ${lispsource}language/european.elc \
+ ${lispsource}language/czech.el \
+ ${lispsource}language/slovak.el \
+ ${lispsource}language/romanian.el \
+ ${lispsource}language/greek.el \
+ ${lispsource}language/hebrew.el \
+ ${lispsource}language/japanese.el \
+ ${lispsource}language/korean.el \
+ ${lispsource}language/lao.el \
+ ${lispsource}language/cham.el \
+ ${lispsource}language/tai-viet.el \
+ ${lispsource}language/thai.el \
+ ${lispsource}language/tibetan.elc \
+ ${lispsource}language/vietnamese.elc \
+ ${lispsource}language/misc-lang.el \
+ ${lispsource}language/utf-8-lang.el \
+ ${lispsource}language/georgian.el \
+ ${lispsource}language/khmer.el \
+ ${lispsource}language/burmese.el \
+ ${lispsource}paths.el \
+ ${lispsource}register.elc \
+ ${lispsource}replace.elc \
+ ${lispsource}simple.elc \
+ ${lispsource}minibuffer.elc \
+ ${lispsource}startup.elc \
+ ${lispsource}subr.elc \
+ ${lispsource}term/tty-colors.elc \
+ ${lispsource}font-core.elc \
+ ${lispsource}emacs-lisp/syntax.elc \
+ ${lispsource}font-lock.elc \
+ ${lispsource}jit-lock.elc \
+ ${lispsource}textmodes/fill.elc \
+ ${lispsource}textmodes/page.elc \
+ ${lispsource}textmodes/paragraphs.elc \
+ ${lispsource}textmodes/text-mode.elc \
+ ${lispsource}emacs-lisp/timer.elc \
+ ${lispsource}jka-cmpr-hook.elc \
+ ${lispsource}vc-hooks.elc \
+ ${lispsource}ediff-hook.elc \
+ ${lispsource}epa-hook.elc \
+ ${TOOLTIP_SUPPORT} \
+ ${MSDOS_SUPPORT} \
+ ${WINDOW_SUPPORT} \
+ ${NS_SUPPORT} \
+ ${lispsource}widget.elc \
+ ${lispsource}window.elc \
+ ${lispsource}version.el
+
+/* List of relative names for those files from $lisp that are loaded
+ unconditionally (i.e. on all platforms). Files from $lisp that
+ are only loaded on some platforms should instead be placed in
+ SOME_MACHINE_LISP. The only reason this variable exists is to prevent
+ the make-docfile command-line getting too long for some systems. */
+shortlisp= \
+ ../lisp/loaddefs.el \
+ ../lisp/abbrev.elc \
+ ../lisp/buff-menu.elc \
+ ../lisp/button.elc \
+ ../lisp/emacs-lisp/byte-run.elc \
+ ../lisp/composite.elc \
+ ../lisp/cus-face.elc \
+ ../lisp/cus-start.elc \
+ ../lisp/custom.elc \
+ ../lisp/emacs-lisp/backquote.elc \
+ ../lisp/emacs-lisp/lisp-mode.elc \
+ ../lisp/emacs-lisp/lisp.elc \
+ ../lisp/facemenu.elc \
+ ../lisp/faces.elc \
+ ../lisp/files.elc \
+ ../lisp/emacs-lisp/float-sup.elc \
+ ../lisp/format.elc \
+ ../lisp/frame.elc \
+ ../lisp/help.elc \
+ ../lisp/indent.elc \
+ ../lisp/isearch.elc \
+ ../lisp/rfn-eshadow.elc \
+ ../lisp/loadup.el \
+ ../lisp/bindings.elc \
+ ../lisp/emacs-lisp/map-ynp.elc \
+ ../lisp/env.elc \
+ ../lisp/international/mule.elc \
+ ../lisp/international/mule-conf.elc \
+ ../lisp/international/mule-cmds.elc \
+ ../lisp/international/characters.elc \
+ ../lisp/case-table.elc \
+ ../lisp/language/chinese.elc \
+ ../lisp/language/cyrillic.elc \
+ ../lisp/language/indian.elc \
+ ../lisp/language/sinhala.el \
+ ../lisp/language/english.el \
+ ../lisp/language/ethiopic.elc \
+ ../lisp/language/european.elc \
+ ../lisp/language/czech.el \
+ ../lisp/language/slovak.el \
+ ../lisp/language/romanian.el \
+ ../lisp/language/greek.el \
+ ../lisp/language/hebrew.el \
+ ../lisp/language/japanese.el \
+ ../lisp/language/korean.el \
+ ../lisp/language/lao.el \
+ ../lisp/language/cham.el \
+ ../lisp/language/tai-viet.el \
+ ../lisp/language/thai.el \
+ ../lisp/language/tibetan.elc \
+ ../lisp/language/vietnamese.elc \
+ ../lisp/language/misc-lang.el \
+ ../lisp/language/utf-8-lang.el \
+ ../lisp/language/georgian.el \
+ ../lisp/language/khmer.el \
+ ../lisp/language/burmese.el \
+ ../lisp/menu-bar.elc \
+ ../lisp/paths.el \
+ ../lisp/register.elc \
+ ../lisp/replace.elc \
+ ../lisp/simple.elc \
+ ../lisp/minibuffer.elc \
+ ../lisp/startup.elc \
+ ../lisp/subr.elc \
+ ../lisp/term/tty-colors.elc \
+ ../lisp/font-core.elc \
+ ../lisp/emacs-lisp/syntax.elc \
+ ../lisp/font-lock.elc \
+ ../lisp/jit-lock.elc \
+ ../lisp/textmodes/fill.elc \
+ ../lisp/textmodes/page.elc \
+ ../lisp/textmodes/paragraphs.elc \
+ ../lisp/textmodes/text-mode.elc \
+ ../lisp/emacs-lisp/timer.elc \
+ ../lisp/vc-hooks.elc \
+ ../lisp/jka-cmpr-hook.elc \
+ ../lisp/ediff-hook.elc \
+ ../lisp/epa-hook.elc \
+ ../lisp/widget.elc \
+ ../lisp/window.elc \
+ ../lisp/version.el
+
+/* Like $shortlisp, but includes only those files from $lisp that are loaded
+ conditionally (i.e., only on some platforms). */
+SOME_MACHINE_LISP = ../lisp/mouse.elc \
+ ../lisp/select.elc ../lisp/scroll-bar.elc \
+ ../lisp/ls-lisp.elc ../lisp/dos-fns.elc \
+ ../lisp/w32-fns.elc ../lisp/dos-w32.elc \
+ ../lisp/disp-table.elc ../lisp/dos-vars.elc \
+ ../lisp/tooltip.elc ../lisp/image.elc \
+ ../lisp/fringe.elc ../lisp/dnd.elc \
+ ../lisp/mwheel.elc ../lisp/tool-bar.elc \
+ ../lisp/x-dnd.elc ../lisp/dynamic-setting.elc \
+ ../lisp/international/ccl.elc \
+ ../lisp/international/fontset.elc \
+ ../lisp/mouse.elc \
+ ../lisp/term/common-win.elc \
+ ../lisp/term/x-win.elc \
+ ../lisp/term/pc-win.elc ../lisp/term/internal.elc \
+ ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc \
+ ../lisp/emacs-lisp/easymenu.elc
+
+/* 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 = $(LOADLIBES) $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
+ $(RSVG_LIBS) $(DBUS_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
+ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
+ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
+ $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC)
+
+all: emacs${EXEEXT} $(OTHER_FILES)
+
+/* Does anyone ever pay attention to the load-path-shadows output here? */
+/* The dumped Emacs is as functional and more efficient than
+ bootstrap-emacs, so we replace the latter with the former. */
+emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
+ if test "${CANNOT_DUMP}" = "yes"; then \
+ ln -f temacs${EXEEXT} emacs${EXEEXT}; \
+ EMACSLOADPATH=${lispsource} ./emacs -q -batch \
+ -f list-load-path-shadows || true; \
+ else \
+ LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
+ ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ ./emacs -q -batch -f list-load-path-shadows || true; \
+ fi
+
+/* We run make-docfile twice because the command line may get too long
+ on some systems. */
+/* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
+ or may not be included in ${obj}, but they are always included in
+ ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned
+ for the first time, this prevents any variation between configurations
+ in the contents of the DOC file.
+ Likewise for ${SOME_MACHINE_LISP}. */
+/* Most of this Makefile refers to Lisp files via ${lispsource}, so
+ we also use ${lisp} rather than ${shortlisp} for the dependency since
+ the Makefile uses string equality to decide when we talk about identical
+ files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile
+ only in order to reduce the command line length. --Stef */
+${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP}
+ -rm -f ${etc}DOC
+ ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
+ ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
+
+${libsrc}make-docfile${EXEEXT}:
+ cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT}
+
+buildobj.h: Makefile
+ echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
+
+#define YMF_PASS_LDFLAGS(flags) @YMF_PASS_LDFLAGS@
+
+temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
+ $(LD) YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
+ ${NS_IMPL_GNUSTEP_TEMACS_LDFLAGS} ) \
+ ${TEMACS_LDFLAGS2} \
+ -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES}
+
+prefix-args${EXEEXT}: prefix-args.o $(config_h)
+ $(CC) $(LDFLAGS) prefix-args.o -o prefix-args
+
+
+/* The following oldxmenu-related rules are only (possibly) used if
+ HAVE_X11 && !USE_GTK, but there is no harm in always defining them
+ (provided we take a little care that OLDXMENU is never empty). */
+really-lwlib:
+ cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
+ CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
+ @true /* make -t should not create really-lwlib. */
+.PHONY: really-lwlib
+
+really-oldXMenu:
+ cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
+ CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
+ @true /* make -t should not create really-oldXMenu. */
+.PHONY: really-oldXMenu
+
+/* We don''t really need this when OLDXMENU_DEPS is empty, but as
+ things stand we need something to satisfy the temacs dependency. */
+stamp-oldxmenu: ${OLDXMENU_DEPS}
+ touch stamp-oldxmenu
+
+/* Supply an ordering for parallel make. */
+../src/$(OLDXMENU): ${OLDXMENU}
+
+$(OLDXMENU): $(OLDXMENU_TARGET)
+
+../config.status:: epaths.in
+ @echo "The file epaths.h needs to be set up from epaths.in."
+ @echo "Please run the `configure' script again."
+ exit 1
+
+../config.status:: config.in
+ @echo "The file config.h needs to be set up from config.in."
+ @echo "Please run the `configure' script again."
+ exit 1
+
+ecrt0.o: ecrt0.c $(config_h)
+ @$(MKDEPDIR)
+ $(CC) -c $(ALL_CFLAGS) ${srcdir}/ecrt0.c
+doc.o: buildobj.h
+
+
+/* If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here. */
+@ns_frag@
+
+
+mostlyclean:
+ rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
+ rm -f ../etc/DOC
+ rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
+ rm -f buildobj.h
+clean: mostlyclean
+ rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
+ -rm -rf ${DEPDIR}
+ test "X${ns_appdir}" = "X" || rm -rf ${ns_appdir}
+
+/* bootstrap-clean is used to clean up just before a bootstrap.
+ It should remove all files generated during a compilation/bootstrap,
+ but not things like config.status or TAGS. */
+bootstrap-clean: clean
+ rm -f epaths.h config.h Makefile.c config.stamp stamp-oldxmenu ../etc/DOC-*
+ if test -f ./.gdbinit; then \
+ mv ./.gdbinit ./.gdbinit.save; \
+ if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; \
+ else mv ./.gdbinit.save ./.gdbinit; fi; \
+ fi
+/**/# This is used in making a distribution.
+/**/# Do not use it on development directories!
+distclean: bootstrap-clean
+ rm -f Makefile
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f TAGS
+versionclean:
+ -rm -f emacs${EXEEXT} emacs-*.*.*${EXEEXT} ../etc/DOC*
+extraclean: distclean
+ -rm -f *~ \#* m/?*~ s/?*~
+
+/* Arrange to make a tags table TAGS-LISP for ../lisp,
+ plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
+
+ctagsfiles1 = [xyzXYZ]*.[hcm]
+ctagsfiles2 = [a-wA-W]*.[hcm]
+
+TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
+ ../lib-src/etags --include=TAGS-LISP --include=${lwlibdir}/TAGS \
+ --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
+ $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
+frc:
+TAGS-LISP: frc
+ $(MAKE) -f ${lispdir}Makefile TAGS-LISP ETAGS=../lib-src/etags
+
+$(lwlibdir)TAGS:
+ (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)Makefile tags ETAGS=../lib-src/etags)
+
+tags: TAGS TAGS-LISP $(lwlibdir)TAGS
+.PHONY: tags
+
+
+/* Bootstrapping. */
+/* Bootstrapping right is difficult because of the circular dependencies.
+ Furthermore, we have to deal with the fact that many compilation targets
+ such as loaddefs.el or *.elc can typically be produced by any old
+ Emacs executable, so we would like to avoid rebuilding them whenever
+ we build a new Emacs executable.
+ To solve the circularity, we use 2 different Emacs executables,
+ "emacs" is the main target and "bootstrap-emacs" is the one used
+ to build the *.elc and loaddefs.el files.
+ To solve the freshness issue, we used to use a third file "witness-emacs"
+ which was used to witness the fact that there is a bootstrap-emacs
+ executable, and then have dependencies on witness-emacs rather than
+ bootstrap-emacs, but that lead to problems in parallel builds (because
+ witness-emacs needed to be free from dependencies (to avoid rebuilding
+ it), so it was compiled in parallel, leading typically to having 2
+ processes dumping bootstrap-emacs at the same time).
+ So instead, we replace the witness-emacs dependencies by conditional
+ bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do
+ not want to rely on GNU Make features, we have to rely on an external
+ script to do the conditional part of the dependency
+ (i.e. see the ${SUBDIR} rule ../Makefile.in). */
+
+.SUFFIXES: .elc .el
+
+/* These suffix rules do not allow additional dependencies, sadly, so
+ instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
+ separately below.
+ With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" */
+.el.elc:
+ @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
+ THEFILE=$< EMACS=${bootstrap_exe}
+
+/* Since the .el.elc rule cannot specify an extra dependency, we do it here. */
+${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS)
+
+/* VCSWITNESS points to the file that holds info about the current checkout.
+ We use it as a heuristic to decide when to rebuild loaddefs.el. */
+${lispsource}loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
+ cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=${bootstrap_exe}
+
+/* Dump an Emacs executable named bootstrap-emacs containing the
+ files from loadup.el in source form. */
+
+bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
+ cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
+ if test "${CANNOT_DUMP}" = "yes"; then \
+ ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ else \
+ $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
+ mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \
+ fi
+ @: Compile some files earlier to speed up further compilation.
+ cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
+
+/* Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. */
+@deps_frag@
Lisp_Object Vmemory_full;
-#ifndef HAVE_SHM
-
/* Initialize it to a nonzero value to force it into data space
(rather than bss space). That way unexec will remap it into text
space (pure), on some systems. We have not implemented the
EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,};
#define PUREBEG (char *) pure
-#else /* HAVE_SHM */
-
-#define pure PURE_SEG_BITS /* Use shared memory segment */
-#define PUREBEG (char *)PURE_SEG_BITS
-
-#endif /* HAVE_SHM */
-
/* Pointer to the pure area, and its size. */
static char *purebeg;
pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&alloc_mutex, &attr);
#else /* !DOUG_LEA_MALLOC */
- /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
+ /* Some systems such as Solaris 2.6 don't have a recursive mutex,
and the bundled gmalloc.c doesn't require it. */
pthread_mutex_init (&alloc_mutex, NULL);
#endif /* !DOUG_LEA_MALLOC */
p = XSYMBOL (val);
p->xname = name;
p->plist = Qnil;
- p->value = Qunbound;
+ p->redirect = SYMBOL_PLAINVAL;
+ SET_SYMBOL_VAL (p, Qunbound);
p->function = Qunbound;
p->next = NULL;
p->gcmarkbit = 0;
p->interned = SYMBOL_UNINTERNED;
p->constant = 0;
- p->indirect_variable = 0;
consing_since_gc += sizeof (struct Lisp_Symbol);
symbols_consed++;
return val;
if (PURE_POINTER_P (XPNTR (obj)))
return obj;
+ if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
+ {
+ Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil);
+ if (!NILP (tmp))
+ return tmp;
+ }
+
if (CONSP (obj))
- return pure_cons (XCAR (obj), XCDR (obj));
+ obj = pure_cons (XCAR (obj), XCDR (obj));
else if (FLOATP (obj))
- return make_pure_float (XFLOAT_DATA (obj));
+ obj = make_pure_float (XFLOAT_DATA (obj));
else if (STRINGP (obj))
- return make_pure_string (SDATA (obj), SCHARS (obj),
- SBYTES (obj),
- STRING_MULTIBYTE (obj));
+ obj = make_pure_string (SDATA (obj), SCHARS (obj),
+ SBYTES (obj),
+ STRING_MULTIBYTE (obj));
else if (COMPILEDP (obj) || VECTORP (obj))
{
register struct Lisp_Vector *vec;
}
else
XSETVECTOR (obj, vec);
- return obj;
}
else if (MARKERP (obj))
error ("Attempt to copy a marker to pure storage");
+ else
+ /* Not purified, don't hash-cons. */
+ return obj;
+
+ if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
+ Fputhash (obj, obj, Vpurify_flag);
return obj;
}
break;
CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
ptr->gcmarkbit = 1;
- mark_object (ptr->value);
mark_object (ptr->function);
mark_object (ptr->plist);
-
+ switch (ptr->redirect)
+ {
+ case SYMBOL_PLAINVAL: mark_object (SYMBOL_VAL (ptr)); break;
+ case SYMBOL_VARALIAS:
+ {
+ Lisp_Object tem;
+ XSETSYMBOL (tem, SYMBOL_ALIAS (ptr));
+ mark_object (tem);
+ break;
+ }
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
+ /* If the value is forwarded to a buffer or keyboard field,
+ these are marked when we see the corresponding object.
+ And if it's forwarded to a C variable, either it's not
+ a Lisp_Object var, or it's staticpro'd already. */
+ mark_object (blv->where);
+ mark_object (blv->valcell);
+ mark_object (blv->defcell);
+ break;
+ }
+ case SYMBOL_FORWARDED:
+ /* If the value is forwarded to a buffer or keyboard field,
+ these are marked when we see the corresponding object.
+ And if it's forwarded to a C variable, either it's not
+ a Lisp_Object var, or it's staticpro'd already. */
+ break;
+ default: abort ();
+ }
if (!PURE_POINTER_P (XSTRING (ptr->xname)))
MARK_STRING (XSTRING (ptr->xname));
MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname));
- /* Note that we do not mark the obarray of the symbol.
- It is safe not to do so because nothing accesses that
- slot except to check whether it is nil. */
ptr = ptr->next;
if (ptr)
{
switch (XMISCTYPE (obj))
{
- case Lisp_Misc_Buffer_Local_Value:
- {
- register struct Lisp_Buffer_Local_Value *ptr
- = XBUFFER_LOCAL_VALUE (obj);
- /* If the cdr is nil, avoid recursion for the car. */
- if (EQ (ptr->cdr, Qnil))
- {
- obj = ptr->realvalue;
- goto loop;
- }
- mark_object (ptr->realvalue);
- mark_object (ptr->buffer);
- mark_object (ptr->frame);
- obj = ptr->cdr;
- goto loop;
- }
case Lisp_Misc_Marker:
/* DO NOT mark thru the marker's chain.
instead, markers are removed from the chain when freed by gc. */
break;
- case Lisp_Misc_Intfwd:
- case Lisp_Misc_Boolfwd:
- case Lisp_Misc_Objfwd:
- case Lisp_Misc_Buffer_Objfwd:
- case Lisp_Misc_Kboard_Objfwd:
- /* Don't bother with Lisp_Buffer_Objfwd,
- since all markable slots in current buffer marked anyway. */
- /* Don't need to do Lisp_Objfwd, since the places they point
- are protected with staticpro. */
- break;
-
case Lisp_Misc_Save_Value:
#if GC_MARK_STACK
{
if (!sym->gcmarkbit && !pure_p)
{
+ if (sym->redirect == SYMBOL_LOCALIZED)
+ xfree (SYMBOL_BLV (sym));
sym->next = symbol_free_list;
symbol_free_list = sym;
#if GC_MARK_STACK
DEFVAR_LISP ("purify-flag", &Vpurify_flag,
doc: /* Non-nil means loading Lisp code in order to dump an executable.
-This means that certain objects should be allocated in shared (pure) space. */);
+This means that certain objects should be allocated in shared (pure) space.
+It can also be set to a hash-table, in which case this table is used to
+do hash-consing of the objects allocated to pure space. */);
DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages,
doc: /* Non-nil means display messages at start and end of garbage collection. */);
static void
set_alarm ()
{
-#if defined (USG) && !defined (POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time. */
- signal (SIGALRM, alarm_signal_handler);
-#endif /* USG */
-
if (atimers)
{
EMACS_TIME now, time;
--- /dev/null
+/* autodeps.mk --- src/Makefile fragment for GNU Emacs
+
+This is inserted in src/Makefile if AUTO_DEPEND=yes. */
+
+ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
+-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
--- /dev/null
+/* Low-level bidirectional buffer-scanning functions for GNU Emacs.
+ Copyright (C) 2000, 2001, 2004, 2005, 2009, 2010
+ 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/>. */
+
+/* Written by Eli Zaretskii <eliz@gnu.org>.
+
+ A sequential implementation of the Unicode Bidirectional algorithm,
+ as per UAX#9, a part of the Unicode Standard.
+
+ Unlike the reference and most other implementations, this one is
+ designed to be called once for every character in the buffer or
+ string.
+
+ The main entry point is bidi_move_to_visually_next. Each time it
+ is called, it finds the next character in the visual order, and
+ returns its information in a special structure. The caller is then
+ expected to process this character for display or any other
+ purposes, and call bidi_move_to_visually_next for the next
+ character. See the comments in bidi_move_to_visually_next for more
+ details about its algorithm that finds the next visual-order
+ character by resolving their levels on the fly.
+
+ The two other entry points are bidi_paragraph_init and
+ bidi_mirror_char. The first determines the base direction of a
+ paragraph, while the second returns the mirrored version of its
+ argument character.
+
+ If you want to understand the code, you will have to read it
+ together with the relevant portions of UAX#9. The comments include
+ references to UAX#9 rules, for that very reason.
+
+ A note about references to UAX#9 rules: if the reference says
+ something like "X9/Retaining", it means that you need to refer to
+ rule X9 and to its modifications decribed in the "Implementation
+ Notes" section of UAX#9, under "Retaining Format Codes". */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <setjmp.h>
+
+#include "lisp.h"
+#include "buffer.h"
+#include "character.h"
+#include "dispextern.h"
+
+static int bidi_initialized = 0;
+
+static Lisp_Object bidi_type_table;
+
+/* FIXME: Remove these when bidi_explicit_dir_char uses a lookup table. */
+#define LRM_CHAR 0x200E
+#define RLM_CHAR 0x200F
+#define LRE_CHAR 0x202A
+#define RLE_CHAR 0x202B
+#define PDF_CHAR 0x202C
+#define LRO_CHAR 0x202D
+#define RLO_CHAR 0x202E
+
+#define BIDI_EOB -1
+#define BIDI_BOB -2 /* FIXME: Is this needed? */
+
+/* Local data structures. (Look in dispextern.h for the rest.) */
+
+/* What we need to know about the current paragraph. */
+struct bidi_paragraph_info {
+ int start_bytepos; /* byte position where it begins */
+ int end_bytepos; /* byte position where it ends */
+ int embedding_level; /* its basic embedding level */
+ bidi_dir_t base_dir; /* its base direction */
+};
+
+/* Data type for describing the bidirectional character categories. */
+typedef enum {
+ UNKNOWN_BC,
+ NEUTRAL,
+ WEAK,
+ STRONG
+} bidi_category_t;
+
+int bidi_ignore_explicit_marks_for_paragraph_level = 1;
+
+static Lisp_Object paragraph_start_re, paragraph_separate_re;
+static Lisp_Object Qparagraph_start, Qparagraph_separate;
+
+static void
+bidi_initialize ()
+{
+ /* FIXME: This should come from the Unicode Database. */
+ struct {
+ int from, to;
+ bidi_type_t type;
+ } bidi_type[] =
+ { { 0x0000, 0x0008, WEAK_BN },
+ { 0x0009, 0x0000, NEUTRAL_S },
+ { 0x000A, 0x0000, NEUTRAL_B },
+ { 0x000B, 0x0000, NEUTRAL_S },
+ { 0x000C, 0x0000, NEUTRAL_WS },
+ { 0x000D, 0x0000, NEUTRAL_B },
+ { 0x000E, 0x001B, WEAK_BN },
+ { 0x001C, 0x001E, NEUTRAL_B },
+ { 0x001F, 0x0000, NEUTRAL_S },
+ { 0x0020, 0x0000, NEUTRAL_WS },
+ { 0x0021, 0x0022, NEUTRAL_ON },
+ { 0x0023, 0x0025, WEAK_ET },
+ { 0x0026, 0x002A, NEUTRAL_ON },
+ { 0x002B, 0x0000, WEAK_ES },
+ { 0x002C, 0x0000, WEAK_CS },
+ { 0x002D, 0x0000, WEAK_ES },
+ { 0x002E, 0x002F, WEAK_CS },
+ { 0x0030, 0x0039, WEAK_EN },
+ { 0x003A, 0x0000, WEAK_CS },
+ { 0x003B, 0x0040, NEUTRAL_ON },
+ { 0x005B, 0x0060, NEUTRAL_ON },
+ { 0x007B, 0x007E, NEUTRAL_ON },
+ { 0x007F, 0x0084, WEAK_BN },
+ { 0x0085, 0x0000, NEUTRAL_B },
+ { 0x0086, 0x009F, WEAK_BN },
+ { 0x00A0, 0x0000, WEAK_CS },
+ { 0x00A1, 0x0000, NEUTRAL_ON },
+ { 0x00A2, 0x00A5, WEAK_ET },
+ { 0x00A6, 0x00A9, NEUTRAL_ON },
+ { 0x00AB, 0x00AC, NEUTRAL_ON },
+ { 0x00AD, 0x0000, WEAK_BN },
+ { 0x00AE, 0x00Af, NEUTRAL_ON },
+ { 0x00B0, 0x00B1, WEAK_ET },
+ { 0x00B2, 0x00B3, WEAK_EN },
+ { 0x00B4, 0x0000, NEUTRAL_ON },
+ { 0x00B6, 0x00B8, NEUTRAL_ON },
+ { 0x00B9, 0x0000, WEAK_EN },
+ { 0x00BB, 0x00BF, NEUTRAL_ON },
+ { 0x00D7, 0x0000, NEUTRAL_ON },
+ { 0x00F7, 0x0000, NEUTRAL_ON },
+ { 0x02B9, 0x02BA, NEUTRAL_ON },
+ { 0x02C2, 0x02CF, NEUTRAL_ON },
+ { 0x02D2, 0x02DF, NEUTRAL_ON },
+ { 0x02E5, 0x02ED, NEUTRAL_ON },
+ { 0x0300, 0x036F, WEAK_NSM },
+ { 0x0374, 0x0375, NEUTRAL_ON },
+ { 0x037E, 0x0385, NEUTRAL_ON },
+ { 0x0387, 0x0000, NEUTRAL_ON },
+ { 0x03F6, 0x0000, NEUTRAL_ON },
+ { 0x0483, 0x0489, WEAK_NSM },
+ { 0x058A, 0x0000, NEUTRAL_ON },
+ { 0x0591, 0x05BD, WEAK_NSM },
+ { 0x05BE, 0x0000, STRONG_R },
+ { 0x05BF, 0x0000, WEAK_NSM },
+ { 0x05C0, 0x0000, STRONG_R },
+ { 0x05C1, 0x05C2, WEAK_NSM },
+ { 0x05C3, 0x0000, STRONG_R },
+ { 0x05C4, 0x05C5, WEAK_NSM },
+ { 0x05C6, 0x0000, STRONG_R },
+ { 0x05C7, 0x0000, WEAK_NSM },
+ { 0x05D0, 0x05F4, STRONG_R },
+ { 0x060C, 0x0000, WEAK_CS },
+ { 0x061B, 0x064A, STRONG_AL },
+ { 0x064B, 0x0655, WEAK_NSM },
+ { 0x0660, 0x0669, WEAK_AN },
+ { 0x066A, 0x0000, WEAK_ET },
+ { 0x066B, 0x066C, WEAK_AN },
+ { 0x066D, 0x066F, STRONG_AL },
+ { 0x0670, 0x0000, WEAK_NSM },
+ { 0x0671, 0x06D5, STRONG_AL },
+ { 0x06D6, 0x06DC, WEAK_NSM },
+ { 0x06DD, 0x0000, STRONG_AL },
+ { 0x06DE, 0x06E4, WEAK_NSM },
+ { 0x06E5, 0x06E6, STRONG_AL },
+ { 0x06E7, 0x06E8, WEAK_NSM },
+ { 0x06E9, 0x0000, NEUTRAL_ON },
+ { 0x06EA, 0x06ED, WEAK_NSM },
+ { 0x06F0, 0x06F9, WEAK_EN },
+ { 0x06FA, 0x070D, STRONG_AL },
+ { 0x070F, 0x0000, WEAK_BN },
+ { 0x0710, 0x0000, STRONG_AL },
+ { 0x0711, 0x0000, WEAK_NSM },
+ { 0x0712, 0x072C, STRONG_AL },
+ { 0x0730, 0x074A, WEAK_NSM },
+ { 0x0780, 0x07A5, STRONG_AL },
+ { 0x07A6, 0x07B0, WEAK_NSM },
+ { 0x07B1, 0x0000, STRONG_AL },
+ { 0x0901, 0x0902, WEAK_NSM },
+ { 0x093C, 0x0000, WEAK_NSM },
+ { 0x0941, 0x0948, WEAK_NSM },
+ { 0x094D, 0x0000, WEAK_NSM },
+ { 0x0951, 0x0954, WEAK_NSM },
+ { 0x0962, 0x0963, WEAK_NSM },
+ { 0x0981, 0x0000, WEAK_NSM },
+ { 0x09BC, 0x0000, WEAK_NSM },
+ { 0x09C1, 0x09C4, WEAK_NSM },
+ { 0x09CD, 0x0000, WEAK_NSM },
+ { 0x09E2, 0x09E3, WEAK_NSM },
+ { 0x09F2, 0x09F3, WEAK_ET },
+ { 0x0A02, 0x0000, WEAK_NSM },
+ { 0x0A3C, 0x0000, WEAK_NSM },
+ { 0x0A41, 0x0A4D, WEAK_NSM },
+ { 0x0A70, 0x0A71, WEAK_NSM },
+ { 0x0A81, 0x0A82, WEAK_NSM },
+ { 0x0ABC, 0x0000, WEAK_NSM },
+ { 0x0AC1, 0x0AC8, WEAK_NSM },
+ { 0x0ACD, 0x0000, WEAK_NSM },
+ { 0x0B01, 0x0000, WEAK_NSM },
+ { 0x0B3C, 0x0000, WEAK_NSM },
+ { 0x0B3F, 0x0000, WEAK_NSM },
+ { 0x0B41, 0x0B43, WEAK_NSM },
+ { 0x0B4D, 0x0B56, WEAK_NSM },
+ { 0x0B82, 0x0000, WEAK_NSM },
+ { 0x0BC0, 0x0000, WEAK_NSM },
+ { 0x0BCD, 0x0000, WEAK_NSM },
+ { 0x0C3E, 0x0C40, WEAK_NSM },
+ { 0x0C46, 0x0C56, WEAK_NSM },
+ { 0x0CBF, 0x0000, WEAK_NSM },
+ { 0x0CC6, 0x0000, WEAK_NSM },
+ { 0x0CCC, 0x0CCD, WEAK_NSM },
+ { 0x0D41, 0x0D43, WEAK_NSM },
+ { 0x0D4D, 0x0000, WEAK_NSM },
+ { 0x0DCA, 0x0000, WEAK_NSM },
+ { 0x0DD2, 0x0DD6, WEAK_NSM },
+ { 0x0E31, 0x0000, WEAK_NSM },
+ { 0x0E34, 0x0E3A, WEAK_NSM },
+ { 0x0E3F, 0x0000, WEAK_ET },
+ { 0x0E47, 0x0E4E, WEAK_NSM },
+ { 0x0EB1, 0x0000, WEAK_NSM },
+ { 0x0EB4, 0x0EBC, WEAK_NSM },
+ { 0x0EC8, 0x0ECD, WEAK_NSM },
+ { 0x0F18, 0x0F19, WEAK_NSM },
+ { 0x0F35, 0x0000, WEAK_NSM },
+ { 0x0F37, 0x0000, WEAK_NSM },
+ { 0x0F39, 0x0000, WEAK_NSM },
+ { 0x0F3A, 0x0F3D, NEUTRAL_ON },
+ { 0x0F71, 0x0F7E, WEAK_NSM },
+ { 0x0F80, 0x0F84, WEAK_NSM },
+ { 0x0F86, 0x0F87, WEAK_NSM },
+ { 0x0F90, 0x0FBC, WEAK_NSM },
+ { 0x0FC6, 0x0000, WEAK_NSM },
+ { 0x102D, 0x1030, WEAK_NSM },
+ { 0x1032, 0x1037, WEAK_NSM },
+ { 0x1039, 0x0000, WEAK_NSM },
+ { 0x1058, 0x1059, WEAK_NSM },
+ { 0x1680, 0x0000, NEUTRAL_WS },
+ { 0x169B, 0x169C, NEUTRAL_ON },
+ { 0x1712, 0x1714, WEAK_NSM },
+ { 0x1732, 0x1734, WEAK_NSM },
+ { 0x1752, 0x1753, WEAK_NSM },
+ { 0x1772, 0x1773, WEAK_NSM },
+ { 0x17B7, 0x17BD, WEAK_NSM },
+ { 0x17C6, 0x0000, WEAK_NSM },
+ { 0x17C9, 0x17D3, WEAK_NSM },
+ { 0x17DB, 0x0000, WEAK_ET },
+ { 0x1800, 0x180A, NEUTRAL_ON },
+ { 0x180B, 0x180D, WEAK_NSM },
+ { 0x180E, 0x0000, WEAK_BN },
+ { 0x18A9, 0x0000, WEAK_NSM },
+ { 0x1FBD, 0x0000, NEUTRAL_ON },
+ { 0x1FBF, 0x1FC1, NEUTRAL_ON },
+ { 0x1FCD, 0x1FCF, NEUTRAL_ON },
+ { 0x1FDD, 0x1FDF, NEUTRAL_ON },
+ { 0x1FED, 0x1FEF, NEUTRAL_ON },
+ { 0x1FFD, 0x1FFE, NEUTRAL_ON },
+ { 0x2000, 0x200A, NEUTRAL_WS },
+ { 0x200B, 0x200D, WEAK_BN },
+ { 0x200F, 0x0000, STRONG_R },
+ { 0x2010, 0x2027, NEUTRAL_ON },
+ { 0x2028, 0x0000, NEUTRAL_WS },
+ { 0x2029, 0x0000, NEUTRAL_B },
+ { 0x202A, 0x0000, LRE },
+ { 0x202B, 0x0000, RLE },
+ { 0x202C, 0x0000, PDF },
+ { 0x202D, 0x0000, LRO },
+ { 0x202E, 0x0000, RLO },
+ { 0x202F, 0x0000, NEUTRAL_WS },
+ { 0x2030, 0x2034, WEAK_ET },
+ { 0x2035, 0x2057, NEUTRAL_ON },
+ { 0x205F, 0x0000, NEUTRAL_WS },
+ { 0x2060, 0x206F, WEAK_BN },
+ { 0x2070, 0x0000, WEAK_EN },
+ { 0x2074, 0x2079, WEAK_EN },
+ { 0x207A, 0x207B, WEAK_ET },
+ { 0x207C, 0x207E, NEUTRAL_ON },
+ { 0x2080, 0x2089, WEAK_EN },
+ { 0x208A, 0x208B, WEAK_ET },
+ { 0x208C, 0x208E, NEUTRAL_ON },
+ { 0x20A0, 0x20B1, WEAK_ET },
+ { 0x20D0, 0x20EA, WEAK_NSM },
+ { 0x2100, 0x2101, NEUTRAL_ON },
+ { 0x2103, 0x2106, NEUTRAL_ON },
+ { 0x2108, 0x2109, NEUTRAL_ON },
+ { 0x2114, 0x0000, NEUTRAL_ON },
+ { 0x2116, 0x2118, NEUTRAL_ON },
+ { 0x211E, 0x2123, NEUTRAL_ON },
+ { 0x2125, 0x0000, NEUTRAL_ON },
+ { 0x2127, 0x0000, NEUTRAL_ON },
+ { 0x2129, 0x0000, NEUTRAL_ON },
+ { 0x212E, 0x0000, WEAK_ET },
+ { 0x2132, 0x0000, NEUTRAL_ON },
+ { 0x213A, 0x0000, NEUTRAL_ON },
+ { 0x2140, 0x2144, NEUTRAL_ON },
+ { 0x214A, 0x215F, NEUTRAL_ON },
+ { 0x2190, 0x2211, NEUTRAL_ON },
+ { 0x2212, 0x2213, WEAK_ET },
+ { 0x2214, 0x2335, NEUTRAL_ON },
+ { 0x237B, 0x2394, NEUTRAL_ON },
+ { 0x2396, 0x244A, NEUTRAL_ON },
+ { 0x2460, 0x249B, WEAK_EN },
+ { 0x24EA, 0x0000, WEAK_EN },
+ { 0x24EB, 0x2FFB, NEUTRAL_ON },
+ { 0x3000, 0x0000, NEUTRAL_WS },
+ { 0x3001, 0x3004, NEUTRAL_ON },
+ { 0x3008, 0x3020, NEUTRAL_ON },
+ { 0x302A, 0x302F, WEAK_NSM },
+ { 0x3030, 0x0000, NEUTRAL_ON },
+ { 0x3036, 0x3037, NEUTRAL_ON },
+ { 0x303D, 0x303F, NEUTRAL_ON },
+ { 0x3099, 0x309A, WEAK_NSM },
+ { 0x309B, 0x309C, NEUTRAL_ON },
+ { 0x30A0, 0x0000, NEUTRAL_ON },
+ { 0x30FB, 0x0000, NEUTRAL_ON },
+ { 0x3251, 0x325F, NEUTRAL_ON },
+ { 0x32B1, 0x32BF, NEUTRAL_ON },
+ { 0xA490, 0xA4C6, NEUTRAL_ON },
+ { 0xFB1D, 0x0000, STRONG_R },
+ { 0xFB1E, 0x0000, WEAK_NSM },
+ { 0xFB1F, 0xFB28, STRONG_R },
+ { 0xFB29, 0x0000, WEAK_ET },
+ { 0xFB2A, 0xFB4F, STRONG_R },
+ { 0xFB50, 0xFD3D, STRONG_AL },
+ { 0xFD3E, 0xFD3F, NEUTRAL_ON },
+ { 0xFD50, 0xFDFC, STRONG_AL },
+ { 0xFE00, 0xFE23, WEAK_NSM },
+ { 0xFE30, 0xFE4F, NEUTRAL_ON },
+ { 0xFE50, 0x0000, WEAK_CS },
+ { 0xFE51, 0x0000, NEUTRAL_ON },
+ { 0xFE52, 0x0000, WEAK_CS },
+ { 0xFE54, 0x0000, NEUTRAL_ON },
+ { 0xFE55, 0x0000, WEAK_CS },
+ { 0xFE56, 0xFE5E, NEUTRAL_ON },
+ { 0xFE5F, 0x0000, WEAK_ET },
+ { 0xFE60, 0xFE61, NEUTRAL_ON },
+ { 0xFE62, 0xFE63, WEAK_ET },
+ { 0xFE64, 0xFE68, NEUTRAL_ON },
+ { 0xFE69, 0xFE6A, WEAK_ET },
+ { 0xFE6B, 0x0000, NEUTRAL_ON },
+ { 0xFE70, 0xFEFC, STRONG_AL },
+ { 0xFEFF, 0x0000, WEAK_BN },
+ { 0xFF01, 0xFF02, NEUTRAL_ON },
+ { 0xFF03, 0xFF05, WEAK_ET },
+ { 0xFF06, 0xFF0A, NEUTRAL_ON },
+ { 0xFF0B, 0x0000, WEAK_ET },
+ { 0xFF0C, 0x0000, WEAK_CS },
+ { 0xFF0D, 0x0000, WEAK_ET },
+ { 0xFF0E, 0x0000, WEAK_CS },
+ { 0xFF0F, 0x0000, WEAK_ES },
+ { 0xFF10, 0xFF19, WEAK_EN },
+ { 0xFF1A, 0x0000, WEAK_CS },
+ { 0xFF1B, 0xFF20, NEUTRAL_ON },
+ { 0xFF3B, 0xFF40, NEUTRAL_ON },
+ { 0xFF5B, 0xFF65, NEUTRAL_ON },
+ { 0xFFE0, 0xFFE1, WEAK_ET },
+ { 0xFFE2, 0xFFE4, NEUTRAL_ON },
+ { 0xFFE5, 0xFFE6, WEAK_ET },
+ { 0xFFE8, 0xFFEE, NEUTRAL_ON },
+ { 0xFFF9, 0xFFFB, WEAK_BN },
+ { 0xFFFC, 0xFFFD, NEUTRAL_ON },
+ { 0x1D167, 0x1D169, WEAK_NSM },
+ { 0x1D173, 0x1D17A, WEAK_BN },
+ { 0x1D17B, 0x1D182, WEAK_NSM },
+ { 0x1D185, 0x1D18B, WEAK_NSM },
+ { 0x1D1AA, 0x1D1AD, WEAK_NSM },
+ { 0x1D7CE, 0x1D7FF, WEAK_EN },
+ { 0xE0001, 0xE007F, WEAK_BN } };
+ int i;
+
+ bidi_type_table = Fmake_char_table (Qnil, make_number (STRONG_L));
+ staticpro (&bidi_type_table);
+
+ for (i = 0; i < sizeof bidi_type / sizeof bidi_type[0]; i++)
+ char_table_set_range (bidi_type_table, bidi_type[i].from,
+ bidi_type[i].to ? bidi_type[i].to : bidi_type[i].from,
+ make_number (bidi_type[i].type));
+
+ Qparagraph_start = intern ("paragraph-start");
+ staticpro (&Qparagraph_start);
+ paragraph_start_re = Fsymbol_value (Qparagraph_start);
+ if (!STRINGP (paragraph_start_re))
+ paragraph_start_re = build_string ("\f\\|[ \t]*$");
+ staticpro (¶graph_start_re);
+ Qparagraph_separate = intern ("paragraph-separate");
+ staticpro (&Qparagraph_separate);
+ paragraph_separate_re = Fsymbol_value (Qparagraph_separate);
+ if (!STRINGP (paragraph_separate_re))
+ paragraph_separate_re = build_string ("[ \t\f]*$");
+ staticpro (¶graph_separate_re);
+ bidi_initialized = 1;
+}
+
+/* Return the bidi type of a character CH, subject to the current
+ directional OVERRIDE. */
+static INLINE bidi_type_t
+bidi_get_type (int ch, bidi_dir_t override)
+{
+ bidi_type_t default_type;
+
+ if (ch == BIDI_EOB)
+ return NEUTRAL_B;
+ if (ch < 0 || ch > MAX_CHAR)
+ abort ();
+
+ default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch));
+
+ if (override == NEUTRAL_DIR)
+ return default_type;
+
+ switch (default_type)
+ {
+ /* Although UAX#9 does not tell, it doesn't make sense to
+ override NEUTRAL_B and LRM/RLM characters. */
+ case NEUTRAL_B:
+ case LRE:
+ case LRO:
+ case RLE:
+ case RLO:
+ case PDF:
+ return default_type;
+ default:
+ switch (ch)
+ {
+ case LRM_CHAR:
+ case RLM_CHAR:
+ return default_type;
+ default:
+ if (override == L2R) /* X6 */
+ return STRONG_L;
+ else if (override == R2L)
+ return STRONG_R;
+ else
+ abort (); /* can't happen: handled above */
+ }
+ }
+}
+
+void
+bidi_check_type (bidi_type_t type)
+{
+ if (type < UNKNOWN_BT || type > NEUTRAL_ON)
+ abort ();
+}
+
+/* Given a bidi TYPE of a character, return its category. */
+static INLINE bidi_category_t
+bidi_get_category (bidi_type_t type)
+{
+ switch (type)
+ {
+ case UNKNOWN_BT:
+ return UNKNOWN_BC;
+ case STRONG_L:
+ case STRONG_R:
+ case STRONG_AL:
+ case LRE:
+ case LRO:
+ case RLE:
+ case RLO:
+ return STRONG;
+ case PDF: /* ??? really?? */
+ case WEAK_EN:
+ case WEAK_ES:
+ case WEAK_ET:
+ case WEAK_AN:
+ case WEAK_CS:
+ case WEAK_NSM:
+ case WEAK_BN:
+ return WEAK;
+ case NEUTRAL_B:
+ case NEUTRAL_S:
+ case NEUTRAL_WS:
+ case NEUTRAL_ON:
+ return NEUTRAL;
+ default:
+ abort ();
+ }
+}
+
+/* Return the mirrored character of C, if any.
+
+ Note: The conditions in UAX#9 clause L4 must be tested by the
+ caller. */
+/* FIXME: exceedingly temporary! Should consult the Unicode database
+ of character properties. */
+int
+bidi_mirror_char (int c)
+{
+ static const char mirrored_pairs[] = "()<>[]{}";
+ const char *p = c > 0 && c < 128 ? strchr (mirrored_pairs, c) : NULL;
+
+ if (p)
+ {
+ size_t i = p - mirrored_pairs;
+
+ return mirrored_pairs [(i ^ 1)];
+ }
+ return c;
+}
+
+/* Copy the bidi iterator from FROM to TO. To save cycles, this only
+ copies the part of the level stack that is actually in use. */
+static INLINE void
+bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
+{
+ int i;
+
+ /* Copy everything except the level stack and beyond. */
+ memcpy (to, from, ((size_t)&((struct bidi_it *)0)->level_stack[0]));
+
+ /* Copy the active part of the level stack. */
+ to->level_stack[0] = from->level_stack[0]; /* level zero is always in use */
+ for (i = 1; i <= from->stack_idx; i++)
+ to->level_stack[i] = from->level_stack[i];
+}
+
+/* Caching the bidi iterator states. */
+
+#define BIDI_CACHE_CHUNK 200
+static struct bidi_it *bidi_cache;
+static size_t bidi_cache_size = 0;
+static size_t elsz = sizeof (struct bidi_it);
+static int bidi_cache_idx; /* next unused cache slot */
+static int bidi_cache_last_idx; /* slot of last cache hit */
+
+static INLINE void
+bidi_cache_reset (void)
+{
+ bidi_cache_idx = 0;
+ bidi_cache_last_idx = -1;
+}
+
+static INLINE void
+bidi_cache_shrink (void)
+{
+ if (bidi_cache_size > BIDI_CACHE_CHUNK)
+ {
+ bidi_cache_size = BIDI_CACHE_CHUNK;
+ bidi_cache =
+ (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size * elsz);
+ }
+ bidi_cache_reset ();
+}
+
+static INLINE void
+bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
+{
+ int current_scan_dir = bidi_it->scan_dir;
+
+ if (idx < 0 || idx >= bidi_cache_idx)
+ abort ();
+
+ bidi_copy_it (bidi_it, &bidi_cache[idx]);
+ bidi_it->scan_dir = current_scan_dir;
+ bidi_cache_last_idx = idx;
+}
+
+/* Find a cached state with a given CHARPOS and resolved embedding
+ level less or equal to LEVEL. if LEVEL is -1, disregard the
+ resolved levels in cached states. DIR, if non-zero, means search
+ in that direction from the last cache hit. */
+static INLINE int
+bidi_cache_search (int charpos, int level, int dir)
+{
+ int i, i_start;
+
+ if (bidi_cache_idx)
+ {
+ if (charpos < bidi_cache[bidi_cache_last_idx].charpos)
+ dir = -1;
+ else if (charpos > bidi_cache[bidi_cache_last_idx].charpos)
+ dir = 1;
+ if (dir)
+ i_start = bidi_cache_last_idx;
+ else
+ {
+ dir = -1;
+ i_start = bidi_cache_idx - 1;
+ }
+
+ if (dir < 0)
+ {
+ /* Linear search for now; FIXME! */
+ for (i = i_start; i >= 0; i--)
+ if (bidi_cache[i].charpos == charpos
+ && (level == -1 || bidi_cache[i].resolved_level <= level))
+ return i;
+ }
+ else
+ {
+ for (i = i_start; i < bidi_cache_idx; i++)
+ if (bidi_cache[i].charpos == charpos
+ && (level == -1 || bidi_cache[i].resolved_level <= level))
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+/* Find a cached state where the resolved level changes to a value
+ that is lower than LEVEL, and return its cache slot index. DIR is
+ the direction to search, starting with the last used cache slot.
+ BEFORE, if non-zero, means return the index of the slot that is
+ ``before'' the level change in the search direction. That is,
+ given the cached levels like this:
+
+ 1122333442211
+ AB C
+
+ and assuming we are at the position cached at the slot marked with
+ C, searching backwards (DIR = -1) for LEVEL = 2 will return the
+ index of slot B or A, depending whether BEFORE is, respectively,
+ non-zero or zero. */
+static int
+bidi_cache_find_level_change (int level, int dir, int before)
+{
+ if (bidi_cache_idx)
+ {
+ int i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
+ int incr = before ? 1 : 0;
+
+ if (!dir)
+ dir = -1;
+ else if (!incr)
+ i += dir;
+
+ if (dir < 0)
+ {
+ while (i >= incr)
+ {
+ if (bidi_cache[i - incr].resolved_level >= 0
+ && bidi_cache[i - incr].resolved_level < level)
+ return i;
+ i--;
+ }
+ }
+ else
+ {
+ while (i < bidi_cache_idx - incr)
+ {
+ if (bidi_cache[i + incr].resolved_level >= 0
+ && bidi_cache[i + incr].resolved_level < level)
+ return i;
+ i++;
+ }
+ }
+ }
+
+ return -1;
+}
+
+static INLINE void
+bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
+{
+ int idx;
+
+ /* We should never cache on backward scans. */
+ if (bidi_it->scan_dir == -1)
+ abort ();
+ idx = bidi_cache_search (bidi_it->charpos, -1, 1);
+
+ if (idx < 0)
+ {
+ idx = bidi_cache_idx;
+ /* Enlarge the cache as needed. */
+ if (idx >= bidi_cache_size)
+ {
+ bidi_cache_size += BIDI_CACHE_CHUNK;
+ bidi_cache =
+ (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size * elsz);
+ }
+ /* Character positions should correspond to cache positions 1:1.
+ If we are outside the range of cached positions, the cache is
+ useless and must be reset. */
+ if (idx > 0 &&
+ (bidi_it->charpos > bidi_cache[idx - 1].charpos + 1
+ || bidi_it->charpos < bidi_cache[0].charpos))
+ {
+ bidi_cache_reset ();
+ idx = 0;
+ }
+ bidi_copy_it (&bidi_cache[idx], bidi_it);
+ if (!resolved)
+ bidi_cache[idx].resolved_level = -1;
+ }
+ else
+ {
+ /* Copy only the members which could have changed, to avoid
+ costly copying of the entire struct. */
+ bidi_cache[idx].type = bidi_it->type;
+ bidi_check_type (bidi_it->type);
+ bidi_cache[idx].type_after_w1 = bidi_it->type_after_w1;
+ bidi_check_type (bidi_it->type_after_w1);
+ if (resolved)
+ bidi_cache[idx].resolved_level = bidi_it->resolved_level;
+ else
+ bidi_cache[idx].resolved_level = -1;
+ bidi_cache[idx].invalid_levels = bidi_it->invalid_levels;
+ bidi_cache[idx].invalid_rl_levels = bidi_it->invalid_rl_levels;
+ bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral;
+ bidi_cache[idx].next_for_ws = bidi_it->next_for_ws;
+ bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit;
+ }
+
+ bidi_cache_last_idx = idx;
+ if (idx >= bidi_cache_idx)
+ bidi_cache_idx = idx + 1;
+}
+
+static INLINE bidi_type_t
+bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
+{
+ int i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
+
+ if (i >= 0)
+ {
+ bidi_dir_t current_scan_dir = bidi_it->scan_dir;
+
+ bidi_copy_it (bidi_it, &bidi_cache[i]);
+ bidi_cache_last_idx = i;
+ /* Don't let scan direction from from the cached state override
+ the current scan direction. */
+ bidi_it->scan_dir = current_scan_dir;
+ return bidi_it->type;
+ }
+
+ return UNKNOWN_BT;
+}
+
+static INLINE int
+bidi_peek_at_next_level (struct bidi_it *bidi_it)
+{
+ if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1)
+ abort ();
+ return bidi_cache[bidi_cache_last_idx + bidi_it->scan_dir].resolved_level;
+}
+
+/* Check if buffer position CHARPOS/BYTEPOS is the end of a paragraph.
+ Value is the non-negative length of the paragraph separator
+ following the buffer position, -1 if position is at the beginning
+ of a new paragraph, or -2 if position is neither at beginning nor
+ at end of a paragraph. */
+static EMACS_INT
+bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
+{
+ /* FIXME: Why Fbuffer_local_value rather than just Fsymbol_value? */
+ Lisp_Object sep_re;
+ Lisp_Object start_re;
+ EMACS_INT val;
+
+ sep_re = paragraph_separate_re;
+ start_re = paragraph_start_re;
+
+ val = fast_looking_at (sep_re, charpos, bytepos, ZV, ZV_BYTE, Qnil);
+ if (val < 0)
+ {
+ if (fast_looking_at (start_re, charpos, bytepos, ZV, ZV_BYTE, Qnil) >= 0)
+ val = -1;
+ else
+ val = -2;
+ }
+
+ return val;
+}
+
+/* Determine the start-of-run (sor) directional type given the two
+ embedding levels on either side of the run boundary. Also, update
+ the saved info about previously seen characters, since that info is
+ generally valid for a single level run. */
+static INLINE void
+bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
+{
+ int higher_level = level_before > level_after ? level_before : level_after;
+
+ /* The prev_was_pdf gork is required for when we have several PDFs
+ in a row. In that case, we want to compute the sor type for the
+ next level run only once: when we see the first PDF. That's
+ because the sor type depends only on the higher of the two levels
+ that we find on the two sides of the level boundary (see UAX#9,
+ clause X10), and so we don't need to know the final embedding
+ level to which we descend after processing all the PDFs. */
+ if (!bidi_it->prev_was_pdf || level_before < level_after)
+ /* FIXME: should the default sor direction be user selectable? */
+ bidi_it->sor = (higher_level & 1) != 0 ? R2L : L2R;
+ if (level_before > level_after)
+ bidi_it->prev_was_pdf = 1;
+
+ bidi_it->prev.type = UNKNOWN_BT;
+ bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 =
+ bidi_it->last_strong.orig_type = UNKNOWN_BT;
+ bidi_it->prev_for_neutral.type = bidi_it->sor == R2L ? STRONG_R : STRONG_L;
+ bidi_it->prev_for_neutral.charpos = bidi_it->charpos;
+ bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos;
+ bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 =
+ bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
+ bidi_it->ignore_bn_limit = 0; /* meaning it's unknown */
+}
+
+static void
+bidi_line_init (struct bidi_it *bidi_it)
+{
+ bidi_it->scan_dir = 1; /* FIXME: do we need to have control on this? */
+ bidi_it->resolved_level = bidi_it->level_stack[0].level;
+ bidi_it->level_stack[0].override = NEUTRAL_DIR; /* X1 */
+ bidi_it->invalid_levels = 0;
+ bidi_it->invalid_rl_levels = -1;
+ bidi_it->next_en_pos = -1;
+ bidi_it->next_for_ws.type = UNKNOWN_BT;
+ bidi_set_sor_type (bidi_it,
+ bidi_it->paragraph_dir == R2L ? 1 : 0,
+ bidi_it->level_stack[0].level); /* X10 */
+
+ bidi_cache_reset ();
+}
+
+/* Find the beginning of this paragraph by looking back in the buffer.
+ Value is the byte position of the paragraph's beginning. */
+static EMACS_INT
+bidi_find_paragraph_start (EMACS_INT pos, EMACS_INT pos_byte)
+{
+ Lisp_Object re = paragraph_start_re;
+ EMACS_INT limit = ZV, limit_byte = ZV_BYTE;
+
+ while (pos_byte > BEGV_BYTE
+ && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0)
+ {
+ pos = find_next_newline_no_quit (pos - 1, -1);
+ pos_byte = CHAR_TO_BYTE (pos);
+ }
+ return pos_byte;
+}
+
+/* Determine the direction, a.k.a. base embedding level, of the
+ paragraph we are about to iterate through. If DIR is either L2R or
+ R2L, just use that. Otherwise, determine the paragraph direction
+ from the first strong character of the paragraph.
+
+ Note that this gives the paragraph separator the same direction as
+ the preceding paragraph, even though Emacs generally views the
+ separartor as not belonging to any paragraph. */
+void
+bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
+{
+ EMACS_INT bytepos = bidi_it->bytepos;
+
+ /* Special case for an empty buffer. */
+ if (bytepos == BEGV_BYTE && bytepos == ZV_BYTE)
+ dir = L2R;
+ /* We should never be called at EOB or before BEGV. */
+ else if (bytepos >= ZV_BYTE || bytepos < BEGV_BYTE)
+ abort ();
+
+ if (dir == L2R)
+ {
+ bidi_it->paragraph_dir = L2R;
+ bidi_it->new_paragraph = 0;
+ }
+ else if (dir == R2L)
+ {
+ bidi_it->paragraph_dir = R2L;
+ bidi_it->new_paragraph = 0;
+ }
+ else if (dir == NEUTRAL_DIR) /* P2 */
+ {
+ int ch, ch_len;
+ EMACS_INT pos;
+ bidi_type_t type;
+
+ if (!bidi_initialized)
+ bidi_initialize ();
+
+ /* If we are inside a paragraph separator, we are just waiting
+ for the separator to be exhausted; use the previous paragraph
+ direction. But don't do that if we have been just reseated,
+ because we need to reinitialize below in that case. */
+ if (!bidi_it->first_elt
+ && bidi_it->charpos < bidi_it->separator_limit)
+ return;
+
+ /* If we are on a newline, get past it to where the next
+ paragraph might start. But don't do that at BEGV since then
+ we are potentially in a new paragraph that doesn't yet
+ exist. */
+ pos = bidi_it->charpos;
+ if (bytepos > BEGV_BYTE && FETCH_CHAR (bytepos) == '\n')
+ {
+ bytepos++;
+ pos++;
+ }
+
+ /* We are either at the beginning of a paragraph or in the
+ middle of it. Find where this paragraph starts. */
+ bytepos = bidi_find_paragraph_start (pos, bytepos);
+
+ bidi_it->separator_limit = -1;
+ bidi_it->new_paragraph = 0;
+ ch = FETCH_CHAR (bytepos);
+ ch_len = CHAR_BYTES (ch);
+ pos = BYTE_TO_CHAR (bytepos);
+ type = bidi_get_type (ch, NEUTRAL_DIR);
+
+ for (pos++, bytepos += ch_len;
+ /* NOTE: UAX#9 says to search only for L, AL, or R types of
+ characters, and ignore RLE, RLO, LRE, and LRO. However,
+ I'm not sure it makes sense to omit those 4; should try
+ with and without that to see the effect. */
+ (bidi_get_category (type) != STRONG)
+ || (bidi_ignore_explicit_marks_for_paragraph_level
+ && (type == RLE || type == RLO
+ || type == LRE || type == LRO));
+ type = bidi_get_type (ch, NEUTRAL_DIR))
+ {
+ if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1)
+ break;
+ if (bytepos >= ZV_BYTE)
+ {
+ /* Pretend there's a paragraph separator at end of buffer. */
+ type = NEUTRAL_B;
+ break;
+ }
+ FETCH_CHAR_ADVANCE (ch, pos, bytepos);
+ }
+ if (type == STRONG_R || type == STRONG_AL) /* P3 */
+ bidi_it->paragraph_dir = R2L;
+ else if (type == STRONG_L)
+ bidi_it->paragraph_dir = L2R;
+ }
+ else
+ abort ();
+
+ /* Contrary to UAX#9 clause P3, we only default the paragraph
+ direction to L2R if we have no previous usable paragraph
+ direction. */
+ if (bidi_it->paragraph_dir != L2R && bidi_it->paragraph_dir != R2L)
+ bidi_it->paragraph_dir = L2R; /* P3 and ``higher protocols'' */
+ if (bidi_it->paragraph_dir == R2L)
+ bidi_it->level_stack[0].level = 1;
+ else
+ bidi_it->level_stack[0].level = 0;
+
+ bidi_line_init (bidi_it);
+}
+
+/* Do whatever UAX#9 clause X8 says should be done at paragraph's
+ end. */
+static INLINE void
+bidi_set_paragraph_end (struct bidi_it *bidi_it)
+{
+ bidi_it->invalid_levels = 0;
+ bidi_it->invalid_rl_levels = -1;
+ bidi_it->stack_idx = 0;
+ bidi_it->resolved_level = bidi_it->level_stack[0].level;
+}
+
+/* Initialize the bidi iterator from buffer position CHARPOS. */
+void
+bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it)
+{
+ if (! bidi_initialized)
+ bidi_initialize ();
+ bidi_it->charpos = charpos;
+ bidi_it->bytepos = bytepos;
+ bidi_it->first_elt = 1;
+ bidi_set_paragraph_end (bidi_it);
+ bidi_it->new_paragraph = 1;
+ bidi_it->separator_limit = -1;
+ bidi_it->type = NEUTRAL_B;
+ bidi_it->type_after_w1 = NEUTRAL_B;
+ bidi_it->orig_type = NEUTRAL_B;
+ bidi_it->prev_was_pdf = 0;
+ bidi_it->prev.type = bidi_it->prev.type_after_w1 =
+ bidi_it->prev.orig_type = UNKNOWN_BT;
+ bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 =
+ bidi_it->last_strong.orig_type = UNKNOWN_BT;
+ bidi_it->next_for_neutral.charpos = -1;
+ bidi_it->next_for_neutral.type =
+ bidi_it->next_for_neutral.type_after_w1 =
+ bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
+ bidi_it->prev_for_neutral.charpos = -1;
+ bidi_it->prev_for_neutral.type =
+ bidi_it->prev_for_neutral.type_after_w1 =
+ bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT;
+ bidi_it->sor = L2R; /* FIXME: should it be user-selectable? */
+ bidi_cache_shrink ();
+}
+
+/* Push the current embedding level and override status; reset the
+ current level to LEVEL and the current override status to OVERRIDE. */
+static INLINE void
+bidi_push_embedding_level (struct bidi_it *bidi_it,
+ int level, bidi_dir_t override)
+{
+ bidi_it->stack_idx++;
+ if (bidi_it->stack_idx >= BIDI_MAXLEVEL)
+ abort ();
+ bidi_it->level_stack[bidi_it->stack_idx].level = level;
+ bidi_it->level_stack[bidi_it->stack_idx].override = override;
+}
+
+/* Pop the embedding level and directional override status from the
+ stack, and return the new level. */
+static INLINE int
+bidi_pop_embedding_level (struct bidi_it *bidi_it)
+{
+ /* UAX#9 says to ignore invalid PDFs. */
+ if (bidi_it->stack_idx > 0)
+ bidi_it->stack_idx--;
+ return bidi_it->level_stack[bidi_it->stack_idx].level;
+}
+
+/* Record in SAVED_INFO the information about the current character. */
+static INLINE void
+bidi_remember_char (struct bidi_saved_info *saved_info,
+ struct bidi_it *bidi_it)
+{
+ saved_info->charpos = bidi_it->charpos;
+ saved_info->bytepos = bidi_it->bytepos;
+ saved_info->type = bidi_it->type;
+ bidi_check_type (bidi_it->type);
+ saved_info->type_after_w1 = bidi_it->type_after_w1;
+ bidi_check_type (bidi_it->type_after_w1);
+ saved_info->orig_type = bidi_it->orig_type;
+ bidi_check_type (bidi_it->orig_type);
+}
+
+/* Resolve the type of a neutral character according to the type of
+ surrounding strong text and the current embedding level. */
+static INLINE bidi_type_t
+bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
+{
+ /* N1: European and Arabic numbers are treated as though they were R. */
+ if (next_type == WEAK_EN || next_type == WEAK_AN)
+ next_type = STRONG_R;
+ if (prev_type == WEAK_EN || prev_type == WEAK_AN)
+ prev_type = STRONG_R;
+
+ if (next_type == prev_type) /* N1 */
+ return next_type;
+ else if ((lev & 1) == 0) /* N2 */
+ return STRONG_L;
+ else
+ return STRONG_R;
+}
+
+static INLINE int
+bidi_explicit_dir_char (int c)
+{
+ /* FIXME: this should be replaced with a lookup table with suitable
+ bits set, like standard C ctype macros do. */
+ return (c == LRE_CHAR || c == LRO_CHAR
+ || c == RLE_CHAR || c == RLO_CHAR || c == PDF_CHAR);
+}
+
+/* A helper function for bidi_resolve_explicit. It advances to the
+ next character in logical order and determines the new embedding
+ level and directional override, but does not take into account
+ empty embeddings. */
+static int
+bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
+{
+ int curchar;
+ bidi_type_t type;
+ int current_level;
+ int new_level;
+ bidi_dir_t override;
+
+ if (bidi_it->bytepos < BEGV_BYTE /* after reseat to BEGV? */
+ || bidi_it->first_elt)
+ {
+ bidi_it->first_elt = 0;
+ if (bidi_it->charpos < BEGV)
+ bidi_it->charpos = BEGV;
+ bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos);
+ }
+ else if (bidi_it->bytepos < ZV_BYTE) /* don't move at ZV */
+ {
+ bidi_it->charpos++;
+ if (bidi_it->ch_len == 0)
+ abort ();
+ bidi_it->bytepos += bidi_it->ch_len;
+ }
+
+ current_level = bidi_it->level_stack[bidi_it->stack_idx].level; /* X1 */
+ override = bidi_it->level_stack[bidi_it->stack_idx].override;
+ new_level = current_level;
+
+ /* in case it is a unibyte character (not yet implemented) */
+ /* _fetch_multibyte_char_len = 1; */
+ if (bidi_it->bytepos >= ZV_BYTE)
+ {
+ curchar = BIDI_EOB;
+ bidi_it->ch_len = 1;
+ }
+ else
+ {
+ curchar = FETCH_CHAR (bidi_it->bytepos);
+ bidi_it->ch_len = CHAR_BYTES (curchar);
+ }
+ bidi_it->ch = curchar;
+
+ /* Don't apply directional override here, as all the types we handle
+ below will not be affected by the override anyway, and we need
+ the original type unaltered. The override will be applied in
+ bidi_resolve_weak. */
+ type = bidi_get_type (curchar, NEUTRAL_DIR);
+ bidi_it->orig_type = type;
+ bidi_check_type (bidi_it->orig_type);
+
+ if (type != PDF)
+ bidi_it->prev_was_pdf = 0;
+
+ bidi_it->type_after_w1 = UNKNOWN_BT;
+
+ switch (type)
+ {
+ case RLE: /* X2 */
+ case RLO: /* X4 */
+ bidi_it->type_after_w1 = type;
+ bidi_check_type (bidi_it->type_after_w1);
+ type = WEAK_BN; /* X9/Retaining */
+ if (bidi_it->ignore_bn_limit <= 0)
+ {
+ if (current_level <= BIDI_MAXLEVEL - 4)
+ {
+ /* Compute the least odd embedding level greater than
+ the current level. */
+ new_level = ((current_level + 1) & ~1) + 1;
+ if (bidi_it->type_after_w1 == RLE)
+ override = NEUTRAL_DIR;
+ else
+ override = R2L;
+ if (current_level == BIDI_MAXLEVEL - 4)
+ bidi_it->invalid_rl_levels = 0;
+ bidi_push_embedding_level (bidi_it, new_level, override);
+ }
+ else
+ {
+ bidi_it->invalid_levels++;
+ /* See the commentary about invalid_rl_levels below. */
+ if (bidi_it->invalid_rl_levels < 0)
+ bidi_it->invalid_rl_levels = 0;
+ bidi_it->invalid_rl_levels++;
+ }
+ }
+ else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+ || bidi_it->next_en_pos > bidi_it->charpos)
+ type = WEAK_EN;
+ break;
+ case LRE: /* X3 */
+ case LRO: /* X5 */
+ bidi_it->type_after_w1 = type;
+ bidi_check_type (bidi_it->type_after_w1);
+ type = WEAK_BN; /* X9/Retaining */
+ if (bidi_it->ignore_bn_limit <= 0)
+ {
+ if (current_level <= BIDI_MAXLEVEL - 5)
+ {
+ /* Compute the least even embedding level greater than
+ the current level. */
+ new_level = ((current_level + 2) & ~1);
+ if (bidi_it->type_after_w1 == LRE)
+ override = NEUTRAL_DIR;
+ else
+ override = L2R;
+ bidi_push_embedding_level (bidi_it, new_level, override);
+ }
+ else
+ {
+ bidi_it->invalid_levels++;
+ /* invalid_rl_levels counts invalid levels encountered
+ while the embedding level was already too high for
+ LRE/LRO, but not for RLE/RLO. That is because
+ there may be exactly one PDF which we should not
+ ignore even though invalid_levels is non-zero.
+ invalid_rl_levels helps to know what PDF is
+ that. */
+ if (bidi_it->invalid_rl_levels >= 0)
+ bidi_it->invalid_rl_levels++;
+ }
+ }
+ else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+ || bidi_it->next_en_pos > bidi_it->charpos)
+ type = WEAK_EN;
+ break;
+ case PDF: /* X7 */
+ bidi_it->type_after_w1 = type;
+ bidi_check_type (bidi_it->type_after_w1);
+ type = WEAK_BN; /* X9/Retaining */
+ if (bidi_it->ignore_bn_limit <= 0)
+ {
+ if (!bidi_it->invalid_rl_levels)
+ {
+ new_level = bidi_pop_embedding_level (bidi_it);
+ bidi_it->invalid_rl_levels = -1;
+ if (bidi_it->invalid_levels)
+ bidi_it->invalid_levels--;
+ /* else nothing: UAX#9 says to ignore invalid PDFs */
+ }
+ if (!bidi_it->invalid_levels)
+ new_level = bidi_pop_embedding_level (bidi_it);
+ else
+ {
+ bidi_it->invalid_levels--;
+ bidi_it->invalid_rl_levels--;
+ }
+ }
+ else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+ || bidi_it->next_en_pos > bidi_it->charpos)
+ type = WEAK_EN;
+ break;
+ default:
+ /* Nothing. */
+ break;
+ }
+
+ bidi_it->type = type;
+ bidi_check_type (bidi_it->type);
+
+ return new_level;
+}
+
+/* Given an iterator state in BIDI_IT, advance one character position
+ in the buffer to the next character (in the logical order), resolve
+ any explicit embeddings and directional overrides, and return the
+ embedding level of the character after resolving explicit
+ directives and ignoring empty embeddings. */
+static int
+bidi_resolve_explicit (struct bidi_it *bidi_it)
+{
+ int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+ int new_level = bidi_resolve_explicit_1 (bidi_it);
+
+ if (prev_level < new_level
+ && bidi_it->type == WEAK_BN
+ && bidi_it->ignore_bn_limit == 0 /* only if not already known */
+ && bidi_it->bytepos < ZV_BYTE /* not already at EOB */
+ && bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
+ + bidi_it->ch_len)))
+ {
+ /* Avoid pushing and popping embedding levels if the level run
+ is empty, as this breaks level runs where it shouldn't.
+ UAX#9 removes all the explicit embedding and override codes,
+ so empty embeddings disappear without a trace. We need to
+ behave as if we did the same. */
+ struct bidi_it saved_it;
+ int level = prev_level;
+
+ bidi_copy_it (&saved_it, bidi_it);
+
+ while (bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
+ + bidi_it->ch_len)))
+ {
+ level = bidi_resolve_explicit_1 (bidi_it);
+ }
+
+ if (level == prev_level) /* empty embedding */
+ saved_it.ignore_bn_limit = bidi_it->charpos + 1;
+ else /* this embedding is non-empty */
+ saved_it.ignore_bn_limit = -1;
+
+ bidi_copy_it (bidi_it, &saved_it);
+ if (bidi_it->ignore_bn_limit > 0)
+ {
+ /* We pushed a level, but we shouldn't have. Undo that. */
+ if (!bidi_it->invalid_rl_levels)
+ {
+ new_level = bidi_pop_embedding_level (bidi_it);
+ bidi_it->invalid_rl_levels = -1;
+ if (bidi_it->invalid_levels)
+ bidi_it->invalid_levels--;
+ }
+ if (!bidi_it->invalid_levels)
+ new_level = bidi_pop_embedding_level (bidi_it);
+ else
+ {
+ bidi_it->invalid_levels--;
+ bidi_it->invalid_rl_levels--;
+ }
+ }
+ }
+
+ if (bidi_it->type == NEUTRAL_B) /* X8 */
+ {
+ bidi_set_paragraph_end (bidi_it);
+ /* This is needed by bidi_resolve_weak below, and in L1. */
+ bidi_it->type_after_w1 = bidi_it->type;
+ bidi_check_type (bidi_it->type_after_w1);
+ }
+
+ return new_level;
+}
+
+/* Advance in the buffer, resolve weak types and return the type of
+ the next character after weak type resolution. */
+static bidi_type_t
+bidi_resolve_weak (struct bidi_it *bidi_it)
+{
+ bidi_type_t type;
+ bidi_dir_t override;
+ int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+ int new_level = bidi_resolve_explicit (bidi_it);
+ int next_char;
+ bidi_type_t type_of_next;
+ struct bidi_it saved_it;
+
+ type = bidi_it->type;
+ override = bidi_it->level_stack[bidi_it->stack_idx].override;
+
+ if (type == UNKNOWN_BT
+ || type == LRE
+ || type == LRO
+ || type == RLE
+ || type == RLO
+ || type == PDF)
+ abort ();
+
+ if (new_level != prev_level
+ || bidi_it->type == NEUTRAL_B)
+ {
+ /* We've got a new embedding level run, compute the directional
+ type of sor and initialize per-run variables (UAX#9, clause
+ X10). */
+ bidi_set_sor_type (bidi_it, prev_level, new_level);
+ }
+ else if (type == NEUTRAL_S || type == NEUTRAL_WS
+ || type == WEAK_BN || type == STRONG_AL)
+ bidi_it->type_after_w1 = type; /* needed in L1 */
+ bidi_check_type (bidi_it->type_after_w1);
+
+ /* Level and directional override status are already recorded in
+ bidi_it, and do not need any change; see X6. */
+ if (override == R2L) /* X6 */
+ type = STRONG_R;
+ else if (override == L2R)
+ type = STRONG_L;
+ else
+ {
+ if (type == WEAK_NSM) /* W1 */
+ {
+ /* Note that we don't need to consider the case where the
+ prev character has its type overridden by an RLO or LRO,
+ because then either the type of this NSM would have been
+ also overridden, or the previous character is outside the
+ current level run, and thus not relevant to this NSM.
+ This is why NSM gets the type_after_w1 of the previous
+ character. */
+ if (bidi_it->prev.type_after_w1 != UNKNOWN_BT
+ /* if type_after_w1 is NEUTRAL_B, this NSM is at sor */
+ && bidi_it->prev.type_after_w1 != NEUTRAL_B)
+ type = bidi_it->prev.type_after_w1;
+ else if (bidi_it->sor == R2L)
+ type = STRONG_R;
+ else if (bidi_it->sor == L2R)
+ type = STRONG_L;
+ else /* shouldn't happen! */
+ abort ();
+ }
+ if (type == WEAK_EN /* W2 */
+ && bidi_it->last_strong.type_after_w1 == STRONG_AL)
+ type = WEAK_AN;
+ else if (type == STRONG_AL) /* W3 */
+ type = STRONG_R;
+ else if ((type == WEAK_ES /* W4 */
+ && bidi_it->prev.type_after_w1 == WEAK_EN
+ && bidi_it->prev.orig_type == WEAK_EN)
+ || (type == WEAK_CS
+ && ((bidi_it->prev.type_after_w1 == WEAK_EN
+ && bidi_it->prev.orig_type == WEAK_EN)
+ || bidi_it->prev.type_after_w1 == WEAK_AN)))
+ {
+ next_char =
+ bidi_it->bytepos + bidi_it->ch_len >= ZV_BYTE
+ ? BIDI_EOB : FETCH_CHAR (bidi_it->bytepos + bidi_it->ch_len);
+ type_of_next = bidi_get_type (next_char, override);
+
+ if (type_of_next == WEAK_BN
+ || bidi_explicit_dir_char (next_char))
+ {
+ bidi_copy_it (&saved_it, bidi_it);
+ while (bidi_resolve_explicit (bidi_it) == new_level
+ && bidi_it->type == WEAK_BN)
+ ;
+ type_of_next = bidi_it->type;
+ bidi_copy_it (bidi_it, &saved_it);
+ }
+
+ /* If the next character is EN, but the last strong-type
+ character is AL, that next EN will be changed to AN when
+ we process it in W2 above. So in that case, this ES
+ should not be changed into EN. */
+ if (type == WEAK_ES
+ && type_of_next == WEAK_EN
+ && bidi_it->last_strong.type_after_w1 != STRONG_AL)
+ type = WEAK_EN;
+ else if (type == WEAK_CS)
+ {
+ if (bidi_it->prev.type_after_w1 == WEAK_AN
+ && (type_of_next == WEAK_AN
+ /* If the next character is EN, but the last
+ strong-type character is AL, EN will be later
+ changed to AN when we process it in W2 above.
+ So in that case, this ES should not be
+ changed into EN. */
+ || (type_of_next == WEAK_EN
+ && bidi_it->last_strong.type_after_w1 == STRONG_AL)))
+ type = WEAK_AN;
+ else if (bidi_it->prev.type_after_w1 == WEAK_EN
+ && type_of_next == WEAK_EN
+ && bidi_it->last_strong.type_after_w1 != STRONG_AL)
+ type = WEAK_EN;
+ }
+ }
+ else if (type == WEAK_ET /* W5: ET with EN before or after it */
+ || type == WEAK_BN) /* W5/Retaining */
+ {
+ if (bidi_it->prev.type_after_w1 == WEAK_EN /* ET/BN w/EN before it */
+ || bidi_it->next_en_pos > bidi_it->charpos)
+ type = WEAK_EN;
+ else /* W5: ET/BN with EN after it. */
+ {
+ EMACS_INT en_pos = bidi_it->charpos + 1;
+
+ next_char =
+ bidi_it->bytepos + bidi_it->ch_len >= ZV_BYTE
+ ? BIDI_EOB : FETCH_CHAR (bidi_it->bytepos + bidi_it->ch_len);
+ type_of_next = bidi_get_type (next_char, override);
+
+ if (type_of_next == WEAK_ET
+ || type_of_next == WEAK_BN
+ || bidi_explicit_dir_char (next_char))
+ {
+ bidi_copy_it (&saved_it, bidi_it);
+ while (bidi_resolve_explicit (bidi_it) == new_level
+ && (bidi_it->type == WEAK_BN
+ || bidi_it->type == WEAK_ET))
+ ;
+ type_of_next = bidi_it->type;
+ en_pos = bidi_it->charpos;
+ bidi_copy_it (bidi_it, &saved_it);
+ }
+ if (type_of_next == WEAK_EN)
+ {
+ /* If the last strong character is AL, the EN we've
+ found will become AN when we get to it (W2). */
+ if (bidi_it->last_strong.type_after_w1 != STRONG_AL)
+ {
+ type = WEAK_EN;
+ /* Remember this EN position, to speed up processing
+ of the next ETs. */
+ bidi_it->next_en_pos = en_pos;
+ }
+ else if (type == WEAK_BN)
+ type = NEUTRAL_ON; /* W6/Retaining */
+ }
+ }
+ }
+ }
+
+ if (type == WEAK_ES || type == WEAK_ET || type == WEAK_CS /* W6 */
+ || (type == WEAK_BN
+ && (bidi_it->prev.type_after_w1 == WEAK_CS /* W6/Retaining */
+ || bidi_it->prev.type_after_w1 == WEAK_ES
+ || bidi_it->prev.type_after_w1 == WEAK_ET)))
+ type = NEUTRAL_ON;
+
+ /* Store the type we've got so far, before we clobber it with strong
+ types in W7 and while resolving neutral types. But leave alone
+ the original types that were recorded above, because we will need
+ them for the L1 clause. */
+ if (bidi_it->type_after_w1 == UNKNOWN_BT)
+ bidi_it->type_after_w1 = type;
+ bidi_check_type (bidi_it->type_after_w1);
+
+ if (type == WEAK_EN) /* W7 */
+ {
+ if ((bidi_it->last_strong.type_after_w1 == STRONG_L)
+ || (bidi_it->last_strong.type == UNKNOWN_BT && bidi_it->sor == L2R))
+ type = STRONG_L;
+ }
+
+ bidi_it->type = type;
+ bidi_check_type (bidi_it->type);
+ return type;
+}
+
+static bidi_type_t
+bidi_resolve_neutral (struct bidi_it *bidi_it)
+{
+ int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+ bidi_type_t type = bidi_resolve_weak (bidi_it);
+ int current_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+
+ if (!(type == STRONG_R
+ || type == STRONG_L
+ || type == WEAK_BN
+ || type == WEAK_EN
+ || type == WEAK_AN
+ || type == NEUTRAL_B
+ || type == NEUTRAL_S
+ || type == NEUTRAL_WS
+ || type == NEUTRAL_ON))
+ abort ();
+
+ if (bidi_get_category (type) == NEUTRAL
+ || (type == WEAK_BN && prev_level == current_level))
+ {
+ if (bidi_it->next_for_neutral.type != UNKNOWN_BT)
+ type = bidi_resolve_neutral_1 (bidi_it->prev_for_neutral.type,
+ bidi_it->next_for_neutral.type,
+ current_level);
+ else
+ {
+ /* Arrrgh!! The UAX#9 algorithm is too deeply entrenched in
+ the assumption of batch-style processing; see clauses W4,
+ W5, and especially N1, which require to look far forward
+ (as well as back) in the buffer. May the fleas of a
+ thousand camels infest the armpits of those who design
+ supposedly general-purpose algorithms by looking at their
+ own implementations, and fail to consider other possible
+ implementations! */
+ struct bidi_it saved_it;
+ bidi_type_t next_type;
+
+ if (bidi_it->scan_dir == -1)
+ abort ();
+
+ bidi_copy_it (&saved_it, bidi_it);
+ /* Scan the text forward until we find the first non-neutral
+ character, and then use that to resolve the neutral we
+ are dealing with now. We also cache the scanned iterator
+ states, to salvage some of the effort later. */
+ bidi_cache_iterator_state (bidi_it, 0);
+ do {
+ /* Record the info about the previous character, so that
+ it will be cached below with this state. */
+ if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */
+ && bidi_it->type != WEAK_BN)
+ bidi_remember_char (&bidi_it->prev, bidi_it);
+ type = bidi_resolve_weak (bidi_it);
+ /* Paragraph separators have their levels fully resolved
+ at this point, so cache them as resolved. */
+ bidi_cache_iterator_state (bidi_it, type == NEUTRAL_B);
+ /* FIXME: implement L1 here, by testing for a newline and
+ resetting the level for any sequence of whitespace
+ characters adjacent to it. */
+ } while (!(type == NEUTRAL_B
+ || (type != WEAK_BN
+ && bidi_get_category (type) != NEUTRAL)
+ /* This is all per level run, so stop when we
+ reach the end of this level run. */
+ || bidi_it->level_stack[bidi_it->stack_idx].level !=
+ current_level));
+
+ bidi_remember_char (&saved_it.next_for_neutral, bidi_it);
+
+ switch (type)
+ {
+ case STRONG_L:
+ case STRONG_R:
+ case STRONG_AL:
+ next_type = type;
+ break;
+ case WEAK_EN:
+ case WEAK_AN:
+ /* N1: ``European and Arabic numbers are treated as
+ though they were R.'' */
+ next_type = STRONG_R;
+ saved_it.next_for_neutral.type = STRONG_R;
+ break;
+ case WEAK_BN:
+ if (!bidi_explicit_dir_char (bidi_it->ch))
+ abort (); /* can't happen: BNs are skipped */
+ /* FALLTHROUGH */
+ case NEUTRAL_B:
+ /* Marched all the way to the end of this level run.
+ We need to use the eor type, whose information is
+ stored by bidi_set_sor_type in the prev_for_neutral
+ member. */
+ if (saved_it.type != WEAK_BN
+ || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL)
+ {
+ next_type = bidi_it->prev_for_neutral.type;
+ saved_it.next_for_neutral.type = next_type;
+ bidi_check_type (next_type);
+ }
+ else
+ {
+ /* This is a BN which does not adjoin neutrals.
+ Leave its type alone. */
+ bidi_copy_it (bidi_it, &saved_it);
+ return bidi_it->type;
+ }
+ break;
+ default:
+ abort ();
+ }
+ type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type,
+ next_type, current_level);
+ saved_it.type = type;
+ bidi_check_type (type);
+ bidi_copy_it (bidi_it, &saved_it);
+ }
+ }
+ return type;
+}
+
+/* Given an iterator state in BIDI_IT, advance one character position
+ in the buffer to the next character (in the logical order), resolve
+ the bidi type of that next character, and return that type. */
+static bidi_type_t
+bidi_type_of_next_char (struct bidi_it *bidi_it)
+{
+ bidi_type_t type;
+
+ /* This should always be called during a forward scan. */
+ if (bidi_it->scan_dir != 1)
+ abort ();
+
+ /* Reset the limit until which to ignore BNs if we step out of the
+ area where we found only empty levels. */
+ if ((bidi_it->ignore_bn_limit > 0
+ && bidi_it->ignore_bn_limit <= bidi_it->charpos)
+ || (bidi_it->ignore_bn_limit == -1
+ && !bidi_explicit_dir_char (bidi_it->ch)))
+ bidi_it->ignore_bn_limit = 0;
+
+ type = bidi_resolve_neutral (bidi_it);
+
+ return type;
+}
+
+/* Given an iterator state BIDI_IT, advance one character position in
+ the buffer to the next character (in the logical order), resolve
+ the embedding and implicit levels of that next character, and
+ return the resulting level. */
+static int
+bidi_level_of_next_char (struct bidi_it *bidi_it)
+{
+ bidi_type_t type;
+ int level, prev_level = -1;
+ struct bidi_saved_info next_for_neutral;
+
+ if (bidi_it->scan_dir == 1)
+ {
+ /* There's no sense in trying to advance if we hit end of text. */
+ if (bidi_it->bytepos >= ZV_BYTE)
+ return bidi_it->resolved_level;
+
+ /* Record the info about the previous character. */
+ if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */
+ && bidi_it->type != WEAK_BN)
+ bidi_remember_char (&bidi_it->prev, bidi_it);
+ if (bidi_it->type_after_w1 == STRONG_R
+ || bidi_it->type_after_w1 == STRONG_L
+ || bidi_it->type_after_w1 == STRONG_AL)
+ bidi_remember_char (&bidi_it->last_strong, bidi_it);
+ /* FIXME: it sounds like we don't need both prev and
+ prev_for_neutral members, but I'm leaving them both for now. */
+ if (bidi_it->type == STRONG_R || bidi_it->type == STRONG_L
+ || bidi_it->type == WEAK_EN || bidi_it->type == WEAK_AN)
+ bidi_remember_char (&bidi_it->prev_for_neutral, bidi_it);
+
+ /* If we overstepped the characters used for resolving neutrals
+ and whitespace, invalidate their info in the iterator. */
+ if (bidi_it->charpos >= bidi_it->next_for_neutral.charpos)
+ bidi_it->next_for_neutral.type = UNKNOWN_BT;
+ if (bidi_it->next_en_pos >= 0
+ && bidi_it->charpos >= bidi_it->next_en_pos)
+ bidi_it->next_en_pos = -1;
+ if (bidi_it->next_for_ws.type != UNKNOWN_BT
+ && bidi_it->charpos >= bidi_it->next_for_ws.charpos)
+ bidi_it->next_for_ws.type = UNKNOWN_BT;
+
+ /* This must be taken before we fill the iterator with the info
+ about the next char. If we scan backwards, the iterator
+ state must be already cached, so there's no need to know the
+ embedding level of the previous character, since we will be
+ returning to our caller shortly. */
+ prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+ }
+ next_for_neutral = bidi_it->next_for_neutral;
+
+ /* Perhaps it is already cached. */
+ type = bidi_cache_find (bidi_it->charpos + bidi_it->scan_dir, -1, bidi_it);
+ if (type != UNKNOWN_BT)
+ {
+ /* Don't lose the information for resolving neutrals! The
+ cached states could have been cached before their
+ next_for_neutral member was computed. If we are on our way
+ forward, we can simply take the info from the previous
+ state. */
+ if (bidi_it->scan_dir == 1
+ && bidi_it->next_for_neutral.type == UNKNOWN_BT)
+ bidi_it->next_for_neutral = next_for_neutral;
+
+ /* If resolved_level is -1, it means this state was cached
+ before it was completely resolved, so we cannot return
+ it. */
+ if (bidi_it->resolved_level != -1)
+ return bidi_it->resolved_level;
+ }
+ if (bidi_it->scan_dir == -1)
+ /* If we are going backwards, the iterator state is already cached
+ from previous scans, and should be fully resolved. */
+ abort ();
+
+ if (type == UNKNOWN_BT)
+ type = bidi_type_of_next_char (bidi_it);
+
+ if (type == NEUTRAL_B)
+ return bidi_it->resolved_level;
+
+ level = bidi_it->level_stack[bidi_it->stack_idx].level;
+ if ((bidi_get_category (type) == NEUTRAL /* && type != NEUTRAL_B */)
+ || (type == WEAK_BN && prev_level == level))
+ {
+ if (bidi_it->next_for_neutral.type == UNKNOWN_BT)
+ abort ();
+
+ /* If the cached state shows a neutral character, it was not
+ resolved by bidi_resolve_neutral, so do it now. */
+ type = bidi_resolve_neutral_1 (bidi_it->prev_for_neutral.type,
+ bidi_it->next_for_neutral.type,
+ level);
+ }
+
+ if (!(type == STRONG_R
+ || type == STRONG_L
+ || type == WEAK_BN
+ || type == WEAK_EN
+ || type == WEAK_AN))
+ abort ();
+ bidi_it->type = type;
+ bidi_check_type (bidi_it->type);
+
+ /* For L1 below, we need to know, for each WS character, whether
+ it belongs to a sequence of WS characters preceeding a newline
+ or a TAB or a paragraph separator. */
+ if (bidi_it->orig_type == NEUTRAL_WS
+ && bidi_it->next_for_ws.type == UNKNOWN_BT)
+ {
+ int ch;
+ int clen = bidi_it->ch_len;
+ EMACS_INT bpos = bidi_it->bytepos;
+ EMACS_INT cpos = bidi_it->charpos;
+ bidi_type_t chtype;
+
+ do {
+ /*_fetch_multibyte_char_len = 1;*/
+ ch = bpos + clen >= ZV_BYTE ? BIDI_EOB : FETCH_CHAR (bpos + clen);
+ bpos += clen;
+ cpos++;
+ clen = (ch == BIDI_EOB ? 1 : CHAR_BYTES (ch));
+ if (ch == '\n' || ch == BIDI_EOB /* || ch == LINESEP_CHAR */)
+ chtype = NEUTRAL_B;
+ else
+ chtype = bidi_get_type (ch, NEUTRAL_DIR);
+ } while (chtype == NEUTRAL_WS || chtype == WEAK_BN
+ || bidi_explicit_dir_char (ch)); /* L1/Retaining */
+ bidi_it->next_for_ws.type = chtype;
+ bidi_check_type (bidi_it->next_for_ws.type);
+ bidi_it->next_for_ws.charpos = cpos;
+ bidi_it->next_for_ws.bytepos = bpos;
+ }
+
+ /* Resolve implicit levels, with a twist: PDFs get the embedding
+ level of the enbedding they terminate. See below for the
+ reason. */
+ if (bidi_it->orig_type == PDF
+ /* Don't do this if this formatting code didn't change the
+ embedding level due to invalid or empty embeddings. */
+ && prev_level != level)
+ {
+ /* Don't look in UAX#9 for the reason for this: it's our own
+ private quirk. The reason is that we want the formatting
+ codes to be delivered so that they bracket the text of their
+ embedding. For example, given the text
+
+ {RLO}teST{PDF}
+
+ we want it to be displayed as
+
+ {RLO}STet{PDF}
+
+ not as
+
+ STet{RLO}{PDF}
+
+ which will result because we bump up the embedding level as
+ soon as we see the RLO and pop it as soon as we see the PDF,
+ so RLO itself has the same embedding level as "teST", and
+ thus would be normally delivered last, just before the PDF.
+ The switch below fiddles with the level of PDF so that this
+ ugly side effect does not happen.
+
+ (This is, of course, only important if the formatting codes
+ are actually displayed, but Emacs does need to display them
+ if the user wants to.) */
+ level = prev_level;
+ }
+ else if (bidi_it->orig_type == NEUTRAL_B /* L1 */
+ || bidi_it->orig_type == NEUTRAL_S
+ || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB
+ /* || bidi_it->ch == LINESEP_CHAR */
+ || (bidi_it->orig_type == NEUTRAL_WS
+ && (bidi_it->next_for_ws.type == NEUTRAL_B
+ || bidi_it->next_for_ws.type == NEUTRAL_S)))
+ level = bidi_it->level_stack[0].level;
+ else if ((level & 1) == 0) /* I1 */
+ {
+ if (type == STRONG_R)
+ level++;
+ else if (type == WEAK_EN || type == WEAK_AN)
+ level += 2;
+ }
+ else /* I2 */
+ {
+ if (type == STRONG_L || type == WEAK_EN || type == WEAK_AN)
+ level++;
+ }
+
+ bidi_it->resolved_level = level;
+ return level;
+}
+
+/* Move to the other edge of a level given by LEVEL. If END_FLAG is
+ non-zero, we are at the end of a level, and we need to prepare to
+ resume the scan of the lower level.
+
+ If this level's other edge is cached, we simply jump to it, filling
+ the iterator structure with the iterator state on the other edge.
+ Otherwise, we walk the buffer until we come back to the same level
+ as LEVEL.
+
+ Note: we are not talking here about a ``level run'' in the UAX#9
+ sense of the term, but rather about a ``level'' which includes
+ all the levels higher than it. In other words, given the levels
+ like this:
+
+ 11111112222222333333334443343222222111111112223322111
+ A B C
+
+ and assuming we are at point A scanning left to right, this
+ function moves to point C, whereas the UAX#9 ``level 2 run'' ends
+ at point B. */
+static void
+bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag)
+{
+ int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir;
+ int idx;
+
+ /* Try the cache first. */
+ if ((idx = bidi_cache_find_level_change (level, dir, end_flag)) >= 0)
+ bidi_cache_fetch_state (idx, bidi_it);
+ else
+ {
+ int new_level;
+
+ if (end_flag)
+ abort (); /* if we are at end of level, its edges must be cached */
+
+ bidi_cache_iterator_state (bidi_it, 1);
+ do {
+ new_level = bidi_level_of_next_char (bidi_it);
+ bidi_cache_iterator_state (bidi_it, 1);
+ } while (new_level >= level);
+ }
+}
+
+void
+bidi_move_to_visually_next (struct bidi_it *bidi_it)
+{
+ int old_level, new_level, next_level;
+ struct bidi_it sentinel;
+
+ if (bidi_it->scan_dir == 0)
+ {
+ bidi_it->scan_dir = 1; /* default to logical order */
+ }
+
+ /* If we just passed a newline, initialize for the next line. */
+ if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B)
+ bidi_line_init (bidi_it);
+
+ /* Prepare the sentinel iterator state. */
+ if (bidi_cache_idx == 0)
+ {
+ bidi_copy_it (&sentinel, bidi_it);
+ if (bidi_it->first_elt)
+ {
+ sentinel.charpos--; /* cached charpos needs to be monotonic */
+ sentinel.bytepos--;
+ sentinel.ch = '\n'; /* doesn't matter, but why not? */
+ sentinel.ch_len = 1;
+ }
+ }
+
+ old_level = bidi_it->resolved_level;
+ new_level = bidi_level_of_next_char (bidi_it);
+
+ /* Reordering of resolved levels (clause L2) is implemented by
+ jumping to the other edge of the level and flipping direction of
+ scanning the text whenever we find a level change. */
+ if (new_level != old_level)
+ {
+ int ascending = new_level > old_level;
+ int level_to_search = ascending ? old_level + 1 : old_level;
+ int incr = ascending ? 1 : -1;
+ int expected_next_level = old_level + incr;
+
+ /* If we don't have anything cached yet, we need to cache the
+ sentinel state, since we'll need it to record where to jump
+ when the last non-base level is exhausted. */
+ if (bidi_cache_idx == 0)
+ bidi_cache_iterator_state (&sentinel, 1);
+ /* Jump (or walk) to the other edge of this level. */
+ bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
+ /* Switch scan direction and peek at the next character in the
+ new direction. */
+ bidi_it->scan_dir = -bidi_it->scan_dir;
+
+ /* The following loop handles the case where the resolved level
+ jumps by more than one. This is typical for numbers inside a
+ run of text with left-to-right embedding direction, but can
+ also happen in other situations. In those cases the decision
+ where to continue after a level change, and in what direction,
+ is tricky. For example, given a text like below:
+
+ abcdefgh
+ 11336622
+
+ (where the numbers below the text show the resolved levels),
+ the result of reordering according to UAX#9 should be this:
+
+ efdcghba
+
+ This is implemented by the loop below which flips direction
+ and jumps to the other edge of the level each time it finds
+ the new level not to be the expected one. The expected level
+ is always one more or one less than the previous one. */
+ next_level = bidi_peek_at_next_level (bidi_it);
+ while (next_level != expected_next_level)
+ {
+ expected_next_level += incr;
+ level_to_search += incr;
+ bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
+ bidi_it->scan_dir = -bidi_it->scan_dir;
+ next_level = bidi_peek_at_next_level (bidi_it);
+ }
+
+ /* Finally, deliver the next character in the new direction. */
+ next_level = bidi_level_of_next_char (bidi_it);
+ }
+
+ /* Take note when we have just processed the newline that precedes
+ the end of the paragraph. The next time we are about to be
+ called, set_iterator_to_next will automatically reinit the
+ paragraph direction, if needed. We do this at the newline before
+ the paragraph separator, because the next character might not be
+ the first character of the next paragraph, due to the bidi
+ reordering, whereas we _must_ know the paragraph base direction
+ _before_ we process the paragraph's text, since the base
+ direction affects the reordering. */
+ if (bidi_it->scan_dir == 1
+ && bidi_it->orig_type == NEUTRAL_B
+ && bidi_it->bytepos < ZV_BYTE)
+ {
+ EMACS_INT sep_len =
+ bidi_at_paragraph_end (bidi_it->charpos + 1,
+ bidi_it->bytepos + bidi_it->ch_len);
+ if (sep_len >= 0)
+ {
+ bidi_it->new_paragraph = 1;
+ /* Record the buffer position of the last character of the
+ paragraph separator. */
+ bidi_it->separator_limit = bidi_it->charpos + 1 + sep_len;
+ }
+ }
+
+ if (bidi_it->scan_dir == 1 && bidi_cache_idx)
+ {
+ /* If we are at paragraph's base embedding level and beyond the
+ last cached position, the cache's job is done and we can
+ discard it. */
+ if (bidi_it->resolved_level == bidi_it->level_stack[0].level
+ && bidi_it->charpos > bidi_cache[bidi_cache_idx - 1].charpos)
+ bidi_cache_reset ();
+ /* But as long as we are caching during forward scan, we must
+ cache each state, or else the cache integrity will be
+ compromised: it assumes cached states correspond to buffer
+ positions 1:1. */
+ else
+ bidi_cache_iterator_state (bidi_it, 1);
+ }
+}
+
+/* This is meant to be called from within the debugger, whenever you
+ wish to examine the cache contents. */
+void
+bidi_dump_cached_states (void)
+{
+ int i;
+ int ndigits = 1;
+
+ if (bidi_cache_idx == 0)
+ {
+ fprintf (stderr, "The cache is empty.\n");
+ return;
+ }
+ fprintf (stderr, "Total of %d state%s in cache:\n",
+ bidi_cache_idx, bidi_cache_idx == 1 ? "" : "s");
+
+ for (i = bidi_cache[bidi_cache_idx - 1].charpos; i > 0; i /= 10)
+ ndigits++;
+ fputs ("ch ", stderr);
+ for (i = 0; i < bidi_cache_idx; i++)
+ fprintf (stderr, "%*c", ndigits, bidi_cache[i].ch);
+ fputs ("\n", stderr);
+ fputs ("lvl ", stderr);
+ for (i = 0; i < bidi_cache_idx; i++)
+ fprintf (stderr, "%*d", ndigits, bidi_cache[i].resolved_level);
+ fputs ("\n", stderr);
+ fputs ("pos ", stderr);
+ for (i = 0; i < bidi_cache_idx; i++)
+ fprintf (stderr, "%*d", ndigits, bidi_cache[i].charpos);
+ fputs ("\n", stderr);
+}
#include <stdio.h>
#include <setjmp.h>
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
be a DEFVAR_PER_BUFFER for the slot, there is no default value for it;
and the corresponding slot in buffer_defaults is not used.
- If a slot is -2, then there is no DEFVAR_PER_BUFFER for it,
- but there is a default value which is copied into each buffer.
-
If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is
zero, that is a bug */
/* A Lisp_Object pointer to the above, used for staticpro */
static Lisp_Object Vbuffer_local_symbols;
+/* Return the symbol of the per-buffer variable at offset OFFSET in
+ the buffer structure. */
+
+#define PER_BUFFER_SYMBOL(OFFSET) \
+ (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols))
+
/* Flags indicating which built-in buffer-local variables
are permanent locals. */
static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS];
continue;
obj = PER_BUFFER_VALUE (from, offset);
- if (MARKERP (obj))
+ if (MARKERP (obj) && XMARKER (obj)->buffer == from)
{
struct Lisp_Marker *m = XMARKER (obj);
obj = Fmake_marker ();
b->file_truename = Qnil;
b->directory = (current_buffer) ? current_buffer->directory : Qnil;
b->modtime = 0;
+ b->modtime_size = -1;
XSETFASTINT (b->save_length, 0);
b->last_window_start = 1;
/* It is more conservative to start out "changed" than "unchanged". */
{
Lisp_Object tmp, prop, last = Qnil;
for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp))
- if (CONSP (XCAR (tmp))
- && SYMBOLP (XCAR (XCAR (tmp)))
- && !NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local)))
+ if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local)))
{
/* If permanent-local, keep it. */
last = tmp;
int idx = PER_BUFFER_IDX (offset);
if ((idx > 0
&& (permanent_too
- || buffer_permanent_local_flags[idx] == 0))
- /* Is -2 used anywhere? */
- || idx == -2)
+ || buffer_permanent_local_flags[idx] == 0)))
PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset);
}
}
CHECK_SYMBOL (variable);
CHECK_BUFFER (buffer);
buf = XBUFFER (buffer);
+ sym = XSYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
- XSETSYMBOL (variable, sym);
-
- /* Look in local_var_list */
- result = Fassoc (variable, buf->local_var_alist);
- if (NILP (result))
- {
- int offset, idx;
- int found = 0;
-
- /* Look in special slots */
- /* buffer-local Lisp variables start at `undo_list',
- tho only the ones from `name' on are GC'd normally. */
- for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
- offset < sizeof (struct buffer);
- /* sizeof EMACS_INT == sizeof Lisp_Object */
- offset += (sizeof (EMACS_INT)))
- {
- idx = PER_BUFFER_IDX (offset);
- if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
- && SYMBOLP (PER_BUFFER_SYMBOL (offset))
- && EQ (PER_BUFFER_SYMBOL (offset), variable))
- {
- result = PER_BUFFER_VALUE (buf, offset);
- found = 1;
- break;
- }
- }
-
- if (!found)
- result = Fdefault_value (variable);
- }
- else
+ start:
+ switch (sym->redirect)
{
- Lisp_Object valcontents;
- Lisp_Object current_alist_element;
-
- /* What binding is loaded right now? */
- valcontents = sym->value;
- current_alist_element
- = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
-
- /* The value of the currently loaded binding is not
- stored in it, but rather in the realvalue slot.
- Store that value into the binding it belongs to
- in case that is the one we are about to use. */
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: result = SYMBOL_VAL (sym); break;
+ case SYMBOL_LOCALIZED:
+ { /* Look in local_var_alist. */
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ XSETSYMBOL (variable, sym); /* Update In case of aliasing. */
+ result = Fassoc (variable, buf->local_var_alist);
+ if (!NILP (result))
+ {
+ if (blv->fwd)
+ { /* What binding is loaded right now? */
+ Lisp_Object current_alist_element = blv->valcell;
- Fsetcdr (current_alist_element,
- do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue));
+ /* The value of the currently loaded binding is not
+ stored in it, but rather in the realvalue slot.
+ Store that value into the binding it belongs to
+ in case that is the one we are about to use. */
- /* Now get the (perhaps updated) value out of the binding. */
- result = XCDR (result);
+ XSETCDR (current_alist_element,
+ do_symval_forwarding (blv->fwd));
+ }
+ /* Now get the (perhaps updated) value out of the binding. */
+ result = XCDR (result);
+ }
+ else
+ result = Fdefault_value (variable);
+ break;
+ }
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *fwd = SYMBOL_FWD (sym);
+ if (BUFFER_OBJFWDP (fwd))
+ result = PER_BUFFER_VALUE (buf, XBUFFER_OBJFWD (fwd)->offset);
+ else
+ result = Fdefault_value (variable);
+ break;
+ }
+ default: abort ();
}
if (!EQ (result, Qunbound))
if (buf != current_buffer)
val = XCDR (elt);
- /* If symbol is unbound, put just the symbol in the list. */
- if (EQ (val, Qunbound))
- result = Fcons (XCAR (elt), result);
- /* Otherwise, put (symbol . value) in the list. */
- else
- result = Fcons (Fcons (XCAR (elt), val), result);
+ result = Fcons (Fcons (XCAR (elt), val), result);
}
return result;
Lisp_Object tem;
tem = Fsymbol_value (intern ("delete-auto-save-files"));
if (! NILP (tem))
- internal_delete_file (b->auto_save_file_name);
+ internal_delete_file (b->auto_save_file_name, Qt);
}
if (b->base_buffer)
register struct buffer *b;
{
register struct buffer *old_buf;
- register Lisp_Object tail, valcontents;
- Lisp_Object tem;
+ register Lisp_Object tail;
#ifdef USE_MMAP_FOR_BUFFERS
if (b->text->beg == NULL)
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
- for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ do
{
- if (CONSP (XCAR (tail))
- && SYMBOLP (XCAR (XCAR (tail)))
- && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))),
- (BUFFER_LOCAL_VALUEP (valcontents)))
- && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
- (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
- /* Just reference the variable to cause it to become set for
- this buffer. */
- Fsymbol_value (XCAR (XCAR (tail)));
+ for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ Lisp_Object var = XCAR (XCAR (tail));
+ struct Lisp_Symbol *sym = XSYMBOL (var);
+ if (sym->redirect == SYMBOL_LOCALIZED /* Just to be sure. */
+ && SYMBOL_BLV (sym)->fwd)
+ /* Just reference the variable
+ to cause it to become set for this buffer. */
+ Fsymbol_value (var);
+ }
}
-
/* Do the same with any others that were local to the previous buffer */
-
- if (old_buf)
- for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
- {
- if (CONSP (tail)
- && SYMBOLP (XCAR (XCAR (tail)))
- && (valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))),
- (BUFFER_LOCAL_VALUEP (valcontents)))
- && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
- (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
- /* Just reference the variable to cause it to become set for
- this buffer. */
- Fsymbol_value (XCAR (XCAR (tail)));
- }
+ while (b != old_buf && (b = old_buf, b));
}
/* Switch to buffer B temporarily for redisplay purposes.
swapfield (undo_list, Lisp_Object);
swapfield (mark, Lisp_Object);
swapfield (enable_multibyte_characters, Lisp_Object);
+ swapfield (bidi_display_reordering, Lisp_Object);
+ swapfield (bidi_paragraph_direction, Lisp_Object);
/* FIXME: Not sure what we should do with these *_marker fields.
Hopefully they're just nil anyway. */
swapfield (pt_marker, Lisp_Object);
swap_out_buffer_local_variables (b)
struct buffer *b;
{
- Lisp_Object oalist, alist, sym, buffer;
+ Lisp_Object oalist, alist, buffer;
XSETBUFFER (buffer, b);
oalist = b->local_var_alist;
for (alist = oalist; CONSP (alist); alist = XCDR (alist))
{
- if (CONSP (XCAR (alist))
- && (sym = XCAR (XCAR (alist)), SYMBOLP (sym))
- /* Need not do anything if some other buffer's binding is
- now encached. */
- && EQ (XBUFFER_LOCAL_VALUE (SYMBOL_VALUE (sym))->buffer,
- buffer))
+ Lisp_Object sym = XCAR (XCAR (alist));
+ eassert (XSYMBOL (sym)->redirect == SYMBOL_LOCALIZED);
+ /* Need not do anything if some other buffer's binding is
+ now encached. */
+ if (EQ (SYMBOL_BLV (XSYMBOL (sym))->where, buffer))
{
/* Symbol is set up for this buffer's old local value:
swap it out! */
- swap_in_global_binding (sym);
+ swap_in_global_binding (XSYMBOL (sym));
}
}
}
#endif
#include <stdio.h>
-#include <errno.h>
#if MAP_ANON == 0
#include <fcntl.h>
/* Make sure all markable slots in buffer_defaults
are initialized reasonably, so mark_buffer won't choke. */
reset_buffer (&buffer_defaults);
+ eassert (EQ (buffer_defaults.name, make_number (0)));
reset_buffer_local_variables (&buffer_defaults, 1);
+ eassert (EQ (buffer_local_symbols.name, make_number (0)));
reset_buffer (&buffer_local_symbols);
reset_buffer_local_variables (&buffer_local_symbols, 1);
/* Prevent GC from getting confused. */
buffer_defaults.truncate_lines = Qnil;
buffer_defaults.word_wrap = Qnil;
buffer_defaults.ctl_arrow = Qt;
- buffer_defaults.direction_reversed = Qnil;
+ buffer_defaults.bidi_display_reordering = Qnil;
+ buffer_defaults.bidi_paragraph_direction = Qnil;
buffer_defaults.cursor_type = Qt;
buffer_defaults.extra_line_spacing = Qnil;
buffer_defaults.cursor_in_non_selected_windows = Qt;
XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx;
XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx;
XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
- XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx;
XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
in the buffer that is current now. */
/* TYPE is nil for a general Lisp variable.
- An integer specifies a type; then only LIsp values
+ An integer specifies a type; then only Lisp values
with that type code are allowed (except that nil is allowed too).
- LNAME is the LIsp-level variable name.
+ LNAME is the Lisp-level variable name.
VNAME is the name of the buffer slot.
DOC is a dummy where you write the doc string as a comment. */
-#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
- defvar_per_buffer (lname, vname, type, 0)
+#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
+ do { \
+ static struct Lisp_Buffer_Objfwd bo_fwd; \
+ defvar_per_buffer (&bo_fwd, lname, vname, type, 0); \
+ } while (0)
static void
-defvar_per_buffer (namestring, address, type, doc)
+defvar_per_buffer (bo_fwd, namestring, address, type, doc)
+ struct Lisp_Buffer_Objfwd *bo_fwd;
char *namestring;
Lisp_Object *address;
Lisp_Object type;
char *doc;
{
- Lisp_Object sym, val;
+ struct Lisp_Symbol *sym;
int offset;
- sym = intern (namestring);
- val = allocate_misc ();
+ sym = XSYMBOL (intern (namestring));
offset = (char *)address - (char *)current_buffer;
- XMISCTYPE (val) = Lisp_Misc_Buffer_Objfwd;
- XBUFFER_OBJFWD (val)->offset = offset;
- XBUFFER_OBJFWD (val)->slottype = type;
- SET_SYMBOL_VALUE (sym, val);
- PER_BUFFER_SYMBOL (offset) = sym;
+ bo_fwd->type = Lisp_Fwd_Buffer_Obj;
+ bo_fwd->offset = offset;
+ bo_fwd->slottype = type;
+ sym->redirect = SYMBOL_FORWARDED;
+ {
+ /* I tried to do the job without a cast, but it seems impossible.
+ union Lisp_Fwd *fwd; &(fwd->u_buffer_objfwd) = bo_fwd; */
+ SET_SYMBOL_FWD (sym, (union Lisp_Fwd *)bo_fwd);
+ }
+ XSETSYMBOL (PER_BUFFER_SYMBOL (offset), sym);
if (PER_BUFFER_IDX (offset) == 0)
/* Did a DEFVAR_PER_BUFFER without initializing the corresponding
doc: /* Default value of `ctl-arrow' for buffers that do not override it.
This is the same as (default-value 'ctl-arrow). */);
- DEFVAR_LISP_NOPRO ("default-direction-reversed",
- &buffer_defaults.direction_reversed,
- doc: /* Default value of `direction-reversed' for buffers that do not override it.
-This is the same as (default-value 'direction-reversed). */);
-
DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters",
&buffer_defaults.enable_multibyte_characters,
doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it.
This variable is never applied to a way of decoding a file while reading it. */);
- DEFVAR_PER_BUFFER ("direction-reversed", ¤t_buffer->direction_reversed,
- Qnil,
- doc: /* *Non-nil means lines in the buffer are displayed right to left. */);
+ DEFVAR_PER_BUFFER ("bidi-display-reordering",
+ ¤t_buffer->bidi_display_reordering, Qnil,
+ doc: /* Non-nil means reorder bidirectional text for display in the visual order. */);
+
+ DEFVAR_PER_BUFFER ("bidi-paragraph-direction",
+ ¤t_buffer->bidi_paragraph_direction, Qnil,
+ doc: /* *If non-nil, forces directionality of text paragraphs in the buffer.
+
+If this is nil (the default), the direction of each paragraph is
+determined by the first strong directional character of its text.
+The values of `right-to-left' and `left-to-right' override that.
+Any other value is treated as nil.
+
+This variable has no effect unless the buffer's value of
+\`bidi-display-reordering' is non-nil. */);
- DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil,
+ DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil,
doc: /* *Non-nil means do not display continuation lines.
Instead, give each line of text just one screen line.
#define BUF_BEG(buf) (BEG)
#define BUF_BEG_BYTE(buf) (BEG_BYTE)
+/* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed:
+ on indirect (or base) buffers, that value is only correct if that buffer
+ is the current_buffer, or if the buffer's text hasn't been modified (via
+ an indirect buffer) since it was last current. */
+
/* Position of beginning of accessible range of buffer. */
#define BUF_BEGV(buf) ((buf)->begv)
#define BUF_BEGV_BYTE(buf) ((buf)->begv_byte)
- (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \
+ BEG_BYTE)
-/* Return character at position POS. */
+/* Return character at byte position POS. */
#define FETCH_CHAR(pos) \
(!NILP (current_buffer->enable_multibyte_characters) \
/* Variables used locally in FETCH_MULTIBYTE_CHAR. */
extern unsigned char *_fetch_multibyte_char_p;
-/* Return character code of multi-byte form at position POS. If POS
+/* Return character code of multi-byte form at byte position POS. If POS
doesn't point the head of valid multi-byte form, only the byte at
POS is returned. No range checking. */
+ (pos) + BEG_ADDR - BEG_BYTE), \
STRING_CHAR (_fetch_multibyte_char_p))
-/* Return character at position POS. If the current buffer is unibyte
+/* Return character at byte position POS. If the current buffer is unibyte
and the character is not ASCII, make the returning character
multibyte. */
/* The markers that refer to this buffer.
This is actually a single marker ---
successive elements in its marker `chain'
- are the other markers referring to this buffer. */
+ are the other markers referring to this buffer.
+ This is a singly linked unordered list, which means that it's
+ very cheap to add a marker to the list and it's also very cheap
+ to move a marker within a buffer. */
struct Lisp_Marker *markers;
/* Usually 0. Temporarily set to 1 in decode_coding_gap to
0 means visited file modtime unknown; in no case complain
about any mismatch on next save attempt. */
int modtime;
+ /* Size of the file when modtime was set. This is used to detect the
+ case where the file grew while we were reading it, so the modtime
+ is still the same (since it's rounded up to seconds) but we're actually
+ not up-to-date. -1 means the size is unknown. Only meaningful if
+ modtime is actually set. */
+ EMACS_INT modtime_size;
/* The value of text->modiff at the last auto-save. */
int auto_save_modified;
/* The value of text->modiff at the last display error.
Lisp_Object word_wrap;
/* Non-nil means display ctl chars with uparrow. */
Lisp_Object ctl_arrow;
- /* Non-nil means display text from right to left. */
- Lisp_Object direction_reversed;
+ /* Non-nil means reorder bidirectional text for display in the
+ visual order. */
+ Lisp_Object bidi_display_reordering;
+ /* If non-nil, specifies which direction of text to force in all the
+ paragraphs of the buffer. Nil means determine paragraph
+ direction dynamically for each paragraph. */
+ Lisp_Object bidi_paragraph_direction;
/* Non-nil means do selective display;
see doc string in syms_of_buffer (buffer.c) for details. */
Lisp_Object selective_display;
be a Lisp-level local variable for the slot, it has no default value,
and the corresponding slot in buffer_defaults is not used. */
+
extern struct buffer buffer_local_flags;
/* For each buffer slot, this points to the Lisp symbol name
from the start of a buffer structure. */
#define PER_BUFFER_VAR_OFFSET(VAR) \
- ((char *) &buffer_local_flags.VAR - (char *) &buffer_local_flags)
+ ((char *) &((struct buffer *)0)->VAR - (char *) ((struct buffer *)0))
/* Return the index of buffer-local variable VAR. Each per-buffer
variable has an index > 0 associated with it, except when it always
#define PER_BUFFER_VALUE(BUFFER, OFFSET) \
(*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
-/* Return the symbol of the per-buffer variable at offset OFFSET in
- the buffer structure. */
-
-#define PER_BUFFER_SYMBOL(OFFSET) \
- (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols))
-
/* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1
(do not change this comment) */
v1 = vectorp[op];
if (SYMBOLP (v1))
{
- v2 = SYMBOL_VALUE (v1);
- if (MISCP (v2) || EQ (v2, Qunbound))
+ if (XSYMBOL (v1)->redirect != SYMBOL_PLAINVAL
+ || (v2 = SYMBOL_VAL (XSYMBOL (v1)),
+ EQ (v2, Qunbound)))
{
BEFORE_POTENTIAL_GC ();
v2 = Fsymbol_value (v1);
/* Inline the most common case. */
if (SYMBOLP (sym)
&& !EQ (val, Qunbound)
- && !XSYMBOL (sym)->indirect_variable
- && !SYMBOL_CONSTANT_P (sym)
- && !MISCP (XSYMBOL (sym)->value))
- XSYMBOL (sym)->value = val;
+ && !XSYMBOL (sym)->redirect
+ && !SYMBOL_CONSTANT_P (sym))
+ XSYMBOL (sym)->val.value = val;
else
{
BEFORE_POTENTIAL_GC ();
- set_internal (sym, val, current_buffer, 0);
+ set_internal (sym, val, Qnil, 0);
AFTER_POTENTIAL_GC ();
}
}
#include <stdio.h>
#include <setjmp.h>
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* Define SIGCHLD as an alias for SIGCLD. */
#if !defined (SIGCHLD) && defined (SIGCLD)
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/param.h>
-#include <errno.h>
#endif /* MSDOS */
#ifndef O_RDONLY
#endif
#ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
#undef setpgrp
#define setpgrp setpgid
#endif
#ifdef HAVE_SETSID
setsid ();
#endif
-#if defined (USG) && !defined (BSD_PGRPS)
+#if defined (USG)
setpgrp ();
#else
setpgrp (pid, pid);
/* Suppress jka-compr handling, etc. */
int count = SPECPDL_INDEX ();
specbind (intern ("file-name-handler-alist"), Qnil);
- internal_delete_file (name);
+ internal_delete_file (name, Qt);
unbind_to (count, Qnil);
return Qnil;
}
#endif /* not MSDOS */
#endif /* not WINDOWSNT */
-#if defined(USG) && !defined(BSD_PGRPS)
+#if defined(USG)
#ifndef SETPGRP_RELEASES_CTTY
setpgrp (); /* No arguments but equivalent in this case */
#endif
/* If P is after LIMIT, advance P to the previous character boundary.
Assumes that P is already at a character boundary of the same
- mulitbyte form whose beginning address is LIMIT. */
+ multibyte form whose beginning address is LIMIT. */
#define PREV_CHAR_BOUNDARY(p, limit) \
do { \
n_entries++;
}
fclose (fp);
- close (fd);
load_charset_map (charset, head, n_entries, control_flag);
SAFE_FREE ();
return charset;
}
charset_list = XCDR (charset_list);
- if (c <= MAX_UNICODE_CHAR
- && EQ (charset_list, Vcharset_non_preferred_head))
+ if (! maybe_null
+ && c <= MAX_UNICODE_CHAR
+ && EQ (charset_list, Vcharset_non_preferred_head))
return CHARSET_FROM_ID (charset_unicode);
}
return (maybe_null ? NULL
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
won't find. */
-
-#if defined HAVE_TERMCAP_H && 0
-#include <termcap.h>
-#else
extern void tputs P_ ((const char *, int, int (*)(int)));
extern char *tgoto P_ ((const char *, int, int));
-#endif
#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
use about 2000.... */
}
DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
- doc: /* Move point right N characters (left if N is negative).
-On reaching end of buffer, stop and signal error. */)
+ doc: /* Move point N characters forward (backward if N is negative).
+On reaching end or beginning of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[right-arrow-command], which see. */)
(n)
Lisp_Object n;
{
}
DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
- doc: /* Move point left N characters (right if N is negative).
-On attempt to pass beginning or end of buffer, stop and signal error. */)
+ doc: /* Move point N characters backward (forward if N is negative).
+On attempt to pass beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen. This is in contrast with
+\\[left-arrow-command], which see. */)
(n)
Lisp_Object n;
{
return value;
}
-int nonundocount;
+static int nonundocount;
/* Note that there's code in command_loop_1 which typically avoids
calling this. */
{
/* We didn't find an 8-bit code. We may
have found a null-byte, but it's very
- rare that a binary file confirm to
+ rare that a binary file conforms to
ISO-2022. */
src = src_end;
coding->head_ascii = src - coding->source;
composition rules to tell how to compose (2N+2)th element with
the previously composed 2N glyphs.
- COMPONENTS-VEC -- Vector of integers. In relative composition, the
- elements are characters to be composed. In rule-base
+ COMPONENTS-VEC -- Vector of integers. In a relative composition,
+ the elements are the characters to be composed. In a rule-base
composition, the elements are characters or encoded
composition rules.
get_composition_id checks the validity of `composition' property,
and, if valid, assigns a new ID, registers the information in
composition_hash_table and composition_table, and changes the form
- of the property value. If the property is invalid, return -1
- without changing the property value.
+ of the property value. If the property is invalid,
+ get_composition_id returns -1 without changing the property value.
- We use two tables to keep information about composition;
+ We use two tables to keep the information about composition;
composition_hash_table and composition_table.
- The former is a hash table in which keys are COMPONENTS-VECs and
+ The former is a hash table whose keys are COMPONENTS-VECs and
values are the corresponding COMPOSITION-IDs. This hash table is
weak, but as each key (COMPONENTS-VEC) is also kept as a value of the
`composition' property, it won't be collected as garbage until all
Lisp_Object Qauto_composition_function;
Lisp_Object Vcomposition_function_table;
-/* Maxinum number of characters to lookback to check
- auto-composition. */
+/* Maximum number of characters to look back for
+ auto-compositions. */
#define MAX_AUTO_COMPOSITION_LOOKBACK 3
EXFUN (Fremove_list_of_text_properties, 4);
return unbind_to (count, Qnil);
}
+static Lisp_Object _work_val;
+static int _work_char;
+
+/* 1 iff the character C is composable. */
+#define CHAR_COMPOSABLE_P(C) \
+ ((C) == 0x200C || (C) == 0x200D \
+ || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \
+ (SYMBOLP (_work_val) \
+ && (_work_char = SDATA (SYMBOL_NAME (_work_val))[0]) != 'C' \
+ && _work_char != 'Z')))
/* Update cmp_it->stop_pos to the next position after CHARPOS (and
BYTEPOS) where character composition may happen. If BYTEPOS is
- negative, compoute it. If it is a static composition, set
- cmp_it->ch to -1. Otherwise, set cmp_it->ch to the character that
- triggers a automatic composition. */
+ negative, compute it. ENDPOS is a limit of searching. If it is
+ less than CHARPOS, search backward to ENDPOS+1 assuming that
+ set_iterator_to_next works in reverse order. In this case, if a
+ composition closest to CHARPOS is found, set cmp_it->stop_pos to
+ the last character of the composition.
+
+ If no composition is found, set cmp_it->ch to -2. If a static
+ composition is found, set cmp_it->ch to -1. Otherwise, set
+ cmp_it->ch to the character that triggers the automatic
+ composition. */
void
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
/* This is from forward_to_next_line_start in xdisp.c. */
const int MAX_NEWLINE_DISTANCE = 500;
- if (endpos > charpos + MAX_NEWLINE_DISTANCE)
- endpos = charpos + MAX_NEWLINE_DISTANCE;
- cmp_it->stop_pos = endpos;
+ if (charpos < endpos)
+ {
+ if (endpos > charpos + MAX_NEWLINE_DISTANCE)
+ endpos = charpos + MAX_NEWLINE_DISTANCE;
+ }
+ else if (endpos < charpos)
+ {
+ /* We search backward for a position to check composition. */
+ if (endpos < 0)
+ {
+ /* But we don't know where to stop the searching. */
+ endpos = NILP (string) ? BEGV - 1 : -1;
+ /* Usually we don't reach ENDPOS because we stop searching
+ at an uncomposable character (NL, LRE, etc). */
+ }
+ }
cmp_it->id = -1;
cmp_it->ch = -2;
- if (find_composition (charpos, endpos, &start, &end, &prop, string)
+ cmp_it->reversed_p = 0;
+ cmp_it->stop_pos = endpos;
+ if (charpos == endpos)
+ return;
+ /* FIXME: Bidi is not yet handled well in static composition. */
+ if (charpos < endpos
+ && find_composition (charpos, endpos, &start, &end, &prop, string)
&& COMPOSITION_VALID_P (start, end, prop))
{
cmp_it->stop_pos = endpos = start;
cmp_it->ch = -1;
}
- if (NILP (string) && PT > charpos && PT < endpos)
- cmp_it->stop_pos = PT;
+ if (NILP (string))
+ {
+ /* A composition never strides over PT. */
+ if (PT > charpos)
+ {
+ if (PT < endpos)
+ cmp_it->stop_pos = endpos = PT;
+ }
+ else if (PT < charpos && PT > endpos)
+ {
+ cmp_it->stop_pos = endpos = PT - 1;
+ }
+ }
if (NILP (current_buffer->enable_multibyte_characters)
|| NILP (Vauto_composition_mode))
return;
if (bytepos < 0)
{
- if (STRINGP (string))
- bytepos = string_char_to_byte (string, charpos);
- else
+ if (NILP (string))
bytepos = CHAR_TO_BYTE (charpos);
+ else
+ bytepos = string_char_to_byte (string, charpos);
}
start = charpos;
- while (charpos < endpos)
+ if (charpos < endpos)
{
- if (STRINGP (string))
- FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
- else
- FETCH_CHAR_ADVANCE (c, charpos, bytepos);
- if (c == '\n')
+ /* Forward search. */
+ while (charpos < endpos)
{
- cmp_it->ch = -2;
- break;
+ if (STRINGP (string))
+ FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
+ else
+ FETCH_CHAR_ADVANCE (c, charpos, bytepos);
+ if (c == '\n')
+ {
+ cmp_it->ch = -2;
+ break;
+ }
+ val = CHAR_TABLE_REF (Vcomposition_function_table, c);
+ if (! NILP (val))
+ {
+ Lisp_Object elt;
+
+ for (; CONSP (val); val = XCDR (val))
+ {
+ elt = XCAR (val);
+ if (VECTORP (elt) && ASIZE (elt) == 3
+ && NATNUMP (AREF (elt, 1))
+ && charpos - 1 - XFASTINT (AREF (elt, 1)) >= start)
+ break;
+ }
+ if (CONSP (val))
+ {
+ cmp_it->lookback = XFASTINT (AREF (elt, 1));
+ cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
+ cmp_it->ch = c;
+ return;
+ }
+ }
}
- val = CHAR_TABLE_REF (Vcomposition_function_table, c);
- if (! NILP (val))
+ }
+ else
+ {
+ /* Search backward for a pattern that may be composed and the
+ position of (possibly) the last character of the match is
+ closest to (but not after) START. The reason for the last
+ character is that set_iterator_to_next works in reverse order,
+ and thus we must stop at the last character for composition
+ check. */
+ unsigned char *p;
+ int len;
+ /* Limit byte position used in fast_looking_at. This is the
+ byte position of the character after START. */
+ EMACS_INT limit;
+
+ if (NILP (string))
+ p = BYTE_POS_ADDR (bytepos);
+ else
+ p = SDATA (string) + bytepos;
+ c = STRING_CHAR_AND_LENGTH (p, len);
+ limit = bytepos + len;
+ while (CHAR_COMPOSABLE_P (c))
{
- Lisp_Object elt;
+ for (val = CHAR_TABLE_REF (Vcomposition_function_table, c);
+ CONSP (val); val = XCDR (val))
+ {
+ Lisp_Object elt = XCAR (val);
+ int back, len;
- for (; CONSP (val); val = XCDR (val))
+ if (VECTORP (elt) && ASIZE (elt) == 3
+ && NATNUMP (AREF (elt, 1))
+ && charpos - (back = XFASTINT (AREF (elt, 1))) > endpos)
+ {
+ EMACS_INT cpos = charpos - back, bpos;
+
+ if (back == 0)
+ bpos = bytepos;
+ else
+ bpos = (NILP (string) ? CHAR_TO_BYTE (cpos)
+ : string_char_to_byte (string, cpos));
+ if (STRINGP (AREF (elt, 0)))
+ len = fast_looking_at (AREF (elt, 0), cpos, bpos,
+ start + 1, limit, string);
+ else
+ len = 1;
+ if (len > 0)
+ {
+ /* Make CPOS point to the last character of match.
+ Note that LEN is byte-length. */
+ bpos += len;
+ if (NILP (string))
+ cpos = BYTE_TO_CHAR (bpos) - 1;
+ else
+ cpos = string_byte_to_char (string, bpos) - 1;
+ back = cpos - (charpos - back);
+ if (cmp_it->stop_pos < cpos
+ || (cmp_it->stop_pos == cpos
+ && cmp_it->lookback < back))
+ {
+ cmp_it->stop_pos = cpos;
+ cmp_it->ch = c;
+ cmp_it->lookback = back;
+ }
+ }
+ }
+ }
+ if (charpos - 1 == endpos)
+ break;
+ if (STRINGP (string))
{
- elt = XCAR (val);
- if (VECTORP (elt) && ASIZE (elt) == 3 && NATNUMP (AREF (elt, 1))
- && charpos - 1 - XFASTINT (AREF (elt, 1)) >= start)
- break;
+ p--, bytepos--;
+ while (! CHAR_HEAD_P (*p))
+ p--, bytepos--;
+ charpos--;
}
- if (CONSP (val))
+ else
{
- cmp_it->lookback = XFASTINT (AREF (elt, 1));
- cmp_it->stop_pos = charpos - 1 - cmp_it->lookback;
- cmp_it->ch = c;
- return;
+ DEC_BOTH (charpos, bytepos);
+ p = BYTE_POS_ADDR (bytepos);
+ }
+ c = STRING_CHAR (p);
+ }
+ if (cmp_it->ch >= 0)
+ /* We found a position to check. */
+ return;
+ /* Skip all uncomposable characters. */
+ if (NILP (string))
+ {
+ while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
+ {
+ DEC_BOTH (charpos, bytepos);
+ c = FETCH_MULTIBYTE_CHAR (bytepos);
+ }
+ }
+ else
+ {
+ while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
+ {
+ p--;
+ while (! CHAR_HEAD_P (*p))
+ p--;
+ charpos--;
+ c = STRING_CHAR (p);
}
}
}
string. In that case, FACE must not be NULL.
If the character is composed, setup members of CMP_IT (id, nglyphs,
- and from), and return 1. Otherwise, update CMP_IT->stop_pos, and
- return 0. */
+ from, to, reversed_p), and return 1. Otherwise, update
+ CMP_IT->stop_pos, and return 0. */
int
composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
struct face *face;
Lisp_Object string;
{
- if (NILP (string) && charpos < PT && PT < endpos)
- endpos = PT;
+ if (endpos <= charpos)
+ {
+ if (NILP (string))
+ {
+ if (endpos < 0)
+ endpos = BEGV;
+ if (endpos < PT && PT < charpos)
+ endpos = PT;
+ }
+ else if (endpos < 0)
+ endpos = 0;
+ }
+ else
+ {
+ if (NILP (string) && charpos < PT && PT < endpos)
+ endpos = PT;
+ }
if (cmp_it->ch == -2)
{
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
- if (cmp_it->ch == -2)
+ if (cmp_it->stop_pos != charpos)
+ /* The current position is not composed. */
return 0;
}
int i;
val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
- for (; CONSP (val); val = XCDR (val))
+ if (charpos < endpos)
{
- elt = XCAR (val);
- if (cmp_it->lookback == XFASTINT (AREF (elt, 1)))
- break;
+ for (; CONSP (val); val = XCDR (val))
+ {
+ elt = XCAR (val);
+ if (cmp_it->lookback == XFASTINT (AREF (elt, 1)))
+ break;
+ }
+ if (NILP (val))
+ goto no_composition;
+
+ val = autocmp_chars (val, charpos, bytepos, endpos, w, face, string);
+ if (! composition_gstring_p (val))
+ goto no_composition;
+ cmp_it->reversed_p = 0;
}
- if (NILP (val))
- goto no_composition;
+ else
+ {
+ EMACS_INT saved_charpos = charpos, saved_bytepos = bytepos;
- val = autocmp_chars (val, charpos, bytepos, endpos, w, face, string);
- if (! composition_gstring_p (val))
- goto no_composition;
+ if (cmp_it->lookback > 0)
+ {
+ charpos -= cmp_it->lookback;
+ if (charpos < endpos)
+ goto no_composition;
+ if (STRINGP (string))
+ bytepos = string_char_to_byte (string, charpos);
+ else
+ bytepos = CHAR_TO_BYTE (charpos);
+ }
+ val = autocmp_chars (val, charpos, bytepos, saved_charpos + 1,
+ w, face, string);
+ if (! composition_gstring_p (val)
+ || charpos + LGSTRING_CHAR_LEN (val) <= saved_charpos)
+ {
+ charpos = saved_charpos, bytepos = saved_bytepos;
+ goto no_composition;
+ }
+ cmp_it->reversed_p = 1;
+ }
if (NILP (LGSTRING_ID (val)))
val = composition_gstring_put_cache (val, -1);
cmp_it->id = XINT (LGSTRING_ID (val));
if (NILP (LGSTRING_GLYPH (val, i)))
break;
cmp_it->nglyphs = i;
+ cmp_it->from = 0;
+ cmp_it->to = i;
}
else
goto no_composition;
- cmp_it->from = 0;
return 1;
no_composition:
- charpos++;
- if (STRINGP (string))
- bytepos += MULTIBYTE_LENGTH_NO_CHECK (SDATA (string) + bytepos);
+ if (charpos == endpos)
+ return 0;
+ if (charpos < endpos)
+ {
+ charpos++;
+ if (STRINGP (string))
+ bytepos += MULTIBYTE_LENGTH_NO_CHECK (SDATA (string) + bytepos);
+ else
+ INC_POS (bytepos);
+ }
else
- INC_POS (bytepos);
+ {
+ charpos--;
+ /* BYTEPOS is calculated in composition_compute_stop_pos */
+ bytepos = -1;
+ }
composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
return 0;
}
+/* Update nchars, nbytes, and width of the current grapheme cluster
+ which is identified by CMP_IT->from (if the composition is static
+ or automatic in l2r context) or CMPT_IT->to (if the composition is
+ automatic in r2l context). In addition, in the former case, update
+ CMP_IT->to, and in the latter case, update CMP_IT->from. */
+
int
composition_update_it (cmp_it, charpos, bytepos, string)
struct composition_it *cmp_it;
cmp_it->nchars = LGSTRING_CHAR_LEN (gstring);
cmp_it->width = 0;
}
- else
+ else if (! cmp_it->reversed_p)
{
Lisp_Object glyph = LGSTRING_GLYPH (gstring, cmp_it->from);
int from = LGLYPH_FROM (glyph);
cmp_it->width += CHAR_WIDTH (LGLYPH_CHAR (glyph));
}
}
+ else
+ {
+ int from_idx = cmp_it->to - 1;
+ Lisp_Object glyph = LGSTRING_GLYPH (gstring, from_idx);
+ int from = LGLYPH_FROM (glyph);
+
+ c = XINT (LGSTRING_CHAR (gstring, from));
+ cmp_it->nchars = LGLYPH_TO (glyph) - from + 1;
+ cmp_it->width = (LGLYPH_WIDTH (glyph) > 0
+ ? CHAR_WIDTH (LGLYPH_CHAR (glyph)) : 0);
+ for (from_idx--; from_idx >= 0; from_idx--)
+ {
+ glyph = LGSTRING_GLYPH (gstring, from_idx);
+ if (LGLYPH_FROM (glyph) != from)
+ break;
+ if (LGLYPH_WIDTH (glyph) > 0)
+ cmp_it->width += CHAR_WIDTH (LGLYPH_CHAR (glyph));
+ }
+ cmp_it->from = from_idx + 1;
+ charpos -= cmp_it->nchars - 1;
+ bytepos += CHAR_BYTES (c);
+ if (STRINGP (string))
+ cmp_it->nbytes = bytepos - string_char_to_byte (string, charpos);
+ else
+ cmp_it->nbytes = bytepos - CHAR_TO_BYTE (charpos);
+ return c;
+ }
}
charpos += cmp_it->nchars;
unsigned char *p;
};
-/* Update the members of POSTION to the next character boundary. */
+/* Update the members of POSITION to the next character boundary. */
#define FORWARD_CHAR(POSITION, STOP) \
do { \
(POSITION).pos++; \
} \
} while (0)
-/* Update the members of POSTION to the previous character boundary. */
+/* Update the members of POSITION to the previous character boundary. */
#define BACKWARD_CHAR(POSITION, STOP) \
do { \
if ((POSITION).pos == STOP) \
(POSITION).pos--; \
} while (0)
-static Lisp_Object _work_val;
-static int _work_char;
-
-/* 1 iff the character C is composable. */
-#define CHAR_COMPOSABLE_P(C) \
- ((C) == 0x200C || (C) == 0x200D \
- || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)), \
- (SYMBOLP (_work_val) \
- && (_work_char = SDATA (SYMBOL_NAME (_work_val))[0]) != 'C' \
- && _work_char != 'Z')))
-
/* This is like find_composition, but find an automatic composition
instead. If found, set *GSTRING to the glyph-string representing
the composition, and return 1. Otherwise, return 0. */
}
if (need_adjustment)
{
- /* As we have called Lisp, there's a possibilily that
+ /* As we have called Lisp, there's a possibility that
buffer/string is relocated. */
if (NILP (string))
cur.p = BYTE_POS_ADDR (cur.pos_byte);
if (find_automatic_composition (from, to, &s, &e, &gstring, string)
&& (e <= XINT (pos) ? e > end : s < start))
- return list3 (make_number (start), make_number (end), gstring);
+ return list3 (make_number (s), make_number (e), gstring);
}
if (!COMPOSITION_VALID_P (start, end, prop))
return Fcons (make_number (start), Fcons (make_number (end),
#define EMACS_CONFIG_H
-/* Generate dependencies with gcc. */
-#undef AUTO_DEPEND
-
/* Define to 1 if the mktime function is broken. */
#undef BROKEN_MKTIME
/* Define to 1 if using `getloadavg.c'. */
#undef C_GETLOADAVG
-/* Define C_SWITCH_X_SITE to contain any special flags your compiler may need
- to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS
- above and your X include files aren't in a place that your compiler can
- find on its own, you might want to add "-I/..." or something similar. */
-#undef C_SWITCH_X_SITE
-
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
#undef DGUX
/* Define to 1 if you have the <com_err.h> header file. */
#undef HAVE_COM_ERR_H
-/* Define to 1 if you have /usr/lib/crti.o. */
-#undef HAVE_CRTIN
+/* Define to 1 if you have the `copysign' function. */
+#undef HAVE_COPYSIGN
/* Define to 1 if using D-Bus. */
#undef HAVE_DBUS
/* Define to 1 if you have the `get_current_dir_name' function. */
#undef HAVE_GET_CURRENT_DIR_NAME
-/* Define to 1 if you have a gif library (default -lgif; otherwise specify
- with LIBGIF). */
+/* Define to 1 if you have a gif (or ungif) library. */
#undef HAVE_GIF
/* Define to 1 if you have the gpm library (-lgpm). */
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `isnan' function. */
+#undef HAVE_ISNAN
+
/* Define to 1 if you have the jpeg library (-ljpeg). */
#undef HAVE_JPEG
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
-/* Define to 1 if the directory /usr/lib64 exists. */
-#undef HAVE_LIB64_DIR
-
/* Define to 1 if you have the `com_err' library (-lcom_err). */
#undef HAVE_LIBCOM_ERR
/* Define to 1 if you have the resolv library (-lresolv). */
#undef HAVE_LIBRESOLV
+/* Define to 1 if using SELinux. */
+#undef HAVE_LIBSELINUX
+
/* Define to 1 if you have the `Xext' library (-lXext). */
#undef HAVE_LIBXEXT
/* Define to 1 if you have the `Xmu' library (-lXmu). */
#undef HAVE_LIBXMU
-/* Define to 1 if you have the Xp library (-lXp). */
-#undef HAVE_LIBXP
-
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
-/* Define to 1 if you have Motif 2.1 or newer. */
-#undef HAVE_MOTIF_2_1
+/* Define if you have mouse support. */
+#undef HAVE_MOUSE
/* Define to 1 if you have the `mremap' function. */
#undef HAVE_MREMAP
/* Define to 1 if you have the <sys/_mbstate_t.h> header file. */
#undef HAVE_SYS__MBSTATE_T_H
-/* Define to 1 if you have the <termcap.h> header file. */
-#undef HAVE_TERMCAP_H
-
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
+/* Define if you have a window system. */
+#undef HAVE_WINDOW_SYSTEM
+
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to use Kerberos 5 instead of Kerberos 4. */
#undef KERBEROS5
-/* Define LD_SWITCH_X_SITE to contain any special flags your loader may need
- to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS
- above and your X libraries aren't in a place that your loader can find on
- its own, you might want to add "-L/..." or something similar. */
-#undef LD_SWITCH_X_SITE
+/* Define to 1 if localtime caches TZ. */
+#undef LOCALTIME_CACHE
+
+/* String giving fallback POP mail host. */
+#undef MAILHOST
-/* Define LD_SWITCH_X_SITE_AUX with an -R option in case it's needed (for
- Solaris, for example). */
-#undef LD_SWITCH_X_SITE_AUX
+/* Define to unlink, rather than empty, mail spool after reading. */
+#undef MAIL_UNLINK_SPOOL
-/* Compiler option to link with the gif library (if not -lgif). */
-#undef LIBGIF
+/* Define if the mailer uses flock to interlock the mail spool. */
+#undef MAIL_USE_FLOCK
-/* Define to 1 if localtime caches TZ. */
-#undef LOCALTIME_CACHE
+/* Define if the mailer uses lockf to interlock the mail spool. */
+#undef MAIL_USE_LOCKF
+
+/* Define to support MMDF mailboxes in movemail. */
+#undef MAIL_USE_MMDF
/* Define to support POP mail retrieval. */
#undef MAIL_USE_POP
/* Define to 1 if you are using NS windowing under GNUstep. */
#undef NS_IMPL_GNUSTEP
+/* Define if the C compiler is the linker. */
+#undef ORDINARY_LINK
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Process async input synchronously. */
#undef SYNC_INPUT
+/* Define to 1 if you use terminfo instead of termcap. */
+#undef TERMINFO
+
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
<sys/cpustats.h>. */
#undef UMAX4_3
-/* Define to the unexec source file name. */
-#undef UNEXEC_SRC
-
/* Define to 1 if using GTK. */
#undef USE_GTK
#undef volatile
-/* If we're using X11/Carbon/GNUstep, define some consequences. */
-#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
-#define HAVE_WINDOW_SYSTEM
-#define HAVE_MOUSE
-#endif
-
/* Define AMPERSAND_FULL_NAME if you use the convention
that & in the full name stands for the login id. */
/* Turned on June 1996 supposing nobody will mind it. */
#endif
#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
-/* If using GNU, then support inline function declarations. */
+/* If using GNU, then support inline function declarations. */
/* Don't try to switch on inline handling as detected by AC_C_INLINE
generally, because even if non-gcc compilers accept `inline', they
may reject `extern inline'. */
/* Set up some defines, C and LD flags for NeXTstep interface on GNUstep.
(There is probably a better place to do this, but right now the Cocoa
side does this in s/darwin.h and we cannot
- parallel this exactly since GNUstep is multi-OS. */
+ parallel this exactly since GNUstep is multi-OS. */
#ifdef HAVE_NS
# ifdef NS_IMPL_GNUSTEP
-/* See also .m.o rule in Makefile.in */
-/* FIXME: are all these flags really needed? Document here why. */
-# define C_SWITCH_X_SYSTEM -D_REENTRANT -fPIC -fno-strict-aliasing
/* GNUstep needs a bit more pure memory. Of the existing knobs,
SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */
# define SYSTEM_PURESIZE_EXTRA 30000
#include "string.h"
#endif
#ifdef HAVE_STRINGS_H
-#include "strings.h" /* May be needed for bcopy & al. */
+#include "strings.h" /* May be needed for bcopy & al. */
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#ifdef HAVE_X11R6
#define HAVE_X_I18N
-#elif !defined X11R5_INHIBIT_I18N
-#define HAVE_X_I18N
#endif
/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
that the stack is continuous. */
#ifdef __GNUC__
# ifndef GC_SETJMP_WORKS
- /* GC_SETJMP_WORKS is nearly always appropriate for GCC --
- see NON_SAVING_SETJMP in the target descriptions. */
- /* Exceptions (see NON_SAVING_SETJMP in target description) are
- SCO5 non-ELF (but Emacs specifies ELF) and SVR3 on x86.
- Fixme: Deal with SVR3. */
+ /* GC_SETJMP_WORKS is nearly always appropriate for GCC. */
# define GC_SETJMP_WORKS 1
# endif
# ifndef GC_LISP_OBJECT_ALIGNMENT
Lisp_Object Qinteractive_form;
-static Lisp_Object swap_in_symval_forwarding P_ ((Lisp_Object, Lisp_Object));
+static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *);
Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum;
register Lisp_Object symbol;
{
Lisp_Object valcontents;
+ struct Lisp_Symbol *sym;
CHECK_SYMBOL (symbol);
+ sym = XSYMBOL (symbol);
- valcontents = SYMBOL_VALUE (symbol);
-
- if (BUFFER_LOCAL_VALUEP (valcontents))
- valcontents = swap_in_symval_forwarding (symbol, valcontents);
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_PLAINVAL: valcontents = SYMBOL_VAL (sym); break;
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ if (blv->fwd)
+ /* In set_internal, we un-forward vars when their value is
+ set to Qunbound. */
+ return Qt;
+ else
+ {
+ swap_in_symval_forwarding (sym, blv);
+ valcontents = BLV_VALUE (blv);
+ }
+ break;
+ }
+ case SYMBOL_FORWARDED:
+ /* In set_internal, we un-forward vars when their value is
+ set to Qunbound. */
+ return Qt;
+ default: abort ();
+ }
return (EQ (valcontents, Qunbound) ? Qnil : Qt);
}
hare = tortoise = symbol;
- while (hare->indirect_variable)
+ while (hare->redirect == SYMBOL_VARALIAS)
{
- hare = XSYMBOL (hare->value);
- if (!hare->indirect_variable)
+ hare = SYMBOL_ALIAS (hare);
+ if (hare->redirect != SYMBOL_VARALIAS)
break;
- hare = XSYMBOL (hare->value);
- tortoise = XSYMBOL (tortoise->value);
+ hare = SYMBOL_ALIAS (hare);
+ tortoise = SYMBOL_ALIAS (tortoise);
if (hare == tortoise)
{
This does not handle buffer-local variables; use
swap_in_symval_forwarding for that. */
+#define do_blv_forwarding(blv) \
+ ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
+
Lisp_Object
do_symval_forwarding (valcontents)
- register Lisp_Object valcontents;
+ register union Lisp_Fwd *valcontents;
{
register Lisp_Object val;
- if (MISCP (valcontents))
- switch (XMISCTYPE (valcontents))
- {
- case Lisp_Misc_Intfwd:
- XSETINT (val, *XINTFWD (valcontents)->intvar);
- return val;
-
- case Lisp_Misc_Boolfwd:
- return (*XBOOLFWD (valcontents)->boolvar ? Qt : Qnil);
-
- case Lisp_Misc_Objfwd:
- return *XOBJFWD (valcontents)->objvar;
-
- case Lisp_Misc_Buffer_Objfwd:
- return PER_BUFFER_VALUE (current_buffer,
- XBUFFER_OBJFWD (valcontents)->offset);
-
- case Lisp_Misc_Kboard_Objfwd:
- /* We used to simply use current_kboard here, but from Lisp
- code, it's value is often unexpected. It seems nicer to
- allow constructions like this to work as intuitively expected:
-
- (with-selected-frame frame
- (define-key local-function-map "\eOP" [f1]))
-
- On the other hand, this affects the semantics of
- last-command and real-last-command, and people may rely on
- that. I took a quick look at the Lisp codebase, and I
- don't think anything will break. --lorentey */
- return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
- + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
- }
- return valcontents;
+ switch (XFWDTYPE (valcontents))
+ {
+ case Lisp_Fwd_Int:
+ XSETINT (val, *XINTFWD (valcontents)->intvar);
+ return val;
+
+ case Lisp_Fwd_Bool:
+ return (*XBOOLFWD (valcontents)->boolvar ? Qt : Qnil);
+
+ case Lisp_Fwd_Obj:
+ return *XOBJFWD (valcontents)->objvar;
+
+ case Lisp_Fwd_Buffer_Obj:
+ return PER_BUFFER_VALUE (current_buffer,
+ XBUFFER_OBJFWD (valcontents)->offset);
+
+ case Lisp_Fwd_Kboard_Obj:
+ /* We used to simply use current_kboard here, but from Lisp
+ code, it's value is often unexpected. It seems nicer to
+ allow constructions like this to work as intuitively expected:
+
+ (with-selected-frame frame
+ (define-key local-function-map "\eOP" [f1]))
+
+ On the other hand, this affects the semantics of
+ last-command and real-last-command, and people may rely on
+ that. I took a quick look at the Lisp codebase, and I
+ don't think anything will break. --lorentey */
+ return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
+ + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
+ default: abort ();
+ }
}
/* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell
BUF non-zero means set the value in buffer BUF instead of the
current buffer. This only plays a role for per-buffer variables. */
-void
-store_symval_forwarding (symbol, valcontents, newval, buf)
- Lisp_Object symbol;
- register Lisp_Object valcontents, newval;
+#define store_blv_forwarding(blv, newval, buf) \
+ do { \
+ if ((blv)->forwarded) \
+ store_symval_forwarding (BLV_FWD (blv), (newval), (buf)); \
+ else \
+ SET_BLV_VALUE (blv, newval); \
+ } while (0)
+
+static void
+store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
+ /* struct Lisp_Symbol *symbol; */
+ union Lisp_Fwd *valcontents;
+ register Lisp_Object newval;
struct buffer *buf;
{
- switch (SWITCH_ENUM_CAST (XTYPE (valcontents)))
+ switch (XFWDTYPE (valcontents))
{
- case Lisp_Misc:
- switch (XMISCTYPE (valcontents))
+ case Lisp_Fwd_Int:
+ CHECK_NUMBER (newval);
+ *XINTFWD (valcontents)->intvar = XINT (newval);
+ break;
+
+ case Lisp_Fwd_Bool:
+ *XBOOLFWD (valcontents)->boolvar = !NILP (newval);
+ break;
+
+ case Lisp_Fwd_Obj:
+ *XOBJFWD (valcontents)->objvar = newval;
+
+ /* If this variable is a default for something stored
+ in the buffer itself, such as default-fill-column,
+ find the buffers that don't have local values for it
+ and update them. */
+ if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults
+ && XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1))
{
- case Lisp_Misc_Intfwd:
- CHECK_NUMBER (newval);
- *XINTFWD (valcontents)->intvar = XINT (newval);
- /* This can never happen since intvar points to an EMACS_INT
- which is at least large enough to hold a Lisp_Object.
- if (*XINTFWD (valcontents)->intvar != XINT (newval))
- error ("Value out of range for variable `%s'",
- SDATA (SYMBOL_NAME (symbol))); */
- break;
-
- case Lisp_Misc_Boolfwd:
- *XBOOLFWD (valcontents)->boolvar = !NILP (newval);
- break;
-
- case Lisp_Misc_Objfwd:
- *XOBJFWD (valcontents)->objvar = newval;
-
- /* If this variable is a default for something stored
- in the buffer itself, such as default-fill-column,
- find the buffers that don't have local values for it
- and update them. */
- if (XOBJFWD (valcontents)->objvar > (Lisp_Object *) &buffer_defaults
- && XOBJFWD (valcontents)->objvar < (Lisp_Object *) (&buffer_defaults + 1))
+ int offset = ((char *) XOBJFWD (valcontents)->objvar
+ - (char *) &buffer_defaults);
+ int idx = PER_BUFFER_IDX (offset);
+
+ Lisp_Object tail;
+
+ if (idx <= 0)
+ break;
+
+ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
- int offset = ((char *) XOBJFWD (valcontents)->objvar
- - (char *) &buffer_defaults);
- int idx = PER_BUFFER_IDX (offset);
-
- Lisp_Object tail;
-
- if (idx <= 0)
- break;
-
- for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
- {
- Lisp_Object buf;
- struct buffer *b;
+ Lisp_Object buf;
+ struct buffer *b;
- buf = Fcdr (XCAR (tail));
- if (!BUFFERP (buf)) continue;
- b = XBUFFER (buf);
+ buf = Fcdr (XCAR (tail));
+ if (!BUFFERP (buf)) continue;
+ b = XBUFFER (buf);
- if (! PER_BUFFER_VALUE_P (b, idx))
- PER_BUFFER_VALUE (b, offset) = newval;
- }
+ if (! PER_BUFFER_VALUE_P (b, idx))
+ PER_BUFFER_VALUE (b, offset) = newval;
}
- break;
-
- case Lisp_Misc_Buffer_Objfwd:
- {
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
-
- if (!(NILP (type) || NILP (newval)
- || (XINT (type) == LISP_INT_TAG
- ? INTEGERP (newval)
- : XTYPE (newval) == XINT (type))))
- buffer_slot_type_mismatch (newval, XINT (type));
-
- if (buf == NULL)
- buf = current_buffer;
- PER_BUFFER_VALUE (buf, offset) = newval;
- }
- break;
+ }
+ break;
- case Lisp_Misc_Kboard_Objfwd:
- {
- char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
- char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
- *(Lisp_Object *) p = newval;
- }
- break;
+ case Lisp_Fwd_Buffer_Obj:
+ {
+ int offset = XBUFFER_OBJFWD (valcontents)->offset;
+ Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype;
+
+ if (!(NILP (type) || NILP (newval)
+ || (XINT (type) == LISP_INT_TAG
+ ? INTEGERP (newval)
+ : XTYPE (newval) == XINT (type))))
+ buffer_slot_type_mismatch (newval, XINT (type));
+
+ if (buf == NULL)
+ buf = current_buffer;
+ PER_BUFFER_VALUE (buf, offset) = newval;
+ }
+ break;
- default:
- goto def;
- }
+ case Lisp_Fwd_Kboard_Obj:
+ {
+ char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
+ char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
+ *(Lisp_Object *) p = newval;
+ }
break;
default:
- def:
- valcontents = SYMBOL_VALUE (symbol);
- if (BUFFER_LOCAL_VALUEP (valcontents))
- XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval;
- else
- SET_SYMBOL_VALUE (symbol, newval);
+ abort (); /* goto def; */
}
}
void
swap_in_global_binding (symbol)
- Lisp_Object symbol;
+ struct Lisp_Symbol *symbol;
{
- Lisp_Object valcontents = SYMBOL_VALUE (symbol);
- struct Lisp_Buffer_Local_Value *blv = XBUFFER_LOCAL_VALUE (valcontents);
- Lisp_Object cdr = blv->cdr;
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol);
/* Unload the previously loaded binding. */
- Fsetcdr (XCAR (cdr),
- do_symval_forwarding (blv->realvalue));
+ if (blv->fwd)
+ SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
/* Select the global binding in the symbol. */
- XSETCAR (cdr, cdr);
- store_symval_forwarding (symbol, blv->realvalue, XCDR (cdr), NULL);
+ blv->valcell = blv->defcell;
+ if (blv->fwd)
+ store_symval_forwarding (blv->fwd, XCDR (blv->defcell), NULL);
/* Indicate that the global binding is set up now. */
- blv->frame = Qnil;
- blv->buffer = Qnil;
- blv->found_for_frame = 0;
- blv->found_for_buffer = 0;
+ blv->where = Qnil;
+ SET_BLV_FOUND (blv, 0);
}
/* Set up the buffer-local symbol SYMBOL for validity in the current buffer.
Return the value forwarded one step past the buffer-local stage.
This could be another forwarding pointer. */
-static Lisp_Object
-swap_in_symval_forwarding (symbol, valcontents)
- Lisp_Object symbol, valcontents;
+static void
+swap_in_symval_forwarding (symbol, blv)
+ struct Lisp_Symbol *symbol;
+ struct Lisp_Buffer_Local_Value *blv;
{
register Lisp_Object tem1;
- tem1 = XBUFFER_LOCAL_VALUE (valcontents)->buffer;
+ eassert (blv == SYMBOL_BLV (symbol));
+
+ tem1 = blv->where;
if (NILP (tem1)
- || current_buffer != XBUFFER (tem1)
- || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame
- && ! EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame)))
+ || (blv->frame_local
+ ? !EQ (selected_frame, tem1)
+ : current_buffer != XBUFFER (tem1)))
{
- struct Lisp_Symbol *sym = XSYMBOL (symbol);
- if (sym->indirect_variable)
- {
- sym = indirect_variable (sym);
- XSETSYMBOL (symbol, sym);
- }
/* Unload the previously loaded binding. */
- tem1 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
- Fsetcdr (tem1,
- do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue));
+ tem1 = blv->valcell;
+ if (blv->fwd)
+ SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
/* Choose the new binding. */
- tem1 = assq_no_quit (symbol, current_buffer->local_var_alist);
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 0;
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
- if (NILP (tem1))
- {
- if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
- tem1 = assq_no_quit (symbol, XFRAME (selected_frame)->param_alist);
- if (! NILP (tem1))
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 1;
- else
- tem1 = XBUFFER_LOCAL_VALUE (valcontents)->cdr;
- }
- else
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 1;
+ {
+ Lisp_Object var;
+ XSETSYMBOL (var, symbol);
+ if (blv->frame_local)
+ {
+ tem1 = assq_no_quit (var, XFRAME (selected_frame)->param_alist);
+ blv->where = selected_frame;
+ }
+ else
+ {
+ tem1 = assq_no_quit (var, current_buffer->local_var_alist);
+ XSETBUFFER (blv->where, current_buffer);
+ }
+ }
+ if (!(blv->found = !NILP (tem1)))
+ tem1 = blv->defcell;
/* Load the new binding. */
- XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1);
- XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, current_buffer);
- XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
- store_symval_forwarding (symbol,
- XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
- Fcdr (tem1), NULL);
+ blv->valcell = tem1;
+ if (blv->fwd)
+ store_symval_forwarding (blv->fwd, BLV_VALUE (blv), NULL);
}
- return XBUFFER_LOCAL_VALUE (valcontents)->realvalue;
}
\f
/* Find the value of a symbol, returning Qunbound if it's not bound.
find_symbol_value (symbol)
Lisp_Object symbol;
{
- register Lisp_Object valcontents;
- register Lisp_Object val;
+ struct Lisp_Symbol *sym;
CHECK_SYMBOL (symbol);
- valcontents = SYMBOL_VALUE (symbol);
+ sym = XSYMBOL (symbol);
- if (BUFFER_LOCAL_VALUEP (valcontents))
- valcontents = swap_in_symval_forwarding (symbol, valcontents);
-
- return do_symval_forwarding (valcontents);
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return SYMBOL_VAL (sym);
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ swap_in_symval_forwarding (sym, blv);
+ return blv->fwd ? do_symval_forwarding (blv->fwd) : BLV_VALUE (blv);
+ }
+ /* FALLTHROUGH */
+ case SYMBOL_FORWARDED:
+ return do_symval_forwarding (SYMBOL_FWD (sym));
+ default: abort ();
+ }
}
DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
(symbol, newval)
register Lisp_Object symbol, newval;
{
- return set_internal (symbol, newval, current_buffer, 0);
+ set_internal (symbol, newval, Qnil, 0);
+ return newval;
}
/* Return 1 if SYMBOL currently has a let-binding
which was made in the buffer that is now current. */
static int
-let_shadows_buffer_binding_p (symbol)
- struct Lisp_Symbol *symbol;
+let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
{
- volatile struct specbinding *p;
+ struct specbinding *p;
for (p = specpdl_ptr - 1; p >= specpdl; p--)
if (p->func == NULL
&& CONSP (p->symbol))
{
struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol));
- if ((symbol == let_bound_symbol
- || (let_bound_symbol->indirect_variable
- && symbol == indirect_variable (let_bound_symbol)))
+ eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
+ if (symbol == let_bound_symbol
&& XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer)
break;
}
return p >= specpdl;
}
+static int
+let_shadows_global_binding_p (symbol)
+ Lisp_Object symbol;
+{
+ struct specbinding *p;
+
+ for (p = specpdl_ptr - 1; p >= specpdl; p--)
+ if (p->func == NULL && EQ (p->symbol, symbol))
+ break;
+
+ return p >= specpdl;
+}
+
/* Store the value NEWVAL into SYMBOL.
- If buffer-locality is an issue, BUF specifies which buffer to use.
- (0 stands for the current buffer.)
+ If buffer/frame-locality is an issue, WHERE specifies which context to use.
+ (nil stands for the current buffer/frame).
If BINDFLAG is zero, then if this symbol is supposed to become
local in every buffer where it is set, then we make it local.
If BINDFLAG is nonzero, we don't do that. */
-Lisp_Object
-set_internal (symbol, newval, buf, bindflag)
- register Lisp_Object symbol, newval;
- struct buffer *buf;
+void
+set_internal (symbol, newval, where, bindflag)
+ register Lisp_Object symbol, newval, where;
int bindflag;
{
int voide = EQ (newval, Qunbound);
-
- register Lisp_Object valcontents, innercontents, tem1, current_alist_element;
-
- if (buf == 0)
- buf = current_buffer;
+ struct Lisp_Symbol *sym;
+ Lisp_Object tem1;
/* If restoring in a dead buffer, do nothing. */
- if (NILP (buf->name))
- return newval;
+ /* if (BUFFERP (where) && NILP (XBUFFER (where)->name))
+ return; */
CHECK_SYMBOL (symbol);
- if (SYMBOL_CONSTANT_P (symbol)
- && (NILP (Fkeywordp (symbol))
- || !EQ (newval, SYMBOL_VALUE (symbol))))
- xsignal1 (Qsetting_constant, symbol);
-
- innercontents = valcontents = SYMBOL_VALUE (symbol);
-
- if (BUFFER_OBJFWDP (valcontents))
+ if (SYMBOL_CONSTANT_P (symbol))
{
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- int idx = PER_BUFFER_IDX (offset);
- if (idx > 0
- && !bindflag
- && !let_shadows_buffer_binding_p (XSYMBOL (symbol)))
- SET_PER_BUFFER_VALUE_P (buf, idx, 1);
+ if (NILP (Fkeywordp (symbol))
+ || !EQ (newval, Fsymbol_value (symbol)))
+ xsignal1 (Qsetting_constant, symbol);
+ else
+ /* Allow setting keywords to their own value. */
+ return;
}
- else if (BUFFER_LOCAL_VALUEP (valcontents))
- {
- /* valcontents is a struct Lisp_Buffer_Local_Value. */
- if (XSYMBOL (symbol)->indirect_variable)
- XSETSYMBOL (symbol, indirect_variable (XSYMBOL (symbol)));
-
- /* What binding is loaded right now? */
- current_alist_element
- = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
-
- /* If the current buffer is not the buffer whose binding is
- loaded, or if there may be frame-local bindings and the frame
- isn't the right one, or if it's a Lisp_Buffer_Local_Value and
- the default binding is loaded, the loaded binding may be the
- wrong one. */
- if (!BUFFERP (XBUFFER_LOCAL_VALUE (valcontents)->buffer)
- || buf != XBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer)
- || (XBUFFER_LOCAL_VALUE (valcontents)->check_frame
- && !EQ (selected_frame, XBUFFER_LOCAL_VALUE (valcontents)->frame))
- /* Also unload a global binding (if the var is local_if_set). */
- || (EQ (XCAR (current_alist_element),
- current_alist_element)))
- {
- /* The currently loaded binding is not necessarily valid.
- We need to unload it, and choose a new binding. */
-
- /* Write out `realvalue' to the old loaded binding. */
- Fsetcdr (current_alist_element,
- do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue));
- /* Find the new binding. */
- tem1 = Fassq (symbol, buf->local_var_alist);
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 1;
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 0;
+ sym = XSYMBOL (symbol);
- if (NILP (tem1))
- {
- /* This buffer still sees the default value. */
-
- /* If the variable is not local_if_set,
- or if this is `let' rather than `set',
- make CURRENT-ALIST-ELEMENT point to itself,
- indicating that we're seeing the default value.
- Likewise if the variable has been let-bound
- in the current buffer. */
- if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set
- || let_shadows_buffer_binding_p (XSYMBOL (symbol)))
- {
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
-
- if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
- tem1 = Fassq (symbol,
- XFRAME (selected_frame)->param_alist);
-
- if (! NILP (tem1))
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame = 1;
- else
- tem1 = XBUFFER_LOCAL_VALUE (valcontents)->cdr;
- }
- /* If it's a Lisp_Buffer_Local_Value, being set not bound,
- and we're not within a let that was made for this buffer,
- create a new buffer-local binding for the variable.
- That means, give this buffer a new assoc for a local value
- and load that binding. */
- else
- {
- tem1 = Fcons (symbol, XCDR (current_alist_element));
- buf->local_var_alist
- = Fcons (tem1, buf->local_var_alist);
- }
- }
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: SET_SYMBOL_VAL (sym , newval); return;
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ if (NILP (where))
+ {
+ if (blv->frame_local)
+ where = selected_frame;
+ else
+ XSETBUFFER (where, current_buffer);
+ }
+ /* If the current buffer is not the buffer whose binding is
+ loaded, or if there may be frame-local bindings and the frame
+ isn't the right one, or if it's a Lisp_Buffer_Local_Value and
+ the default binding is loaded, the loaded binding may be the
+ wrong one. */
+ if (!EQ (blv->where, where)
+ /* Also unload a global binding (if the var is local_if_set). */
+ || (EQ (blv->valcell, blv->defcell)))
+ {
+ /* The currently loaded binding is not necessarily valid.
+ We need to unload it, and choose a new binding. */
+
+ /* Write out `realvalue' to the old loaded binding. */
+ if (blv->fwd)
+ SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
+
+ /* Find the new binding. */
+ XSETSYMBOL (symbol, sym); /* May have changed via aliasing. */
+ tem1 = Fassq (symbol,
+ (blv->frame_local
+ ? XFRAME (where)->param_alist
+ : XBUFFER (where)->local_var_alist));
+ blv->where = where;
+ blv->found = 1;
+
+ if (NILP (tem1))
+ {
+ /* This buffer still sees the default value. */
+
+ /* If the variable is a Lisp_Some_Buffer_Local_Value,
+ or if this is `let' rather than `set',
+ make CURRENT-ALIST-ELEMENT point to itself,
+ indicating that we're seeing the default value.
+ Likewise if the variable has been let-bound
+ in the current buffer. */
+ if (bindflag || !blv->local_if_set
+ || let_shadows_buffer_binding_p (sym))
+ {
+ blv->found = 0;
+ tem1 = blv->defcell;
+ }
+ /* If it's a local_if_set, being set not bound,
+ and we're not within a let that was made for this buffer,
+ create a new buffer-local binding for the variable.
+ That means, give this buffer a new assoc for a local value
+ and load that binding. */
+ else
+ {
+ /* local_if_set is only supported for buffer-local
+ bindings, not for frame-local bindings. */
+ eassert (!blv->frame_local);
+ tem1 = Fcons (symbol, XCDR (blv->defcell));
+ XBUFFER (where)->local_var_alist
+ = Fcons (tem1, XBUFFER (where)->local_var_alist);
+ }
+ }
+
+ /* Record which binding is now loaded. */
+ blv->valcell = tem1;
+ }
- /* Record which binding is now loaded. */
- XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1);
+ /* Store the new value in the cons cell. */
+ SET_BLV_VALUE (blv, newval);
- /* Set `buffer' and `frame' slots for the binding now loaded. */
- XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
- XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
- }
- innercontents = XBUFFER_LOCAL_VALUE (valcontents)->realvalue;
+ if (blv->fwd)
+ {
+ if (voide)
+ /* If storing void (making the symbol void), forward only through
+ buffer-local indicator, not through Lisp_Objfwd, etc. */
+ blv->fwd = NULL;
+ else
+ store_symval_forwarding (blv->fwd, newval,
+ BUFFERP (where)
+ ? XBUFFER (where) : current_buffer);
+ }
+ break;
+ }
+ case SYMBOL_FORWARDED:
+ {
+ struct buffer *buf
+ = BUFFERP (where) ? XBUFFER (where) : current_buffer;
+ union Lisp_Fwd *innercontents = SYMBOL_FWD (sym);
+ if (BUFFER_OBJFWDP (innercontents))
+ {
+ int offset = XBUFFER_OBJFWD (innercontents)->offset;
+ int idx = PER_BUFFER_IDX (offset);
+ if (idx > 0
+ && !bindflag
+ && !let_shadows_buffer_binding_p (sym))
+ SET_PER_BUFFER_VALUE_P (buf, idx, 1);
+ }
- /* Store the new value in the cons-cell. */
- XSETCDR (XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr), newval);
+ if (voide)
+ { /* If storing void (making the symbol void), forward only through
+ buffer-local indicator, not through Lisp_Objfwd, etc. */
+ sym->redirect = SYMBOL_PLAINVAL;
+ SET_SYMBOL_VAL (sym, newval);
+ }
+ else
+ store_symval_forwarding (/* sym, */ innercontents, newval, buf);
+ break;
+ }
+ default: abort ();
}
-
- /* If storing void (making the symbol void), forward only through
- buffer-local indicator, not through Lisp_Objfwd, etc. */
- if (voide)
- store_symval_forwarding (symbol, Qnil, newval, buf);
- else
- store_symval_forwarding (symbol, innercontents, newval, buf);
-
- return newval;
+ return;
}
\f
/* Access or set a buffer-local symbol's default value. */
default_value (symbol)
Lisp_Object symbol;
{
- register Lisp_Object valcontents;
+ struct Lisp_Symbol *sym;
CHECK_SYMBOL (symbol);
- valcontents = SYMBOL_VALUE (symbol);
+ sym = XSYMBOL (symbol);
- /* For a built-in buffer-local variable, get the default value
- rather than letting do_symval_forwarding get the current value. */
- if (BUFFER_OBJFWDP (valcontents))
+ start:
+ switch (sym->redirect)
{
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- if (PER_BUFFER_IDX (offset) != 0)
- return PER_BUFFER_DEFAULT (offset);
- }
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return SYMBOL_VAL (sym);
+ case SYMBOL_LOCALIZED:
+ {
+ /* If var is set up for a buffer that lacks a local value for it,
+ the current value is nominally the default value.
+ But the `realvalue' slot may be more up to date, since
+ ordinary setq stores just that slot. So use that. */
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ if (blv->fwd && EQ (blv->valcell, blv->defcell))
+ return do_symval_forwarding (blv->fwd);
+ else
+ return XCDR (blv->defcell);
+ }
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
- /* Handle user-created local variables. */
- if (BUFFER_LOCAL_VALUEP (valcontents))
- {
- /* If var is set up for a buffer that lacks a local value for it,
- the current value is nominally the default value.
- But the `realvalue' slot may be more up to date, since
- ordinary setq stores just that slot. So use that. */
- Lisp_Object current_alist_element, alist_element_car;
- current_alist_element
- = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
- alist_element_car = XCAR (current_alist_element);
- if (EQ (alist_element_car, current_alist_element))
- return do_symval_forwarding (XBUFFER_LOCAL_VALUE (valcontents)->realvalue);
- else
- return XCDR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
+ /* For a built-in buffer-local variable, get the default value
+ rather than letting do_symval_forwarding get the current value. */
+ if (BUFFER_OBJFWDP (valcontents))
+ {
+ int offset = XBUFFER_OBJFWD (valcontents)->offset;
+ if (PER_BUFFER_IDX (offset) != 0)
+ return PER_BUFFER_DEFAULT (offset);
+ }
+
+ /* For other variables, get the current value. */
+ return do_symval_forwarding (valcontents);
+ }
+ default: abort ();
}
- /* For other variables, get the current value. */
- return do_symval_forwarding (valcontents);
}
DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
(symbol, value)
Lisp_Object symbol, value;
{
- register Lisp_Object valcontents, current_alist_element, alist_element_buffer;
+ struct Lisp_Symbol *sym;
CHECK_SYMBOL (symbol);
- valcontents = SYMBOL_VALUE (symbol);
-
- /* Handle variables like case-fold-search that have special slots
- in the buffer. Make them work apparently like Lisp_Buffer_Local_Value
- variables. */
- if (BUFFER_OBJFWDP (valcontents))
+ if (SYMBOL_CONSTANT_P (symbol))
{
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- int idx = PER_BUFFER_IDX (offset);
+ if (NILP (Fkeywordp (symbol))
+ || !EQ (value, Fdefault_value (symbol)))
+ xsignal1 (Qsetting_constant, symbol);
+ else
+ /* Allow setting keywords to their own value. */
+ return value;
+ }
+ sym = XSYMBOL (symbol);
- PER_BUFFER_DEFAULT (offset) = value;
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return Fset (symbol, value);
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
- /* If this variable is not always local in all buffers,
- set it in the buffers that don't nominally have a local value. */
- if (idx > 0)
- {
- struct buffer *b;
+ /* Store new value into the DEFAULT-VALUE slot. */
+ XSETCDR (blv->defcell, value);
- for (b = all_buffers; b; b = b->next)
- if (!PER_BUFFER_VALUE_P (b, idx))
- PER_BUFFER_VALUE (b, offset) = value;
- }
- return value;
- }
+ /* If the default binding is now loaded, set the REALVALUE slot too. */
+ if (blv->fwd && EQ (blv->defcell, blv->valcell))
+ store_symval_forwarding (blv->fwd, value, NULL);
+ return value;
+ }
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
- if (!BUFFER_LOCAL_VALUEP (valcontents))
- return Fset (symbol, value);
+ /* Handle variables like case-fold-search that have special slots
+ in the buffer.
+ Make them work apparently like Lisp_Buffer_Local_Value variables. */
+ if (BUFFER_OBJFWDP (valcontents))
+ {
+ int offset = XBUFFER_OBJFWD (valcontents)->offset;
+ int idx = PER_BUFFER_IDX (offset);
- /* Store new value into the DEFAULT-VALUE slot. */
- XSETCDR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, value);
+ PER_BUFFER_DEFAULT (offset) = value;
- /* If the default binding is now loaded, set the REALVALUE slot too. */
- current_alist_element
- = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
- alist_element_buffer = Fcar (current_alist_element);
- if (EQ (alist_element_buffer, current_alist_element))
- store_symval_forwarding (symbol,
- XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
- value, NULL);
+ /* If this variable is not always local in all buffers,
+ set it in the buffers that don't nominally have a local value. */
+ if (idx > 0)
+ {
+ struct buffer *b;
- return value;
+ for (b = all_buffers; b; b = b->next)
+ if (!PER_BUFFER_VALUE_P (b, idx))
+ PER_BUFFER_VALUE (b, offset) = value;
+ }
+ return value;
+ }
+ else
+ return Fset (symbol, value);
+ }
+ default: abort ();
+ }
}
DEFUN ("setq-default", Fsetq_default, Ssetq_default, 0, UNEVALLED, 0,
\f
/* Lisp functions for creating and removing buffer-local variables. */
+union Lisp_Val_Fwd
+ {
+ Lisp_Object value;
+ union Lisp_Fwd *fwd;
+ };
+
+static struct Lisp_Buffer_Local_Value *
+make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents)
+{
+ struct Lisp_Buffer_Local_Value *blv
+ = xmalloc (sizeof (struct Lisp_Buffer_Local_Value));
+ Lisp_Object symbol;
+ Lisp_Object tem;
+
+ XSETSYMBOL (symbol, sym);
+ tem = Fcons (symbol, (forwarded
+ ? do_symval_forwarding (valcontents.fwd)
+ : valcontents.value));
+
+ /* Buffer_Local_Values cannot have as realval a buffer-local
+ or keyboard-local forwarding. */
+ eassert (!(forwarded && BUFFER_OBJFWDP (valcontents.fwd)));
+ eassert (!(forwarded && KBOARD_OBJFWDP (valcontents.fwd)));
+ blv->fwd = forwarded ? valcontents.fwd : NULL;
+ blv->where = Qnil;
+ blv->frame_local = 0;
+ blv->local_if_set = 0;
+ blv->defcell = tem;
+ blv->valcell = tem;
+ SET_BLV_FOUND (blv, 0);
+ return blv;
+}
+
DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local,
1, 1, "vMake Variable Buffer Local: ",
doc: /* Make VARIABLE become buffer-local whenever it is set.
(variable)
register Lisp_Object variable;
{
- register Lisp_Object tem, valcontents, newval;
struct Lisp_Symbol *sym;
+ struct Lisp_Buffer_Local_Value *blv = NULL;
+ union Lisp_Val_Fwd valcontents;
+ int forwarded;
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
+ sym = XSYMBOL (variable);
- valcontents = sym->value;
- if (sym->constant || KBOARD_OBJFWDP (valcontents))
- error ("Symbol %s may not be buffer-local", SDATA (sym->xname));
-
- if (BUFFER_OBJFWDP (valcontents))
- return variable;
- else if (BUFFER_LOCAL_VALUEP (valcontents))
+ start:
+ switch (sym->redirect)
{
- if (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
- error ("Symbol %s may not be buffer-local", SDATA (sym->xname));
- newval = valcontents;
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL:
+ forwarded = 0; valcontents.value = SYMBOL_VAL (sym);
+ if (EQ (valcontents.value, Qunbound))
+ valcontents.value = Qnil;
+ break;
+ case SYMBOL_LOCALIZED:
+ blv = SYMBOL_BLV (sym);
+ if (blv->frame_local)
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
+ break;
+ case SYMBOL_FORWARDED:
+ forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym);
+ if (KBOARD_OBJFWDP (valcontents.fwd))
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
+ else if (BUFFER_OBJFWDP (valcontents.fwd))
+ return variable;
+ break;
+ default: abort ();
}
- else
+
+ if (sym->constant)
+ error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
+
+ if (!blv)
{
- if (EQ (valcontents, Qunbound))
- sym->value = Qnil;
- tem = Fcons (Qnil, Fsymbol_value (variable));
- XSETCAR (tem, tem);
- newval = allocate_misc ();
- XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
- XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value;
- XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
- XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
- XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
- XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
- XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
- XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
- sym->value = newval;
+ blv = make_blv (sym, forwarded, valcontents);
+ sym->redirect = SYMBOL_LOCALIZED;
+ SET_SYMBOL_BLV (sym, blv);
+ {
+ Lisp_Object symbol;
+ XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
+ if (let_shadows_global_binding_p (symbol))
+ message ("Making %s buffer-local while let-bound!",
+ SDATA (SYMBOL_NAME (variable)));
+ }
}
- XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1;
+
+ blv->local_if_set = 1;
return variable;
}
(variable)
register Lisp_Object variable;
{
- register Lisp_Object tem, valcontents;
+ register Lisp_Object tem;
+ int forwarded;
+ union Lisp_Val_Fwd valcontents;
struct Lisp_Symbol *sym;
+ struct Lisp_Buffer_Local_Value *blv = NULL;
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
+ sym = XSYMBOL (variable);
+
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL:
+ forwarded = 0; valcontents.value = SYMBOL_VAL (sym); break;
+ case SYMBOL_LOCALIZED:
+ blv = SYMBOL_BLV (sym);
+ if (blv->frame_local)
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
+ break;
+ case SYMBOL_FORWARDED:
+ forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym);
+ if (KBOARD_OBJFWDP (valcontents.fwd))
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
+ break;
+ default: abort ();
+ }
- valcontents = sym->value;
- if (sym->constant || KBOARD_OBJFWDP (valcontents)
- || (BUFFER_LOCAL_VALUEP (valcontents)
- && (XBUFFER_LOCAL_VALUE (valcontents)->check_frame)))
- error ("Symbol %s may not be buffer-local", SDATA (sym->xname));
+ if (sym->constant)
+ error ("Symbol %s may not be buffer-local",
+ SDATA (SYMBOL_NAME (variable)));
- if ((BUFFER_LOCAL_VALUEP (valcontents)
- && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
- || BUFFER_OBJFWDP (valcontents))
+ if (blv ? blv->local_if_set
+ : (forwarded && BUFFER_OBJFWDP (valcontents.fwd)))
{
tem = Fboundp (variable);
-
/* Make sure the symbol has a local value in this particular buffer,
by setting it to the same value it already has. */
Fset (variable, (EQ (tem, Qt) ? Fsymbol_value (variable) : Qunbound));
return variable;
}
- /* Make sure symbol is set up to hold per-buffer values. */
- if (!BUFFER_LOCAL_VALUEP (valcontents))
+ if (!blv)
{
- Lisp_Object newval;
- tem = Fcons (Qnil, do_symval_forwarding (valcontents));
- XSETCAR (tem, tem);
- newval = allocate_misc ();
- XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
- XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value;
- XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
- XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
- XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
- XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
- XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
- XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
- XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
- sym->value = newval;
+ blv = make_blv (sym, forwarded, valcontents);
+ sym->redirect = SYMBOL_LOCALIZED;
+ SET_SYMBOL_BLV (sym, blv);
+ {
+ Lisp_Object symbol;
+ XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
+ if (let_shadows_global_binding_p (symbol))
+ message ("Making %s local to %s while let-bound!",
+ SDATA (SYMBOL_NAME (variable)),
+ SDATA (current_buffer->name));
+ }
}
+
/* Make sure this buffer has its own value of symbol. */
- XSETSYMBOL (variable, sym); /* Propagate variable indirections. */
+ XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
tem = Fassq (variable, current_buffer->local_var_alist);
if (NILP (tem))
{
+ if (let_shadows_buffer_binding_p (sym))
+ message ("Making %s buffer-local while locally let-bound!",
+ SDATA (SYMBOL_NAME (variable)));
+
/* Swap out any local binding for some other buffer, and make
sure the current value is permanently recorded, if it's the
default value. */
find_symbol_value (variable);
current_buffer->local_var_alist
- = Fcons (Fcons (variable, XCDR (XBUFFER_LOCAL_VALUE (sym->value)->cdr)),
+ = Fcons (Fcons (variable, XCDR (blv->defcell)),
current_buffer->local_var_alist);
/* Make sure symbol does not think it is set up for this buffer;
force it to look once again for this buffer's value. */
- {
- Lisp_Object *pvalbuf;
-
- valcontents = sym->value;
-
- pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer;
- if (current_buffer == XBUFFER (*pvalbuf))
- *pvalbuf = Qnil;
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
- }
+ if (current_buffer == XBUFFER (blv->where))
+ blv->where = Qnil;
+ /* blv->valcell = blv->defcell;
+ * SET_BLV_FOUND (blv, 0); */
+ blv->found = 0;
}
/* If the symbol forwards into a C variable, then load the binding
for this buffer now. If C code modifies the variable before we
load the binding in, then that new value will clobber the default
binding the next time we unload it. */
- valcontents = XBUFFER_LOCAL_VALUE (sym->value)->realvalue;
- if (INTFWDP (valcontents) || BOOLFWDP (valcontents) || OBJFWDP (valcontents))
- swap_in_symval_forwarding (variable, sym->value);
+ if (blv->fwd)
+ swap_in_symval_forwarding (sym, blv);
return variable;
}
(variable)
register Lisp_Object variable;
{
- register Lisp_Object tem, valcontents;
+ register Lisp_Object tem;
+ struct Lisp_Buffer_Local_Value *blv;
struct Lisp_Symbol *sym;
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
-
- valcontents = sym->value;
+ sym = XSYMBOL (variable);
- if (BUFFER_OBJFWDP (valcontents))
+ start:
+ switch (sym->redirect)
{
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- int idx = PER_BUFFER_IDX (offset);
-
- if (idx > 0)
- {
- SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0);
- PER_BUFFER_VALUE (current_buffer, offset)
- = PER_BUFFER_DEFAULT (offset);
- }
- return variable;
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return variable;
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
+ if (BUFFER_OBJFWDP (valcontents))
+ {
+ int offset = XBUFFER_OBJFWD (valcontents)->offset;
+ int idx = PER_BUFFER_IDX (offset);
+
+ if (idx > 0)
+ {
+ SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0);
+ PER_BUFFER_VALUE (current_buffer, offset)
+ = PER_BUFFER_DEFAULT (offset);
+ }
+ }
+ return variable;
+ }
+ case SYMBOL_LOCALIZED:
+ blv = SYMBOL_BLV (sym);
+ if (blv->frame_local)
+ return variable;
+ break;
+ default: abort ();
}
- if (!BUFFER_LOCAL_VALUEP (valcontents))
- return variable;
-
/* Get rid of this buffer's alist element, if any. */
XSETSYMBOL (variable, sym); /* Propagate variable indirection. */
tem = Fassq (variable, current_buffer->local_var_alist);
loaded, recompute its value. We have to do it now, or else
forwarded objects won't work right. */
{
- Lisp_Object *pvalbuf, buf;
- valcontents = sym->value;
- pvalbuf = &XBUFFER_LOCAL_VALUE (valcontents)->buffer;
- XSETBUFFER (buf, current_buffer);
- if (EQ (buf, *pvalbuf))
+ Lisp_Object buf; XSETBUFFER (buf, current_buffer);
+ if (EQ (buf, blv->where))
{
- *pvalbuf = Qnil;
- XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
+ blv->where = Qnil;
+ /* blv->valcell = blv->defcell;
+ * SET_BLV_FOUND (blv, 0); */
+ blv->found = 0;
find_symbol_value (variable);
}
}
(variable)
register Lisp_Object variable;
{
- register Lisp_Object tem, valcontents, newval;
+ int forwarded;
+ union Lisp_Val_Fwd valcontents;
struct Lisp_Symbol *sym;
+ struct Lisp_Buffer_Local_Value *blv = NULL;
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
+ sym = XSYMBOL (variable);
- valcontents = sym->value;
- if (sym->constant || KBOARD_OBJFWDP (valcontents)
- || BUFFER_OBJFWDP (valcontents))
- error ("Symbol %s may not be frame-local", SDATA (sym->xname));
-
- if (BUFFER_LOCAL_VALUEP (valcontents))
+ start:
+ switch (sym->redirect)
{
- if (!XBUFFER_LOCAL_VALUE (valcontents)->check_frame)
- error ("Symbol %s may not be frame-local", SDATA (sym->xname));
- return variable;
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL:
+ forwarded = 0; valcontents.value = SYMBOL_VAL (sym);
+ if (EQ (valcontents.value, Qunbound))
+ valcontents.value = Qnil;
+ break;
+ case SYMBOL_LOCALIZED:
+ if (SYMBOL_BLV (sym)->frame_local)
+ return variable;
+ else
+ error ("Symbol %s may not be frame-local",
+ SDATA (SYMBOL_NAME (variable)));
+ case SYMBOL_FORWARDED:
+ forwarded = 1; valcontents.fwd = SYMBOL_FWD (sym);
+ if (KBOARD_OBJFWDP (valcontents.fwd) || BUFFER_OBJFWDP (valcontents.fwd))
+ error ("Symbol %s may not be frame-local",
+ SDATA (SYMBOL_NAME (variable)));
+ break;
+ default: abort ();
}
- if (EQ (valcontents, Qunbound))
- sym->value = Qnil;
- tem = Fcons (Qnil, Fsymbol_value (variable));
- XSETCAR (tem, tem);
- newval = allocate_misc ();
- XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
- XBUFFER_LOCAL_VALUE (newval)->realvalue = sym->value;
- XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
- XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
- XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
- XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
- XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
- XBUFFER_LOCAL_VALUE (newval)->check_frame = 1;
- XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
- sym->value = newval;
+ if (sym->constant)
+ error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable)));
+
+ blv = make_blv (sym, forwarded, valcontents);
+ blv->frame_local = 1;
+ sym->redirect = SYMBOL_LOCALIZED;
+ SET_SYMBOL_BLV (sym, blv);
+ {
+ Lisp_Object symbol;
+ XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
+ if (let_shadows_global_binding_p (symbol))
+ message ("Making %s frame-local while let-bound!",
+ SDATA (SYMBOL_NAME (variable)));
+ }
return variable;
}
(variable, buffer)
register Lisp_Object variable, buffer;
{
- Lisp_Object valcontents;
register struct buffer *buf;
struct Lisp_Symbol *sym;
}
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
- XSETSYMBOL (variable, sym);
+ sym = XSYMBOL (variable);
- valcontents = sym->value;
- if (BUFFER_LOCAL_VALUEP (valcontents))
+ start:
+ switch (sym->redirect)
{
- Lisp_Object tail, elt;
-
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
- {
- elt = XCAR (tail);
- if (EQ (variable, XCAR (elt)))
- return Qt;
- }
- }
- if (BUFFER_OBJFWDP (valcontents))
- {
- int offset = XBUFFER_OBJFWD (valcontents)->offset;
- int idx = PER_BUFFER_IDX (offset);
- if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
- return Qt;
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return Qnil;
+ case SYMBOL_LOCALIZED:
+ {
+ Lisp_Object tail, elt, tmp;
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ XSETBUFFER (tmp, buf);
+
+ for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ elt = XCAR (tail);
+ if (EQ (variable, XCAR (elt)))
+ {
+ eassert (!blv->frame_local);
+ eassert (BLV_FOUND (blv) || !EQ (blv->where, tmp));
+ return Qt;
+ }
+ }
+ eassert (!BLV_FOUND (blv) || !EQ (blv->where, tmp));
+ return Qnil;
+ }
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
+ if (BUFFER_OBJFWDP (valcontents))
+ {
+ int offset = XBUFFER_OBJFWD (valcontents)->offset;
+ int idx = PER_BUFFER_IDX (offset);
+ if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
+ return Qt;
+ }
+ return Qnil;
+ }
+ default: abort ();
}
- return Qnil;
}
DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p,
(variable, buffer)
register Lisp_Object variable, buffer;
{
- Lisp_Object valcontents;
- register struct buffer *buf;
struct Lisp_Symbol *sym;
- if (NILP (buffer))
- buf = current_buffer;
- else
- {
- CHECK_BUFFER (buffer);
- buf = XBUFFER (buffer);
- }
-
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
- XSETSYMBOL (variable, sym);
+ sym = XSYMBOL (variable);
- valcontents = sym->value;
-
- if (BUFFER_OBJFWDP (valcontents))
- /* All these slots become local if they are set. */
- return Qt;
- else if (BUFFER_LOCAL_VALUEP (valcontents))
+ start:
+ switch (sym->redirect)
{
- Lisp_Object tail, elt;
- if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
- return Qt;
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
- {
- elt = XCAR (tail);
- if (EQ (variable, XCAR (elt)))
- return Qt;
- }
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return Qnil;
+ case SYMBOL_LOCALIZED:
+ {
+ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
+ if (blv->local_if_set)
+ return Qt;
+ XSETSYMBOL (variable, sym); /* Update in case of aliasing. */
+ return Flocal_variable_p (variable, buffer);
+ }
+ case SYMBOL_FORWARDED:
+ /* All BUFFER_OBJFWD slots become local if they are set. */
+ return (BUFFER_OBJFWDP (SYMBOL_FWD (sym)) ? Qt : Qnil);
+ default: abort ();
}
- return Qnil;
}
DEFUN ("variable-binding-locus", Fvariable_binding_locus, Svariable_binding_locus,
(variable)
register Lisp_Object variable;
{
- Lisp_Object valcontents;
struct Lisp_Symbol *sym;
CHECK_SYMBOL (variable);
- sym = indirect_variable (XSYMBOL (variable));
+ sym = XSYMBOL (variable);
/* Make sure the current binding is actually swapped in. */
find_symbol_value (variable);
- valcontents = sym->value;
-
- if (BUFFER_LOCAL_VALUEP (valcontents)
- || BUFFER_OBJFWDP (valcontents))
+ start:
+ switch (sym->redirect)
{
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: return Qnil;
+ case SYMBOL_FORWARDED:
+ {
+ union Lisp_Fwd *valcontents = SYMBOL_FWD (sym);
+ if (KBOARD_OBJFWDP (valcontents))
+ return Fframe_terminal (Fselected_frame ());
+ else if (!BUFFER_OBJFWDP (valcontents))
+ return Qnil;
+ }
+ /* FALLTHROUGH */
+ case SYMBOL_LOCALIZED:
/* For a local variable, record both the symbol and which
buffer's or frame's value we are saving. */
if (!NILP (Flocal_variable_p (variable, Qnil)))
return Fcurrent_buffer ();
- else if (BUFFER_LOCAL_VALUEP (valcontents)
- && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
- return XBUFFER_LOCAL_VALUE (valcontents)->frame;
+ else if (sym->redirect == SYMBOL_LOCALIZED
+ && BLV_FOUND (SYMBOL_BLV (sym)))
+ return SYMBOL_BLV (sym)->where;
+ else
+ return Qnil;
+ default: abort ();
}
-
- return Qnil;
}
/* This code is disabled now that we use the selected frame to return
arith_error (signo)
int signo;
{
-#if defined(USG) && !defined(POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- signal (signo, arith_error);
-#endif /* USG */
sigsetmask (SIGEMPTYMASK);
SIGNAL_THREAD_CHECK (signo);
--- /dev/null
+/* deps.mk --- src/Makefile fragment for GNU Emacs
+
+Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 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:
+
+This file is inserted in src/Makefile if AUTO_DEPEND=no.
+It defines static dependencies between the various source files.
+
+FIXME some of these dependencies are platform-specific.
+Eg callproc.c only depends on w32.h for WINDOWSNT builds.
+One way to fix this would be to replace w32.h (etc) by $(W32_H),
+a variable set by configure. Does not seem worth the trouble.
+Since the w32 build does not even use this file, you might ask
+why these dependencies are here at all...
+
+nsgui.h: In fact, every .o file depends directly or indirectly on
+dispextern.h and hence nsgui.h under NS. But the ones that actually
+use stuff there are more limited.
+
+Code: */
+
+atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
+ $(config_h)
+bidi.o: bidi.c buffer.h character.h dispextern.h lisp.h $(config_h)
+buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
+ $(INTERVALS_H) blockinput.h atimer.h systime.h character.h \
+ indent.h keyboard.h coding.h keymap.h frame.h lisp.h $(config_h)
+callint.o: callint.c window.h commands.h buffer.h keymap.h \
+ keyboard.h dispextern.h systime.h coding.h composite.h lisp.h $(config_h)
+callproc.o: callproc.c epaths.h buffer.h commands.h lisp.h $(config_h) \
+ process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
+ composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h \
+ buffer.h
+casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
+ composite.h keymap.h lisp.h $(config_h)
+casetab.o: casetab.c buffer.h character.h lisp.h $(config_h)
+category.o: category.c category.h buffer.h charset.h keymap.h \
+ character.h lisp.h $(config_h)
+ccl.o: ccl.c ccl.h charset.h character.h coding.h composite.h lisp.h $(config_h)
+character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
+ lisp.h $(config_h)
+charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
+ disptab.h lisp.h $(config_h)
+chartab.o: charset.h character.h ccl.h lisp.h $(config_h)
+coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h composite.h \
+ window.h dispextern.h frame.h termhooks.h lisp.h $(config_h)
+cm.o: cm.c frame.h cm.h termhooks.h termchar.h dispextern.h lisp.h $(config_h)
+cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h \
+ $(config_h) msdos.h dispextern.h keyboard.h keymap.h systime.h \
+ coding.h frame.h composite.h
+pre-crt0.o: pre-crt0.c
+dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h)
+dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \
+ coding.h regex.h systime.h blockinput.h atimer.h composite.h
+dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \
+ window.h buffer.h termchar.h termopts.h termhooks.h cm.h \
+ disptab.h indent.h $(INTERVALS_H) nsgui.h \
+ xterm.h blockinput.h atimer.h character.h msdos.h keyboard.h \
+ syssignal.h lisp.h $(config_h)
+doc.o: doc.c lisp.h $(config_h) epaths.h buffer.h keyboard.h keymap.h \
+ character.h systime.h coding.h composite.h
+doprnt.o: doprnt.c character.h lisp.h $(config_h)
+dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
+ msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
+ lisp.h $(config_h)
+editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
+ coding.h frame.h blockinput.h atimer.h lisp.h $(config_h)
+emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
+ termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
+ window.h dispextern.h keyboard.h keymap.h frame.h coding.h
+fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
+ coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h commands.h
+filelock.o: filelock.c buffer.h character.h coding.h systime.h composite.h \
+ lisp.h $(config_h)
+filemode.o: filemode.c $(config_h)
+frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
+ blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \
+ msdos.h dosfns.h dispextern.h w32term.h nsgui.h termchar.h coding.h \
+ composite.h lisp.h $(config_h) termhooks.h ccl.h
+fringe.o: fringe.c dispextern.h nsgui.h frame.h window.h buffer.h termhooks.h \
+ blockinput.h atimer.h systime.h lisp.h $(config_h)
+font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
+ font.h lisp.h $(config_h) buffer.h composite.h fontset.h xterm.h nsgui.h
+ftfont.o: dispextern.h frame.h character.h charset.h composite.h font.h \
+ lisp.h $(config_h) blockinput.h atimer.h systime.h coding.h fontset.h \
+ ccl.h ftfont.h
+fontset.o: fontset.c fontset.h ccl.h buffer.h character.h \
+ charset.h frame.h keyboard.h termhooks.h font.h lisp.h $(config_h) \
+ blockinput.h atimer.h systime.h coding.h $(INTERVALS_H) nsgui.h \
+ window.h xterm.h
+getloadavg.o: getloadavg.c $(config_h)
+gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h lisp.h $(config_h) \
+ blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
+ charset.h coding.h syssignal.h dispextern.h composite.h
+image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
+ systime.h xterm.h w32term.h w32gui.h font.h epaths.h character.h coding.h \
+ nsterm.h nsgui.h lisp.h $(config_h) composite.h termhooks.h ccl.h
+indent.o: indent.c frame.h window.h indent.h buffer.h lisp.h $(config_h) \
+ termchar.h termopts.h disptab.h region-cache.h character.h category.h \
+ keyboard.h systime.h coding.h $(INTERVALS_H)
+insdel.o: insdel.c window.h buffer.h $(INTERVALS_H) blockinput.h character.h \
+ dispextern.h atimer.h systime.h region-cache.h lisp.h $(config_h)
+keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
+ commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
+ systime.h syntax.h $(INTERVALS_H) blockinput.h atimer.h composite.h \
+ xterm.h puresize.h msdos.h keymap.h w32term.h nsterm.h nsgui.h coding.h \
+ lisp.h $(config_h)
+keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
+ atimer.h systime.h puresize.h character.h charset.h $(INTERVALS_H) \
+ keymap.h window.h coding.h frame.h lisp.h $(config_h)
+lastfile.o: lastfile.c $(config_h)
+macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
+ dispextern.h lisp.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 $(config_h)
+marker.o: marker.c buffer.h character.h lisp.h $(config_h)
+md5.o: md5.c md5.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 \
+ termhooks.h lisp.h $(config_h) coding.h
+mktime.o: mktime.c $(config_h)
+msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
+ termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
+ keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h \
+ lisp.h $(config_h)
+nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
+ dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \
+ atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h)
+nsfont.o: nsterm.h dispextern.h frame.h lisp.h lisp.h $(config_h)
+nsimage.o: nsimage.m nsterm.h lisp.h $(config_h)
+nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
+ nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
+ nsterm.h lisp.h $(config_h)
+nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h nsterm.h \
+ nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h \
+ termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
+ $(INTERVALS_H) process.h coding.h lisp.h $(config_h)
+nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h lisp.h $(config_h)
+process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
+ commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
+ blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
+ keyboard.h lisp.h $(config_h) character.h xgselect.h sysselect.h
+regex.o: regex.c syntax.h buffer.h lisp.h $(config_h) regex.h \
+ category.h character.h
+region-cache.o: region-cache.c buffer.h region-cache.h lisp.h $(config_h)
+scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
+ termhooks.h lisp.h $(config_h) systime.h coding.h composite.h window.h
+search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
+ blockinput.h atimer.h systime.h category.h character.h charset.h \
+ $(INTERVALS_H) \
+ lisp.h $(config_h)
+sound.o: sound.c dispextern.h syssignal.h lisp.h $(config_h) atimer.h systime.h
+strftime.o: strftime.c $(config_h)
+syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
+ keymap.h regex.h $(INTERVALS_H) lisp.h $(config_h)
+sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
+ process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \
+ frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \
+ $(config_h) composite.h
+term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) \
+ cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
+ xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
+ systty.h syssignal.h $(INTERVALS_H) buffer.h
+termcap.o: termcap.c lisp.h $(config_h)
+terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
+ keyboard.h lisp.h $(config_h) dispextern.h composite.h systime.h
+terminfo.o: terminfo.c lisp.h $(config_h)
+tparam.o: tparam.c lisp.h $(config_h)
+undo.o: undo.c buffer.h commands.h window.h dispextern.h lisp.h $(config_h)
+unexaix.o: unexaix.c lisp.h $(config_h)
+unexalpha.o: unexalpha.c $(config_h)
+unexcw.o: unexcw.c lisp.h $(config_h)
+unexec.o: unexec.c lisp.h $(config_h)
+unexelf.o: unexelf.c $(config_h)
+unexhp9k800.o: unexhp9k800.c $(config_h)
+unexmacosx.o: unexmacosx.c $(config_h)
+unexsol.o: unexsol.c lisp.h $(config_h)
+unexw32.o: unexw32.c $(config_h)
+w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
+ msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
+widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
+ $(srcdir)/../lwlib/lwlib.h lisp.h $(config_h)
+window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
+ disptab.h keyboard.h msdos.h coding.h termhooks.h \
+ keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \
+ xterm.h w32term.h nsterm.h nsgui.h lisp.h $(config_h)
+xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
+ coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
+ charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h \
+ xterm.h w32term.h nsterm.h nsgui.h msdos.h composite.h fontset.h ccl.h \
+ blockinput.h atimer.h systime.h keymap.h font.h
+xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
+ window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
+ systime.h keyboard.h fontset.h w32term.h nsterm.h coding.h ccl.h \
+ $(INTERVALS_H) nsgui.h termchar.h termhooks.h font.h lisp.h $(config_h)
+xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
+ $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
+ character.h charset.h coding.h gtkutil.h lisp.h $(config_h) termhooks.h \
+ fontset.h termchar.h font.h xsettings.h $(INTERVALS_H) ccl.h
+xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
+xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h ftfont.h
+ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
+ font.h lisp.h $(config_h) atimer.h systime.h fontset.h ccl.h
+menu.o: menu.c lisp.h keyboard.h keymap.h frame.h termhooks.h blockinput.h \
+ dispextern.h $(srcdir)/../lwlib/lwlib.h xterm.h gtkutil.h menu.h \
+ lisp.h $(config_h) systime.h coding.h composite.h window.h atimer.h nsgui.h
+xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
+ charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
+ systime.h gtkutil.h msdos.h coding.h menu.h lisp.h $(config_h) composite.h \
+ keymap.h sysselect.h
+xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
+ dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
+ keyboard.h emacs-icon.h character.h charset.h ccl.h fontset.h composite.h \
+ coding.h process.h gtkutil.h font.h fontset.h lisp.h $(config_h) \
+ xsettings.h intervals.h keymap.h xgselect.h sysselect.h
+xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
+ buffer.h atimer.h systime.h termhooks.h lisp.h $(config_h) keyboard.h \
+ coding.h composite.h
+xgselect.o: xgselect.h systime.h sysselect.h lisp.h $(config_h)
+xrdb.o: xrdb.c lisp.h $(config_h) epaths.h
+xsmfns.o: xsmfns.c lisp.h $(config_h) systime.h sysselect.h termhooks.h \
+ xterm.h lisp.h termopts.h frame.h dispextern.h
+xsettings.o: xterm.h xsettings.h lisp.h frame.h termhooks.h $(config_h) \
+ dispextern.h keyboard.h systime.h coding.h composite.h blockinput.h \
+ atimer.h termopts.h
+
+/* The files of Lisp proper. */
+alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h \
+ keyboard.h blockinput.h atimer.h systime.h character.h lisp.h $(config_h) \
+ $(INTERVALS_H) termhooks.h
+bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
+ frame.h xterm.h lisp.h $(config_h)
+data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
+ termhooks.h systime.h coding.h composite.h dispextern.h font.h ccl.h \
+ lisp.h $(config_h)
+eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
+ dispextern.h lisp.h $(config_h) coding.h composite.h xterm.h
+floatfns.o: floatfns.c syssignal.h lisp.h $(config_h)
+fns.o: fns.c commands.h lisp.h $(config_h) frame.h buffer.h character.h \
+ keyboard.h keymap.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \
+ blockinput.h atimer.h systime.h xterm.h
+print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
+ lisp.h $(config_h) termchar.h $(INTERVALS_H) msdos.h termhooks.h \
+ blockinput.h atimer.h systime.h font.h charset.h coding.h ccl.h
+lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
+ charset.h lisp.h $(config_h) $(INTERVALS_H) termhooks.h coding.h msdos.h \
+ systime.h frame.h blockinput.h atimer.h
+
+/* Text properties support. */
+composite.o: composite.c buffer.h character.h coding.h font.h ccl.h \
+ frame.h termhooks.h $(INTERVALS_H) window.h lisp.h $(config_h)
+intervals.o: intervals.c buffer.h $(INTERVALS_H) keyboard.h puresize.h \
+ keymap.h lisp.h $(config_h) systime.h coding.h
+textprop.o: textprop.c buffer.h window.h $(INTERVALS_H) \
+ lisp.h $(config_h)
+
+
+/* deps.mk ends here */
char *fullname = (char *) alloca (len + pos + 2);
#ifdef MSDOS
-#if __DJGPP__ > 1
/* Some fields of struct stat are *very* expensive to compute on MS-DOS,
but aren't required here. Avoid computing the following fields:
st_inode, st_size and st_nlink for directories, and the execute bits
unsigned short save_djstat_flags = _djstat_flags;
_djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
bcopy (SDATA (dirname), fullname, pos);
#else
value = stat (fullname, st_addr);
#ifdef MSDOS
-#if __DJGPP__ > 1
_djstat_flags = save_djstat_flags;
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
return value;
#endif /* S_IFLNK */
/* Non-zero means don't display cursor here. */
unsigned avoid_cursor_p : 1;
+ /* Resolved bidirectional level of this character [0..63]. */
+ unsigned resolved_level : 5;
+
+ /* Resolved bidirectional type of this character, see enum
+ bidi_type_t below. Note that according to UAX#9, only some
+ values (STRONG_L, STRONG_R, WEAK_AN, WEAK_EN, WEAK_BN, and
+ NEUTRAL_B) can appear in the resolved type, so we only reserve
+ space for those that can. */
+ unsigned bidi_type : 3;
+
#define FACE_ID_BITS 20
/* Face of the glyph. This is a realized face ID,
/* First position in this row. This is the text position, including
overlay position information etc, where the display of this row
- started, and can thus be less the position of the first glyph
- (e.g. due to invisible text or horizontal scrolling). */
+ started, and can thus be less than the position of the first
+ glyph (e.g. due to invisible text or horizontal scrolling).
+ BIDI Note: In R2L rows, that have its reversed_p flag set, this
+ position is at or beyond the right edge of the row. */
struct display_pos start;
/* Text position at the end of this row. This is the position after
the last glyph on this row. It can be greater than the last
- glyph position + 1, due to truncation, invisible text etc. In an
- up-to-date display, this should always be equal to the start
- position of the next row. */
+ glyph position + 1, due to a newline that ends the line,
+ truncation, invisible text etc. In an up-to-date display, this
+ should always be equal to the start position of the next row.
+ BIDI Note: In R2L rows, this position is at or beyond the left
+ edge of the row. */
struct display_pos end;
+ /* The smallest and the largest buffer positions that contributed to
+ glyphs in this row. Note that due to bidi reordering, these are
+ in general different from the text positions stored in `start'
+ and `end' members above, and also different from the buffer
+ positions recorded in the glyphs displayed the leftmost and
+ rightmost on the screen. */
+ struct text_pos minpos, maxpos;
+
/* Non-zero means the overlay arrow bitmap is on this line.
-1 means use default overlay arrow bitmap, else
it specifies actual fringe bitmap number. */
the bottom line of the window, but not end of the buffer. */
unsigned indicate_bottom_line_p : 1;
+ /* Non-zero means the row was reversed to display text in a
+ right-to-left paragraph. */
+ unsigned reversed_p : 1;
+
/* Continuation lines width at the start of the row. */
int continuation_lines_width;
(MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA])
/* Return the character/ byte position at which the display of ROW
- starts. */
+ starts. BIDI Note: this is the smallest character/byte position
+ among characters in ROW, i.e. the first logical-order character
+ displayed by ROW, which is not necessarily the smallest horizontal
+ position. */
-#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos)
-#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos)
+#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->minpos.charpos)
+#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->minpos.bytepos)
-/* Return the character/ byte position at which ROW ends. */
+/* Return the character/ byte position at which ROW ends. BIDI Note:
+ this is the largest character/byte position among characters in
+ ROW, i.e. the last logical-order character displayed by ROW, which
+ is not necessarily the largest horizontal position. */
-#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos)
-#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos)
+#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->maxpos.charpos)
+#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->maxpos.bytepos)
/* Return the vertical position of ROW in MATRIX. */
extern int display_completed;
-/* Non-zero means redisplay has been performed directly (see also
- direct_output_for_insert and direct_output_forward_char), so that
- no further updating has to be performed. The function
- redisplay_internal checks this flag, and does nothing but reset it
- to zero if it is non-zero. */
-
-extern int redisplay_performed_directly_p;
-
/* A temporary storage area, including a row of glyphs. Initialized
in xdisp.c. Used for various purposes, as an example see
- direct_output_for_insert. */
+ get_overlay_arrow_glyph_row. */
extern struct glyph_row scratch_glyph_row;
extern int face_change_count;
+/* For reordering of bidirectional text. */
+#define BIDI_MAXLEVEL 64
+
+/* Data type for describing the bidirectional character types. The
+ first 7 must be at the beginning, because they are the only values
+ valid in the `bidi_type' member of `struct glyph'; we only reserve
+ 3 bits for it, so we cannot use there values larger than 7. */
+typedef enum {
+ UNKNOWN_BT = 0,
+ STRONG_L, /* strong left-to-right */
+ STRONG_R, /* strong right-to-left */
+ WEAK_EN, /* european number */
+ WEAK_AN, /* arabic number */
+ WEAK_BN, /* boundary neutral */
+ NEUTRAL_B, /* paragraph separator */
+ STRONG_AL, /* arabic right-to-left letter */
+ LRE, /* left-to-right embedding */
+ LRO, /* left-to-right override */
+ RLE, /* right-to-left embedding */
+ RLO, /* right-to-left override */
+ PDF, /* pop directional format */
+ WEAK_ES, /* european number separator */
+ WEAK_ET, /* european number terminator */
+ WEAK_CS, /* common separator */
+ WEAK_NSM, /* non-spacing mark */
+ NEUTRAL_S, /* segment separator */
+ NEUTRAL_WS, /* whitespace */
+ NEUTRAL_ON /* other neutrals */
+} bidi_type_t;
+
+/* The basic directionality data type. */
+typedef enum { NEUTRAL_DIR, L2R, R2L } bidi_dir_t;
+
+/* Data type for storing information about characters we need to
+ remember. */
+struct bidi_saved_info {
+ int bytepos, charpos; /* character's buffer position */
+ bidi_type_t type; /* character's resolved bidi type */
+ bidi_type_t type_after_w1; /* original type of the character, after W1 */
+ bidi_type_t orig_type; /* type as we found it in the buffer */
+};
+
+/* Data type for keeping track of saved embedding levels and override
+ status information. */
+struct bidi_stack {
+ int level;
+ bidi_dir_t override;
+};
+/* Data type for iterating over bidi text. */
+struct bidi_it {
+ EMACS_INT bytepos; /* iterator's position in buffer */
+ EMACS_INT charpos;
+ int ch; /* character itself */
+ int ch_len; /* length of its multibyte sequence */
+ bidi_type_t type; /* bidi type of this character, after
+ resolving weak and neutral types */
+ bidi_type_t type_after_w1; /* original type, after overrides and W1 */
+ bidi_type_t orig_type; /* original type, as found in the buffer */
+ int resolved_level; /* final resolved level of this character */
+ int invalid_levels; /* how many PDFs to ignore */
+ int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */
+ int prev_was_pdf; /* if non-zero, previous char was PDF */
+ struct bidi_saved_info prev; /* info about previous character */
+ struct bidi_saved_info last_strong; /* last-seen strong directional char */
+ struct bidi_saved_info next_for_neutral; /* surrounding characters for... */
+ struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */
+ struct bidi_saved_info next_for_ws; /* character after sequence of ws */
+ EMACS_INT next_en_pos; /* position of next EN char for ET */
+ EMACS_INT ignore_bn_limit; /* position until which to ignore BNs */
+ bidi_dir_t sor; /* direction of start-of-run in effect */
+ int scan_dir; /* direction of text scan, 1: forw, -1: back */
+ int stack_idx; /* index of current data on the stack */
+ /* Note: Everything from here on is not copied/saved when the bidi
+ iterator state is saved, pushed, or popped. So only put here
+ stuff that is not part of the bidi iterator's state! */
+ struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */
+ int first_elt; /* if non-zero, examine current char first */
+ bidi_dir_t paragraph_dir; /* current paragraph direction */
+ int new_paragraph; /* if non-zero, we expect a new paragraph */
+ EMACS_INT separator_limit; /* where paragraph separator should end */
+};
+
+/* Value is non-zero when the bidi iterator is at base paragraph
+ embedding level. */
+#define BIDI_AT_BASE_LEVEL(BIDI_IT) \
+ ((BIDI_IT).resolved_level == (BIDI_IT).level_stack[0].level)
\f
/***********************************************************************
NUM_IT_METHODS
};
-#define IT_STACK_SIZE 4
+/* FIXME: What is this? Why 5? */
+#define IT_STACK_SIZE 5
/* Iterator for composition (both for static and automatic). */
struct composition_it
graphic display and in units of canonical characters on a
terminal display. */
int width;
+ /* Nonzero iff the composition is created while buffer is scanned in
+ reverse order, and thus the grapheme clusters must be rendered
+ from the last to the first. */
+ int reversed_p;
};
struct it
text, overlay strings, end of text etc., which see. */
EMACS_INT stop_charpos;
+ /* Previous stop position, i.e. the last one before the current
+ iterator position in `current'. */
+ EMACS_INT prev_stop;
+
+ /* Last stop position iterated across whose bidi embedding level is
+ equal to the current paragraph's base embedding level. */
+ EMACS_INT base_level_stop;
+
/* Maximum string or buffer position + 1. ZV when iterating over
current_buffer. */
EMACS_INT end_charpos;
int string_nchars;
EMACS_INT end_charpos;
EMACS_INT stop_charpos;
+ EMACS_INT prev_stop;
+ EMACS_INT base_level_stop;
struct composition_it cmp_it;
int face_id;
MODE_LINE_FACE_ID, etc, depending on what we are displaying. */
int base_face_id;
- /* If what == IT_CHARACTER, character and length in bytes. This is
- a character from a buffer or string. It may be different from
- the character displayed in case that
- unibyte_display_via_language_environment is set.
+ /* If `what' == IT_CHARACTER, the character and the length in bytes
+ of its multibyte sequence. The character comes from a buffer or
+ a string. It may be different from the character displayed in
+ case that unibyte_display_via_language_environment is set.
- If what == IT_COMPOSITION, the first component of a composition
- and length in bytes of the composition. */
+ If `what' == IT_COMPOSITION, the first component of a composition
+ and length in bytes of the composition.
+
+ If `what' is anything else, these two are undefined (will
+ probably hold values for the last IT_CHARACTER or IT_COMPOSITION
+ traversed by the iterator.
+
+ The values are updated by get_next_display_element, so they are
+ out of sync with the value returned by IT_CHARPOS between the
+ time set_iterator_to_next advances the position and the time
+ get_next_display_element loads the new values into c and len. */
int c, len;
/* If what == IT_COMPOSITION, iterator substructure for the
incremented/reset by display_line, move_it_to etc. */
int continuation_lines_width;
+ /* Buffer position that ends the buffer text line being iterated.
+ This is normally the position after the newline at EOL. If this
+ is the last line of the buffer and it doesn't have a newline,
+ value is ZV/ZV_BYTE. Set and used only if IT->bidi_p, for
+ setting the end position of glyph rows produced for continuation
+ lines, see display_line. */
+ struct text_pos eol_pos;
+
/* Current y-position. Automatically incremented by the height of
glyph_row in move_it_to and display_line. */
int current_y;
/* Face of the right fringe glyph. */
unsigned right_user_fringe_face_id : FACE_ID_BITS;
+
+ /* Non-zero means we need to reorder bidirectional text for display
+ in the visual order. */
+ int bidi_p;
+
+ /* For iterating over bidirectional text. */
+ struct bidi_it bidi_it;
+ bidi_dir_t paragraph_embedding;
};
#define PRODUCE_GLYPHS(IT) \
do { \
extern int inhibit_free_realized_faces; \
+ if ((IT)->glyph_row != NULL && (IT)->bidi_p) \
+ { \
+ if ((IT)->bidi_it.paragraph_dir == R2L) \
+ (IT)->glyph_row->reversed_p = 1; \
+ else \
+ (IT)->glyph_row->reversed_p = 0; \
+ } \
if (FRAME_RIF ((IT)->f) != NULL) \
FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \
else \
/* Icon file name of right to left image when an RTL locale is used. */
TOOL_BAR_ITEM_RTL_IMAGE,
+ /* Label to show when text labels are enabled. */
+ TOOL_BAR_ITEM_LABEL,
+
/* Sentinel = number of slots in tool_bar_items occupied by one
tool-bar item. */
TOOL_BAR_ITEM_NSLOTS
extern Lisp_Object Vtool_bar_button_margin;
+/* Tool bar style */
+
+extern Lisp_Object Vtool_bar_style;
+
+/* Maximum number of characters a label can have to be shown. */
+
+extern EMACS_INT tool_bar_max_label_size;
+#define DEFAULT_TOOL_BAR_LABEL_SIZE 14
+
/* Thickness of relief to draw around tool-bar buttons. */
extern EMACS_INT tool_bar_button_relief;
Function Prototypes
***********************************************************************/
+/* Defined in bidi.c */
+
+extern void bidi_init_it P_ ((EMACS_INT, EMACS_INT, struct bidi_it *));
+extern void bidi_move_to_visually_next P_ ((struct bidi_it *));
+extern void bidi_paragraph_init P_ ((bidi_dir_t, struct bidi_it *));
+extern int bidi_mirror_char P_ ((int));
+
/* Defined in xdisp.c */
struct glyph_row *row_containing_pos P_ ((struct window *, int,
struct glyph_row *,
struct glyph_row *, int));
-int string_buffer_position P_ ((struct window *, Lisp_Object, int));
+EMACS_INT string_buffer_position P_ ((struct window *, Lisp_Object,
+ EMACS_INT));
int line_bottom_y P_ ((struct it *));
int display_prop_intangible_p P_ ((Lisp_Object));
void resize_echo_area_exactly P_ ((void));
void redisplay_preserve_echo_area P_ ((int));
int set_cursor_from_row P_ ((struct window *, struct glyph_row *,
struct glyph_matrix *, int, int, int, int));
-void init_iterator P_ ((struct it *, struct window *, int,
- int, struct glyph_row *, enum face_id));
+void init_iterator P_ ((struct it *, struct window *, EMACS_INT,
+ EMACS_INT, struct glyph_row *, enum face_id));
void init_iterator_to_row_start P_ ((struct it *, struct window *,
struct glyph_row *));
int get_next_display_element P_ ((struct it *));
XRectangle *));
#endif
+/* Flags passed to try_window. */
+#define TRY_WINDOW_CHECK_MARGINS (1 << 0)
+#define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1)
+
/* Defined in fringe.c */
int lookup_fringe_bitmap (Lisp_Object);
extern void cancel_line P_ ((int, struct frame *));
extern void init_desired_glyphs P_ ((struct frame *));
extern int scroll_frame_lines P_ ((struct frame *, int, int, int, int));
-extern int direct_output_for_insert P_ ((int));
-extern int direct_output_forward_char P_ ((int));
extern int update_frame P_ ((struct frame *, int, int));
extern int scrolling P_ ((struct frame *));
extern void bitch_at_user P_ ((void));
void redraw_frame P_ ((struct frame *));
void redraw_garbaged_frames P_ ((void));
int scroll_cost P_ ((struct frame *, int, int, int));
-int direct_output_for_insert P_ ((int));
-int direct_output_forward_char P_ ((int));
int update_frame P_ ((struct frame *, int, int));
void update_single_window P_ ((struct window *, int));
int scrolling P_ ((struct frame *));
struct glyph space_glyph;
-/* Non-zero means update has been performed directly, so that there's
- no need for redisplay_internal to do much work. Set by
- direct_output_for_insert. */
-
-int redisplay_performed_directly_p;
-
/* Counts of allocated structures. These counts serve to diagnose
memory leaks and double frees. */
MATRIX_ROW_START_BYTEPOS (row) += delta_bytes;
MATRIX_ROW_END_CHARPOS (row) += delta;
MATRIX_ROW_END_BYTEPOS (row) += delta_bytes;
+ CHARPOS (row->start.pos) += delta;
+ BYTEPOS (row->start.pos) += delta_bytes;
+ CHARPOS (row->end.pos) += delta;
+ BYTEPOS (row->end.pos) += delta_bytes;
if (!row->enabled_p)
return;
{
if (!row->enabled_p)
{
+ unsigned rp = row->reversed_p;
+
clear_glyph_row (row);
row->enabled_p = 1;
+ row->reversed_p = rp;
}
}
|| a->overlapped_p != b->overlapped_p
|| (MATRIX_ROW_CONTINUATION_LINE_P (a)
!= MATRIX_ROW_CONTINUATION_LINE_P (b))
+ || a->reversed_p != b->reversed_p
/* Different partially visible characters on left margin. */
|| a->x != b->x
/* Different height. */
/* Check that character and byte positions are in sync. */
xassert (MATRIX_ROW_START_BYTEPOS (row)
== CHAR_TO_BYTE (MATRIX_ROW_START_CHARPOS (row)));
+ xassert (BYTEPOS (row->start.pos)
+ == CHAR_TO_BYTE (CHARPOS (row->start.pos)));
/* CHAR_TO_BYTE aborts when invoked for a position > Z. We can
have such a position temporarily in case of a minibuffer
displaying something like `[Sole completion]' at its end. */
if (MATRIX_ROW_END_CHARPOS (row) < BUF_ZV (current_buffer))
- xassert (MATRIX_ROW_END_BYTEPOS (row)
- == CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row)));
+ {
+ xassert (MATRIX_ROW_END_BYTEPOS (row)
+ == CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row)));
+ xassert (BYTEPOS (row->end.pos)
+ == CHAR_TO_BYTE (CHARPOS (row->end.pos)));
+ }
/* Check that end position of `row' is equal to start position
of next row. */
== MATRIX_ROW_START_CHARPOS (next));
xassert (MATRIX_ROW_END_BYTEPOS (row)
== MATRIX_ROW_START_BYTEPOS (next));
+ xassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos));
+ xassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos));
}
row = next;
}
\f
-/***********************************************************************
- Direct Operations
- ***********************************************************************/
-
-/* Try to update display and current glyph matrix directly.
-
- This function is called after a character G has been inserted into
- current_buffer. It tries to update the current glyph matrix and
- perform appropriate screen output to reflect the insertion. If it
- succeeds, the global flag redisplay_performed_directly_p will be
- set to 1, and thereby prevent the more costly general redisplay
- from running (see redisplay_internal).
-
- This function is not called for `hairy' character insertions.
- In particular, it is not called when after or before change
- functions exist, like they are used by font-lock. See keyboard.c
- for details where this function is called. */
-
-int
-direct_output_for_insert (g)
- int g;
-{
- register struct frame *f = SELECTED_FRAME ();
- struct window *w = XWINDOW (selected_window);
- struct it it, it2;
- struct glyph_row *glyph_row;
- struct glyph *glyphs, *glyph, *end;
- int n;
- /* Non-null means that redisplay of W is based on window matrices. */
- int window_redisplay_p = FRAME_WINDOW_P (f);
- /* Non-null means we are in overwrite mode. */
- int overwrite_p = !NILP (current_buffer->overwrite_mode);
- int added_width;
- struct text_pos pos;
- int delta, delta_bytes;
-
- /* Not done directly. */
- redisplay_performed_directly_p = 0;
-
- /* Quickly give up for some common cases. */
- if (cursor_in_echo_area
- /* Give up if fonts have changed. */
- || fonts_changed_p
- /* Give up if face attributes have been changed. */
- || face_change_count
- /* Give up if cursor position not really known. */
- || !display_completed
- /* Give up if buffer appears in two places. */
- || buffer_shared > 1
- /* Give up if currently displaying a message instead of the
- minibuffer contents. */
- || (EQ (selected_window, minibuf_window)
- && EQ (minibuf_window, echo_area_window))
- /* Give up for hscrolled mini-buffer because display of the prompt
- is handled specially there (see display_line). */
- || (MINI_WINDOW_P (w) && XFASTINT (w->hscroll))
- /* Give up if overwriting in the middle of a line. */
- || (overwrite_p
- && PT != ZV
- && FETCH_BYTE (PT) != '\n')
- /* Give up for tabs and line ends. */
- || g == '\t'
- || g == '\n'
- || g == '\r'
- || (g == ' ' && !NILP (current_buffer->word_wrap))
- /* Give up if unable to display the cursor in the window. */
- || w->cursor.vpos < 0
- /* Give up if we are showing a message or just cleared the message
- because we might need to resize the echo area window. */
- || !NILP (echo_area_buffer[0])
- || !NILP (echo_area_buffer[1])
- || (glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos),
- /* Can't do it in a continued line because continuation
- lines would change. */
- (glyph_row->continued_p
- || glyph_row->exact_window_width_line_p
- /* Can't use this method if the line overlaps others or is
- overlapped by others because these other lines would
- have to be redisplayed. */
- || glyph_row->overlapping_p
- || glyph_row->overlapped_p))
- /* Can't do it for partial width windows on terminal frames
- because we can't clear to eol in such a window. */
- || (!window_redisplay_p && !WINDOW_FULL_WIDTH_P (w)))
- return 0;
-
- /* If we can't insert glyphs, we can use this method only
- at the end of a line. */
- if (!FRAME_CHAR_INS_DEL_OK (f))
- if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n')
- return 0;
-
- /* Set up a display iterator structure for W. Glyphs will be
- produced in scratch_glyph_row. Current position is W's cursor
- position. */
- clear_glyph_row (&scratch_glyph_row);
- SET_TEXT_POS (pos, PT, PT_BYTE);
- DEC_TEXT_POS (pos, !NILP (current_buffer->enable_multibyte_characters));
- init_iterator (&it, w, CHARPOS (pos), BYTEPOS (pos), &scratch_glyph_row,
- DEFAULT_FACE_ID);
-
- glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
- if (glyph_row->mouse_face_p)
- return 0;
-
- /* Give up if highlighting trailing whitespace and we have trailing
- whitespace in glyph_row. We would have to remove the trailing
- whitespace face in that case. */
- if (!NILP (Vshow_trailing_whitespace)
- && glyph_row->used[TEXT_AREA])
- {
- struct glyph *last;
-
- last = glyph_row->glyphs[TEXT_AREA] + glyph_row->used[TEXT_AREA] - 1;
- if (last->type == STRETCH_GLYPH
- || (last->type == CHAR_GLYPH
- && last->u.ch == ' '))
- return 0;
- }
-
- /* Give up if there are overlay strings at pos. This would fail
- if the overlay string has newlines in it. */
- if (STRINGP (it.string))
- return 0;
-
- it.hpos = w->cursor.hpos;
- it.vpos = w->cursor.vpos;
- it.current_x = w->cursor.x + it.first_visible_x;
- it.current_y = w->cursor.y;
- it.end_charpos = PT;
- it.stop_charpos = min (PT, it.stop_charpos);
- it.stop_charpos = max (IT_CHARPOS (it), it.stop_charpos);
-
- /* More than one display element may be returned for PT - 1 if
- (i) it's a control character which is translated into `\003' or
- `^C', or (ii) it has a display table entry, or (iii) it's a
- combination of both. */
- delta = delta_bytes = 0;
- while (get_next_display_element (&it))
- {
- PRODUCE_GLYPHS (&it);
-
- /* Give up if glyph doesn't fit completely on the line. */
- if (it.current_x >= it.last_visible_x)
- return 0;
-
- /* Give up if new glyph has different ascent or descent than
- the original row, or if it is not a character glyph. */
- if (glyph_row->ascent != it.ascent
- || glyph_row->height != it.ascent + it.descent
- || glyph_row->phys_ascent != it.phys_ascent
- || glyph_row->phys_height != it.phys_ascent + it.phys_descent
- || it.what != IT_CHARACTER)
- return 0;
-
- delta += 1;
- delta_bytes += it.len;
- set_iterator_to_next (&it, 1);
- }
-
- /* Give up if we hit the right edge of the window. We would have
- to insert truncation or continuation glyphs. */
- added_width = it.current_x - (w->cursor.x + it.first_visible_x);
- if (glyph_row->pixel_width + added_width >= it.last_visible_x)
- return 0;
-
- /* Give up if there is a \t following in the line. */
- it2 = it;
- it2.end_charpos = ZV;
- it2.stop_charpos = min (it2.stop_charpos, ZV);
- while (get_next_display_element (&it2)
- && !ITERATOR_AT_END_OF_LINE_P (&it2))
- {
- if (it2.c == '\t')
- return 0;
- set_iterator_to_next (&it2, 1);
- }
-
- /* Number of new glyphs produced. */
- n = it.glyph_row->used[TEXT_AREA];
-
- /* Start and end of glyphs in original row. */
- glyphs = glyph_row->glyphs[TEXT_AREA] + w->cursor.hpos;
- end = glyph_row->glyphs[1 + TEXT_AREA];
-
- /* Make room for new glyphs, then insert them. */
- xassert (end - glyphs - n >= 0);
- safe_bcopy ((char *) glyphs, (char *) (glyphs + n),
- (end - glyphs - n) * sizeof (*end));
- bcopy (it.glyph_row->glyphs[TEXT_AREA], glyphs, n * sizeof *glyphs);
- glyph_row->used[TEXT_AREA] = min (glyph_row->used[TEXT_AREA] + n,
- end - glyph_row->glyphs[TEXT_AREA]);
-
- /* Compute new line width. */
- glyph = glyph_row->glyphs[TEXT_AREA];
- end = glyph + glyph_row->used[TEXT_AREA];
- glyph_row->pixel_width = glyph_row->x;
- while (glyph < end)
- {
- glyph_row->pixel_width += glyph->pixel_width;
- ++glyph;
- }
-
- /* Increment buffer positions for glyphs following the newly
- inserted ones. */
- for (glyph = glyphs + n; glyph < end; ++glyph)
- if (glyph->charpos > 0 && BUFFERP (glyph->object))
- glyph->charpos += delta;
-
- if (MATRIX_ROW_END_CHARPOS (glyph_row) > 0)
- {
- MATRIX_ROW_END_CHARPOS (glyph_row) += delta;
- MATRIX_ROW_END_BYTEPOS (glyph_row) += delta_bytes;
- }
-
- /* Adjust positions in lines following the one we are in. */
- increment_matrix_positions (w->current_matrix,
- w->cursor.vpos + 1,
- w->current_matrix->nrows,
- delta, delta_bytes);
-
- glyph_row->contains_overlapping_glyphs_p
- |= it.glyph_row->contains_overlapping_glyphs_p;
-
- glyph_row->displays_text_p = 1;
- w->window_end_vpos = make_number (max (w->cursor.vpos,
- XFASTINT (w->window_end_vpos)));
-
- if (!NILP (Vshow_trailing_whitespace))
- highlight_trailing_whitespace (it.f, glyph_row);
-
- /* Write glyphs. If at end of row, we can simply call write_glyphs.
- In the middle, we have to insert glyphs. Note that this is now
- implemented for X frames. The implementation uses updated_window
- and updated_row. */
- updated_row = glyph_row;
- updated_area = TEXT_AREA;
- update_begin (f);
- if (FRAME_RIF (f))
- {
- FRAME_RIF (f)->update_window_begin_hook (w);
-
- if (glyphs == end - n
- /* In front of a space added by append_space. */
- || (glyphs == end - n - 1
- && (end - n)->charpos <= 0))
- FRAME_RIF (f)->write_glyphs (glyphs, n);
- else
- FRAME_RIF (f)->insert_glyphs (glyphs, n);
- }
- else
- {
- if (glyphs == end - n)
- write_glyphs (f, glyphs, n);
- else
- insert_glyphs (f, glyphs, n);
- }
-
- w->cursor.hpos += n;
- w->cursor.x = it.current_x - it.first_visible_x;
- xassert (w->cursor.hpos >= 0
- && w->cursor.hpos < w->desired_matrix->matrix_w);
-
- /* How to set the cursor differs depending on whether we are
- using a frame matrix or a window matrix. Note that when
- a frame matrix is used, cursor_to expects frame coordinates,
- and the X and Y parameters are not used. */
- if (window_redisplay_p)
- FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
- w->cursor.y, w->cursor.x);
- else
- {
- int x, y;
- x = (WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos)
- + (INTEGERP (w->left_margin_cols)
- ? XFASTINT (w->left_margin_cols)
- : 0));
- y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (f, y, x);
- }
-
-#ifdef HAVE_WINDOW_SYSTEM
- update_window_fringes (w, 0);
-#endif
-
- if (FRAME_RIF (f))
- FRAME_RIF (f)->update_window_end_hook (w, 1, 0);
- update_end (f);
- updated_row = NULL;
- if (FRAME_TERMCAP_P (f))
- fflush (FRAME_TTY (f)->output);
-
- TRACE ((stderr, "direct output for insert\n"));
- mark_window_display_accurate (it.window, 1);
- redisplay_performed_directly_p = 1;
- return 1;
-}
-
-
-/* Perform a direct display update for moving PT by N positions
- left or right. N < 0 means a movement backwards. This function
- is currently only called for N == 1 or N == -1. */
-
-int
-direct_output_forward_char (n)
- int n;
-{
- struct frame *f = SELECTED_FRAME ();
- struct window *w = XWINDOW (selected_window);
- struct glyph_row *row;
-
- /* Give up if point moved out of or into a composition. */
- if (check_point_in_composition (current_buffer, XINT (w->last_point),
- current_buffer, PT))
- return 0;
-
- /* Give up if face attributes have been changed. */
- if (face_change_count)
- return 0;
-
- /* Give up if current matrix is not up to date or we are
- displaying a message. */
- if (!display_completed || cursor_in_echo_area)
- return 0;
-
- /* Give up if the buffer's direction is reversed. */
- if (!NILP (XBUFFER (w->buffer)->direction_reversed))
- return 0;
-
- /* Can't use direct output if highlighting a region. */
- if (!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active))
- return 0;
-
- /* Can't use direct output if highlighting trailing whitespace. */
- if (!NILP (Vshow_trailing_whitespace))
- return 0;
-
- /* Give up if we are showing a message or just cleared the message
- because we might need to resize the echo area window. */
- if (!NILP (echo_area_buffer[0]) || !NILP (echo_area_buffer[1]))
- return 0;
-
- /* Give up if currently displaying a message instead of the
- minibuffer contents. */
- if (XWINDOW (minibuf_window) == w
- && EQ (minibuf_window, echo_area_window))
- return 0;
-
- /* Give up if we don't know where the cursor is. */
- if (w->cursor.vpos < 0)
- return 0;
-
- row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
-
- /* Give up if PT is outside of the last known cursor row. */
- if (PT <= MATRIX_ROW_START_CHARPOS (row)
- || PT >= MATRIX_ROW_END_CHARPOS (row))
- return 0;
-
- set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
-
- w->last_cursor = w->cursor;
- XSETFASTINT (w->last_point, PT);
-
- xassert (w->cursor.hpos >= 0
- && w->cursor.hpos < w->desired_matrix->matrix_w);
-
- if (FRAME_WINDOW_P (f))
- FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
- w->cursor.y, w->cursor.x);
- else
- {
- int x, y;
- x = (WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos)
- + (INTEGERP (w->left_margin_cols)
- ? XFASTINT (w->left_margin_cols)
- : 0));
- y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
- cursor_to (f, y, x);
- }
-
- if (FRAME_TERMCAP_P (f))
- fflush (FRAME_TTY (f)->output);
- redisplay_performed_directly_p = 1;
- return 1;
-}
-
-
-\f
/***********************************************************************
Frame Update
***********************************************************************/
doesn't work with lbearing/rbearing), so we must do it
this way. */
if (vpos == w->phys_cursor.vpos
- && w->phys_cursor.hpos >= desired_row->used[TEXT_AREA])
+ && (desired_row->reversed_p
+ ? (w->phys_cursor.hpos < 0)
+ : (w->phys_cursor.hpos >= desired_row->used[TEXT_AREA])))
{
w->phys_cursor_on_p = 0;
x = -1;
}
/* Window cursor can be out of sync for horizontally split windows. */
- hpos = max (0, hpos);
+ hpos = max (-1, hpos); /* -1 is for when cursor is on the left fringe */
hpos = min (w->current_matrix->matrix_w - 1, hpos);
vpos = max (0, vpos);
vpos = min (w->current_matrix->nrows - 1, vpos);
int signalnum; /* some compilers complain in signal calls. */
{
int width, height;
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
int old_errno = errno;
struct tty_display_info *tty;
{
tem = Fcdr (Fcdr (fun));
if (CONSP (tem) && INTEGERP (XCAR (tem)))
- XSETCARFASTINT (tem, offset);
+ XSETCAR (tem, make_number (offset));
}
else if (EQ (tem, Qmacro))
store_function_docstring (XCDR (fun), offset);
#include <grp.h>
#include <crt0.h>
-#ifndef __DJGPP_MINOR__
-# define __tb _go32_info_block.linear_address_of_transfer_buffer;
-#endif
-
DEFUN ("int86", Fint86, Sint86, 2, 2, 0,
doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS.
Return the updated REGISTER vector.
}
#endif /* !HAVE_X_WINDOWS */
-#if __DJGPP__ >= 2
-
/* Without this, we never see hidden files.
Don't OR it with the previous value, so the value recorded at dump
time, possibly with `preserve-case' flags set, won't get through. */
if (!NILP (Fmsdos_long_file_names ()))
__opendir_flags |= __OPENDIR_PRESERVE_CASE;
#endif /* __DJGPP_MINOR__ == 0 */
-#endif /* __DJGPP__ >= 2 */
}
\f
#ifndef HAVE_X_WINDOWS
int data_start = 0;
-#ifdef NEED_ERRNO
-int errno;
-#endif
-
-#ifndef MSDOS
char **environ;
-#endif
-#ifndef static
-/* On systems where the static storage class is usable, this function
- should be declared as static. Otherwise, the static keyword has
- been defined to be something else, and code for those systems must
- take care of this declaration appropriately. */
static start1 ();
-#endif
-
-#ifdef CRT0_DUMMIES
/* Define symbol "start": here; some systems want that symbol. */
asm(" .text ");
}
static
-start1 (CRT0_DUMMIES argc, xargv)
+start1 (bogus_fp, argc, xargv)
int argc;
char *xargv;
{
and optimize it out. */
(void) &start1;
}
-#else /* not CRT0_DUMMIES */
-
-/* This is a kludge. Now that the CRT0_DUMMIES mechanism above exists,
- most of these machines could use the vax code above
- with some suitable definition of CRT0_DUMMIES.
- Then the symbol m68k could be flushed.
- But I don't want to risk breaking these machines
- in a version 17 patch release, so that change is being put off. */
-
-#ifdef m68k /* Can't do it all from C */
- asm (" global _start");
- asm (" text");
- asm ("_start:");
- asm (" comm splimit%,4");
- asm (" global exit");
- asm (" text");
- asm (" mov.l %d0,splimit%");
- asm (" jsr start1");
- asm (" mov.l %d0,(%sp)");
- asm (" jsr exit");
- asm (" mov.l &1,%d0"); /* d0 = 1 => exit */
- asm (" trap &0");
-
-/* ignore takes care of skipping the a6 value pushed in start. */
-static
-start1 (argc, xargv)
- int argc;
- char *xargv;
-{
- register char **argv = &xargv;
- environ = argv + argc + 1;
-
- if ((char *)environ == xargv)
- environ--;
- exit (main (argc, argv, environ));
-}
-
-#endif /* m68k */
-
-#endif /* not CRT0_DUMMIES */
-
-#ifdef __sparc__
-asm (".global __start");
-asm (".text");
-asm ("__start:");
-asm (" mov 0, %fp");
-asm (" ld [%sp + 64], %o0");
-asm (" add %sp, 68, %o1");
-asm (" sll %o0, 2, %o2");
-asm (" add %o2, 4, %o2");
-asm (" add %o1, %o2, %o2");
-asm (" sethi %hi(_environ), %o3");
-asm (" st %o2, [%o3+%lo(_environ)]");
-asm (" andn %sp, 7, %sp");
-asm (" call _main");
-asm (" sub %sp, 24, %sp");
-asm (" call __exit");
-asm (" nop");
-
-#endif /* __sparc__ */
-
-#if __FreeBSD__ == 2
-char *__progname;
-#endif
/* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74
(do not change this comment) */
#include <unistd.h>
#endif
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#endif
#ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
#undef setpgrp
#define setpgrp setpgid
#endif
#endif
+const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
+const char emacs_version[] = "24.0.50";
+
extern void malloc_warning P_ ((char *));
extern void set_time_zone_rule P_ ((char *));
#ifdef HAVE_INDEX
Lisp_Object Vsystem_time_locale;
Lisp_Object Vprevious_system_time_locale;
+/* Copyright and version info. The version number may be updated by
+ Lisp code. */
+Lisp_Object Vemacs_copyright, Vemacs_version;
+
/* If non-zero, emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
int inhibit_window_system;
data on the first attempt to change it inside asynchronous code. */
int running_asynch_code;
-#ifdef BSD_PGRPS
-/* See sysdep.c. */
-extern int inherited_pgroup;
-#endif
-
#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
/* If non-zero, -d was specified, meaning we're using some window system. */
int display_arg;
Initialization options:\n\
\n\
--batch do not do interactive display; implies -q\n\
+--chdir DIR change to directory DIR\n\
--daemon start a server in the background\n\
--debug-init enable Emacs Lisp debugger for init file\n\
--display, -d DISPLAY use X server DISPLAY\n\
Various environment variables and window system resources also affect\n\
Emacs' operation. See the main documentation.\n\
\n\
-Report bugs to %s. First, please see the Bugs\n\
+Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\
section of the Emacs manual or the file BUGS.\n"
\f
{
fatal_error_in_progress = 1;
+ if (sig == SIGTERM || sig == SIGHUP)
+ Fkill_emacs (make_number (sig));
+
shut_down_emacs (sig, 0, Qnil);
}
#endif /* DOUG_LEA_MALLOC */
-#define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org"
-#define REPORT_EMACS_BUG_PRETEST_ADDRESS "bug-gnu-emacs@gnu.org"
-
-/* This function is used to determine an address to which bug report should
- be sent. */
-
-char *
-bug_reporting_address ()
-{
- int count = 0;
- Lisp_Object temp;
- char *string;
-
- temp = Fsymbol_value (intern ("emacs-version"));
-
- /* When `emacs-version' is invalid, use normal address. */
- if (!STRINGP(temp))
- return REPORT_EMACS_BUG_ADDRESS;
-
- string = SDATA (temp);
-
- /* Count dots in `emacs-version'. */
- while (*string)
- {
- if (*string == '.')
- count++;
- string++;
- }
-
- /* When `emacs-version' has at least three dots, it is development or
- pretest version of Emacs. */
- return count >= 3 ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS;
-}
-
-
/* ARGSUSED */
int
main (int argc, char **argv)
char stack_bottom_variable;
int do_initial_setlocale;
int skip_args = 0;
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
#ifdef HAVE_SETRLIMIT
struct rlimit rlim;
#endif
#ifdef NS_IMPL_COCOA
char dname_arg2[80];
#endif
+ char *ch_to_dir;
#if GC_MARK_STACK
extern Lisp_Object *stack_base;
heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static);
}
-#ifdef LINUX_SBRK_BUG
- /* This is only used GNU/LINUX running on alpha when using libc5 */
- __sbrk (1);
-#endif
-
#ifdef RUN_TIME_REMAP
if (initialized)
run_time_remap (argv[0]);
argc = 0;
while (argv[argc]) argc++;
- if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args)
- /* We don't know the version number unless this is a dumped Emacs.
- So ignore --version otherwise. */
- && initialized)
+ if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
{
- Lisp_Object tem, tem2;
- tem = Fsymbol_value (intern_c_string ("emacs-version"));
- tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
- if (!STRINGP (tem))
- {
- fprintf (stderr, "Invalid value of `emacs-version'\n");
- exit (1);
- }
- if (!STRINGP (tem2))
+ const char *version, *copyright;
+ if (initialized)
{
- fprintf (stderr, "Invalid value of `emacs-copyright'\n");
- exit (1);
+ Lisp_Object tem, tem2;
+ tem = Fsymbol_value (intern_c_string ("emacs-version"));
+ tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
+ if (!STRINGP (tem))
+ {
+ fprintf (stderr, "Invalid value of `emacs-version'\n");
+ exit (1);
+ }
+ if (!STRINGP (tem2))
+ {
+ fprintf (stderr, "Invalid value of `emacs-copyright'\n");
+ exit (1);
+ }
+ else
+ {
+ version = SDATA (tem);
+ copyright = SDATA (tem2);
+ }
}
else
{
- printf ("GNU Emacs %s\n", SDATA (tem));
- printf ("%s\n", SDATA(tem2));
- printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
- printf ("You may redistribute copies of Emacs\n");
- printf ("under the terms of the GNU General Public License.\n");
- printf ("For more information about these matters, ");
- printf ("see the file named COPYING.\n");
- exit (0);
+ version = emacs_version;
+ copyright = emacs_copyright;
}
+ printf ("GNU Emacs %s\n", version);
+ printf ("%s\n", copyright);
+ printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
+ printf ("You may redistribute copies of Emacs\n");
+ printf ("under the terms of the GNU General Public License.\n");
+ printf ("For more information about these matters, ");
+ printf ("see the file named COPYING.\n");
+ exit (0);
}
+ if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args))
+ if (chdir (ch_to_dir) == -1)
+ {
+ fprintf (stderr, "%s: Can't chdir to %s: %s\n",
+ argv[0], ch_to_dir, strerror (errno));
+ exit (1);
+ }
+
#ifdef HAVE_PERSONALITY_LINUX32
if (!initialized
#endif /* MSDOS || WINDOWSNT */
#ifdef MSDOS
-#if __DJGPP__ >= 2
if (!isatty (fileno (stdin)))
setmode (fileno (stdin), O_BINARY);
if (!isatty (fileno (stdout)))
fflush (stdout);
setmode (fileno (stdout), O_BINARY);
}
-#else /* not __DJGPP__ >= 2 */
- (stdin)->_flag &= ~_IOTEXT;
- (stdout)->_flag &= ~_IOTEXT;
- (stderr)->_flag &= ~_IOTEXT;
-#endif /* not __DJGPP__ >= 2 */
#endif /* MSDOS */
#ifdef SET_EMACS_PRIORITY
{
printf (USAGE1, argv[0], USAGE2);
printf (USAGE3);
- printf (USAGE4, bug_reporting_address ());
+ printf (USAGE4);
exit (0);
}
if (! noninteractive)
{
-#ifdef BSD_PGRPS
- if (initialized)
- {
- inherited_pgroup = EMACS_GETPGRP (0);
- setpgrp (0, getpid ());
- }
-#else
#if defined (USG5) && defined (INTERRUPT_INPUT)
setpgrp ();
#endif
-#endif
#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
{
extern void malloc_enable_thread P_ ((void));
ns_init_paths ();
#endif
+ /* Initialize and GC-protect Vinitial_environment and
+ Vprocess_environment before set_initial_environment fills them
+ in. */
+ if (!initialized)
+ syms_of_callproc ();
/* egetenv is a pretty low-level facility, which may get called in
many circumstances; it seems flimsy to put off initializing it
until calling init_callproc. */
syms_of_callint ();
syms_of_casefiddle ();
syms_of_casetab ();
- syms_of_callproc ();
syms_of_category ();
syms_of_ccl ();
syms_of_character ();
syms_of_cmds ();
-#ifndef NO_DIR_LIBRARY
syms_of_dired ();
-#endif /* not NO_DIR_LIBRARY */
syms_of_display ();
syms_of_doc ();
syms_of_editfns ();
const struct standard_args standard_args[] =
{
{ "-version", "--version", 150, 0 },
-#ifdef HAVE_SHM
- { "-nl", "--no-shared-memory", 140, 0 },
-#endif
+ { "-chdir", "--chdir", 130, 1 },
{ "-t", "--terminal", 120, 1 },
{ "-nw", "--no-window-system", 110, 0 },
{ "-nw", "--no-windows", 110, 0 },
\f
#ifndef CANNOT_DUMP
-#ifdef HAVE_SHM
-
-DEFUN ("dump-emacs-data", Fdump_emacs_data, Sdump_emacs_data, 1, 1, 0,
- doc: /* Dump current state of Emacs into data file FILENAME.
-This function exists on systems that use HAVE_SHM. */)
- (filename)
- Lisp_Object filename;
-{
- extern char my_edata[];
- Lisp_Object tem;
-
- check_pure_size ();
- CHECK_STRING (filename);
- filename = Fexpand_file_name (filename, Qnil);
-
- tem = Vpurify_flag;
- Vpurify_flag = Qnil;
-
- fflush (stdout);
- /* Tell malloc where start of impure now is. */
- /* Also arrange for warnings when nearly out of space. */
-#ifndef SYSTEM_MALLOC
- memory_warnings (my_edata, malloc_warning);
-#endif
- map_out_data (SDATA (filename));
-
- Vpurify_flag = tem;
-
- return Qnil;
-}
-
-#else /* not HAVE_SHM */
-
DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
doc: /* Dump current state of Emacs into executable file FILENAME.
Take symbols from SYMFILE (presumably the file you executed to run Emacs).
return unbind_to (count, Qnil);
}
-#endif /* not HAVE_SHM */
-
#endif /* not CANNOT_DUMP */
\f
#if HAVE_SETLOCALE
staticpro (&Qfile_name_handler_alist);
#ifndef CANNOT_DUMP
-#ifdef HAVE_SHM
- defsubr (&Sdump_emacs_data);
-#else
defsubr (&Sdump_emacs);
-#endif
#endif
defsubr (&Skill_emacs);
doc: /* If non-nil, X resources, Windows Registry settings, and NS defaults are not used. */);
inhibit_x_resources = 0;
+ DEFVAR_LISP ("emacs-copyright", &Vemacs_copyright,
+ doc: /* Short copyright string for this version of Emacs. */);
+ Vemacs_copyright = build_string (emacs_copyright);
+
+ DEFVAR_LISP ("emacs-version", &Vemacs_version,
+ doc: /* Version numbers of this version of Emacs. */);
+ Vemacs_version = build_string (emacs_version);
+
/* Make sure IS_DAEMON starts up as false. */
daemon_pipe[1] = 0;
}
#include "commands.h"
#include "keyboard.h"
#include "dispextern.h"
+#include "frame.h" /* For XFRAME. */
#if HAVE_X_WINDOWS
#include "xterm.h"
CHECK_SYMBOL (new_alias);
CHECK_SYMBOL (base_variable);
- if (SYMBOL_CONSTANT_P (new_alias))
+ sym = XSYMBOL (new_alias);
+
+ if (sym->constant)
+ /* Not sure why, but why not? */
error ("Cannot make a constant an alias");
- sym = XSYMBOL (new_alias);
+ switch (sym->redirect)
+ {
+ case SYMBOL_FORWARDED:
+ error ("Cannot make an internal variable an alias");
+ case SYMBOL_LOCALIZED:
+ error ("Don't know how to make a localized variable an alias");
+ }
+
/* http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00834.html
- If n_a is bound, but b_v is not, set the value of b_v to n_a.
- This is for the sake of define-obsolete-variable-alias and user
- customizations. */
- if (NILP (Fboundp (base_variable)) && !NILP (Fboundp (new_alias)))
- XSYMBOL(base_variable)->value = sym->value;
- sym->indirect_variable = 1;
- sym->value = base_variable;
+ If n_a is bound, but b_v is not, set the value of b_v to n_a,
+ so that old-code that affects n_a before the aliasing is setup
+ still works. */
+ if (NILP (Fboundp (base_variable)))
+ set_internal (base_variable, find_symbol_value (new_alias), Qnil, 1);
+
+ {
+ struct specbinding *p;
+
+ for (p = specpdl_ptr - 1; p >= specpdl; p--)
+ if (p->func == NULL
+ && (EQ (new_alias,
+ CONSP (p->symbol) ? XCAR (p->symbol) : p->symbol)))
+ error ("Don't know how to make a let-bound variable an alias");
+ }
+
+ sym->redirect = SYMBOL_VARALIAS;
+ SET_SYMBOL_ALIAS (sym, XSYMBOL (base_variable));
sym->constant = SYMBOL_CONSTANT_P (base_variable);
LOADHIST_ATTACH (new_alias);
- if (!NILP (docstring))
- Fput (new_alias, Qvariable_documentation, docstring);
- else
- Fput (new_alias, Qvariable_documentation, Qnil);
+ /* Even if docstring is nil: remove old docstring. */
+ Fput (new_alias, Qvariable_documentation, docstring);
return base_variable;
}
return Qnil;
/* If indirect and there's an alias loop, don't check anything else. */
- if (XSYMBOL (variable)->indirect_variable
+ if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS
&& NILP (internal_condition_case_1 (lisp_indirect_variable, variable,
Qt, user_variable_p_eh)))
return Qnil;
|| (!NILP (Fget (variable, intern ("custom-autoload")))))
return Qt;
- if (!XSYMBOL (variable)->indirect_variable)
+ if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS))
return Qnil;
/* An indirect variable? Let's follow the chain. */
- variable = XSYMBOL (variable)->value;
+ XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable)));
}
}
\f
return val;
}
+/* Like internal_condition_case_1 but call BFUN with ARG1 and ARG2 as
+ its arguments. */
+
+Lisp_Object
+internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
+ Lisp_Object arg1,
+ Lisp_Object arg2,
+ Lisp_Object handlers,
+ Lisp_Object (*hfun) (Lisp_Object))
+{
+ Lisp_Object val;
+ struct catchtag c;
+ struct handler h;
+
+ /* Since Fsignal will close off all calls to x_catch_errors,
+ we will get the wrong results if some are not closed now. */
+#if HAVE_X_WINDOWS
+ if (x_catching_errors ())
+ abort ();
+#endif
+
+ c.tag = Qnil;
+ c.val = Qnil;
+ c.backlist = backtrace_list;
+ c.handlerlist = handlerlist;
+ c.lisp_eval_depth = lisp_eval_depth;
+ c.pdlcount = SPECPDL_INDEX ();
+ c.poll_suppress_count = poll_suppress_count;
+ c.interrupt_input_blocked = interrupt_input_blocked;
+ c.gcpro = gcprolist;
+ c.byte_stack = byte_stack_list;
+ if (_setjmp (c.jmp))
+ {
+ return (*hfun) (c.val);
+ }
+ c.next = catchlist;
+ catchlist = &c;
+ h.handler = handlers;
+ h.var = Qnil;
+ h.next = handlerlist;
+ h.tag = &c;
+ handlerlist = &h;
+
+ val = (*bfun) (arg1, arg2);
+ catchlist = c.next;
+ handlerlist = h.next;
+ return val;
+}
/* Like internal_condition_case but call BFUN with NARGS as first,
and ARGS as second argument. */
Lisp_Object
-internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
- Lisp_Object (*bfun) ();
- int nargs;
- Lisp_Object *args;
- Lisp_Object handlers;
- Lisp_Object (*hfun) ();
+internal_condition_case_n (Lisp_Object (*bfun) (int, Lisp_Object*),
+ int nargs,
+ Lisp_Object *args,
+ Lisp_Object handlers,
+ Lisp_Object (*hfun) (Lisp_Object))
{
Lisp_Object val;
struct catchtag c;
(function, file, docstring, interactive, type)
Lisp_Object function, file, docstring, interactive, type;
{
- Lisp_Object args[4];
-
CHECK_SYMBOL (function);
CHECK_STRING (file);
LOADHIST_ATTACH (Fcons (Qautoload, function));
else
/* We don't want the docstring in purespace (instead,
- Snarf-documentation should (hopefully) overwrite it). */
- docstring = make_number (0);
+ Snarf-documentation should (hopefully) overwrite it).
+ We used to use 0 here, but that leads to accidental sharing in
+ purecopy's hash-consing, so we use a (hopefully) unique integer
+ instead. */
+ docstring = make_number (XHASH (function));
return Ffset (function,
Fpurecopy (list5 (Qautoload, file, docstring,
interactive, type)));
if (NILP (arg))
RETURN_UNGCPRO (Ffuncall (1, &fn));
gcpro1.nvars = 2;
-#ifdef NO_ARG_ARRAY
{
Lisp_Object args[2];
args[0] = fn;
gcpro1.var = args;
RETURN_UNGCPRO (Fapply (2, args));
}
-#else /* not NO_ARG_ARRAY */
- RETURN_UNGCPRO (Fapply (2, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn on no arguments */
Lisp_Object fn, arg1;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[2];
args[0] = fn;
GCPRO1 (args[0]);
gcpro1.nvars = 2;
RETURN_UNGCPRO (Ffuncall (2, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 2;
- RETURN_UNGCPRO (Ffuncall (2, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn with 2 arguments arg1, arg2 */
Lisp_Object fn, arg1, arg2;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[3];
args[0] = fn;
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 3;
RETURN_UNGCPRO (Ffuncall (3, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 3;
- RETURN_UNGCPRO (Ffuncall (3, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn with 3 arguments arg1, arg2, arg3 */
Lisp_Object fn, arg1, arg2, arg3;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[4];
args[0] = fn;
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 4;
RETURN_UNGCPRO (Ffuncall (4, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 4;
- RETURN_UNGCPRO (Ffuncall (4, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn with 4 arguments arg1, arg2, arg3, arg4 */
Lisp_Object fn, arg1, arg2, arg3, arg4;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[5];
args[0] = fn;
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 5;
RETURN_UNGCPRO (Ffuncall (5, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 5;
- RETURN_UNGCPRO (Ffuncall (5, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5 */
Lisp_Object fn, arg1, arg2, arg3, arg4, arg5;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[6];
args[0] = fn;
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 6;
RETURN_UNGCPRO (Ffuncall (6, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 6;
- RETURN_UNGCPRO (Ffuncall (6, &fn));
-#endif /* not NO_ARG_ARRAY */
}
/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6 */
Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6;
{
struct gcpro gcpro1;
-#ifdef NO_ARG_ARRAY
Lisp_Object args[7];
args[0] = fn;
args[1] = arg1;
GCPRO1 (args[0]);
gcpro1.nvars = 7;
RETURN_UNGCPRO (Ffuncall (7, args));
-#else /* not NO_ARG_ARRAY */
- GCPRO1 (fn);
- gcpro1.nvars = 7;
- RETURN_UNGCPRO (Ffuncall (7, &fn));
-#endif /* not NO_ARG_ARRAY */
+}
+
+/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7 */
+/* ARGSUSED */
+Lisp_Object
+call7 (fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+ Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7;
+{
+ struct gcpro gcpro1;
+ Lisp_Object args[8];
+ args[0] = fn;
+ args[1] = arg1;
+ args[2] = arg2;
+ args[3] = arg3;
+ args[4] = arg4;
+ args[5] = arg5;
+ args[6] = arg6;
+ args[7] = arg7;
+ GCPRO1 (args[0]);
+ gcpro1.nvars = 8;
+ RETURN_UNGCPRO (Ffuncall (8, args));
}
/* The caller should GCPRO all the elements of ARGS. */
specpdl_ptr = specpdl + count;
}
+/* specpdl_ptr->symbol is a field which describes which variable is
+ let-bound, so it can be properly undone when we unbind_to.
+ It can have the following two shapes:
+ - SYMBOL : if it's a plain symbol, it means that we have let-bound
+ a symbol that is not buffer-local (at least at the time
+ the let binding started). Note also that it should not be
+ aliased (i.e. when let-binding V1 that's aliased to V2, we want
+ to record V2 here).
+ - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for
+ variable SYMBOL which can be buffer-local. WHERE tells us
+ which buffer is affected (or nil if the let-binding affects the
+ global value of the variable) and BUFFER tells us which buffer was
+ current (i.e. if WHERE is non-nil, then BUFFER==WHERE, otherwise
+ BUFFER did not yet have a buffer-local value). */
+
void
specbind (symbol, value)
Lisp_Object symbol, value;
{
- Lisp_Object valcontents;
+ struct Lisp_Symbol *sym;
+
+ eassert (!handling_signal);
CHECK_SYMBOL (symbol);
+ sym = XSYMBOL (symbol);
if (specpdl_ptr == specpdl + specpdl_size)
grow_specpdl ();
- /* The most common case is that of a non-constant symbol with a
- trivial value. Make that as fast as we can. */
- valcontents = SYMBOL_VALUE (symbol);
- if (!MISCP (valcontents) && !SYMBOL_CONSTANT_P (symbol))
- {
- specpdl_ptr->symbol = symbol;
- specpdl_ptr->old_value = valcontents;
- specpdl_ptr->func = NULL;
- ++specpdl_ptr;
- SET_SYMBOL_VALUE (symbol, value);
- }
- else
- {
- Lisp_Object ovalue = find_symbol_value (symbol);
- specpdl_ptr->func = 0;
- specpdl_ptr->old_value = ovalue;
-
- valcontents = XSYMBOL (symbol)->value;
-
- if (BUFFER_LOCAL_VALUEP (valcontents)
- || BUFFER_OBJFWDP (valcontents))
- {
- Lisp_Object where, current_buffer;
-
- current_buffer = Fcurrent_buffer ();
-
- /* For a local variable, record both the symbol and which
- buffer's or frame's value we are saving. */
- if (!NILP (Flocal_variable_p (symbol, Qnil)))
- where = current_buffer;
- else if (BUFFER_LOCAL_VALUEP (valcontents)
- && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
- where = XBUFFER_LOCAL_VALUE (valcontents)->frame;
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS:
+ sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start;
+ case SYMBOL_PLAINVAL:
+ { /* The most common case is that of a non-constant symbol with a
+ trivial value. Make that as fast as we can. */
+ specpdl_ptr->symbol = symbol;
+ specpdl_ptr->old_value = SYMBOL_VAL (sym);
+ specpdl_ptr->func = NULL;
+ ++specpdl_ptr;
+ if (!sym->constant)
+ SET_SYMBOL_VAL (sym, value);
else
- where = Qnil;
-
- /* We're not using the `unused' slot in the specbinding
- structure because this would mean we have to do more
- work for simple variables. */
- specpdl_ptr->symbol = Fcons (symbol, Fcons (where, current_buffer));
-
- /* If SYMBOL is a per-buffer variable which doesn't have a
- buffer-local value here, make the `let' change the global
- value by changing the value of SYMBOL in all buffers not
- having their own value. This is consistent with what
- happens with other buffer-local variables. */
- if (NILP (where)
- && BUFFER_OBJFWDP (valcontents))
- {
- ++specpdl_ptr;
- Fset_default (symbol, value);
- return;
- }
+ set_internal (symbol, value, Qnil, 1);
+ break;
}
- else
- specpdl_ptr->symbol = symbol;
-
- specpdl_ptr++;
- /* We used to do
- if (BUFFER_OBJFWDP (ovalue) || KBOARD_OBJFWDP (ovalue))
- store_symval_forwarding (symbol, ovalue, value, NULL);
- else
- but ovalue comes from find_symbol_value which should never return
- such an internal value. */
- eassert (!(BUFFER_OBJFWDP (ovalue) || KBOARD_OBJFWDP (ovalue)));
- set_internal (symbol, value, 0, 1);
+ case SYMBOL_LOCALIZED:
+ if (SYMBOL_BLV (sym)->frame_local)
+ error ("Frame-local vars cannot be let-bound");
+ case SYMBOL_FORWARDED:
+ {
+ Lisp_Object ovalue = find_symbol_value (symbol);
+ specpdl_ptr->func = 0;
+ specpdl_ptr->old_value = ovalue;
+
+ eassert (sym->redirect != SYMBOL_LOCALIZED
+ || (EQ (SYMBOL_BLV (sym)->where,
+ SYMBOL_BLV (sym)->frame_local ?
+ Fselected_frame () : Fcurrent_buffer ())));
+
+ if (sym->redirect == SYMBOL_LOCALIZED
+ || BUFFER_OBJFWDP (SYMBOL_FWD (sym)))
+ {
+ Lisp_Object where, cur_buf = Fcurrent_buffer ();
+
+ /* For a local variable, record both the symbol and which
+ buffer's or frame's value we are saving. */
+ if (!NILP (Flocal_variable_p (symbol, Qnil)))
+ {
+ eassert (sym->redirect != SYMBOL_LOCALIZED
+ || (BLV_FOUND (SYMBOL_BLV (sym))
+ && EQ (cur_buf, SYMBOL_BLV (sym)->where)));
+ where = cur_buf;
+ }
+ else if (sym->redirect == SYMBOL_LOCALIZED
+ && BLV_FOUND (SYMBOL_BLV (sym)))
+ where = SYMBOL_BLV (sym)->where;
+ else
+ where = Qnil;
+
+ /* We're not using the `unused' slot in the specbinding
+ structure because this would mean we have to do more
+ work for simple variables. */
+ /* FIXME: The third value `current_buffer' is only used in
+ let_shadows_buffer_binding_p which is itself only used
+ in set_internal for local_if_set. */
+ eassert (NILP (where) || EQ (where, cur_buf));
+ specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf));
+
+ /* If SYMBOL is a per-buffer variable which doesn't have a
+ buffer-local value here, make the `let' change the global
+ value by changing the value of SYMBOL in all buffers not
+ having their own value. This is consistent with what
+ happens with other buffer-local variables. */
+ if (NILP (where)
+ && sym->redirect == SYMBOL_FORWARDED)
+ {
+ eassert (BUFFER_OBJFWDP (SYMBOL_FWD (sym)));
+ ++specpdl_ptr;
+ Fset_default (symbol, value);
+ return;
+ }
+ }
+ else
+ specpdl_ptr->symbol = symbol;
+
+ specpdl_ptr++;
+ set_internal (symbol, value, Qnil, 1);
+ break;
+ }
+ default: abort ();
}
}
if (NILP (where))
Fset_default (symbol, this_binding.old_value);
- else if (BUFFERP (where))
- set_internal (symbol, this_binding.old_value, XBUFFER (where), 1);
- else
- set_internal (symbol, this_binding.old_value, NULL, 1);
+ /* If `where' is non-nil, reset the value in the appropriate
+ local binding, but only if that binding still exists. */
+ else if (BUFFERP (where)
+ ? !NILP (Flocal_variable_p (symbol, where))
+ : !NILP (Fassq (symbol, XFRAME (where)->param_alist)))
+ set_internal (symbol, this_binding.old_value, where, 1);
}
+ /* If variable has a trivial value (no forwarding), we can
+ just set it. No need to check for constant symbols here,
+ since that was already done by specbind. */
+ else if (XSYMBOL (this_binding.symbol)->redirect == SYMBOL_PLAINVAL)
+ SET_SYMBOL_VAL (XSYMBOL (this_binding.symbol),
+ this_binding.old_value);
else
- {
- /* If variable has a trivial value (no forwarding), we can
- just set it. No need to check for constant symbols here,
- since that was already done by specbind. */
- if (!MISCP (SYMBOL_VALUE (this_binding.symbol)))
- SET_SYMBOL_VALUE (this_binding.symbol, this_binding.old_value);
- else
- set_internal (this_binding.symbol, this_binding.old_value, 0, 1);
- }
+ /* NOTE: we only ever come here if make_local_foo was used for
+ the first time on this var within this let. */
+ Fset_default (this_binding.symbol, this_binding.old_value);
}
if (NILP (Vquit_flag) && !NILP (quitf))
#include <ctype.h>
#include <errno.h>
-#ifndef vax11c
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
+#ifdef HAVE_LIBSELINUX
+#include <selinux/selinux.h>
+#include <selinux/context.h>
#endif
#include "lisp.h"
#ifdef MSDOS
#include "msdos.h"
#include <sys/param.h>
-#if __DJGPP__ >= 2
#include <fcntl.h>
#include <string.h>
#endif
-#endif
#ifdef DOS_NT
#define CORRECT_DIR_SEPS(s) \
Lisp_Object Qfile_modes;
Lisp_Object Qset_file_modes;
Lisp_Object Qset_file_times;
+Lisp_Object Qfile_selinux_context;
+Lisp_Object Qset_file_selinux_context;
Lisp_Object Qfile_newer_than_file_p;
Lisp_Object Qinsert_file_contents;
Lisp_Object Qwrite_region;
return;
}
-DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 5,
+DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6,
"fCopy file: \nGCopy %s to file: \np\nP",
doc: /* Copy FILE to NEWNAME. Both args must be strings.
If NEWNAME names a directory, copy FILE there.
A prefix arg makes KEEP-TIME non-nil.
If PRESERVE-UID-GID is non-nil, we try to transfer the
-uid and gid of FILE to NEWNAME. */)
- (file, newname, ok_if_already_exists, keep_time, preserve_uid_gid)
+uid and gid of FILE to NEWNAME.
+
+If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
+on the system, we copy the SELinux context of FILE to NEWNAME. */)
+ (file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_selinux_context)
Lisp_Object file, newname, ok_if_already_exists, keep_time;
- Lisp_Object preserve_uid_gid;
+ Lisp_Object preserve_uid_gid, preserve_selinux_context;
{
int ifd, ofd, n;
char buf[16 * 1024];
int count = SPECPDL_INDEX ();
int input_file_statable_p;
Lisp_Object encoded_file, encoded_newname;
+#if HAVE_LIBSELINUX
+ security_context_t con;
+ int fail, conlength = 0;
+#endif
encoded_file = encoded_newname = Qnil;
GCPRO4 (file, newname, encoded_file, encoded_newname);
if (NILP (handler))
handler = Ffind_file_name_handler (newname, Qcopy_file);
if (!NILP (handler))
- RETURN_UNGCPRO (call6 (handler, Qcopy_file, file, newname,
- ok_if_already_exists, keep_time, preserve_uid_gid));
+ RETURN_UNGCPRO (call7 (handler, Qcopy_file, file, newname,
+ ok_if_already_exists, keep_time, preserve_uid_gid,
+ preserve_selinux_context));
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
copyable by us. */
input_file_statable_p = (fstat (ifd, &st) >= 0);
-#if !defined (MSDOS) || __DJGPP__ > 1
+#if HAVE_LIBSELINUX
+ if (!NILP (preserve_selinux_context) && is_selinux_enabled ())
+ {
+ conlength = fgetfilecon (ifd, &con);
+ if (conlength == -1)
+ report_file_error ("Doing fgetfilecon", Fcons (file, Qnil));
+ }
+#endif
+
if (out_st.st_mode != 0
&& st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
{
report_file_error ("Input and output files are the same",
Fcons (file, Fcons (newname, Qnil)));
}
-#endif
#if defined (S_ISREG) && defined (S_ISLNK)
if (input_file_statable_p)
}
#endif /* not MSDOS */
+#if HAVE_LIBSELINUX
+ if (conlength > 0)
+ {
+ /* Set the modified context back to the file. */
+ fail = fsetfilecon (ofd, con);
+ if (fail)
+ report_file_error ("Doing fsetfilecon", Fcons (newname, Qnil));
+
+ freecon (con);
+ }
+#endif
+
/* Closing the output clobbers the file times on some systems. */
if (emacs_close (ofd) < 0)
report_file_error ("I/O error", Fcons (newname, Qnil));
emacs_close (ifd);
-#if defined (__DJGPP__) && __DJGPP__ > 1
+#ifdef MSDOS
if (input_file_statable_p)
{
/* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
chmod (SDATA (encoded_newname), st.st_mode & 07777);
}
-#endif /* DJGPP version 2 or newer */
+#endif /* MSDOS */
#endif /* not WINDOWSNT */
/* Discard the unwind protects. */
return Qnil;
}
-DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ",
+DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2,
+ "(list (read-file-name \"Delete file: \" nil default-directory \
+ (confirm-nonexistent-file-or-buffer)) \
+ current-prefix-arg)",
doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink.
-If file has multiple names, it continues to exist with the other names. */)
- (filename)
+If file has multiple names, it continues to exist with the other names.
+
+If optional arg FORCE is non-nil, really delete the file regardless of
+`delete-by-moving-to-trash'. Otherwise, \"deleting\" actually moves
+it to the system's trash can if `delete-by-moving-to-trash' is non-nil.
+Interactively, FORCE is non-nil if called with a prefix arg. */)
+ (filename, force)
Lisp_Object filename;
+ Lisp_Object force;
{
Lisp_Object handler;
Lisp_Object encoded_file;
if (!NILP (handler))
return call2 (handler, Qdelete_file, filename);
- if (delete_by_moving_to_trash)
+ if (delete_by_moving_to_trash && NILP (force))
return call1 (Qmove_file_to_trash, filename);
encoded_file = ENCODE_FILE (filename);
return Qt;
}
-/* Delete file FILENAME, returning 1 if successful and 0 if failed. */
+/* Delete file FILENAME, returning 1 if successful and 0 if failed.
+ FORCE means to ignore `delete-by-moving-to-trash'. */
int
-internal_delete_file (filename)
- Lisp_Object filename;
+internal_delete_file (Lisp_Object filename, Lisp_Object force)
{
Lisp_Object tem;
- tem = internal_condition_case_1 (Fdelete_file, filename,
+
+ tem = internal_condition_case_2 (Fdelete_file, filename, force,
Qt, internal_delete_file_1);
return NILP (tem);
}
have copy-file prompt again. */
Fcopy_file (file, newname,
NILP (ok_if_already_exists) ? Qnil : Qt,
- Qt, Qt);
+ Qt, Qt, Qt);
count = SPECPDL_INDEX ();
specbind (Qdelete_by_moving_to_trash, Qnil);
)
call2 (Qdelete_directory, file, Qt);
else
- Fdelete_file (file);
+ Fdelete_file (file, Qt);
unbind_to (count, Qnil);
}
else
struct stat st;
if (stat (filename, &st) < 0)
return 0;
-#if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1)
return ((st.st_mode & S_IEXEC) != 0);
-#else
- return (S_ISREG (st.st_mode)
- && len >= 5
- && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0
- || xstrcasecmp (suffix, ".exe") == 0
- || xstrcasecmp (suffix, ".bat") == 0)
- || (st.st_mode & S_IFMT) == S_IFDIR);
-#endif /* not WINDOWSNT */
#else /* not DOS_NT */
#ifdef HAVE_EUIDACCESS
return (euidaccess (filename, 1) >= 0);
#endif
}
\f
+DEFUN ("file-selinux-context", Ffile_selinux_context,
+ Sfile_selinux_context, 1, 1, 0,
+ doc: /* Return SELinux context of file named FILENAME,
+as a list ("user", "role", "type", "range"). Return (nil, nil, nil, nil)
+if file does not exist, is not accessible, or SELinux is disabled */)
+ (filename)
+ Lisp_Object filename;
+{
+ Lisp_Object absname;
+ Lisp_Object values[4];
+ Lisp_Object handler;
+#if HAVE_LIBSELINUX
+ security_context_t con;
+ int conlength;
+ context_t context;
+#endif
+
+ absname = expand_and_dir_to_file (filename, current_buffer->directory);
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (absname, Qfile_selinux_context);
+ if (!NILP (handler))
+ return call2 (handler, Qfile_selinux_context, absname);
+
+ absname = ENCODE_FILE (absname);
+
+ values[0] = Qnil;
+ values[1] = Qnil;
+ values[2] = Qnil;
+ values[3] = Qnil;
+#if HAVE_LIBSELINUX
+ if (is_selinux_enabled ())
+ {
+ conlength = lgetfilecon (SDATA (absname), &con);
+ if (conlength > 0)
+ {
+ context = context_new (con);
+ if (context_user_get (context))
+ values[0] = build_string (context_user_get (context));
+ if (context_role_get (context))
+ values[1] = build_string (context_role_get (context));
+ if (context_type_get (context))
+ values[2] = build_string (context_type_get (context));
+ if (context_range_get (context))
+ values[3] = build_string (context_range_get (context));
+ context_free (context);
+ }
+ if (con)
+ freecon (con);
+ }
+#endif
+
+ return Flist (sizeof(values) / sizeof(values[0]), values);
+}
+\f
+DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
+ Sset_file_selinux_context, 2, 2, 0,
+ doc: /* Set SELinux context of file named FILENAME to CONTEXT
+as a list ("user", "role", "type", "range"). Has no effect if SELinux
+is disabled. */)
+ (filename, context)
+ Lisp_Object filename, context;
+{
+ Lisp_Object absname, encoded_absname;
+ Lisp_Object handler;
+ Lisp_Object user = CAR_SAFE (context);
+ Lisp_Object role = CAR_SAFE (CDR_SAFE (context));
+ Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context)));
+ Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context))));
+#if HAVE_LIBSELINUX
+ security_context_t con;
+ int fail, conlength;
+ context_t parsed_con;
+#endif
+
+ absname = Fexpand_file_name (filename, current_buffer->directory);
+
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (absname, Qset_file_selinux_context);
+ if (!NILP (handler))
+ return call3 (handler, Qset_file_selinux_context, absname, context);
+
+ encoded_absname = ENCODE_FILE (absname);
+
+#if HAVE_LIBSELINUX
+ if (is_selinux_enabled ())
+ {
+ /* Get current file context. */
+ conlength = lgetfilecon (SDATA (encoded_absname), &con);
+ if (conlength > 0)
+ {
+ parsed_con = context_new (con);
+ /* Change the parts defined in the parameter.*/
+ if (STRINGP (user))
+ {
+ if (context_user_set (parsed_con, SDATA (user)))
+ error ("Doing context_user_set");
+ }
+ if (STRINGP (role))
+ {
+ if (context_role_set (parsed_con, SDATA (role)))
+ error ("Doing context_role_set");
+ }
+ if (STRINGP (type))
+ {
+ if (context_type_set (parsed_con, SDATA (type)))
+ error ("Doing context_type_set");
+ }
+ if (STRINGP (range))
+ {
+ if (context_range_set (parsed_con, SDATA (range)))
+ error ("Doing context_range_set");
+ }
+
+ /* Set the modified context back to the file. */
+ fail = lsetfilecon (SDATA (encoded_absname), context_str (parsed_con));
+ if (fail)
+ report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
+
+ context_free (parsed_con);
+ }
+ else
+ report_file_error("Doing lgetfilecon", Fcons (absname, Qnil));
+
+ if (con)
+ freecon (con);
+ }
+#endif
+
+ return Qnil;
+}
+\f
DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
doc: /* Return mode bits of file named FILENAME, as an integer.
Return nil, if file does not exist or is not accessible. */)
if (stat (SDATA (absname), &st) < 0)
return Qnil;
-#if defined (MSDOS) && __DJGPP__ < 2
- if (check_executable (SDATA (absname)))
- st.st_mode |= S_IEXEC;
-#endif /* MSDOS && __DJGPP__ < 2 */
return make_number (st.st_mode & 07777);
}
if (NILP (handler))
{
current_buffer->modtime = st.st_mtime;
+ current_buffer->modtime_size = st.st_size;
current_buffer->filename = orig_filename;
}
to avoid a "file has changed on disk" warning on
next attempt to save. */
if (visiting)
- current_buffer->modtime = st.st_mtime;
+ {
+ current_buffer->modtime = st.st_mtime;
+ current_buffer->modtime_size = st.st_size;
+ }
if (failure)
error ("IO error writing %s: %s", SDATA (filename),
else
st.st_mtime = 0;
}
- if (st.st_mtime == b->modtime
- /* If both are positive, accept them if they are off by one second. */
- || (st.st_mtime > 0 && b->modtime > 0
- && (st.st_mtime == b->modtime + 1
- || st.st_mtime == b->modtime - 1)))
+ if ((st.st_mtime == b->modtime
+ /* If both are positive, accept them if they are off by one second. */
+ || (st.st_mtime > 0 && b->modtime > 0
+ && (st.st_mtime == b->modtime + 1
+ || st.st_mtime == b->modtime - 1)))
+ && (st.st_size == b->modtime_size
+ || b->modtime_size < 0))
return Qt;
return Qnil;
}
()
{
current_buffer->modtime = 0;
+ current_buffer->modtime_size = -1;
return Qnil;
}
Lisp_Object time_list;
{
if (!NILP (time_list))
- current_buffer->modtime = cons_to_long (time_list);
+ {
+ current_buffer->modtime = cons_to_long (time_list);
+ current_buffer->modtime_size = -1;
+ }
else
{
register Lisp_Object filename;
filename = ENCODE_FILE (filename);
if (stat (SDATA (filename), &st) >= 0)
- current_buffer->modtime = st.st_mtime;
+ {
+ current_buffer->modtime = st.st_mtime;
+ current_buffer->modtime_size = st.st_size;
+ }
}
return Qnil;
Qfile_modes = intern_c_string ("file-modes");
Qset_file_modes = intern_c_string ("set-file-modes");
Qset_file_times = intern_c_string ("set-file-times");
+ Qfile_selinux_context = intern_c_string("file-selinux-context");
+ Qset_file_selinux_context = intern_c_string("set-file-selinux-context");
Qfile_newer_than_file_p = intern_c_string ("file-newer-than-file-p");
Qinsert_file_contents = intern_c_string ("insert-file-contents");
Qwrite_region = intern_c_string ("write-region");
staticpro (&Qfile_modes);
staticpro (&Qset_file_modes);
staticpro (&Qset_file_times);
+ staticpro (&Qfile_selinux_context);
+ staticpro (&Qset_file_selinux_context);
staticpro (&Qfile_newer_than_file_p);
staticpro (&Qinsert_file_contents);
staticpro (&Qwrite_region);
defsubr (&Sfile_modes);
defsubr (&Sset_file_modes);
defsubr (&Sset_file_times);
+ defsubr (&Sfile_selinux_context);
+ defsubr (&Sset_file_selinux_context);
defsubr (&Sset_default_file_modes);
defsubr (&Sdefault_file_modes);
defsubr (&Sfile_newer_than_file_p);
#endif /* __FreeBSD__ */
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#include "lisp.h"
#include "buffer.h"
#ifdef FLOAT_CHECK_ERRNO
# include <errno.h>
-
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
#endif
#ifdef FLOAT_CATCH_SIGILL
IN_FLOAT (d = sin (d) / c, "tan", arg);
return make_float (d);
}
+
+#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
+DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
+ doc: /* Return non nil iff argument X is a NaN. */)
+ (x)
+ Lisp_Object x;
+{
+ CHECK_FLOAT (x);
+ return isnan (XFLOAT_DATA (x)) ? Qt : Qnil;
+}
+
+DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0,
+ doc: /* Copy sign of X2 to value of X1, and return the result.
+Cause an error if X1 or X2 is not a float. */)
+ (x1, x2)
+ Lisp_Object x1, x2;
+{
+ double f1, f2;
+
+ CHECK_FLOAT (x1);
+ CHECK_FLOAT (x2);
+
+ f1 = XFLOAT_DATA (x1);
+ f2 = XFLOAT_DATA (x2);
+
+ return make_float (copysign (f1, f2));
+}
+
+DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0,
+ doc: /* Get significand and exponent of a floating point number.
+Breaks the floating point number X into its binary significand SGNFCAND
+\(a floating point value between 0.5 (included) and 1.0 (excluded))
+and an integral exponent EXP for 2, such that:
+
+ X = SGNFCAND * 2^EXP
+
+The function returns the cons cell (SGNFCAND . EXP).
+If X is zero, both parts (SGNFCAND and EXP) are zero. */)
+ (x)
+ Lisp_Object x;
+{
+ double f = XFLOATINT (x);
+
+ if (f == 0.0)
+ return Fcons (make_float (0.0), make_number (0));
+ else
+ {
+ int exp;
+ double sgnfcand = frexp (f, &exp);
+ return Fcons (make_float (sgnfcand), make_number (exp));
+ }
+}
+
+DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
+ doc: /* Construct number X from significand SGNFCAND and exponent EXP.
+Returns the floating point value resulting from multiplying SGNFCAND
+(the significand) by 2 raised to the power of EXP (the exponent). */)
+ (sgnfcand, exp)
+ Lisp_Object sgnfcand, exp;
+{
+ CHECK_NUMBER (exp);
+ return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp)));
+}
+#endif
\f
#if 0 /* Leave these out unless we find there's a reason for them. */
defsubr (&Scos);
defsubr (&Ssin);
defsubr (&Stan);
+#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
+ defsubr (&Sisnan);
+ defsubr (&Scopysign);
+ defsubr (&Sfrexp);
+ defsubr (&Sldexp);
+#endif
#if 0
defsubr (&Sacosh);
defsubr (&Sasinh);
concat2 (s1, s2)
Lisp_Object s1, s2;
{
-#ifdef NO_ARG_ARRAY
Lisp_Object args[2];
args[0] = s1;
args[1] = s2;
return concat (2, args, Lisp_String, 0);
-#else
- return concat (2, &s1, Lisp_String, 0);
-#endif /* NO_ARG_ARRAY */
}
/* ARGSUSED */
concat3 (s1, s2, s3)
Lisp_Object s1, s2, s3;
{
-#ifdef NO_ARG_ARRAY
Lisp_Object args[3];
args[0] = s1;
args[1] = s2;
args[2] = s3;
return concat (3, args, Lisp_String, 0);
-#else
- return concat (3, &s1, Lisp_String, 0);
-#endif /* NO_ARG_ARRAY */
}
DEFUN ("append", Fappend, Sappend, 0, MANY, 0,
nconc2 (s1, s2)
Lisp_Object s1, s2;
{
-#ifdef NO_ARG_ARRAY
Lisp_Object args[2];
args[0] = s1;
args[1] = s2;
return Fnconc (2, args);
-#else
- return Fnconc (2, &s1);
-#endif /* NO_ARG_ARRAY */
}
DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0,
struct face *face;
Lisp_Object string;
{
- EMACS_INT pos_byte, ignore, start, start_byte;
+ EMACS_INT pos_byte, ignore;
int c;
Lisp_Object font_object = Qnil;
pos_byte = string_char_to_byte (string, pos);
}
- start = pos, start_byte = pos_byte;
while (pos < *limit)
{
Lisp_Object category;
FETCH_CHAR_ADVANCE_NO_CHECK (c, pos, pos_byte);
else
FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, pos, pos_byte);
+ category = CHAR_TABLE_REF (Vunicode_category_table, c);
+ if (EQ (category, QCf)
+ || CHAR_VARIATION_SELECTOR_P (c))
+ continue;
if (NILP (font_object))
{
font_object = font_for_char (face, c, pos - 1, string);
return Qnil;
continue;
}
-
- category = CHAR_TABLE_REF (Vunicode_category_table, c);
- if (! EQ (category, QCf)
- && ! CHAR_VARIATION_SELECTOR_P (c)
- && font_encode_char (font_object, c) == FONT_INVALID_CODE)
- {
- Lisp_Object f = font_for_char (face, c, pos - 1, string);
- EMACS_INT i, i_byte;
-
-
- if (NILP (f))
- {
- *limit = pos - 1;
- return font_object;
- }
- i = start, i_byte = start_byte;
- while (i < pos - 1)
- {
-
- if (NILP (string))
- FETCH_CHAR_ADVANCE_NO_CHECK (c, i, i_byte);
- else
- FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string, i, i_byte);
- category = CHAR_TABLE_REF (Vunicode_category_table, c);
- if (! EQ (category, QCf)
- && ! CHAR_VARIATION_SELECTOR_P (c)
- && font_encode_char (f, c) == FONT_INVALID_CODE)
- {
- *limit = pos - 1;
- return font_object;
- }
- }
- font_object = f;
- }
+ if (font_encode_char (font_object, c) == FONT_INVALID_CODE)
+ *limit = pos - 1;
}
return font_object;
}
gets the repertory information by an opened font and ENCODING. */);
Vfont_encoding_alist = Qnil;
+ /* FIXME: These 3 vars are not quite what they appear: setq on them
+ won't have any effect other than disconnect them from the style
+ table used by the font display code. So we make them read-only,
+ to avoid this confusing situation. */
+
DEFVAR_LISP_NOPRO ("font-weight-table", &Vfont_weight_table,
doc: /* Vector of valid font weight values.
Each element has the form:
[NUMERIC-VALUE SYMBOLIC-NAME ALIAS-NAME ...]
NUMERIC-VALUE is an integer, and SYMBOLIC-NAME and ALIAS-NAME are symbols. */);
Vfont_weight_table = BUILD_STYLE_TABLE (weight_table);
+ XSYMBOL (intern_c_string ("font-weight-table"))->constant = 1;
DEFVAR_LISP_NOPRO ("font-slant-table", &Vfont_slant_table,
doc: /* Vector of font slant symbols vs the corresponding numeric values.
See `font-weight-table' for the format of the vector. */);
Vfont_slant_table = BUILD_STYLE_TABLE (slant_table);
+ XSYMBOL (intern_c_string ("font-slant-table"))->constant = 1;
DEFVAR_LISP_NOPRO ("font-width-table", &Vfont_width_table,
doc: /* Alist of font width symbols vs the corresponding numeric values.
See `font-weight-table' for the format of the vector. */);
Vfont_width_table = BUILD_STYLE_TABLE (width_table);
+ XSYMBOL (intern_c_string ("font-width-table"))->constant = 1;
staticpro (&font_style_table);
font_style_table = Fmake_vector (make_number (3), Qnil);
without messing up the symbol's status. */
if (SYMBOLP (prop))
{
- Lisp_Object valcontents;
- valcontents = SYMBOL_VALUE (prop);
- if ((BUFFER_LOCAL_VALUEP (valcontents))
- && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
- && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
- && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
- swap_in_global_binding (prop);
+ struct Lisp_Symbol *sym = XSYMBOL (prop);
+ start:
+ switch (sym->redirect)
+ {
+ case SYMBOL_VARALIAS: sym = indirect_variable (sym); goto start;
+ case SYMBOL_PLAINVAL: case SYMBOL_FORWARDED: break;
+ case SYMBOL_LOCALIZED:
+ { struct Lisp_Buffer_Local_Value *blv = sym->val.blv;
+ if (blv->frame_local && BLV_FOUND (blv) && XFRAME (blv->where) == f)
+ swap_in_global_binding (sym);
+ break;
+ }
+ default: abort ();
+ }
}
/* The tty color needed to be set before the frame's parameter
|| EQ (parameter, Qbackground_mode))
value = Fcdr (Fassq (parameter, f->param_alist));
else
+ /* FIXME: Avoid this code path at all (as well as code duplication)
+ by sharing more code with Fframe_parameters. */
value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
}
DEFVAR_LISP ("default-frame-scroll-bars", &Vdefault_frame_scroll_bars,
doc: /* Default position of scroll bars on this window-system. */);
#ifdef HAVE_WINDOW_SYSTEM
-#if defined(HAVE_NTGUI) || defined(NS_IMPL_COCOA)
- /* MS-Windows and Mac OS X have scroll bars on the right by default. */
+#if defined(HAVE_NTGUI) || defined(NS_IMPL_COCOA) || (defined(USE_GTK) && defined(USE_TOOLKIT_SCROLL_BARS))
+ /* MS-Windows, Mac OS X, and GTK have scroll bars on the right by
+ default. */
Vdefault_frame_scroll_bars = Qright;
#else
Vdefault_frame_scroll_bars = Qleft;
{
int overlay = 0;
- if (!left_p && row->cursor_in_fringe_p)
+ if (left_p == row->reversed_p && row->cursor_in_fringe_p)
{
Lisp_Object cursor = Qnil;
int bm = get_logical_cursor_bitmap (w, cursor);
if (bm != NO_FRINGE_BITMAP)
{
- draw_fringe_bitmap_1 (w, row, 0, 2, bm);
+ draw_fringe_bitmap_1 (w, row, left_p, 2, bm);
overlay = EQ (cursor, Qbox) ? 3 : 1;
}
}
left = row->left_user_fringe_bitmap;
left_face_id = row->left_user_fringe_face_id;
}
- else if (row->truncated_on_left_p)
+ else if ((!row->reversed_p && row->truncated_on_left_p)
+ || (row->reversed_p && row->truncated_on_right_p))
left = LEFT_FRINGE(0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
: LEFT_FRINGE (2, Qtop, 0));
else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
- else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
+ else if ((!row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row))
+ || (row->reversed_p && row->continued_p))
left = LEFT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
left = LEFT_FRINGE (5, Qempty_line, 0);
right = row->right_user_fringe_bitmap;
right_face_id = row->right_user_fringe_face_id;
}
- else if (row->truncated_on_right_p)
+ else if ((!row->reversed_p && row->truncated_on_right_p)
+ || (row->reversed_p && row->truncated_on_left_p))
right = RIGHT_FRINGE (0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qright))
right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
: RIGHT_FRINGE (2, Qtop, 0));
else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
- else if (row->continued_p)
+ else if ((!row->reversed_p && row->continued_p)
+ || (row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row)))
right = RIGHT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
right = RIGHT_FRINGE (6, Qup, 0);
extern void free PP ((__ptr_t __ptr));
/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
-#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */
+#if !defined (_MALLOC_INTERNAL) || defined (MSDOS) /* Avoid conflict. */
extern __ptr_t memalign PP ((__malloc_size_t __alignment,
__malloc_size_t __size));
extern int posix_memalign PP ((__ptr_t *, __malloc_size_t,
#include <malloc.h>
#endif
-#if __DJGPP__ - 0 == 1
-
-/* There is some problem with memalign in DJGPP v1 and we are supposed
- to omit it. Noone told me why, they just told me to do it. */
-
-#else
-
__ptr_t (*__memalign_hook) PP ((__malloc_size_t __size,
__malloc_size_t __alignment));
return 0;
}
-#endif /* Not DJGPP v1 */
/* Allocate memory on a page boundary.
Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
#include "charset.h"
#include "coding.h"
#include <gdk/gdkkeysyms.h>
+#include "xsettings.h"
#ifdef HAVE_XFT
#include <X11/Xft/Xft.h>
xg_set_geometry (f)
FRAME_PTR f;
{
- if (f->size_hint_flags & USPosition)
+ if (f->size_hint_flags & (USPosition | PPosition))
{
int left = f->left_pos;
int xneg = f->size_hint_flags & XNegative;
sprintf (geom_str, "=%dx%d%c%d%c%d",
FRAME_PIXEL_WIDTH (f),
- FRAME_TOTAL_PIXEL_HEIGHT (f),
+ FRAME_PIXEL_HEIGHT (f),
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
geom_str))
fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
}
- else if (f->size_hint_flags & PPosition)
- gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- f->left_pos, f->top_pos);
}
/* Clear under internal border if any. As we use a mix of Gtk+ and X calls
else if (win_gravity == StaticGravity)
size_hints.win_gravity = GDK_GRAVITY_STATIC;
- if (flags & PPosition) hint_flags |= GDK_HINT_POS;
- if (flags & USPosition) hint_flags |= GDK_HINT_USER_POS;
- if (flags & USSize) hint_flags |= GDK_HINT_USER_SIZE;
-
if (user_position)
{
hint_flags &= ~GDK_HINT_POS;
|| event->type == MotionNotify))
{
/* If we are releasing or moving the scroll bar, it has the grab. */
- retval = gtk_grab_get_current () != 0
- && gtk_grab_get_current () != f->output_data.x->edit_widget;
+ GtkWidget *w = gtk_grab_get_current ();
+ retval = w != 0 && GTK_IS_SCROLLBAR (w);
}
return retval;
{
GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem));
GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox)));
- GtkWidget *wmenuitem = gtk_image_menu_item_new_with_label ("");
+ GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
+ GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
+ GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
+ GtkImage *wimage = GTK_IS_IMAGE (c1->widget)
+ ? GTK_IMAGE (c1->widget) : GTK_IMAGE (c2->widget);
+ GtkLabel *wlbl = GTK_IS_LABEL (c1->widget)
+ ? GTK_LABEL (c1->widget) : GTK_LABEL (c2->widget);
+ GtkWidget *wmenuitem = gtk_image_menu_item_new_with_label
+ (gtk_label_get_text (wlbl));
+
GtkWidget *wmenuimage;
if (gtk_button_get_use_stock (wbutton))
GTK_ICON_SIZE_MENU);
else
{
- GtkImage *wimage = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (wbutton)));
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton));
GtkImageType store_type = gtk_image_get_storage_type (wimage);
gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->handlebox_widget,
vbox_pos);
- gtk_widget_show_all (x->handlebox_widget);
+
+ gtk_widget_show (x->toolbar_widget);
+ gtk_widget_show (x->handlebox_widget);
}
/* Create a tool bar for frame F. */
gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
- /* We only have icons, so override any user setting. We could
- use the caption property of the toolbar item (see update_frame_tool_bar
- below), but some of those strings are long, making the toolbar so
- long it does not fit on the screen. The GtkToolbar widget makes every
- item equal size, so the longest caption determine the size of every
- tool bar item. I think the creators of the GtkToolbar widget
- counted on 4 or 5 character long strings. */
gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
gtk_toolbar_set_orientation (GTK_TOOLBAR (x->toolbar_widget),
GTK_ORIENTATION_HORIZONTAL);
return image;
}
+static GtkToolItem *
+xg_make_tool_item (FRAME_PTR f,
+ GtkWidget *wimage,
+ GtkWidget **wbutton,
+ char *label,
+ int i)
+{
+ GtkToolItem *ti = gtk_tool_item_new ();
+ GtkWidget *vb = EQ (Vtool_bar_style, Qboth_horiz)
+ ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0);
+ GtkWidget *wb = gtk_button_new ();
+ GtkWidget *weventbox = gtk_event_box_new ();
+
+ if (wimage)
+ gtk_box_pack_start_defaults (GTK_BOX (vb), wimage);
+
+ gtk_box_pack_start_defaults (GTK_BOX (vb), gtk_label_new (label));
+ gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE);
+ gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE);
+ gtk_container_add (GTK_CONTAINER (wb), vb);
+ gtk_container_add (GTK_CONTAINER (weventbox), wb);
+ gtk_container_add (GTK_CONTAINER (ti), weventbox);
+
+ if (wimage)
+ {
+ /* The EMACS_INT cast avoids a warning. */
+ g_signal_connect (G_OBJECT (ti), "create-menu-proxy",
+ G_CALLBACK (xg_tool_bar_menu_proxy),
+ (gpointer) (EMACS_INT) i);
+
+ g_signal_connect (G_OBJECT (wb), "clicked",
+ G_CALLBACK (xg_tool_bar_callback),
+ (gpointer) (EMACS_INT) i);
+
+ g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
+
+ /* Catch expose events to overcome an annoying redraw bug, see
+ comment for xg_tool_bar_item_expose_callback. */
+ g_signal_connect (G_OBJECT (ti),
+ "expose-event",
+ G_CALLBACK (xg_tool_bar_item_expose_callback),
+ 0);
+
+ gtk_tool_item_set_homogeneous (ti, FALSE);
+
+ /* Callback to save modifyer mask (Shift/Control, etc). GTK makes
+ no distinction based on modifiers in the activate callback,
+ so we have to do it ourselves. */
+ g_signal_connect (wb, "button-release-event",
+ G_CALLBACK (xg_tool_bar_button_cb),
+ NULL);
+
+ g_object_set_data (G_OBJECT (wb), XG_FRAME_DATA, (gpointer)f);
+
+ /* Use enter/leave notify to show help. We use the events
+ rather than the GtkButton specific signals "enter" and
+ "leave", so we can have only one callback. The event
+ will tell us what kind of event it is. */
+ /* The EMACS_INT cast avoids a warning. */
+ g_signal_connect (G_OBJECT (weventbox),
+ "enter-notify-event",
+ G_CALLBACK (xg_tool_bar_help_callback),
+ (gpointer) (EMACS_INT) i);
+ g_signal_connect (G_OBJECT (weventbox),
+ "leave-notify-event",
+ G_CALLBACK (xg_tool_bar_help_callback),
+ (gpointer) (EMACS_INT) i);
+ }
+
+ if (wbutton) *wbutton = wb;
+
+ return ti;
+}
+
+static void
+xg_show_toolbar_item (GtkToolItem *ti)
+{
+ Lisp_Object style = Ftool_bar_get_system_style ();
+
+ int show_label = EQ (style, Qboth)
+ || EQ (style, Qboth_horiz) || EQ (style, Qtext);
+ int show_image = ! EQ (style, Qtext);
+ int horiz = EQ (style, Qboth_horiz);
+
+ GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (ti));
+ GtkWidget *wbutton = gtk_bin_get_child (GTK_BIN (weventbox));
+ GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
+ GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
+ GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
+ GtkWidget *wimage = GTK_IS_IMAGE (c1->widget)
+ ? c1->widget : c2->widget;
+ GtkWidget *wlbl = GTK_IS_LABEL (c1->widget)
+ ? c1->widget : c2->widget;
+ GtkWidget *new_box = NULL;
+
+ if (GTK_IS_VBOX (vb) && horiz)
+ new_box = gtk_hbox_new (FALSE, 0);
+ else if (GTK_IS_HBOX (vb) && !horiz && show_label && show_image)
+ new_box = gtk_vbox_new (FALSE, 0);
+ if (new_box)
+ {
+ gtk_widget_ref (wimage);
+ gtk_widget_ref (wlbl);
+ gtk_container_remove (GTK_CONTAINER (vb), wimage);
+ gtk_container_remove (GTK_CONTAINER (vb), wlbl);
+ gtk_widget_destroy (GTK_WIDGET (vb));
+ gtk_box_pack_start_defaults (GTK_BOX (new_box), wimage);
+ gtk_box_pack_start_defaults (GTK_BOX (new_box), wlbl);
+ gtk_container_add (GTK_CONTAINER (wbutton), new_box);
+ gtk_widget_unref (wimage);
+ gtk_widget_unref (wlbl);
+ vb = GTK_BOX (new_box);
+ }
+
+ if (show_label) gtk_widget_show (wlbl);
+ else gtk_widget_hide (wlbl);
+ if (show_image) gtk_widget_show (wimage);
+ else gtk_widget_hide (wimage);
+ gtk_widget_show (GTK_WIDGET (weventbox));
+ gtk_widget_show (GTK_WIDGET (vb));
+ gtk_widget_show (GTK_WIDGET (wbutton));
+ gtk_widget_show (GTK_WIDGET (ti));
+}
+
+
/* Update the tool bar for frame F. Add new buttons and remove old. */
extern Lisp_Object Qx_gtk_map_stock;
wtoolbar = GTK_TOOLBAR (x->toolbar_widget);
gtk_widget_size_request (GTK_WIDGET (wtoolbar), &old_req);
- dir = gtk_widget_get_direction (x->toolbar_widget);
-
+ dir = gtk_widget_get_direction (GTK_WIDGET (wtoolbar));
+
for (i = 0; i < f->n_tool_bar_items; ++i)
{
int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
GtkWidget *wbutton = NULL;
GtkWidget *weventbox;
Lisp_Object specified_file;
-
- ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i);
+ Lisp_Object lbl = PROP (TOOL_BAR_ITEM_LABEL);
+ char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL));
+
+ ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), i);
if (ti)
{
wbutton = gtk_bin_get_child (GTK_BIN (weventbox));
}
+
image = PROP (TOOL_BAR_ITEM_IMAGES);
/* Ignore invalid image specifications. */
icon_size = gtk_toolbar_get_icon_size (wtoolbar);
}
else if (gtk_stock_lookup (SSDATA (stock), &stock_item))
- icon_size = gtk_toolbar_get_icon_size (wtoolbar);
+ icon_size = gtk_toolbar_get_icon_size (wtoolbar);
else
{
stock = Qnil;
if (img->load_failed_p || img->pixmap == None)
{
- if (ti)
- gtk_widget_hide_all (GTK_WIDGET (ti));
- else
+ if (ti)
+ gtk_widget_hide_all (GTK_WIDGET (ti));
+ else
{
- /* Insert an empty (non-image) button */
- weventbox = gtk_event_box_new ();
- wbutton = gtk_button_new ();
- gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE);
- gtk_button_set_relief (GTK_BUTTON (wbutton),
- GTK_RELIEF_NONE);
- gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
- ti = gtk_tool_item_new ();
- gtk_container_add (GTK_CONTAINER (ti), weventbox);
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
+ /* Insert an empty (non-image) button */
+ ti = xg_make_tool_item (f, NULL, NULL, "", i);
+ gtk_toolbar_insert (GTK_TOOLBAR (wtoolbar), ti, -1);
}
- continue;
+ continue;
}
}
}
gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
- wbutton = gtk_button_new ();
- gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE);
- gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE);
- gtk_container_add (GTK_CONTAINER (wbutton), w);
- weventbox = gtk_event_box_new ();
- gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
- ti = gtk_tool_item_new ();
- gtk_container_add (GTK_CONTAINER (ti), weventbox);
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, -1);
-
-
- /* The EMACS_INT cast avoids a warning. */
- g_signal_connect (G_OBJECT (ti), "create-menu-proxy",
- G_CALLBACK (xg_tool_bar_menu_proxy),
- (gpointer) (EMACS_INT) i);
-
- g_signal_connect (G_OBJECT (wbutton), "clicked",
- G_CALLBACK (xg_tool_bar_callback),
- (gpointer) (EMACS_INT) i);
-
- gtk_widget_show_all (GTK_WIDGET (ti));
-
-
- g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
-
- /* Catch expose events to overcome an annoying redraw bug, see
- comment for xg_tool_bar_item_expose_callback. */
- g_signal_connect (G_OBJECT (ti),
- "expose-event",
- G_CALLBACK (xg_tool_bar_item_expose_callback),
- 0);
-
+ ti = xg_make_tool_item (f, w, &wbutton, label, i);
+ gtk_toolbar_insert (GTK_TOOLBAR (wtoolbar), ti, -1);
gtk_widget_set_sensitive (wbutton, enabled_p);
- gtk_tool_item_set_homogeneous (ti, FALSE);
-
- /* Callback to save modifyer mask (Shift/Control, etc). GTK makes
- no distinction based on modifiers in the activate callback,
- so we have to do it ourselves. */
- g_signal_connect (wbutton, "button-release-event",
- G_CALLBACK (xg_tool_bar_button_cb),
- NULL);
-
- g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f);
-
- /* Use enter/leave notify to show help. We use the events
- rather than the GtkButton specific signals "enter" and
- "leave", so we can have only one callback. The event
- will tell us what kind of event it is. */
- /* The EMACS_INT cast avoids a warning. */
- g_signal_connect (G_OBJECT (weventbox),
- "enter-notify-event",
- G_CALLBACK (xg_tool_bar_help_callback),
- (gpointer) (EMACS_INT) i);
- g_signal_connect (G_OBJECT (weventbox),
- "leave-notify-event",
- G_CALLBACK (xg_tool_bar_help_callback),
- (gpointer) (EMACS_INT) i);
}
else
{
- GtkWidget *wimage = gtk_bin_get_child (GTK_BIN (wbutton));
+ GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
+ GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
+ GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
+ GtkWidget *wimage = GTK_IS_IMAGE (c1->widget)
+ ? c1->widget : c2->widget;
+ GtkWidget *wlbl = GTK_IS_LABEL (c1->widget)
+ ? c1->widget : c2->widget;
+
Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_IMAGE_DATA);
gpointer old_stock_name = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_STOCK_NAME);
gpointer old_icon_name = g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_ICON_NAME);
+ gtk_label_set_text (GTK_LABEL (wlbl), label);
if (stock_name &&
(! old_stock_name || strcmp (old_stock_name, stock_name) != 0))
{
(GDestroyNotify) xfree);
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA,
NULL);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL);
+ g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME,
+ NULL);
}
else if (icon_name &&
(! old_icon_name || strcmp (old_icon_name, icon_name) != 0))
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_STOCK_NAME,
NULL);
- g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME, NULL);
+ g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME,
+ NULL);
}
gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin);
gtk_widget_set_sensitive (wbutton, enabled_p);
- gtk_widget_show_all (GTK_WIDGET (ti));
- }
+ }
+ xg_show_toolbar_item (ti);
#undef PROP
}
can be reused later on. */
do
{
- ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i++);
+ ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), i++);
if (ti) gtk_widget_hide_all (GTK_WIDGET (ti));
} while (ti != NULL);
new_req.height = 0;
if (pack_tool_bar && f->n_tool_bar_items != 0)
- xg_pack_tool_bar (f);
+ xg_pack_tool_bar (f);
- gtk_widget_size_request (GTK_WIDGET (x->toolbar_widget), &new_req);
+ gtk_widget_size_request (GTK_WIDGET (wtoolbar), &new_req);
if (old_req.height != new_req.height
&& ! FRAME_X_OUTPUT (f)->toolbar_detached)
{
\f
/***********************************************************************
Initializing
- ***********************************************************************/
+***********************************************************************/
void
xg_initialize ()
{
extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
extern Lisp_Object QCdata, QCtype;
extern Lisp_Object Qcenter;
-Lisp_Object QCascent, QCmargin, QCrelief, Qcount;
+Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
return mask;
}
-DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
- doc: /* Return extension data for image SPEC.
+DEFUN ("image-metadata", Fimage_metadata, Simage_metadata, 1, 2, 0,
+ doc: /* Return metadata for image SPEC.
FRAME is the frame on which the image will be displayed. FRAME nil
or omitted means use the selected frame. */)
(spec, frame)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
- if (c && (!NILP (filter) || INTEGERP (Vimage_cache_eviction_delay)))
+ if (c)
{
- EMACS_TIME t;
- unsigned long old;
- int i, nfreed;
-
- EMACS_GET_TIME (t);
- old = EMACS_SECS (t) - XFASTINT (Vimage_cache_eviction_delay);
+ int i, nfreed = 0;
/* Block input so that we won't be interrupted by a SIGIO
while being in an inconsistent state. */
BLOCK_INPUT;
- for (i = nfreed = 0; i < c->used; ++i)
+ if (!NILP (filter))
{
- struct image *img = c->images[i];
- if (img != NULL
- && (NILP (filter) ? img->timestamp < old
- : (EQ (Qt, filter)
- || !NILP (Fmember (filter, img->dependencies)))))
+ /* Filter image cache. */
+ for (i = 0; i < c->used; ++i)
{
- free_image (f, img);
- ++nfreed;
+ struct image *img = c->images[i];
+ if (img && (EQ (Qt, filter)
+ || !NILP (Fmember (filter, img->dependencies))))
+ {
+ free_image (f, img);
+ ++nfreed;
+ }
+ }
+ }
+ else if (INTEGERP (Vimage_cache_eviction_delay))
+ {
+ /* Free cache based on timestamp. */
+ EMACS_TIME t;
+ unsigned long old;
+ int delay, nimages = 0;
+
+ for (i = 0; i < c->used; ++i)
+ if (c->images[i])
+ nimages++;
+
+ /* If the number of cached images has grown unusually large,
+ decrease the cache eviction delay (Bug#6230). */
+ delay = XFASTINT (Vimage_cache_eviction_delay);
+ if (nimages > 40)
+ delay = max (1, 1600 * delay / (nimages*nimages));
+
+ EMACS_GET_TIME (t);
+ old = EMACS_SECS (t) - delay;
+
+ for (i = 0; i < c->used; ++i)
+ {
+ struct image *img = c->images[i];
+ if (img && img->timestamp < old)
+ {
+ free_image (f, img);
+ ++nfreed;
+ }
}
}
}
-DEFUN ("image-refresh", Fimage_refresh, Simage_refresh,
+DEFUN ("image-flush", Fimage_flush, Simage_flush,
1, 2, 0,
- doc: /* Refresh the image with specification SPEC on frame FRAME.
-If SPEC specifies an image file, the displayed image is updated with
-the current contents of that file.
+ doc: /* Fush the image with specification SPEC on frame FRAME.
+This removes the image from the Emacs image cache. If SPEC specifies
+an image file, the next redisplay of this image will read from the
+current contents of that file.
+
FRAME nil or omitted means use the selected frame.
FRAME t means refresh the image on all frames. */)
(spec, frame)
struct frame *f;
struct image *img;
{
- /* IMG->data.ptr_val may contain extension data. */
+ /* IMG->data.ptr_val may contain metadata with extension data. */
img->data.lisp_val = Qnil;
x_clear_image (f, img);
}
}
}
- /* Save GIF image extension data for `image-extension-data'.
- Format is (count IMAGES FUNCTION "BYTES" ...). */
+ /* Save GIF image extension data for `image-metadata'.
+ Format is (count IMAGES extension-data (FUNCTION "BYTES" ...)). */
img->data.lisp_val = Qnil;
if (gif->SavedImages[ino].ExtensionBlockCount > 0)
{
img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
Fcons (make_number (ext->Function),
img->data.lisp_val));
- img->data.lisp_val = Fnreverse (img->data.lisp_val);
+ img->data.lisp_val = Fcons (Qextension_data,
+ Fcons (Fnreverse (img->data.lisp_val),
+ Qnil));
}
if (gif->ImageCount > 1)
img->data.lisp_val = Fcons (Qcount,
Qcount = intern_c_string ("count");
staticpro (&Qcount);
+ Qextension_data = intern_c_string ("extension-data");
+ staticpro (&Qextension_data);
QCascent = intern_c_string (":ascent");
staticpro (&QCascent);
defsubr (&Sinit_image_library);
defsubr (&Sclear_image_cache);
- defsubr (&Simage_refresh);
+ defsubr (&Simage_flush);
defsubr (&Simage_size);
defsubr (&Simage_mask_p);
- defsubr (&Simage_extension_data);
+ defsubr (&Simage_metadata);
#if GLYPH_DEBUG
defsubr (&Simagep);
Vx_bitmap_file_path = decode_env_path ((char *) 0, PATH_BITMAPS);
DEFVAR_LISP ("image-cache-eviction-delay", &Vimage_cache_eviction_delay,
- doc: /* Time after which cached images are removed from the cache.
-When an image has not been displayed this many seconds, remove it
-from the image cache. Value must be an integer or nil with nil
-meaning don't clear the cache. */);
- Vimage_cache_eviction_delay = make_number (30 * 60);
+ doc: /* Maximum time after which images are removed from the cache.
+When an image has not been displayed this many seconds, Emacs
+automatically removes it from the image cache. If the cache contains
+a large number of images, the actual eviction time may be shorter.
+The value can also be nil, meaning the cache is never cleared.
+
+The function `clear-image-cache' disregards this variable. */);
+ Vimage_cache_eviction_delay = make_number (300);
}
void
Lisp_Object Fcombine_after_change_execute ();
/* Non-nil means don't call the after-change-functions right away,
- just record an element in Vcombine_after_change_calls_list. */
+ just record an element in combine_after_change_list. */
Lisp_Object Vcombine_after_change_calls;
/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT)
#include "nsterm.h"
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* Variables for blockinput.h: */
/* Non-zero if interrupt input is blocked right now. */
/* menu item parts */
Lisp_Object Qmenu_enable;
Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence;
-Lisp_Object QCbutton, QCtoggle, QCradio;
+Lisp_Object QCbutton, QCtoggle, QCradio, QClabel;
extern Lisp_Object Qmenu_item;
/* An event header symbol HEAD may have a property named
}
#endif
-extern int nonundocount; /* Declared in cmds.c. */
-
Lisp_Object
command_loop_1 ()
{
Lisp_Object cmd;
- int lose;
Lisp_Object keybuf[30];
int i;
int prev_modiff = 0;
}
else
{
- if (NILP (current_kboard->Vprefix_arg))
- {
- /* In case we jump to directly_done. */
- Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
-
- /* Recognize some common commands in common situations and
- do them directly. */
- if (EQ (Vthis_command, Qforward_char) && PT < ZV
- && NILP (Vthis_command_keys_shift_translated)
- && !CONSP (Vtransient_mark_mode))
- {
- struct Lisp_Char_Table *dp
- = window_display_table (XWINDOW (selected_window));
- lose = FETCH_CHAR (PT_BYTE);
- SET_PT (PT + 1);
- if (! NILP (Vpost_command_hook))
- /* Put this before calling adjust_point_for_property
- so it will only get called once in any case. */
- goto directly_done;
- if (current_buffer == prev_buffer
- && last_point_position != PT
- && NILP (Vdisable_point_adjustment)
- && NILP (Vglobal_disable_point_adjustment))
- adjust_point_for_property (last_point_position, 0);
- already_adjusted = 1;
- if (PT == last_point_position + 1
- && (dp
- ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
- ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1
- : (NILP (DISP_CHAR_VECTOR (dp, lose))
- && (lose >= 0x20 && lose < 0x7f)))
- : (lose >= 0x20 && lose < 0x7f))
- /* To extract the case of continuation on
- wide-column characters. */
- && ASCII_BYTE_P (lose)
- && (XFASTINT (XWINDOW (selected_window)->last_modified)
- >= MODIFF)
- && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
- >= OVERLAY_MODIFF)
- && (XFASTINT (XWINDOW (selected_window)->last_point)
- == PT - 1)
- && !windows_or_buffers_changed
- && EQ (current_buffer->selective_display, Qnil)
- && !detect_input_pending ()
- && NILP (XWINDOW (selected_window)->column_number_displayed)
- && NILP (Vexecuting_kbd_macro))
- direct_output_forward_char (1);
- goto directly_done;
- }
- else if (EQ (Vthis_command, Qbackward_char) && PT > BEGV
- && NILP (Vthis_command_keys_shift_translated)
- && !CONSP (Vtransient_mark_mode))
- {
- struct Lisp_Char_Table *dp
- = window_display_table (XWINDOW (selected_window));
- SET_PT (PT - 1);
- lose = FETCH_CHAR (PT_BYTE);
- if (! NILP (Vpost_command_hook))
- goto directly_done;
- if (current_buffer == prev_buffer
- && last_point_position != PT
- && NILP (Vdisable_point_adjustment)
- && NILP (Vglobal_disable_point_adjustment))
- adjust_point_for_property (last_point_position, 0);
- already_adjusted = 1;
- if (PT == last_point_position - 1
- && (dp
- ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
- ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1
- : (NILP (DISP_CHAR_VECTOR (dp, lose))
- && (lose >= 0x20 && lose < 0x7f)))
- : (lose >= 0x20 && lose < 0x7f))
- && (XFASTINT (XWINDOW (selected_window)->last_modified)
- >= MODIFF)
- && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
- >= OVERLAY_MODIFF)
- && (XFASTINT (XWINDOW (selected_window)->last_point)
- == PT + 1)
- && !windows_or_buffers_changed
- && EQ (current_buffer->selective_display, Qnil)
- && !detect_input_pending ()
- && NILP (XWINDOW (selected_window)->column_number_displayed)
- && NILP (Vexecuting_kbd_macro))
- direct_output_forward_char (-1);
- goto directly_done;
- }
- else if (EQ (Vthis_command, Qself_insert_command)
- /* Try this optimization only on char keystrokes. */
- && NATNUMP (last_command_event)
- && CHAR_VALID_P (XFASTINT (last_command_event), 0))
- {
- unsigned int c
- = translate_char (Vtranslation_table_for_input,
- XFASTINT (last_command_event));
- int value;
- if (NILP (Vexecuting_kbd_macro)
- && !EQ (minibuf_window, selected_window))
- {
- if (!nonundocount || nonundocount >= 20)
- {
- Fundo_boundary ();
- nonundocount = 0;
- }
- nonundocount++;
- }
-
- lose = ((XFASTINT (XWINDOW (selected_window)->last_modified)
- < MODIFF)
- || (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
- < OVERLAY_MODIFF)
- || (XFASTINT (XWINDOW (selected_window)->last_point)
- != PT)
- || MODIFF <= SAVE_MODIFF
- || windows_or_buffers_changed
- || !EQ (current_buffer->selective_display, Qnil)
- || detect_input_pending ()
- || !NILP (XWINDOW (selected_window)->column_number_displayed)
- || !NILP (Vexecuting_kbd_macro));
-
- value = internal_self_insert (c, 0);
-
- if (value == 2)
- nonundocount = 0;
-
- frame_make_pointer_invisible ();
-
- if (! NILP (Vpost_command_hook))
- /* Put this before calling adjust_point_for_property
- so it will only get called once in any case. */
- goto directly_done;
-
- /* VALUE == 1 when AFTER-CHANGE functions are
- installed which is the case most of the time
- because FONT-LOCK installs one. */
- if (!lose && !value)
- direct_output_for_insert (c);
- goto directly_done;
- }
- }
-
/* Here for a command that isn't executed directly */
- {
#ifdef HAVE_WINDOW_SYSTEM
int scount = SPECPDL_INDEX ();
}
#endif
- nonundocount = 0;
if (NILP (current_kboard->Vprefix_arg)) /* FIXME: Why? --Stef */
Fundo_boundary ();
Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
unbind_to (scount, Qnil);
#endif
}
- }
- directly_done: ;
current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
/* Note that the value cell will never directly contain nil
{
/* Must preserve main program's value of errno. */
int old_errno = errno;
-#if defined (USG) && !defined (POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- signal (signo, input_available_signal);
-#endif /* USG */
-
SIGNAL_THREAD_CHECK (signo);
#ifdef SYNC_INPUT
int old_errno = errno;
struct user_signal_info *p;
-#if defined (USG) && !defined (POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- signal (sig, handle_user_signal);
-#endif
-
SIGNAL_THREAD_CHECK (sig);
for (p = user_signals; p; p = p->next)
- `:help HELP-STRING'.
- Gives a help string to display for the tool bar item. */
+ Gives a help string to display for the tool bar item.
+
+ - `:label LABEL-STRING'.
+
+ A text label to show with the tool bar button if labels are enabled. */
static int
parse_tool_bar_item (key, item)
Lisp_Object filter = Qnil;
Lisp_Object caption;
- int i;
+ int i, have_label = 0;
/* Defininition looks like `(menu-item CAPTION BINDING PROPS...)'.
Rule out items that aren't lists, don't start with
else if (EQ (key, QChelp))
/* `:help HELP-STRING'. */
PROP (TOOL_BAR_ITEM_HELP) = value;
+ else if (EQ (key, QClabel))
+ {
+ /* `:label LABEL-STRING'. */
+ PROP (TOOL_BAR_ITEM_LABEL) = value;
+ have_label = 1;
+ }
else if (EQ (key, QCfilter))
/* ':filter FORM'. */
filter = value;
PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
}
+
+ if (!have_label)
+ {
+ /* Try to make one from caption and key. */
+ Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY);
+ Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION);
+ char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : "";
+ char *caption = STRINGP (capt) ? (char *) SDATA (capt) : "";
+ char buf[64];
+ EMACS_INT max_lbl = 2*tool_bar_max_label_size;
+ Lisp_Object new_lbl;
+
+ if (strlen (caption) < max_lbl && caption[0] != '\0')
+ {
+ strcpy (buf, caption);
+ while (buf[0] != '\0' && buf[strlen (buf) -1] == '.')
+ buf[strlen (buf)-1] = '\0';
+ if (strlen (buf) <= max_lbl)
+ caption = buf;
+ }
+
+ if (strlen (caption) <= max_lbl)
+ label = caption;
+
+ if (strlen (label) <= max_lbl && label[0] != '\0')
+ {
+ int i;
+ if (label != buf) strcpy (buf, label);
+
+ for (i = 0; i < strlen (buf); ++i)
+ {
+ if (buf[i] == '-') buf[i] = ' ';
+ }
+ label = buf;
+
+ }
+ else label = "";
+
+ new_lbl = Fupcase_initials (make_string (label, strlen (label)));
+ if (SCHARS (new_lbl) <= tool_bar_max_label_size)
+ PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
+ }
+
/* If got a filter apply it on binding. */
if (!NILP (filter))
PROP (TOOL_BAR_ITEM_BINDING)
int old_errno = errno;
struct terminal *terminal;
-#if defined (USG) && !defined (POSIX_SIGNALS)
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- signal (SIGINT, interrupt_signal);
- signal (SIGQUIT, interrupt_signal);
-#endif /* USG */
-
SIGNAL_THREAD_CHECK (signalnum);
/* See if we have an active terminal on our controlling tty. */
GCPRO4 (saved.object, saved.global_code,
saved.current_syntax_table, saved.old_prop);
Fsignal (Qquit, Qnil);
+ /* FIXME: AFAIK, `quit' can never return, so this code is dead! */
gl_state = saved;
UNGCPRO;
}
{
/* When using X, don't give the user a real choice,
because we haven't implemented the mechanisms to support it. */
-#ifdef NO_SOCK_SIGIO
- new_interrupt_input = 0;
-#else /* not NO_SOCK_SIGIO */
new_interrupt_input = 1;
-#endif /* NO_SOCK_SIGIO */
}
else
#endif /* HAVE_X_WINDOWS */
staticpro (&QCtoggle);
QCradio = intern_c_string (":radio");
staticpro (&QCradio);
+ QClabel = intern_c_string (":label");
+ staticpro (&QClabel);
Qmode_line = intern_c_string ("mode-line");
staticpro (&Qmode_line);
{
Lisp_Misc_Free = 0x5eab,
Lisp_Misc_Marker,
- Lisp_Misc_Intfwd,
- Lisp_Misc_Boolfwd,
- Lisp_Misc_Objfwd,
- Lisp_Misc_Buffer_Objfwd,
- Lisp_Misc_Buffer_Local_Value,
Lisp_Misc_Overlay,
- Lisp_Misc_Kboard_Objfwd,
Lisp_Misc_Save_Value,
/* Currently floats are not a misc type,
but let's define this in case we want to change that. */
Lisp_Misc_Limit
};
+/* These are the types of forwarding objects used in the value slot
+ of symbols for special built-in variables whose value is stored in
+ C variables. */
+enum Lisp_Fwd_Type
+ {
+ Lisp_Fwd_Int, /* Fwd to a C `int' variable. */
+ Lisp_Fwd_Bool, /* Fwd to a C boolean var. */
+ Lisp_Fwd_Obj, /* Fwd to a C Lisp_Object variable. */
+ Lisp_Fwd_Buffer_Obj, /* Fwd to a Lisp_Object field of buffers. */
+ Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */
+ };
+
#ifndef GCTYPEBITS
#define GCTYPEBITS 3
#endif
return o;
}
#else
-/* This isn't quite right - it keeps the argument as an lvalue.
- Making it const via casting would help avoid code actually
- modifying the location in question, but the casting could cover
- other type-related bugs. */
-#define LISP_MAKE_RVALUE(o) (o)
+/* This is more portable to pre-C99 non-GCC compilers, but for
+ backwards compatibility GCC still accepts an old GNU extension
+ which caused this to only generate a warning. */
+#define LISP_MAKE_RVALUE(o) (0 ? (o) : (o))
#endif
#else /* USE_LISP_UNION_TYPE */
#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any))
#define XMISCTYPE(a) (XMISCANY (a)->type)
#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker))
-#define XINTFWD(a) (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd))
-#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd))
-#define XOBJFWD(a) (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd))
#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay))
#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value))
+
+/* Forwarding object types. */
+
+#define XFWDTYPE(a) (a->u_intfwd.type)
+#define XINTFWD(a) (eassert (INTFWDP (a)), &((a)->u_intfwd))
+#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &((a)->u_boolfwd))
+#define XOBJFWD(a) (eassert (OBJFWDP (a)), &((a)->u_objfwd))
#define XBUFFER_OBJFWD(a) \
- (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd))
-#define XBUFFER_LOCAL_VALUE(a) \
- (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value))
+ (eassert (BUFFER_OBJFWDP (a)), &((a)->u_buffer_objfwd))
#define XKBOARD_OBJFWD(a) \
- (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd))
+ (eassert (KBOARD_OBJFWDP (a)), &((a)->u_kboard_objfwd))
/* Pseudovector types. */
#define XSETCAR(c,n) (XCAR_AS_LVALUE(c) = (n))
#define XSETCDR(c,n) (XCDR_AS_LVALUE(c) = (n))
-/* For performance: Fast storage of positive integers into the
- fields of a cons cell. See above caveats. */
-#define XSETCARFASTINT(c,n) XSETFASTINT(XCAR_AS_LVALUE(c),(n))
-#define XSETCDRFASTINT(c,n) XSETFASTINT(XCDR_AS_LVALUE(c),(n))
-
/* Take the car or cdr of something whose type is not known. */
#define CAR(c) \
(CONSP ((c)) ? XCAR ((c)) \
SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2
};
+enum symbol_redirect
+{
+ SYMBOL_PLAINVAL = 4,
+ SYMBOL_VARALIAS = 1,
+ SYMBOL_LOCALIZED = 2,
+ SYMBOL_FORWARDED = 3
+};
+
/* In a symbol, the markbit of the plist is used as the gc mark bit */
struct Lisp_Symbol
{
unsigned gcmarkbit : 1;
- /* Non-zero means symbol serves as a variable alias. The symbol
- holding the real value is found in the value slot. */
- unsigned indirect_variable : 1;
+ /* Indicates where the value can be found:
+ 0 : it's a plain var, the value is in the `value' field.
+ 1 : it's a varalias, the value is really in the `alias' symbol.
+ 2 : it's a localized var, the value is in the `blv' object.
+ 3 : it's a forwarding variable, the value is in `forward'.
+ */
+ enum symbol_redirect redirect : 3;
/* Non-zero means symbol is constant, i.e. changing its value
- should signal an error. */
- unsigned constant : 1;
+ should signal an error. If the value is 3, then the var
+ can be changed, but only by `defconst'. */
+ unsigned constant : 2;
/* Interned state of the symbol. This is an enumerator from
enum symbol_interned. */
Lisp_Object xname;
/* Value of the symbol or Qunbound if unbound. If this symbol is a
- defvaralias, `value' contains the symbol for which it is an
+ defvaralias, `alias' contains the symbol for which it is an
alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get
and set a symbol's value, to take defvaralias into account. */
- Lisp_Object value;
+ union {
+ Lisp_Object value;
+ struct Lisp_Symbol *alias;
+ struct Lisp_Buffer_Local_Value *blv;
+ union Lisp_Fwd *fwd;
+ } val;
/* Function value of the symbol or Qunbound if not fboundp. */
Lisp_Object function;
/* Value is name of symbol. */
+#define SYMBOL_VAL(sym) \
+ (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value)
+#define SYMBOL_ALIAS(sym) \
+ (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias)
+#define SYMBOL_BLV(sym) \
+ (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv)
+#define SYMBOL_FWD(sym) \
+ (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd)
+#define SET_SYMBOL_VAL(sym, v) \
+ (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value = (v))
+#define SET_SYMBOL_ALIAS(sym, v) \
+ (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias = (v))
+#define SET_SYMBOL_BLV(sym, v) \
+ (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv = (v))
+#define SET_SYMBOL_FWD(sym, v) \
+ (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd = (v))
+
#define SYMBOL_NAME(sym) \
LISP_MAKE_RVALUE (XSYMBOL (sym)->xname)
#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant
-/* Value is the value of SYM, with defvaralias taken into
- account. */
-
-#define SYMBOL_VALUE(sym) \
- (XSYMBOL (sym)->indirect_variable \
- ? indirect_variable (XSYMBOL (sym))->value \
- : XSYMBOL (sym)->value)
-
-/* Set SYM's value to VAL, taking defvaralias into account. */
-
-#define SET_SYMBOL_VALUE(sym, val) \
- do { \
- if (XSYMBOL (sym)->indirect_variable) \
- indirect_variable (XSYMBOL (sym))->value = (val); \
- else \
- XSYMBOL (sym)->value = (val); \
- } while (0)
-
\f
/***********************************************************************
Hash Tables
struct Lisp_Misc_Any /* Supertype of all Misc types. */
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */
+ enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */
unsigned gcmarkbit : 1;
int spacer : 15;
+ /* Make it as long as "Lisp_Free without padding". */
+ void *fill;
};
struct Lisp_Marker
- Fmarker_buffer
- Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain.
- unchain_marker: to find the list from which to unchain.
- - Fkill_buffer: to unchain the markers of current indirect buffer.
+ - Fkill_buffer: to only unchain the markers of current indirect buffer.
*/
struct buffer *buffer;
struct Lisp_Marker *next;
/* This is the char position where the marker points. */
EMACS_INT charpos;
- /* This is the byte position. */
+ /* This is the byte position.
+ It's mostly used as a charpos<->bytepos cache (i.e. it's not directly
+ used to implement the functionality of markers, but rather to (ab)use
+ markers as a cache for char<->byte mappings). */
EMACS_INT bytepos;
};
specified int variable. */
struct Lisp_Intfwd
{
- int type : 16; /* = Lisp_Misc_Intfwd */
- unsigned gcmarkbit : 1;
- int spacer : 15;
+ enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Int */
EMACS_INT *intvar;
};
nil if it is zero. */
struct Lisp_Boolfwd
{
- int type : 16; /* = Lisp_Misc_Boolfwd */
- unsigned gcmarkbit : 1;
- int spacer : 15;
+ enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */
int *boolvar;
};
specified variable. */
struct Lisp_Objfwd
{
- int type : 16; /* = Lisp_Misc_Objfwd */
- unsigned gcmarkbit : 1;
- int spacer : 15;
+ enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Obj */
Lisp_Object *objvar;
};
current buffer. Value is byte index of slot within buffer. */
struct Lisp_Buffer_Objfwd
{
- int type : 16; /* = Lisp_Misc_Buffer_Objfwd */
- unsigned gcmarkbit : 1;
- int spacer : 15;
- Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */
+ enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */
int offset;
+ Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */
};
/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when
struct Lisp_Buffer_Local_Value
{
- int type : 16; /* = Lisp_Misc_Buffer_Local_Value */
- unsigned gcmarkbit : 1;
- int spacer : 11;
-
/* 1 means that merely setting the variable creates a local
binding for the current buffer */
unsigned int local_if_set : 1;
- /* 1 means this variable is allowed to have frame-local bindings,
- so check for them when looking for the proper binding. */
- unsigned int check_frame : 1;
- /* 1 means that the binding now loaded was found
- as a local binding for the buffer in the `buffer' slot. */
- unsigned int found_for_buffer : 1;
- /* 1 means that the binding now loaded was found
- as a local binding for the frame in the `frame' slot. */
- unsigned int found_for_frame : 1;
- Lisp_Object realvalue;
- /* The buffer and frame for which the loaded binding was found. */
- /* Having both is only needed if we want to allow variables that are
- both buffer local and frame local (in which case, we currently give
- precedence to the buffer-local binding). I don't think such
- a combination is desirable. --Stef */
- Lisp_Object buffer, frame;
-
- /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE).
-
- LOADED-BINDING is the binding now loaded. It is a cons cell
- whose cdr is the binding's value. The cons cell may be an
- element of a buffer's local-variable alist, or an element of a
- frame's parameter alist, or it may be this cons cell.
-
- DEFAULT-VALUE is the variable's default value, seen when the
- current buffer and selected frame do not have their own
- bindings for the variable. When the default binding is loaded,
- LOADED-BINDING is actually this very cons cell; thus, its car
- points to itself. */
- Lisp_Object cdr;
+ /* 1 means this variable can have frame-local bindings, otherwise, it is
+ can have buffer-local bindings. The two cannot be combined. */
+ unsigned int frame_local : 1;
+ /* 1 means that the binding now loaded was found.
+ Presumably equivalent to (defcell!=valcell) */
+ unsigned int found : 1;
+ /* If non-NULL, a forwarding to the C var where it should also be set. */
+ union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */
+ /* The buffer or frame for which the loaded binding was found. */
+ Lisp_Object where;
+ /* A cons cell that holds the default value. It has the form
+ (SYMBOL . DEFAULT-VALUE). */
+ Lisp_Object defcell;
+ /* The cons cell from `where's parameter alist.
+ It always has the form (SYMBOL . VALUE)
+ Note that if `forward' is non-nil, VALUE may be out of date.
+ Also if the currently loaded binding is the default binding, then
+ this is `eq'ual to defcell. */
+ Lisp_Object valcell;
};
+#define BLV_FOUND(blv) \
+ (eassert ((blv)->found == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found)
+#define SET_BLV_FOUND(blv, v) \
+ (eassert ((v) == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found = (v))
+
+#define BLV_VALUE(blv) (XCDR ((blv)->valcell))
+#define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v))
+
/* START and END are markers in the overlay's buffer, and
PLIST is the overlay's property list. */
struct Lisp_Overlay
+/* An overlay's real data content is:
+ - plist
+ - buffer
+ - insertion type of both ends
+ - start & start_byte
+ - end & end_byte
+ - next (singly linked list of overlays).
+ - start_next and end_next (singly linked list of markers).
+ I.e. 9words plus 2 bits, 3words of which are for external linked lists.
+*/
{
enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */
unsigned gcmarkbit : 1;
current kboard. */
struct Lisp_Kboard_Objfwd
{
- enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Kboard_Objfwd */
- unsigned gcmarkbit : 1;
- int spacer : 15;
+ enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Kboard_Obj */
int offset;
};
#ifdef USE_LSB_TAG
/* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment.
This assumes that Lisp_Marker is the largest of the alternatives and
- that Lisp_Intfwd has the same size as "Lisp_Free w/o padding". */
+ that Lisp_Misc_Any has the same size as "Lisp_Free w/o padding". */
char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1)
- << GCTYPEBITS) - sizeof (struct Lisp_Intfwd)];
+ << GCTYPEBITS) - sizeof (struct Lisp_Misc_Any)];
#endif
};
{
struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */
struct Lisp_Free u_free; /* Includes padding to force alignment. */
- struct Lisp_Marker u_marker;
- struct Lisp_Intfwd u_intfwd;
- struct Lisp_Boolfwd u_boolfwd;
- struct Lisp_Objfwd u_objfwd;
- struct Lisp_Buffer_Objfwd u_buffer_objfwd;
- struct Lisp_Buffer_Local_Value u_buffer_local_value;
- struct Lisp_Overlay u_overlay;
- struct Lisp_Kboard_Objfwd u_kboard_objfwd;
- struct Lisp_Save_Value u_save_value;
+ struct Lisp_Marker u_marker; /* 5 */
+ struct Lisp_Overlay u_overlay; /* 5 */
+ struct Lisp_Save_Value u_save_value; /* 3 */
+ };
+
+union Lisp_Fwd
+ {
+ struct Lisp_Intfwd u_intfwd; /* 2 */
+ struct Lisp_Boolfwd u_boolfwd; /* 2 */
+ struct Lisp_Objfwd u_objfwd; /* 2 */
+ struct Lisp_Buffer_Objfwd u_buffer_objfwd; /* 2 */
+ struct Lisp_Kboard_Objfwd u_kboard_objfwd; /* 2 */
};
\f
/* Lisp floating point type */
};
#ifdef HIDE_LISP_IMPLEMENTATION
-#define XFLOAT_DATA(f) (XFLOAT (f)->u.data_ + 0)
+#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_)
#else
-#define XFLOAT_DATA(f) (XFLOAT (f)->u.data + 0)
+#define XFLOAT_DATA(f) (0 ? XFLOAT (f)->u.data : XFLOAT (f)->u.data)
/* This should be used only in alloc.c, which always disables
HIDE_LISP_IMPLEMENTATION. */
#define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n))
#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
-#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
-#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
-#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
-#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
-#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
-#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
-#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
+#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
+#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool)
+#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj)
+#define BUFFER_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Buffer_Obj)
+#define KBOARD_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Kboard_Obj)
/* True if object X is a pseudovector whose code is CODE. */
#define PSEUDOVECTORP(x, code) \
#define MANY -2
#define UNEVALLED -1
-extern void defvar_lisp (const char *, Lisp_Object *);
-extern void defvar_lisp_nopro (const char *, Lisp_Object *);
-extern void defvar_bool (const char *, int *);
-extern void defvar_int (const char *, EMACS_INT *);
-extern void defvar_kboard (const char *, int);
+extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *);
+extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *);
+extern void defvar_bool (struct Lisp_Boolfwd *, const char *, int *);
+extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *);
+extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
/* Macros we use to define forwarded Lisp variables.
These are used in the syms_of_FILENAME functions. */
-#define DEFVAR_LISP(lname, vname, doc) defvar_lisp (lname, vname)
-#define DEFVAR_LISP_NOPRO(lname, vname, doc) defvar_lisp_nopro (lname, vname)
-#define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname)
-#define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname)
+#define DEFVAR_LISP(lname, vname, doc) \
+ do { \
+ static struct Lisp_Objfwd o_fwd; \
+ defvar_lisp (&o_fwd, lname, vname); \
+ } while (0)
+#define DEFVAR_LISP_NOPRO(lname, vname, doc) \
+ do { \
+ static struct Lisp_Objfwd o_fwd; \
+ defvar_lisp_nopro (&o_fwd, lname, vname); \
+ } while (0)
+#define DEFVAR_BOOL(lname, vname, doc) \
+ do { \
+ static struct Lisp_Boolfwd b_fwd; \
+ defvar_bool (&b_fwd, lname, vname); \
+ } while (0)
+#define DEFVAR_INT(lname, vname, doc) \
+ do { \
+ static struct Lisp_Intfwd i_fwd; \
+ defvar_int (&i_fwd, lname, vname); \
+ } while (0)
-#define DEFVAR_KBOARD(lname, vname, doc) \
- defvar_kboard (lname, \
- (int)((char *)(¤t_kboard->vname) \
- - (char *)current_kboard))
+#define DEFVAR_KBOARD(lname, vname, doc) \
+ do { \
+ static struct Lisp_Kboard_Objfwd ko_fwd; \
+ defvar_kboard (&ko_fwd, \
+ lname, \
+ (int)((char *)(¤t_kboard->vname) \
+ - (char *)current_kboard)); \
+ } while (0)
\f
extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object,
Lisp_Object)) NO_RETURN;
extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, struct buffer *));
-extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object));
-extern Lisp_Object set_internal P_ ((Lisp_Object, Lisp_Object, struct buffer *, int));
+extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
+extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int);
extern void syms_of_data P_ ((void));
extern void init_data P_ ((void));
-extern void swap_in_global_binding P_ ((Lisp_Object));
+extern void swap_in_global_binding P_ ((struct Lisp_Symbol *));
/* Defined in cmds.c */
EXFUN (Fend_of_line, 1);
extern Lisp_Object Qinhibit_redisplay, Qdisplay;
extern Lisp_Object Qinhibit_eval_during_redisplay;
extern Lisp_Object Qmessage_truncate_lines;
-extern Lisp_Object Qimage;
+extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz;
extern Lisp_Object Vmessage_log_max;
extern int message_enable_multibyte;
extern Lisp_Object echo_area_buffer[2];
extern Lisp_Object make_symbol P_ ((char *));
extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
#define LOADHIST_ATTACH(x) \
- if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
+ do { \
+ if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
+ } while (0)
extern Lisp_Object Vcurrent_load_list;
extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes;
extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
extern Lisp_Object call4 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object call5 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object call6 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object call7 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
EXFUN (Fdo_auto_save, 2);
extern Lisp_Object apply_lambda P_ ((Lisp_Object, Lisp_Object, int));
extern Lisp_Object internal_catch P_ ((Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object));
extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)));
extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
+extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
+extern Lisp_Object internal_condition_case_n P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
extern void specbind P_ ((Lisp_Object, Lisp_Object));
extern void record_unwind_protect P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object));
extern Lisp_Object unbind_to P_ ((int, Lisp_Object));
extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
extern Lisp_Object restore_point_unwind P_ ((Lisp_Object));
extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
-extern int internal_delete_file P_ ((Lisp_Object));
+extern int internal_delete_file P_ ((Lisp_Object, Lisp_Object));
extern void syms_of_fileio P_ ((void));
extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
EXFUN (Fmake_symbolic_link, 3);
extern void fatal P_ ((const char *msgid, ...)) NO_RETURN;
/* Defined in terminal.c */
+EXFUN (Fframe_terminal, 1);
EXFUN (Fdelete_terminal, 2);
extern void syms_of_terminal P_ ((void));
#include "blockinput.h"
#ifdef MSDOS
-#if __DJGPP__ < 2
-#include <unistd.h> /* to get X_OK */
-#endif
#include "msdos.h"
#endif
#define file_tell ftell
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* hash table read constants */
Lisp_Object Qhash_table, Qdata;
Lisp_Object Qtest, Qsize;
&& EQ (obarray, initial_obarray))
{
XSYMBOL (sym)->constant = 1;
- XSYMBOL (sym)->value = sym;
+ XSYMBOL (sym)->redirect = SYMBOL_PLAINVAL;
+ SET_SYMBOL_VAL (XSYMBOL (sym), sym);
}
ptr = &XVECTOR (obarray)->contents[XINT (tem)];
error ("Attempt to unintern t or nil"); */
XSYMBOL (tem)->interned = SYMBOL_UNINTERNED;
- XSYMBOL (tem)->constant = 0;
- XSYMBOL (tem)->indirect_variable = 0;
hash = oblookup_last_bucket_number;
init_obarray ()
{
Lisp_Object oblength;
- int hash;
- Lisp_Object *tem;
XSETFASTINT (oblength, OBARRAY_SIZE);
- Qnil = Fmake_symbol (make_pure_c_string ("nil"));
Vobarray = Fmake_vector (oblength, make_number (0));
initial_obarray = Vobarray;
staticpro (&initial_obarray);
- /* Intern nil in the obarray */
- XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY;
- XSYMBOL (Qnil)->constant = 1;
-
- /* These locals are to kludge around a pyramid compiler bug. */
- hash = hash_string ("nil", 3);
- /* Separate statement here to avoid VAXC bug. */
- hash %= OBARRAY_SIZE;
- tem = &XVECTOR (Vobarray)->contents[hash];
- *tem = Qnil;
Qunbound = Fmake_symbol (make_pure_c_string ("unbound"));
- XSYMBOL (Qnil)->function = Qunbound;
- XSYMBOL (Qunbound)->value = Qunbound;
+ /* Set temporary dummy values to Qnil and Vpurify_flag to satisfy the
+ NILP (Vpurify_flag) check in intern_c_string. */
+ Qnil = make_number (-1); Vpurify_flag = make_number (1);
+ Qnil = intern_c_string ("nil");
+
+ /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil,
+ so those two need to be fixed manally. */
+ SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound);
XSYMBOL (Qunbound)->function = Qunbound;
+ XSYMBOL (Qunbound)->plist = Qnil;
+ /* XSYMBOL (Qnil)->function = Qunbound; */
+ SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil);
+ XSYMBOL (Qnil)->constant = 1;
+ XSYMBOL (Qnil)->plist = Qnil;
Qt = intern_c_string ("t");
- XSYMBOL (Qnil)->value = Qnil;
- XSYMBOL (Qnil)->plist = Qnil;
- XSYMBOL (Qt)->value = Qt;
+ SET_SYMBOL_VAL (XSYMBOL (Qt), Qt);
XSYMBOL (Qt)->constant = 1;
/* Qt is correct even if CANNOT_DUMP. loadup.el will set to nil at end. */
to a C variable of type int. Sample call:
DEFVAR_INT ("emacs-priority", &emacs_priority, "Documentation"); */
void
-defvar_int (const char *namestring, EMACS_INT *address)
+defvar_int (struct Lisp_Intfwd *i_fwd,
+ const char *namestring, EMACS_INT *address)
{
- Lisp_Object sym, val;
+ Lisp_Object sym;
sym = intern_c_string (namestring);
- val = allocate_misc ();
- XMISCTYPE (val) = Lisp_Misc_Intfwd;
- XINTFWD (val)->intvar = address;
- SET_SYMBOL_VALUE (sym, val);
+ i_fwd->type = Lisp_Fwd_Int;
+ i_fwd->intvar = address;
+ XSYMBOL (sym)->redirect = SYMBOL_FORWARDED;
+ SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)i_fwd);
}
/* Similar but define a variable whose value is t if address contains 1,
nil if address contains 0. */
void
-defvar_bool (const char *namestring, int *address)
+defvar_bool (struct Lisp_Boolfwd *b_fwd,
+ const char *namestring, int *address)
{
- Lisp_Object sym, val;
+ Lisp_Object sym;
sym = intern_c_string (namestring);
- val = allocate_misc ();
- XMISCTYPE (val) = Lisp_Misc_Boolfwd;
- XBOOLFWD (val)->boolvar = address;
- SET_SYMBOL_VALUE (sym, val);
+ b_fwd->type = Lisp_Fwd_Bool;
+ b_fwd->boolvar = address;
+ XSYMBOL (sym)->redirect = SYMBOL_FORWARDED;
+ SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)b_fwd);
Vbyte_boolean_vars = Fcons (sym, Vbyte_boolean_vars);
}
gc-marked for some other reason, since marking the same slot twice
can cause trouble with strings. */
void
-defvar_lisp_nopro (const char *namestring, Lisp_Object *address)
+defvar_lisp_nopro (struct Lisp_Objfwd *o_fwd,
+ const char *namestring, Lisp_Object *address)
{
- Lisp_Object sym, val;
+ Lisp_Object sym;
sym = intern_c_string (namestring);
- val = allocate_misc ();
- XMISCTYPE (val) = Lisp_Misc_Objfwd;
- XOBJFWD (val)->objvar = address;
- SET_SYMBOL_VALUE (sym, val);
+ o_fwd->type = Lisp_Fwd_Obj;
+ o_fwd->objvar = address;
+ XSYMBOL (sym)->redirect = SYMBOL_FORWARDED;
+ SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)o_fwd);
}
void
-defvar_lisp (const char *namestring, Lisp_Object *address)
+defvar_lisp (struct Lisp_Objfwd *o_fwd,
+ const char *namestring, Lisp_Object *address)
{
- defvar_lisp_nopro (namestring, address);
+ defvar_lisp_nopro (o_fwd, namestring, address);
staticpro (address);
}
at a particular offset in the current kboard object. */
void
-defvar_kboard (const char *namestring, int offset)
+defvar_kboard (struct Lisp_Kboard_Objfwd *ko_fwd,
+ const char *namestring, int offset)
{
- Lisp_Object sym, val;
+ Lisp_Object sym;
sym = intern_c_string (namestring);
- val = allocate_misc ();
- XMISCTYPE (val) = Lisp_Misc_Kboard_Objfwd;
- XKBOARD_OBJFWD (val)->offset = offset;
- SET_SYMBOL_VALUE (sym, val);
+ ko_fwd->type = Lisp_Fwd_Kboard_Obj;
+ ko_fwd->offset = offset;
+ XSYMBOL (sym)->redirect = SYMBOL_FORWARDED;
+ SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)ko_fwd);
}
\f
/* Record the value of load-path used at the start of dumping
/* Machine description file for the alpha chip.
- Copyright (C) 1994, 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Author: Rainer Schoepf
(according to authors.el)
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="note"
-
-NOTE-START
-Use -opsystem=osf1
-NOTE-END
-
-*/
-
#ifndef _LP64
-#define _LP64 /* This doesn't appear to be necessary
- on OSF 4/5 -- fx. */
+#define _LP64 /* This doesn't appear to be necessary on OSF 4/5 -- fx. */
#endif
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#undef WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
-
/* __alpha defined automatically */
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* GNU malloc and the relocating allocator do not work together
/* #define SYSTEM_MALLOC */
#ifdef __ELF__
-/* With ELF, make sure that all common symbols get allocated to in the
- data section. Otherwise, the dump of temacs may miss variables in
- the shared library that have been initialized. For example, with
- GNU libc, __malloc_initialized would normally be resolved to the
- shared library's .bss section, which is fatal. */
-# ifdef __GNUC__
-# define C_SWITCH_MACHINE -fno-common
-# else
-# error What gives? Fix me if DEC Unix supports ELF now.
-# endif
#undef UNEXEC
#define UNEXEC unexelf.o
#else /* not __ELF__ */
/* Describe layout of the address space in an executing process. */
-
#define TEXT_START 0x120000000
#define DATA_START 0x140000000
/* The program to be used for unexec. */
-
#define UNEXEC unexalpha.o
#endif /* __ELF__ */
-#if defined (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
-/* This controls a conditional in main. */
-#define LINUX_SBRK_BUG
-#endif
-
/* On the Alpha it's best to avoid including TERMIO since struct
termio and struct termios are mutually incompatible. */
#define NO_TERMIO
-/* machine description file for AMD x86-64.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- 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 i386
-/* Although we're running on an amd64 kernel, we're actually compiling for
- the x86 architecture. The user should probably have provided an
- explicit --build to `configure', but if everything else than the kernel
- is running in i386 mode, then the bug is really ours: we should have
- guessed better. */
-#include "m/intel386.h"
-#else
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="linux" */
-
-#define BITS_PER_LONG 64
-#define BITS_PER_EMACS_INT 64
-
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-
-#undef WORDS_BIG_ENDIAN
-
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
-/* Now define a symbol for the cpu type, if your compiler
- does not define it automatically:
- Ones defined so far include vax, m68000, ns16000, pyramid,
- orion, tahoe, APOLLO and many others */
-/* __x86_64 defined automatically. */
-
-/* Define the type to use. */
-#define EMACS_INT long
-#define EMACS_UINT unsigned long
-
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
- the 24-bit bit field into an int. In other words, if bit fields
- are always unsigned.
-
- This flag only matters if you use USE_LISP_UNION_TYPE. */
-
-#define EXPLICIT_SIGN_EXTEND
-
-/* Data type of load average, as read out of kmem. */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-
-/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
-#undef DATA_SEG_BITS
-
-#ifdef __FreeBSD__
-
-/* The libraries for binaries native to the build host's architecture are
- installed under /usr/lib in FreeBSD, and the ones that need special paths
- are 32-bit compatibility libraries (installed under /usr/lib32). To build
- a native binary of Emacs on FreeBSD/amd64 we can just point to /usr/lib. */
-
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
-
-/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
- The reason is that some functions in libgcc.a call functions from libc.a,
- and some libc.a functions need functions from libgcc.a. Since most
- versions of ld are one-pass linkers, we need to mention -lgcc twice,
- or else we risk getting unresolved externals. */
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
-
-#elif defined(__OpenBSD__)
-
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crtbegin.o
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
-
-#elif defined(__NetBSD__)
-
-/* LIB_STANDARD and START_FILES set correctly in s/netbsd.h */
-
-#elif defined(SOLARIS2)
-
-#undef START_FILES
-#undef LIB_STANDARD
-
-#elif defined(__APPLE__)
-
-/* LIB_STANDARD and START_FILES set correctly in s/darwin.h */
-
-#else /* !__OpenBSD__ && !__FreeBSD__ && !__NetBSD__ && !SOLARIS2
- && !__APPLE__ */
-/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
- The reason is that some functions in libgcc.a call functions from libc.a,
- and some libc.a functions need functions from libgcc.a. Since most
- versions of ld are one-pass linkers, we need to mention -lgcc twice,
- or else we risk getting unresolved externals. */
-#undef START_FILES
-#undef LIB_STANDARD
-#ifdef HAVE_LIB64_DIR
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#else
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
-#endif
-
-#endif /* __FreeBSD__ */
-#endif /* !i386 */
-
-/* arch-tag: 8a5e001d-e12e-4692-a3a6-0b15ba271c6e
- (do not change this comment) */
+/* machine description file for AMD x86-64.
+
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 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/>. */
+
+#define BITS_PER_LONG 64
+#define BITS_PER_EMACS_INT 64
+
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
+ is the most significant byte. */
+#undef WORDS_BIG_ENDIAN
+
+/* Now define a symbol for the cpu type, if your compiler
+ does not define it automatically:
+ Ones defined so far include vax, m68000, ns16000, pyramid,
+ orion, tahoe, APOLLO and many others */
+/* __x86_64 defined automatically. */
+
+/* Define the type to use. */
+#define EMACS_INT long
+#define EMACS_UINT unsigned long
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+ the 24-bit bit field into an int. In other words, if bit fields
+ are always unsigned.
+
+ This flag only matters if you use USE_LISP_UNION_TYPE. */
+#define EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem. */
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0 */
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
+#undef DATA_SEG_BITS
+
+/* arch-tag: 8a5e001d-e12e-4692-a3a6-0b15ba271c6e
+ (do not change this comment) */
/* Machine description file for ARM-based non-RISCiX machines.
- Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#undef WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. We can't
- * do this on the arm with gcc, since the first 4 args are in registers. */
-
-#ifdef __GNUC__
-#define NO_ARG_ARRAY
-#else
-#undef NO_ARG_ARRAY
-#endif
-
#define NO_REMAP
-/* armin76@gentoo.org reported that the lgcc_s flag is necessary to
- build on ARM EABI under GNU/Linux (Bug#5518). */
-#ifdef GNU_LINUX
-#define LIB_GCC -lgcc_s
-#endif
-
/* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42
(do not change this comment) */
-/* machine description file for hp9000 series 800 machines.
- Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 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/>. */
-
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="hpux" */
-
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-
-#define WORDS_BIG_ENDIAN
-
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
-/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
- the bit field into an int. In other words, if bit fields
- are always unsigned.
-
- This flag only matters if you use USE_LISP_UNION_TYPE. */
-
-#define EXPLICIT_SIGN_EXTEND
-
-\f
-/* Common definitions for HPUX and GNU/Linux. */
-
-#if defined (__hpux) || defined (GNU_LINUX)
-
-/* Define NO_REMAP if memory segmentation makes it not work well
- to change the boundary between the text section and data section
- when Emacs is dumped. If you define this, the preloaded Lisp
- code will not be sharable; but that's better than failing completely. */
-
-#define NO_REMAP
-
-#endif /* __hpux or GNU_LINUX */
-\f
-/* Stuff for just GNU/Linux. */
-
-#ifdef GNU_LINUX
-
-/* Data type of load average, as read out of kmem. */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-
-#endif /* GNU_LINUX */
-\f
-/* Stuff for just HPUX. */
-
-#ifdef __hpux
-
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
- pure and impure space as loaded can vary, and even their
- relative order cannot be relied on.
-
- Otherwise Emacs assumes that text space precedes data space,
- numerically. */
-
-#define VIRT_ADDR_VARIES
-\f
-/* the data segment on this machine always starts at address 0x40000000. */
-
-#define DATA_SEG_BITS 0x40000000
-
-#define DATA_START 0x40000000
-#define TEXT_START 0x00000000
-
-/* This machine requires completely different unexec code
- which lives in a separate file. Specify the file name. */
-
-#define UNEXEC unexhp9k800.o
-
-#define LIBS_MACHINE
-#define LIBS_DEBUG
-
-/* Include the file bsdtty.h, since this machine has job control. */
-#define NEED_BSDTTY
-
-/* Data type of load average, as read out of kmem. */
-
-#define LOAD_AVE_TYPE double
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-
-#define LOAD_AVE_CVT(x) ((int) (x * 100.0))
-
-/* The symbol in the kernel where the load average is found
- is named _avenrun. At this time there are two major flavors
- of hp-ux (there is the s800 and s300 (s200) flavors). The
- differences are thusly moved to the corresponding machine description file.
-*/
-
-/* no underscore please */
-#define LDAV_SYMBOL "avenrun"
-
-/* On USG systems these have different names. */
-
-#define index strchr
-#define rindex strrchr
-
-#endif /* __hpux */
-\f
-/* Systems with GCC don't need to lose. */
-#ifdef __NetBSD__
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# define HAVE_ALLOCA
-# endif /* __GNUC__ */
-#endif /* __NetBSD__ */
-
-/* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c
- (do not change this comment) */
+/* machine description file for hp9000 series 800 machines.
+
+Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 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/>. */
+
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
+ is the most significant byte. */
+#define WORDS_BIG_ENDIAN
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+ the bit field into an int. In other words, if bit fields
+ are always unsigned.
+
+ This flag only matters if you use USE_LISP_UNION_TYPE. */
+#define EXPLICIT_SIGN_EXTEND
+
+/* Systems with GCC don't need to lose. */
+#ifdef __NetBSD__
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA
+# endif /* __GNUC__ */
+#endif /* __NetBSD__ */
+
+/* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c
+ (do not change this comment) */
/* machine description file for the IA-64 architecture.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
- Contributed by David Mosberger <davidm@hpl.hp.com>
+
+Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
+
+Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of GNU Emacs.
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#undef WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
-
/* __ia64__ defined automatically */
-
/* Define the type to use. */
#define EMACS_INT long
#define EMACS_UINT unsigned long
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-#ifdef __ELF__
-#undef UNEXEC
-#define UNEXEC unexelf.o
-#endif
-
#ifndef NOT_C_CODE
#ifdef REL_ALLOC
/* R2 AIX machine/system dependent defines
- Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="aix3-1" */
-
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
-/* Now define a symbol for the cpu type, if your compiler
- does not define it automatically. */
-
-#define IBMR2AIX
-
-#ifndef UNEXEC
-#define UNEXEC unexaix.o
-#endif
-
-/* Define addresses, macros, change some setup for dump */
-
-#define NO_REMAP
-
/* The data segment in this machine always starts at address 0x20000000.
An address of data cannot be stored correctly in a Lisp object;
we always lose the high bits. We must tell XPNTR to add them back. */
-
-#ifndef USG5_4
#define TEXT_START 0x10000000
#define DATA_START 0x20000000
#define WORDS_BIG_ENDIAN
#define DATA_SEG_BITS 0x20000000
-/* sfreed@unm.edu says add -bI:/usr/lpp/X11/bin/smt.exp for AIX 3.2.4. */
-/* marc@sti.com (Marc Pawliger) says ibmrs6000.inp is needed to avoid
- linker error for updated X11R5 libraries, which references pthread library
- which most machines don't have. We use the name .inp instead of .imp
- because .inp is a better convention to use in make-dist for naming
- random input files. */
-#ifdef THIS_IS_MAKEFILE /* Don't use this in configure. */
-#define LD_SWITCH_MACHINE -Wl,-bnodelcsect
-#endif /* THIS_IS_MAKEFILE */
-
#ifndef NLIST_STRUCT
/* AIX supposedly doesn't use this interface, but on the RS/6000
it apparently does. */
#define NLIST_STRUCT
#endif
-/* -lpthreads seems to be necessary for Xlib in X11R6, and should be harmless
- on older versions of X where it happens to exist. */
-#ifdef HAVE_LIBPTHREADS
-#define LIBS_MACHINE -lrts -lIM -liconv -lpthreads
-#else
-/* IBM's X11R5 use -lIM and -liconv in AIX 3.2.2. */
-#define LIBS_MACHINE -lrts -lIM -liconv
-#endif
-
-#else /* USG5_4 */
-#undef WORDS_BIG_ENDIAN
-#define DATA_SEG_BITS 0
-#define LIBS_MACHINE
-#endif /* USG5_4 */
-
#undef ADDR_CORRECT
#define ADDR_CORRECT(x) ((int)(x))
-#define START_FILES
/*** BUILD 9008 - FIONREAD problem still exists in X-Windows. ***/
#define BROKEN_FIONREAD
/* As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h.
#define BROKEN_SIGPTY
#define BROKEN_SIGPOLL
-#define ORDINARY_LINK
-
/* arch-tag: 028318ee-a7ae-4a08-804d-cc1e6588d003
(do not change this comment) */
+++ /dev/null
-#!
-pthread_yield
-
-# arch-tag: fc6d01ea-c488-4862-bbdb-e8d3e0f6fdb3
/* machine description file template.
- Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the 24-bit bit field into an int. In other words, if bit fields
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* Define VIRT_ADDR_VARIES if the virtual addresses of
Otherwise Emacs assumes that text space precedes data space,
numerically. */
-
#define VIRT_ADDR_VARIES
/* arch-tag: d8a0ffa4-a8f0-4736-90d3-7fd7b21b8314
/* machine description file for IBM S390 in 64-bit mode
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+
+Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* This file was made by copying the significant parts of amdx86-64.h
into ibms390.h. */
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="<name of system .h file here, without the s- or .h>"
-
-NOTE-START
-IBM s390 64 bits (-machine=ibms390x64)
-
- The possibilities for -opsystem are: gnu-linux.
-
-NOTE-END */
-
+/* Used for machine IBM s390 64 bits with opsys gnu-linux. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Define the type to use. */
#define EMACS_INT long
#define EMACS_UINT unsigned long
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#undef EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* Define VIRT_ADDR_VARIES if the virtual addresses of
Otherwise Emacs assumes that text space precedes data space,
numerically. */
-
#define VIRT_ADDR_VARIES
/* Define HAVE_ALLOCA to say that the system provides a properly
working alloca function and it should be used. Undefine it if an
assembler-language alloca in the file alloca.s should be used. */
-
#define HAVE_ALLOCA
/* On the 64 bit architecture, we can use 60 bits for addresses */
-
#define VALBITS 60
-#define LINKER $(CC) -nostdlib
-
/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
-
#define XPNTR(a) XUINT (a)
-#undef START_FILES
-#ifdef HAVE_LIB64_DIR
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-#else
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
-#endif
-
-#undef LIB_STANDARD
-#ifdef HAVE_LIB64_DIR
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#else
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
-#endif
-
/* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
(do not change this comment) */
-/* Machine description file for intel 386.
- Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 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/>. */
-
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="note"
-
-NOTE-START
-Intel 386 (-machine=intel386)
-
- The possibilities for -opsystem are: bsd4-2, usg5-2-2, usg5-3,
- isc2-2, 386-ix, and linux.
-
- 18.58 should support a wide variety of operating systems.
- Use linux for Linux.
- It isn't clear what to do on an SCO system.
-
-NOTE-END */
-
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-
-#undef WORDS_BIG_ENDIAN
-
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-/* #define NO_ARG_ARRAY */
-
-/* crt0.c, if it is used, should use the i386-bsd style of entry.
- with no extra dummy args. On USG and XENIX,
- NO_REMAP says this isn't used. */
-
-#define CRT0_DUMMIES bogus_fp,
-
-#ifdef SOLARIS2
-/* Data type of load average, as read out of kmem. */
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-/* This is totally uncalibrated. */
-#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
-
-/* J.W.Hawtin@lut.ac.uk say Solaris 2.4 as well as Solaris 2.1 on X86
- requires -lkvm as well.
- And handa@etl.gov.jp says that -lkvm needs -llelf, at least on 2.5. */
-#define LIBS_MACHINE -lkvm -lelf
-
-/* configure thinks solaris X86 has gethostname, but it does not work,
- so undefine it. */
-#undef HAVE_GETHOSTNAME
-
-#else /* not SOLARIS2 */
-#ifdef USG5_4 /* Older USG systems do not support the load average. */
-/* Data type of load average, as read out of kmem. */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0 */
-/* This is totally uncalibrated. */
-
-#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
-#define FSCALE 256.0
-#endif /* USG5_4 */
-#endif /* not SOLARIS2 */
-
-#ifdef USG
-#define TEXT_START 0
-#endif /* USG */
-
-#ifdef MSDOS
-#define NO_REMAP
-#endif
-
-#ifdef WINDOWSNT
-#define VIRT_ADDR_VARIES
-#define DATA_START get_data_start ()
-#define NO_ARG_ARRAY
-#endif
-
-#ifdef GNU_LINUX
-/* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */
-/* we cannot get the maximum address for brk */
-#define ULIMIT_BREAK_VALUE (32*1024*1024)
-
-#define SEGMENT_MASK ((SEGMENT_SIZE)-1)
-#endif
-
-/* arch-tag: 746338f0-cb7b-4f49-a98c-cb50817cf2ec
- (do not change this comment) */
+/* Machine description file for intel 386.
+
+Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 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/>. */
+
+
+/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
+ is the most significant byte. */
+#undef WORDS_BIG_ENDIAN
+
+#ifdef USG
+#define TEXT_START 0
+#endif /* USG */
+
+#ifdef WINDOWSNT
+#define VIRT_ADDR_VARIES
+#define DATA_START get_data_start ()
+#endif
+
+#ifdef GNU_LINUX
+/* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */
+/* we cannot get the maximum address for brk */
+#define ULIMIT_BREAK_VALUE (32*1024*1024)
+
+#define SEGMENT_MASK ((SEGMENT_SIZE)-1)
+#endif
+
+/* arch-tag: 746338f0-cb7b-4f49-a98c-cb50817cf2ec
+ (do not change this comment) */
/* machine description file for Iris-4D machines. Use with s/irix*.h.
- Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the bit field into an int. In other words, if bit fields
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
-/* This machine requires completely different unexec code
- which lives in a separate file. Specify the file name. */
-
-#undef UNEXEC
-#define UNEXEC unexelf.o
-
#define TEXT_START 0x400000
-/*
- * DATA_SEG_BITS forces extra bits to be or'd in with any pointers which
- * were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for
- * the value field of a LISP_OBJECT).
- */
-
+/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which
+ were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for
+ the value field of a LISP_OBJECT). */
#define DATA_START 0x10000000
#define DATA_SEG_BITS 0x10000000
-#undef LIBS_MACHINE
-#define LIBS_MACHINE
-#define LIBS_DEBUG
-\f
-/* Use terminfo instead of termcap. */
-
-#define TERMINFO
-
-/* Letter to use in finding device name of first pty,
- if system supports pty's. 'a' means it is /dev/ptya0 */
-
-#undef FIRST_PTY_LETTER
-#define FIRST_PTY_LETTER 'q'
\f
#if _MIPS_SZLONG != 64
/* fixme: should there be 64-bit definitions? (The ones below aren't OK.) */
/* The standard definitions of these macros would work ok,
but these are faster because the constants are short. */
-
#define XUINT(a) (((unsigned)(a) << BITS_PER_INT-VALBITS) >> BITS_PER_INT-VALBITS)
#define XSET(var, type, ptr) \
/* Machine description file for generic Motorola 68k.
- Copyright (C) 1985, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
-
#ifndef m68k
#define m68k
#endif
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
#ifdef GNU_LINUX
/* machine description file For the powerpc Macintosh.
- Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
#if (defined (__NetBSD__) || defined (__OpenBSD__)) && defined (__ELF__)
#define HAVE_TEXT_START
#endif
-/* NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says this is needed
- For MkLinux/LinuxPPC. */
-
-#ifdef GNU_LINUX
-#define LINKER $(CC) -nostdlib
-/* s/gnu-linux.h defines this to `-z nocombreloc' which does not work here
- because prefix-args is not used. */
-#undef LD_SWITCH_SYSTEM_TEMACS
-#define LD_SWITCH_MACHINE_TEMACS -Xlinker -znocombreloc
-#ifdef _ARCH_PPC64
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#endif
-#endif
-
#ifdef _ARCH_PPC64
#ifndef _LP64
#define _LP64
/* m- file for Mips machines.
- Copyright (C) 1987, 1992, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1987, 1992, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="note"
-
-NOTE-START
-This is used on GNU/Linux and netbsd.
-NOTE-END */
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#if ! (defined (__MIPSEL__) || defined (MIPSEL) || defined (_MIPSEL))
#define WORDS_BIG_ENDIAN
#endif
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the 24-bit bit field into an int. In other words, if bit fields
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Describe layout of the address space in an executing process. */
-
#define TEXT_START 0x00400000
-\f
-#if 0 /* These definitions were advantageous when not using
- USE_LSB_TAG. With that, they get ignored but cause errors. */
-
-#define DATA_SEG_BITS 0x10000000
-
-/* The standard definitions of these macros would work ok,
- but these are faster because the constants are short. */
-
-#define XUINT(a) (((unsigned)(a) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
-
-#define XSET(var, type, ptr) \
- ((var) = \
- ((int)(type) << VALBITS) \
- + (((unsigned) (ptr) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS)))
-
/* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee
(do not change this comment) */
-
-#endif /* 0 */
-
# define WORDS_BIG_ENDIAN
#endif
-#define NO_ARG_ARRAY
-
/* arch-tag: 1b01b84f-f044-4afa-aa4b-caa54ec38966
(do not change this comment) */
/* machine description file for Sun 4 SPARC.
- Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="note"
-
-NOTE-START
-Use -opsystem=sunos4 for operating system version 4, and
--opsystem=bsd4-2 for earlier versions.
-NOTE-END */
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* __sparc__ is defined by the compiler by default. */
/* XINT must explicitly sign-extend
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* Mask for address bits within a memory segment */
-
#define SEGMENT_MASK (SEGSIZ - 1)
#ifdef __arch64__ /* GCC, 64-bit ABI. */
+
#define BITS_PER_LONG 64
-#ifdef __linux__
-#undef START_FILES
-#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
-
-/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
- The reason is that some functions in libgcc.a call functions from libc.a,
- and some libc.a functions need functions from libgcc.a. Since most
- versions of ld are one-pass linkers, we need to mention -lgcc twice,
- or else we risk getting unresolved externals. */
-#undef LIB_STANDARD
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
-#endif
#ifndef _LP64
-#define _LP64 /* Done on Alpha -- not sure if it
- should be here. -- fx */
-#endif
+#define _LP64 /* Done on Alpha -- not sure if it should be here. -- fx */
#endif
+#endif /* __arch64__ */
+
/* arch-tag: 0a6f7882-33fd-4811-9832-7466c51e50f7
(do not change this comment) */
/* machine description file template.
- Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#define WORDS_BIG_ENDIAN
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments. */
-
-#define NO_ARG_ARRAY
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically.
Ones defined so far include m68k and many others */
are always unsigned.
This flag only matters if you use USE_LISP_UNION_TYPE. */
-
#define EXPLICIT_SIGN_EXTEND
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE long
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
/* Define CANNOT_DUMP on machines where unexec does not work.
Then the function dump-emacs will not be defined
and temacs will do (load "loadup") automatically unless told otherwise. */
-
#define CANNOT_DUMP
/* Define VIRT_ADDR_VARIES if the virtual addresses of
Otherwise Emacs assumes that text space precedes data space,
numerically. */
-
#define VIRT_ADDR_VARIES
/* Define NO_REMAP if memory segmentation makes it not work well
to change the boundary between the text section and data section
when Emacs is dumped. If you define this, the preloaded Lisp
code will not be sharable; but that's better than failing completely. */
-
#define NO_REMAP
/* Some really obscure 4.2-based systems (like Sequent DYNIX)
- * do not support asynchronous I/O (using SIGIO) on sockets,
- * even though it works fine on tty's. If you have one of
- * these systems, define the following, and then use it in
- * config.h (or elsewhere) to decide when (not) to use SIGIO.
- *
- * You'd think this would go in an operating-system description file,
- * but since it only occurs on some, but not all, BSD systems, the
- * reasonable place to select for it is in the machine description
- * file.
- */
-
+ do not support asynchronous I/O (using SIGIO) on sockets,
+ even though it works fine on tty's. If you have one of
+ these systems, define the following, and then use it in
+ config.h (or elsewhere) to decide when (not) to use SIGIO.
+
+ You'd think this would go in an operating-system description file,
+ but since it only occurs on some, but not all, BSD systems, the
+ reasonable place to select for it is in the machine description file. */
#define NO_SOCK_SIGIO
-
-/* After adding support for a new system, modify the large case
- statement in the `configure' script to recognize reasonable
+/* After adding support for a new machine, modify the large case
+ statement in configure.in to recognize reasonable
configuration names, and add a description of the system to
`etc/MACHINES'.
+ Check for any tests of $machine in configure.in, and add an entry
+ for the new machine if needed.
+
If you've just fixed a problem in an existing configuration file,
you should also check `etc/MACHINES' to make sure its descriptions
of known problems in that configuration should be updated. */
/* machine description file for vax.
- Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* The following line tells the configuration script what sort of
- operating system this machine is likely to run.
- USUAL-OPSYS="note"
-
-NOTE-START
-The vax (-machine=vax) runs zillions of different operating systems.
-
-NOTE-END */
-
/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
is the most significant byte. */
-
#undef WORDS_BIG_ENDIAN
/* #define vax -- appears to be done automatically */
-/* crt0.c should use the vax-bsd style of entry, with no dummy args. */
-
-#define CRT0_DUMMIES
-
-#ifdef BSD_SYSTEM
/* USG systems I know of running on Vaxes do not actually
support the load average, so disable it for them. */
/* Data type of load average, as read out of kmem. */
-
#define LOAD_AVE_TYPE double
/* Convert that into an integer that is 100 for a load average of 1.0 */
-
#define LOAD_AVE_CVT(x) ((int) ((x) * 100.0))
-#endif /* BSD_SYSTEM */
-
-#ifdef BSD4_2
#define HAVE_FTIME
-#endif
/* arch-tag: 508bdf7a-01a0-4ce0-8eba-0704d0df55a0
(do not change this comment) */
Add a license notice if this grows to > 10 lines of code. */
-#define NO_ARG_ARRAY
-
#ifdef __LITTLE_ENDIAN
#undef WORDS_BIG_ENDIAN
#else
$(BLD)/callint.$(O) \
$(BLD)/callproc.$(O) \
$(BLD)/casefiddle.$(O) \
- $(BLD)/cm.$(O) \
$(BLD)/cmds.$(O) \
$(BLD)/data.$(O) \
$(BLD)/dired.$(O) \
$(BLD)/syntax.$(O) \
$(BLD)/sysdep.$(O) \
$(BLD)/term.$(O) \
- $(BLD)/termcap.$(O) \
$(BLD)/tparam.$(O) \
$(BLD)/undo.$(O) \
$(BLD)/unexw32.$(O) \
$(BLD)/vm-limit.$(O) \
$(BLD)/region-cache.$(O) \
$(BLD)/strftime.$(O) \
+ $(BLD)/bidi.$(O) \
$(BLD)/charset.$(O) \
$(BLD)/character.$(O) \
$(BLD)/chartab.$(O) \
$(SRC)/syssignal.h \
$(SRC)/systime.h
+$(BLD)/bidi.$(O) : \
+ $(SRC)/bidi.c \
+ $(CONFIG_H) \
+ $(SRC)/lisp.h \
+ $(SRC)/buffer.h \
+ $(SRC)/character.h \
+ $(SRC)/dispextern.h \
+ $(SRC)/w32gui.h
+
$(BLD)/buffer.$(O) : \
$(SRC)/buffer.c \
$(CONFIG_H) \
$(SRC)/character.h \
$(SRC)/charset.h
-$(BLD)/cm.$(O) : \
- $(SRC)/cm.c \
- $(CONFIG_H) \
- $(SRC)/lisp.h \
- $(SRC)/cm.h \
- $(SRC)/dispextern.h \
- $(SRC)/frame.h \
- $(SRC)/termchar.h \
- $(SRC)/termhooks.h \
- $(SRC)/w32gui.h
-
$(BLD)/cmds.$(O) : \
$(SRC)/cmds.c \
$(CONFIG_H) \
$(SRC)/commands.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
+ $(SRC)/frame.h \
$(SRC)/keyboard.h \
$(SRC)/systime.h \
$(SRC)/w32gui.h
$(SRC)/w32gui.h \
$(SRC)/window.h
-$(BLD)/termcap.$(O) : \
- $(SRC)/termcap.c \
- $(CONFIG_H) \
- $(EMACS_ROOT)/nt/inc/unistd.h \
- $(EMACS_ROOT)/nt/inc/sys/file.h \
- $(SRC)/lisp.h
-
$(BLD)/terminal.$(O) : \
$(SRC)/terminal.c \
$(CONFIG_H) \
ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name);
}
+#elif defined (USE_LUCID) && defined (HAVE_XFT)
+ if (STRINGP (pane_name))
+ {
+ pane_name = ENCODE_UTF_8 (pane_name);
+ ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name);
+ }
#elif !defined (HAVE_MULTILINGUAL_MENU)
if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
{
descrip = ENCODE_SYSTEM (descrip);
ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
}
+#elif USE_LUCID
+ if (STRINGP (item_name))
+ {
+ item_name = ENCODE_UTF_8 (item_name);
+ ASET (menu_items, i + MENU_ITEMS_ITEM_NAME, item_name);
+ }
+
+ if (STRINGP (descrip))
+ {
+ descrip = ENCODE_UTF_8 (descrip);
+ ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
+ }
#elif !defined (HAVE_MULTILINGUAL_MENU)
if (STRING_MULTIBYTE (item_name))
{
#include <sys/stat.h> /* for _fixpath */
#include <unistd.h> /* for chdir, dup, dup2, etc. */
#include <dir.h> /* for getdisk */
-#if __DJGPP__ >= 2
#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */
#include <fcntl.h>
#include <io.h> /* for setmode */
#include <sys/farptr.h> /* for _farsetsel, _farnspokeb */
#include <libc/dosio.h> /* for _USE_LFN */
#include <conio.h> /* for cputs */
-#endif
#include "msdos.h"
#include "systime.h"
#define _dos_ds _go32_info_block.selector_for_linear_memory
#endif
-#if __DJGPP__ > 1
-
#include <signal.h>
#include "syssignal.h"
#endif /* GNU_MALLOC */
#endif /* not SYSTEM_MALLOC */
-#endif /* __DJGPP__ > 1 */
static unsigned long
event_timestamp ()
colors for newly-created frames. */
static int initial_screen_colors[2];
-#if __DJGPP__ > 1
/* Update the screen from a part of relocated DOS/V screen buffer which
begins at OFFSET and includes COUNT characters. */
static void
regs.x.cx = count;
__dpmi_int (0x10, ®s);
}
-#endif
static void
dos_direct_output (y, x, buf, len)
int t = t0 + (int) ScreenPrimary;
int l0 = len;
-#if (__DJGPP__ < 2)
- while (--len >= 0) {
- dosmemput (buf++, 1, t);
- t += 2;
- }
-#else
/* This is faster. */
for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++)
_farnspokeb (t, *buf);
if (screen_virtual_segment)
dosv_refresh_virtual_screen (t0, l0);
-#endif
-}
-#endif
-
-/* Flash the screen as a substitute for BEEPs. */
-
-#if (__DJGPP__ < 2)
-static void
-do_visible_bell (xorattr)
- unsigned char xorattr;
-{
- asm volatile
- (" movb $1,%%dl \n\
-visible_bell_0: \n\
- movl _ScreenPrimary,%%eax \n\
- call dosmemsetup \n\
- movl %%eax,%%ebx \n\
- movl %1,%%ecx \n\
- movb %0,%%al \n\
- incl %%ebx \n\
-visible_bell_1: \n\
- xorb %%al,%%gs:(%%ebx) \n\
- addl $2,%%ebx \n\
- decl %%ecx \n\
- jne visible_bell_1 \n\
- decb %%dl \n\
- jne visible_bell_3 \n\
-visible_bell_2: \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- decw %%cx \n\
- jne visible_bell_2 \n\
- jmp visible_bell_0 \n\
-visible_bell_3:"
- : /* no output */
- : "m" (xorattr), "g" (screen_size)
- : "%eax", "%ebx", /* "%gs",*/ "%ecx", "%edx");
-}
-
-static void
-ScreenVisualBell (void)
-{
- /* This creates an xor-mask that will swap the default fore- and
- background colors. */
- do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
- ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
- * 0x11) & 0x7f);
}
#endif
/* If the user specified a special video mode for these dimensions,
use that mode. */
sprintf (video_name, "screen-dimensions-%dx%d", *rows, *cols);
- video_mode = XSYMBOL (Fintern_soft (build_string (video_name),
- Qnil))-> value;
+ video_mode = Fsymbol_value (Fintern_soft (build_string (video_name), Qnil));
if (INTEGERP (video_mode)
&& (video_mode_value = XINT (video_mode)) > 0)
/* Find one of the dimensions supported by standard EGA/VGA
which gives us at least the required dimensions. */
-
-#if __DJGPP__ > 1
-
else
{
static struct {
}
}
-#else /* not __DJGPP__ > 1 */
-
- else if (*rows <= 25)
- {
- if (current_rows != 25 || current_cols != 80)
- {
- regs.x.ax = 3;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 0x1101;
- regs.h.bl = 0;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 0x1200;
- regs.h.bl = 32;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 3;
- int86 (0x10, ®s, ®s);
- }
- }
- else if (*rows <= 50)
- if (have_vga && (current_rows != 50 || current_cols != 80)
- || *rows <= 43 && (current_rows != 43 || current_cols != 80))
- {
- regs.x.ax = 3;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 0x1112;
- regs.h.bl = 0;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 0x1200;
- regs.h.bl = 32;
- int86 (0x10, ®s, ®s);
- regs.x.ax = 0x0100;
- regs.x.cx = 7;
- int86 (0x10, ®s, ®s);
- }
-#endif /* not __DJGPP__ > 1 */
if (have_mouse)
{
screen_size_Y = *rows;
screen_size = *cols * *rows;
-#if __DJGPP__ > 1
/* If the dimensions changed, the mouse highlight info is invalid. */
if (current_rows != *rows || current_cols != *cols)
{
dpyinfo->mouse_face_window = Qnil;
}
}
-#endif
/* Enable bright background colors. */
bright_bg ();
static void
msdos_set_cursor_shape (struct frame *f, int start_line, int width)
{
-#if __DJGPP__ > 1
unsigned desired_cursor;
__dpmi_regs regs;
int max_line, top_line, bot_line;
regs.h.ah = 1;
regs.x.cx = desired_cursor;
__dpmi_int (0x10, ®s);
-#endif /* __DJGPP__ > 1 */
}
static void
startup_screen_size_Y = screen_size_Y;
startup_screen_attrib = ScreenAttrib;
-#if __DJGPP__ > 1
/* Is DOS/V (or any other RSIS software which relocates
the screen) installed? */
{
ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset;
}
}
-#endif /* __DJGPP__ > 1 */
ScreenGetCursor (&startup_pos_Y, &startup_pos_X);
ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2));
return np - startp;
}
-#if defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 0
-
-/* In DJGPP v2.0, library `write' can call `malloc', which might
- cause relocation of the buffer whose address we get in ADDR.
- Here is a version of `write' that avoids calling `malloc',
- to serve us until such time as the library is fixed.
- Actually, what we define here is called `__write', because
- `write' is a stub that just jmp's to `__write' (to be
- POSIXLY-correct with respect to the global name-space). */
-
-#include <io.h> /* for _write */
-#include <libc/dosio.h> /* for __file_handle_modes[] */
-
-static char xbuf[64 * 1024]; /* DOS cannot write more in one chunk */
-
-#define XBUF_END (xbuf + sizeof (xbuf) - 1)
-
-int
-__write (int handle, const void *buffer, size_t count)
-{
- if (count == 0)
- return 0;
-
- if(__file_handle_modes[handle] & O_BINARY)
- return _write (handle, buffer, count);
- else
- {
- char *xbp = xbuf;
- const char *bp = buffer;
- int total_written = 0;
- int nmoved = 0, ncr = 0;
-
- while (count)
- {
- /* The next test makes sure there's space for at least 2 more
- characters in xbuf[], so both CR and LF can be put there. */
- if (xbp < XBUF_END)
- {
- if (*bp == '\n')
- {
- ncr++;
- *xbp++ = '\r';
- }
- *xbp++ = *bp++;
- nmoved++;
- count--;
- }
- if (xbp >= XBUF_END || !count)
- {
- size_t to_write = nmoved + ncr;
- int written = _write (handle, xbuf, to_write);
-
- if (written == -1)
- return -1;
- else
- total_written += nmoved; /* CRs aren't counted in ret value */
-
- /* If some, but not all were written (disk full?), return
- an estimate of the total written bytes not counting CRs. */
- if (written < to_write)
- return total_written - (to_write - written) * nmoved/to_write;
-
- nmoved = 0;
- ncr = 0;
- xbp = xbuf;
- }
- }
- return total_written;
- }
-}
-
-/* A low-level file-renaming function which works around Windows 95 bug.
- This is pulled directly out of DJGPP v2.01 library sources, and only
- used when you compile with DJGPP v2.0. */
-
-#include <io.h>
-
-int _rename(const char *old, const char *new)
-{
- __dpmi_regs r;
- int olen = strlen(old) + 1;
- int i;
- int use_lfn = _USE_LFN;
- char tempfile[FILENAME_MAX];
- const char *orig = old;
- int lfn_fd = -1;
-
- r.x.dx = __tb_offset;
- r.x.di = __tb_offset + olen;
- r.x.ds = r.x.es = __tb_segment;
-
- if (use_lfn)
- {
- /* Windows 95 bug: for some filenames, when you rename
- file -> file~ (as in Emacs, to leave a backup), the
- short 8+3 alias doesn't change, which effectively
- makes OLD and NEW the same file. We must rename
- through a temporary file to work around this. */
-
- char *pbase = 0, *p;
- static char try_char[] = "abcdefghijklmnopqrstuvwxyz012345789";
- int idx = sizeof(try_char) - 1;
-
- /* Generate a temporary name. Can't use `tmpnam', since $TMPDIR
- might point to another drive, which will fail the DOS call. */
- strcpy(tempfile, old);
- for (p = tempfile; *p; p++) /* ensure temporary is on the same drive */
- if (*p == '/' || *p == '\\' || *p == ':')
- pbase = p;
- if (pbase)
- pbase++;
- else
- pbase = tempfile;
- strcpy(pbase, "X$$djren$$.$$temp$$");
-
- do
- {
- if (idx <= 0)
- return -1;
- *pbase = try_char[--idx];
- } while (_chmod(tempfile, 0) != -1);
-
- r.x.ax = 0x7156;
- _put_path2(tempfile, olen);
- _put_path(old);
- __dpmi_int(0x21, &r);
- if (r.x.flags & 1)
- {
- errno = __doserr_to_errno(r.x.ax);
- return -1;
- }
-
- /* Now create a file with the original name. This will
- ensure that NEW will always have a 8+3 alias
- different from that of OLD. (Seems to be required
- when NameNumericTail in the Registry is set to 0.) */
- lfn_fd = _creat(old, 0);
-
- olen = strlen(tempfile) + 1;
- old = tempfile;
- r.x.di = __tb_offset + olen;
- }
-
- for (i=0; i<2; i++)
- {
- if(use_lfn)
- r.x.ax = 0x7156;
- else
- r.h.ah = 0x56;
- _put_path2(new, olen);
- _put_path(old);
- __dpmi_int(0x21, &r);
- if(r.x.flags & 1)
- {
- if (r.x.ax == 5 && i == 0) /* access denied */
- remove(new); /* and try again */
- else
- {
- errno = __doserr_to_errno(r.x.ax);
-
- /* Restore to original name if we renamed it to temporary. */
- if (use_lfn)
- {
- if (lfn_fd != -1)
- {
- _close (lfn_fd);
- remove (orig);
- }
- _put_path2(orig, olen);
- _put_path(tempfile);
- r.x.ax = 0x7156;
- __dpmi_int(0x21, &r);
- }
- return -1;
- }
- }
- else
- break;
- }
-
- /* Success. Delete the file possibly created to work
- around the Windows 95 bug. */
- if (lfn_fd != -1)
- return (_close (lfn_fd) == 0) ? remove (orig) : -1;
- return 0;
-}
-
-#endif /* __DJGPP__ == 2 && __DJGPP_MINOR__ == 0 */
-
DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names,
0, 0, 0,
doc: /* Return non-nil if long file names are supported on MS-DOS. */)
static int break_stat; /* BREAK check mode status. */
static int stdin_stat; /* stdin IOCTL status. */
-#if __DJGPP__ < 2
-
-/* These must be global. */
-static _go32_dpmi_seginfo ctrl_break_vector;
-static _go32_dpmi_registers ctrl_break_regs;
-static int ctrlbreakinstalled = 0;
-
-/* Interrupt level detection of Ctrl-Break. Don't do anything fancy here! */
-
-void
-ctrl_break_func (regs)
- _go32_dpmi_registers *regs;
-{
- Vquit_flag = Qt;
-}
-
-void
-install_ctrl_break_check ()
-{
- if (!ctrlbreakinstalled)
- {
- /* Don't press Ctrl-Break if you don't have either DPMI or Emacs
- was compiler with Djgpp 1.11 maintenance level 5 or later! */
- ctrlbreakinstalled = 1;
- ctrl_break_vector.pm_offset = (int) ctrl_break_func;
- _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector,
- &ctrl_break_regs);
- _go32_dpmi_set_real_mode_interrupt_vector (0x1b, &ctrl_break_vector);
- }
-}
-
-#endif /* __DJGPP__ < 2 */
-
/* Turn off Dos' Ctrl-C checking and inhibit interpretation of
control chars by DOS. Determine the keyboard type. */
break_stat = getcbrk ();
setcbrk (0);
-#if __DJGPP__ < 2
- install_ctrl_break_check ();
-#endif
if (first_time)
{
mouse_button_count = outregs.x.bx;
#ifndef HAVE_X_WINDOWS
-#if __DJGPP__ >= 2
/* Save the cursor shape used outside Emacs. */
outside_cursor = _farpeekw (_dos_ds, 0x460);
-#endif
#endif
}
first_time = 0;
-#if __DJGPP__ >= 2
-
stdin_stat = setmode (fileno (stdin), O_BINARY);
return (stdin_stat != -1);
}
else
return (setmode (fileno (stdin), O_BINARY) != -1);
-
-#else /* __DJGPP__ < 2 */
-
- }
-
- /* I think it is wrong to overwrite `stdin_stat' every time
- but the first one this function is called, but I don't
- want to change the way it used to work in v1.x.--EZ */
-
- inregs.x.ax = 0x4400; /* Get IOCTL status. */
- inregs.x.bx = 0x00; /* 0 = stdin. */
- intdos (&inregs, &outregs);
- stdin_stat = outregs.h.dl;
-
- inregs.x.dx = stdin_stat | 0x0020; /* raw mode */
- inregs.x.ax = 0x4401; /* Set IOCTL status */
- intdos (&inregs, &outregs);
- return !outregs.x.cflag;
-
-#endif /* __DJGPP__ < 2 */
}
/* Restore status of standard input and Ctrl-C checking. */
setcbrk (break_stat);
mouse_off ();
-#if __DJGPP__ >= 2
-
#ifndef HAVE_X_WINDOWS
/* Restore the cursor shape we found on startup. */
if (outside_cursor)
#endif
return (setmode (fileno (stdin), stdin_stat) != -1);
-
-#else /* not __DJGPP__ >= 2 */
-
- inregs.x.ax = 0x4401; /* Set IOCTL status. */
- inregs.x.bx = 0x00; /* 0 = stdin. */
- inregs.x.dx = stdin_stat;
- intdos (&inregs, &outregs);
- return !outregs.x.cflag;
-
-#endif /* not __DJGPP__ >= 2 */
}
\f
dup2 (tempout, 1);
dup2 (temperr, 2);
-#if __DJGPP__ > 1
-
if (msshell && !argv[3])
{
/* MS-DOS native shells are too restrictive. For starters, they
result = 0; /* emulate Unixy shell behavior with empty cmd line */
}
else
-
-#endif /* __DJGPP__ > 1 */
-
- result = spawnve (P_WAIT, argv[0], argv, envv);
+ result = spawnve (P_WAIT, argv[0], argv, envv);
dup2 (inbak, 0);
dup2 (outbak, 1);
exit (1);
}
\f
-#if __DJGPP__ < 2
-
-/* ------------------------- Compatibility functions -------------------
- * gethostname
- * gettimeofday
- */
-
-/* Hostnames for a pc are not really funny,
- but they are used in change log so we emulate the best we can. */
-
-gethostname (p, size)
- char *p;
- int size;
-{
- char *q = egetenv ("HOSTNAME");
-
- if (!q) q = "pc";
- strcpy (p, q);
- return 0;
-}
-
-/* When time zones are set from Ms-Dos too many C-libraries are playing
- tricks with time values. We solve this by defining our own version
- of `gettimeofday' bypassing GO32. Our version needs to be initialized
- once and after each call to `tzset' with TZ changed. That is
- accomplished by aliasing tzset to init_gettimeofday. */
-
-static struct tm time_rec;
-
-int
-gettimeofday (struct timeval *tp, struct timezone *tzp)
-{
- if (tp)
- {
- struct time t;
- struct tm tm;
-
- gettime (&t);
- if (t.ti_hour < time_rec.tm_hour) /* midnight wrap */
- {
- struct date d;
- getdate (&d);
- time_rec.tm_year = d.da_year - 1900;
- time_rec.tm_mon = d.da_mon - 1;
- time_rec.tm_mday = d.da_day;
- }
-
- time_rec.tm_hour = t.ti_hour;
- time_rec.tm_min = t.ti_min;
- time_rec.tm_sec = t.ti_sec;
-
- tm = time_rec;
- tm.tm_gmtoff = dos_timezone_offset;
-
- tp->tv_sec = mktime (&tm); /* may modify tm */
- tp->tv_usec = t.ti_hund * (1000000 / 100);
- }
- /* Ignore tzp; it's obsolescent. */
- return 0;
-}
-
-#endif /* __DJGPP__ < 2 */
-
/*
- * A list of unimplemented functions that we silently ignore.
+ * A few unimplemented functions that we silently ignore.
*/
-
-#if __DJGPP__ < 2
-unsigned alarm (s) unsigned s; {}
-fork () { return 0; }
-int kill (x, y) int x, y; { return -1; }
-nice (p) int p; {}
-void volatile pause () {}
-sigsetmask (x) int x; { return 0; }
-sigblock (mask) int mask; { return 0; }
-#endif
-
setpgrp () {return 0; }
setpriority (x,y,z) int x,y,z; { return 0; }
-
-#if __DJGPP__ > 1
-#if __DJGPP_MINOR__ < 2
-
-#ifdef POSIX_SIGNALS
+\f
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
/* Augment DJGPP library POSIX signal functions. This is needed
as of DJGPP v2.01, but might be in the library in later releases. */
return 0;
}
-#else /* not POSIX_SIGNALS */
-
-sigsetmask (x) int x; { return 0; }
-sigblock (mask) int mask; { return 0; }
-
-#endif /* not POSIX_SIGNALS */
#endif /* not __DJGPP_MINOR__ < 2 */
-#endif /* __DJGPP__ > 1 */
#ifndef HAVE_SELECT
#include "sysselect.h"
dos_ttcooked ();
ScreenSetCursor (10, 0);
cputs ("\r\n\nEmacs aborted!\r\n");
-#if __DJGPP__ > 1
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
if (screen_virtual_segment)
dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X);
#else /* __DJGPP_MINOR__ >= 2 */
raise (SIGABRT);
#endif /* __DJGPP_MINOR__ >= 2 */
-#endif
exit (2);
}
#endif
--- /dev/null
+/* autodeps.mk --- src/Makefile fragment for GNU Emacs
+
+Copyright (C) 2008, 2009, 2010 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:
+
+This is inserted in src/Makefile if HAVE_NS.
+
+The only reason this is in a separate file is because $ns_appdir,
+which appears as a target, is empty on non-NS builds. Some makes
+do not like empty targets, even if they are never used. */
+
+${ns_appdir}: ${ns_appsrc}
+ rm -fr ${ns_appdir}
+ mkdir -p ${ns_appdir}
+ ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - )
+
+${ns_appbindir}Emacs: emacs${EXEEXT}
+ mkdir -p ${ns_appbindir}
+ cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
+
+ns-app: ${ns_appdir} ${ns_appbindir}Emacs
+
+/* ns.mk ends here */
strout ("#<misc free cell>", -1, -1, printcharfun, 0);
break;
- case Lisp_Misc_Intfwd:
- sprintf (buf, "#<intfwd to %ld>", (long) *XINTFWD (obj)->intvar);
- strout (buf, -1, -1, printcharfun, 0);
- break;
-
- case Lisp_Misc_Boolfwd:
- sprintf (buf, "#<boolfwd to %s>",
- (*XBOOLFWD (obj)->boolvar ? "t" : "nil"));
- strout (buf, -1, -1, printcharfun, 0);
- break;
-
- case Lisp_Misc_Objfwd:
- strout ("#<objfwd to ", -1, -1, printcharfun, 0);
- print_object (*XOBJFWD (obj)->objvar, printcharfun, escapeflag);
- PRINTCHAR ('>');
- break;
-
- case Lisp_Misc_Buffer_Objfwd:
- strout ("#<buffer_objfwd to ", -1, -1, printcharfun, 0);
- print_object (PER_BUFFER_VALUE (current_buffer,
- XBUFFER_OBJFWD (obj)->offset),
- printcharfun, escapeflag);
- PRINTCHAR ('>');
- break;
-
- case Lisp_Misc_Kboard_Objfwd:
- strout ("#<kboard_objfwd to ", -1, -1, printcharfun, 0);
- print_object (*(Lisp_Object *) ((char *) current_kboard
- + XKBOARD_OBJFWD (obj)->offset),
- printcharfun, escapeflag);
- PRINTCHAR ('>');
- break;
-
- case Lisp_Misc_Buffer_Local_Value:
- strout ("#<buffer_local_value ", -1, -1, printcharfun, 0);
- if (XBUFFER_LOCAL_VALUE (obj)->local_if_set)
- strout ("[local-if-set] ", -1, -1, printcharfun, 0);
- strout ("[realvalue] ", -1, -1, printcharfun, 0);
- print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue,
- printcharfun, escapeflag);
- if (XBUFFER_LOCAL_VALUE (obj)->found_for_buffer)
- strout ("[local in buffer] ", -1, -1, printcharfun, 0);
- else
- strout ("[buffer] ", -1, -1, printcharfun, 0);
- print_object (XBUFFER_LOCAL_VALUE (obj)->buffer,
- printcharfun, escapeflag);
- if (XBUFFER_LOCAL_VALUE (obj)->check_frame)
- {
- if (XBUFFER_LOCAL_VALUE (obj)->found_for_frame)
- strout ("[local in frame] ", -1, -1, printcharfun, 0);
- else
- strout ("[frame] ", -1, -1, printcharfun, 0);
- print_object (XBUFFER_LOCAL_VALUE (obj)->frame,
- printcharfun, escapeflag);
- }
- strout ("[alist-elt] ", -1, -1, printcharfun, 0);
- print_object (XCAR (XBUFFER_LOCAL_VALUE (obj)->cdr),
- printcharfun, escapeflag);
- strout ("[default-value] ", -1, -1, printcharfun, 0);
- print_object (XCDR (XBUFFER_LOCAL_VALUE (obj)->cdr),
- printcharfun, escapeflag);
- PRINTCHAR ('>');
- break;
-
case Lisp_Misc_Save_Value:
strout ("#<save_value ", -1, -1, printcharfun, 0);
sprintf(buf, "ptr=0x%08lx int=%d",
#endif
#endif /* HAVE_SOCKETS */
-#if defined(BSD_SYSTEM)
+#if defined(HAVE_SYS_IOCTL_H)
#include <sys/ioctl.h>
#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
#include <fcntl.h>
#endif /* HAVE_PTYS and no O_NDELAY */
-#endif /* BSD_SYSTEM */
+#endif /* HAVE_SYS_IOCTL_H */
#ifdef NEED_BSDTTY
#include <bsdtty.h>
extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
#ifndef HAVE_H_ERRNO
extern int h_errno;
#endif
#if !defined (WINDOWSNT) && defined (FD_CLOEXEC)
int wait_child_setup[2];
#endif
-#ifdef POSIX_SIGNALS
sigset_t procmask;
sigset_t blocked;
struct sigaction sigint_action;
#ifdef AIX
struct sigaction sighup_action;
#endif
-#else /* !POSIX_SIGNALS */
-#if 0
-#ifdef SIGCHLD
- SIGTYPE (*sigchld)();
-#endif
-#endif /* 0 */
-#endif /* !POSIX_SIGNALS */
/* Use volatile to protect variables from being clobbered by longjmp. */
volatile int forkin, forkout;
volatile int pty_flag = 0;
/* Delay interrupts until we have a chance to store
the new fork's pid in its process structure */
-#ifdef POSIX_SIGNALS
sigemptyset (&blocked);
#ifdef SIGCHLD
sigaddset (&blocked, SIGCHLD);
#endif
#endif /* HAVE_WORKING_VFORK */
sigprocmask (SIG_BLOCK, &blocked, &procmask);
-#else /* !POSIX_SIGNALS */
-#ifdef SIGCHLD
-#if defined (BSD_SYSTEM) || defined (HPUX)
- sigsetmask (sigmask (SIGCHLD));
-#else /* ordinary USG */
-#if 0
- sigchld_deferred = 0;
- sigchld = signal (SIGCHLD, create_process_sigchld);
-#endif
-#endif /* ordinary USG */
-#endif /* SIGCHLD */
-#endif /* !POSIX_SIGNALS */
FD_SET (inchannel, &input_wait_mask);
FD_SET (inchannel, &non_keyboard_wait_mask);
signal (SIGQUIT, SIG_DFL);
/* Stop blocking signals in the child. */
-#ifdef POSIX_SIGNALS
sigprocmask (SIG_SETMASK, &procmask, 0);
-#else /* !POSIX_SIGNALS */
-#ifdef SIGCHLD
-#if defined (BSD_SYSTEM) || defined (HPUX)
- sigsetmask (SIGEMPTYMASK);
-#else /* ordinary USG */
-#if 0
- signal (SIGCHLD, sigchld);
-#endif
-#endif /* ordinary USG */
-#endif /* SIGCHLD */
-#endif /* !POSIX_SIGNALS */
if (pty_flag)
child_setup_tty (xforkout);
/* Restore the signal state whether vfork succeeded or not.
(We will signal an error, below, if it failed.) */
-#ifdef POSIX_SIGNALS
#ifdef HAVE_WORKING_VFORK
/* Restore the parent's signal handlers. */
sigaction (SIGINT, &sigint_action, 0);
#endif /* HAVE_WORKING_VFORK */
/* Stop blocking signals in the parent. */
sigprocmask (SIG_SETMASK, &procmask, 0);
-#else /* !POSIX_SIGNALS */
-#ifdef SIGCHLD
-#if defined (BSD_SYSTEM) || defined (HPUX)
- sigsetmask (SIGEMPTYMASK);
-#else /* ordinary USG */
-#if 0
- signal (SIGCHLD, sigchld);
- /* Now really handle any of these signals
- that came in during this function. */
- if (sigchld_deferred)
- kill (getpid (), SIGCHLD);
-#endif
-#endif /* ordinary USG */
-#endif /* SIGCHLD */
-#endif /* !POSIX_SIGNALS */
/* Now generate the error if vfork failed. */
if (pid < 0)
/* :service SERVICE -- string, integer (port number), or t (random port). */
service = Fplist_get (contact, QCservice);
+ /* :host HOST -- hostname, ip address, or 'local for localhost. */
+ host = Fplist_get (contact, QChost);
+ if (!NILP (host))
+ {
+ if (EQ (host, Qlocal))
+ host = build_string ("localhost");
+ CHECK_STRING (host);
+ }
+
#ifdef HAVE_LOCAL_SOCKETS
if (family == AF_LOCAL)
{
- /* Host is not used. */
- host = Qnil;
+ if (!NILP (host))
+ {
+ message (":family local ignores the :host \"%s\" property",
+ SDATA (host));
+ contact = Fplist_put (contact, QChost, Qnil);
+ host = Qnil;
+ }
CHECK_STRING (service);
bzero (&address_un, sizeof address_un);
address_un.sun_family = AF_LOCAL;
}
#endif
- /* :host HOST -- hostname, ip address, or 'local for localhost. */
- host = Fplist_get (contact, QChost);
- if (!NILP (host))
- {
- if (EQ (host, Qlocal))
- host = build_string ("localhost");
- CHECK_STRING (host);
- }
-
/* Slow down polling to every ten seconds.
Some kernels have a bug which causes retrying connect to fail
after a connect. Polling can interfere with gethostbyname too. */
immediate_quit = 1;
QUIT;
- /* This turns off all alarm-based interrupts; the
- bind_polling_period call above doesn't always turn all the
- short-interval ones off, especially if interrupt_input is
- set.
-
- It'd be nice to be able to control the connect timeout
- though. Would non-blocking connect calls be portable?
-
- This used to be conditioned by HAVE_GETADDRINFO. Why? */
-
- turn_on_atimers (0);
-
ret = connect (s, lres->ai_addr, lres->ai_addrlen);
xerrno = errno;
- turn_on_atimers (1);
-
if (ret == 0 || xerrno == EISCONN)
{
/* The unwind-protect will be discarded afterwards.
#endif
#endif
+#ifndef WINDOWSNT
+ if (xerrno == EINTR)
+ {
+ /* Unlike most other syscalls connect() cannot be called
+ again. (That would return EALREADY.) The proper way to
+ wait for completion is select(). */
+ int sc, len;
+ SELECT_TYPE fdset;
+ retry_select:
+ FD_ZERO (&fdset);
+ FD_SET (s, &fdset);
+ QUIT;
+ sc = select (s + 1, (SELECT_TYPE *)0, &fdset, (SELECT_TYPE *)0,
+ (EMACS_TIME *)0);
+ if (sc == -1)
+ {
+ if (errno == EINTR)
+ goto retry_select;
+ else
+ report_file_error ("select failed", Qnil);
+ }
+ eassert (sc > 0);
+
+ len = sizeof xerrno;
+ eassert (FD_ISSET (s, &fdset));
+ if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
+ report_file_error ("getsockopt failed", Qnil);
+ if (xerrno)
+ errno = xerrno, report_file_error ("error during connect", Qnil);
+ else
+ break;
+ }
+#endif /* !WINDOWSNT */
+
immediate_quit = 0;
/* Discard the unwind protect closing S. */
emacs_close (s);
s = -1;
+#ifdef WINDOWSNT
if (xerrno == EINTR)
goto retry_connect;
+#endif
}
if (s >= 0)
FD_ZERO (&Connecting);
#endif
+ if (time_limit == 0 && wait_proc && !NILP (Vinhibit_quit)
+ && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit)))
+ message ("Blocking call to accept-process-output with quit inhibited!!");
+
/* If wait_proc is a process to watch, set wait_channel accordingly. */
if (wait_proc != NULL)
wait_channel = wait_proc->infd;
struct coding_system *coding = proc_decode_coding_system[channel];
int carryover = p->decoding_carryover;
int readmax = 4096;
+ int count = SPECPDL_INDEX ();
+ Lisp_Object odeactivate;
chars = (char *) alloca (carryover + readmax);
if (carryover)
/* Now set NBYTES how many bytes we must decode. */
nbytes += carryover;
+ odeactivate = Vdeactivate_mark;
+ /* There's no good reason to let process filters change the current
+ buffer, and many callers of accept-process-output, sit-for, and
+ friends don't expect current-buffer to be changed from under them. */
+ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+
/* Read and dispose of the process output. */
outstream = p->filter;
if (!NILP (outstream))
{
- /* We inhibit quit here instead of just catching it so that
- hitting ^G when a filter happens to be running won't screw
- it up. */
- int count = SPECPDL_INDEX ();
- Lisp_Object odeactivate;
Lisp_Object obuffer, okeymap;
Lisp_Object text;
int outer_running_asynch_code = running_asynch_code;
/* No need to gcpro these, because all we do with them later
is test them for EQness, and none of them should be a string. */
- odeactivate = Vdeactivate_mark;
XSETBUFFER (obuffer, current_buffer);
okeymap = current_buffer->keymap;
+ /* We inhibit quit here instead of just catching it so that
+ hitting ^G when a filter happens to be running won't screw
+ it up. */
specbind (Qinhibit_quit, Qt);
specbind (Qlast_nonmenu_event, Qt);
restore_search_regs ();
running_asynch_code = outer_running_asynch_code;
- /* Handling the process output should not deactivate the mark. */
- Vdeactivate_mark = odeactivate;
-
/* Restore waiting_for_user_input_p as it was
when we were called, in case the filter clobbered it. */
waiting_for_user_input_p = waiting;
cause trouble (for example it would make sit_for return). */
if (waiting_for_user_input_p == -1)
record_asynch_buffer_change ();
-
- unbind_to (count, Qnil);
- return nbytes;
}
/* If no filter, write into buffer if it isn't dead. */
- if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name))
+ else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name))
{
Lisp_Object old_read_only;
int old_begv, old_zv;
int old_begv_byte, old_zv_byte;
- Lisp_Object odeactivate;
int before, before_byte;
int opoint_byte;
Lisp_Object text;
struct buffer *b;
- int count = SPECPDL_INDEX ();
- odeactivate = Vdeactivate_mark;
-
- record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
Fset_buffer (p->buffer);
opoint = PT;
opoint_byte = PT_BYTE;
if (old_begv != BEGV || old_zv != ZV)
Fnarrow_to_region (make_number (old_begv), make_number (old_zv));
- /* Handling the process output should not deactivate the mark. */
- Vdeactivate_mark = odeactivate;
current_buffer->read_only = old_read_only;
SET_PT_BOTH (opoint, opoint_byte);
- unbind_to (count, Qnil);
}
+ /* Handling the process output should not deactivate the mark. */
+ Vdeactivate_mark = odeactivate;
+
+ unbind_to (count, Qnil);
return nbytes;
}
{
int this = len;
- /* Decide how much data we can send in one batch.
- Long lines need to be split into multiple batches. */
- if (p->pty_flag)
- {
- /* Starting this at zero is always correct when not the first
- iteration because the previous iteration ended by sending C-d.
- It may not be correct for the first iteration
- if a partial line was sent in a separate send_process call.
- If that proves worth handling, we need to save linepos
- in the process object. */
- int linepos = 0;
- unsigned char *ptr = (unsigned char *) buf;
- unsigned char *end = (unsigned char *) buf + len;
-
- /* Scan through this text for a line that is too long. */
- while (ptr != end && linepos < pty_max_bytes)
- {
- if (*ptr == '\n')
- linepos = 0;
- else
- linepos++;
- ptr++;
- }
- /* If we found one, break the line there
- and put in a C-d to force the buffer through. */
- this = ptr - buf;
- }
-
/* Send this batch, using one or more write calls. */
while (this > 0)
{
len -= rv;
this -= rv;
}
-
- /* If we sent just part of the string, put in an EOF (C-d)
- to force it through, before we send the rest. */
- if (len > 0)
- Fprocess_send_eof (proc);
}
}
else
/* PID == 0 means no processes found, PID == -1 means a real
failure. We have done all our job, so return. */
- /* USG systems forget handlers when they are used;
- must reestablish each time */
-#if defined (USG) && !defined (POSIX_SIGNALS)
- signal (signo, sigchld_handler); /* WARNING - must come after wait3() */
-#endif
errno = old_errno;
return;
}
#if (defined WINDOWSNT \
|| (defined USG && !defined GNU_LINUX \
&& !(defined HPUX && defined WNOHANG)))
-#if defined (USG) && ! defined (POSIX_SIGNALS)
- signal (signo, sigchld_handler);
-#endif
errno = old_errno;
return;
#endif /* USG, but not HPUX with WNOHANG */
XSETBUFFER (obuffer, current_buffer);
okeymap = current_buffer->keymap;
+ /* There's no good reason to let sentinels change the current
+ buffer, and many callers of accept-process-output, sit-for, and
+ friends don't expect current-buffer to be changed from under them. */
+ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+
sentinel = p->sentinel;
if (NILP (sentinel))
return;
when a process becomes runnable. */
else if (!EQ (symbol, Qrun) && !NILP (buffer))
{
- Lisp_Object ro, tem;
+ Lisp_Object tem;
struct buffer *old = current_buffer;
int opoint, opoint_byte;
int before, before_byte;
- ro = XBUFFER (buffer)->read_only;
-
/* Avoid error if buffer is deleted
(probably that's why the process is dead, too) */
if (NILP (XBUFFER (buffer)->name))
syntax-table for ASCII chars, while the other chars
will obey syntax-table properties. It's not ideal,
but it's the way it's been done until now. */
- SETUP_SYNTAX_TABLE (BEGV, 0);
+ SETUP_BUFFER_SYNTAX_TABLE ();
for (ch = 0; ch < 256; ++ch)
{
anchored_start = (bufp->buffer[0] == begline);
#ifdef emacs
- gl_state.object = re_match_object;
+ gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
{
int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (startpos));
#ifdef emacs
int charpos;
- gl_state.object = re_match_object;
+ gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
charpos = SYNTAX_TABLE_BYTE_TO_CHAR (POS_AS_IN_BUFFER (pos));
SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1);
#endif
{
reg_errcode_t ret;
-#ifdef emacs
- gl_state.current_syntax_table = current_buffer->syntax_table;
-#endif
-
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
/*
-Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
-
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#define USG /* System III, System V, etc */
#define USG5
-/* This symbol should be defined on AIX Version 3 ??????? */
+/* This symbol should be defined on AIX Version 3 ??????? */
#ifndef _AIX
#define _AIX
#endif
/* SYSTEM_TYPE should indicate the kind of system you are using.
It sets the Lisp variable system-type. */
-
#define SYSTEM_TYPE "aix"
/* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
To get the name of the slave side, you just ttyname() the master side. */
-
#define PTY_ITERATION for (c = 0; !c ; c++)
#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
-/*
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- */
-
+/* Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control. */
#define HAVE_TERMIOS
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
-
#define HAVE_SOCKETS
-/*
- * Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
- * library functions. Almost, but not quite the same as
- * the 4.2 functions
- */
-
+/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library
+ functions. Almost, but not quite the same as the 4.2 functions. */
#define SYSV_SYSTEM_DIR
-/* Define this symbol if your system has the functions bcopy, etc. */
-
+/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
/* The file containing the kernel's symbol table is called /unix. */
-
#define KERNEL_FILE "/unix"
-/* The symbol in the kernel where the load average is found
- is named avenrun. */
-
+/* The kernel symbol where the load average is found is named avenrun. */
#define LDAV_SYMBOL "avenrun"
\f
-/* Special itemss needed to make Emacs run on this system. */
-
-#ifndef __GNUC__
-#define LINKER cc
-#endif
-
-/* Prevent -lg from being used for debugging. Not needed. */
-
-#define LIBS_DEBUG
-
-/* No need to specify -lc when linking. */
-
-#define LIB_STANDARD
-
-/* Use terminfo instead of termcap. */
-
-#define TERMINFO
+/* Special items needed to make Emacs run on this system. */
/* The following definition seems to be needed in AIX version 3.1.6.8.
It may not have been needed in certain earlier versions. */
#define HAVE_TCATTR
-/* Include unistd.h, even though we don't define POSIX. */
-#define NEED_UNISTD_H
-
/* AIX doesn't define this. */
#define unix 1
-#ifndef __GNUC__
-/* Some programs in src produce warnings saying certain subprograms
- are to comples and need a MAXMEM value greater than 2000 for
- additional optimization. --nils@exp-math.uni-essen.de */
-#define C_SWITCH_SYSTEM -ma -qmaxmem=4000
-#endif
-
/* string.h defines rindex as a macro, at least with native cc, so we
lose declaring char * rindex without this.
It is just a guess which versions of AIX need this definition. */
#undef HAVE_STRING_H
-/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g"
- because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because
- "cc -g" crashes. Go figure. --floppy@merlin.mit.edu */
-/* The above isn't generally true. If it occurs with some compiler
- release, seek a fixed version, be it XLC or GCC. The XLC version
- isn't tied to the OS version on AIX any more than elsewhere. XLC
- (the IBM compiler) can use -g with -O. (-O3 is also a possibility
- for the optimization level.) -- fx, after David Edelsohn. */
-#define C_DEBUG_SWITCH -g -O
-
/* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */
#define SIGNALS_VIA_CHARACTERS
-#define MAIL_USE_LOCKF
#define CLASH_DETECTION
/* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */
-#define POSIX_SIGNALS
#undef sigmask
-/* olson@mcs.anl.gov says -li18n is needed by -lXm. */
-#define LIB_MOTIF -lXm -li18n
-
#ifndef HAVE_LIBXMU
-#define LIBXMU
-
/* Unfortunately without libXmu we cannot support EditRes. */
#define NO_EDITRES
#endif
/* On AIX Emacs uses the gmalloc.c malloc implementation. But given
the way this system works, libc functions that return malloced
memory use the libc malloc implementation. Calling xfree or
- xrealloc on the results of such functions results in a crash.
+ xrealloc on the results of such functions results in a crash.
One solution for this could be to define SYSTEM_MALLOC here, but
that does not currently work on this system.
It is possible to completely override the malloc implementation on
AIX, but that involves putting the malloc functions in a shared
library and setting the MALLOCTYPE environment variable to point to
- tha shared library.
-
+ that shared library.
+
Emacs currently calls xrealloc on the results of get_current_dir name,
- to avoid a crash just use the Emacs implementation for that function.
-*/
+ to avoid a crash just use the Emacs implementation for that function. */
#define BROKEN_GET_CURRENT_DIR_NAME 1
+#define UNEXEC unexaix.o
+
/* arch-tag: 38fe75ea-6aef-42bd-8449-bc34d921a562
(do not change this comment) */
/* Definitions file for GNU Emacs running on bsd 4.3
- Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
/* We give these symbols the numeric values found in <sys/param.h> to
avoid warnings about redefined macros. */
#define BSD_SYSTEM 43
#endif /* BSD_SYSTEM */
+/* For mem-limits.h. */
+#define BSD4_2
+
+#define TABDLY OXTABS
+#define TAB3 OXTABS
+
+/* These aren't needed, since we have getloadavg. */
+#undef KERNEL_FILE
+#undef LDAV_SYMBOL
+
+#define HAVE_TERMIOS
+#define NO_TERMIO
+
+#define SYSV_SYSTEM_DIR
+
+#define UNEXEC unexelf.o
+
+/* If the system's imake configuration file defines `NeedWidePrototypes'
+ as `NO', we must define NARROWPROTO manually. Such a define is
+ generated in the Makefile generated by `xmkmf'. If we don't
+ define NARROWPROTO, we will see the wrong function prototypes
+ for X functions taking float or double parameters. */
+#define NARROWPROTO 1
+
/* SYSTEM_TYPE should indicate the kind of system you are using.
It sets the Lisp variable system-type. */
-
#define SYSTEM_TYPE "berkeley-unix"
/* Do not use interrupt_input = 1 by default, because in 4.3
we can make noninterrupt input work properly. */
-
#undef INTERRUPT_INPUT
/* First pty name is /dev/ptyp0. */
-
#define FIRST_PTY_LETTER 'p'
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
-
#define HAVE_SOCKETS
/* Define this symbol if your system has the functions bcopy, etc. */
-
#define BSTRING
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-#define MAIL_USE_FLOCK
-
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* The file containing the kernel's symbol table is called /vmunix. */
-
#define KERNEL_FILE "/vmunix"
-/* The symbol in the kernel where the load average is found
- is named _avenrun. */
-
+/* The kernel symbol where the load average is found is named _avenrun. */
#define LDAV_SYMBOL "_avenrun"
/* Send signals to subprocesses by "typing" special chars at them. */
-
#define SIGNALS_VIA_CHARACTERS
/* arch-tag: 0c367245-bde3-492e-9029-3ff6898beb95
/* System description header file for Cygwin.
- Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "cygwin"
/* Emacs can read input using SIGIO and buffering characters itself,
It would have Emacs fork off a separate process
to read the input and send it to the true Emacs process
through a pipe. */
-
#undef INTERRUPT_INPUT
-/*
- * Define HAVE_TERMIOS if the system provides POSIX-style
- * functions and macros for terminal control.
- *
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- *
- * Do not define both. HAVE_TERMIOS is preferred, if it is
- * supported on your system.
- */
+/* Define HAVE_TERMIOS if the system provides POSIX-style
+ functions and macros for terminal control.
-#define HAVE_TERMIOS
+ Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control.
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
+ Do not define both. HAVE_TERMIOS is preferred, if it is
+ supported on your system. */
+#define HAVE_TERMIOS
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
#define PTY_ITERATION for (i = 0; i < 1; i++) /* ick */
#define PTY_NAME_SPRINTF /* none */
while (0)
/* Define this symbol if your system has the functions bcopy, etc. */
-
#define BSTRING
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* If the system's imake configuration file defines `NeedWidePrototypes'
generated in the Makefile generated by `xmkmf'. If we don't
define NARROWPROTO, we will see the wrong function prototypes
for X functions taking float or double parameters. */
-
#define NARROWPROTO 1
-/* used in various places to enable cygwin-specific code changes */
+/* Used in various places to enable cygwin-specific code changes. */
#define CYGWIN 1
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
#define SYSV_SYSTEM_DIR 1
#define UNEXEC unexcw.o
-#define POSIX_SIGNALS 1
-#define LINKER $(CC)
-
-/* Use terminfo instead of termcap. Fewer environment variables to
- go wrong, more terminal types. */
-#define TERMINFO
#define HAVE_SOCKETS
returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */
#define G_SLICE_ALWAYS_MALLOC
-/* the end */
-
/* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
(do not change this comment) */
/* System description header file for Darwin (Mac OS X).
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
-
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#define BSD4_2
/* BSD4_3 and BSD4_4 are already defined in sys/param.h */
#define BSD_SYSTEM
/* More specific than the above two. We cannot use __APPLE__ as this
may not be defined on non-OSX Darwin, and we cannot define DARWIN
here because Panther and lower CoreFoundation.h uses DARWIN to
- distinguish OS X from pure Darwin. */
-
+ distinguish OS X from pure Darwin. */
#define DARWIN_OS
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "darwin"
/* Emacs can read input using SIGIO and buffering characters itself,
It would have Emacs fork off a separate process
to read the input and send it to the true Emacs process
through a pipe. */
-
#define INTERRUPT_INPUT
/* Letter to use in finding device name of first pty,
if system supports pty's. 'a' means it is /dev/ptya0 */
-
#define FIRST_PTY_LETTER 'p'
-/*
- * Define HAVE_TERMIOS if the system provides POSIX-style
- * functions and macros for terminal control.
- *
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- *
- * Do not define both. HAVE_TERMIOS is preferred, if it is
- * supported on your system.
- */
+/* Define HAVE_TERMIOS if the system provides POSIX-style
+ functions and macros for terminal control.
-#define HAVE_TERMIOS
+ Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control.
+ Do not define both. HAVE_TERMIOS is preferred, if it is supported
+ on your system. */
+#define HAVE_TERMIOS
#define NO_TERMIO
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- * Note: PTYs are broken on darwin <6. Use at your own risk.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices.
+ Note: PTYs are broken on darwin <6. Use at your own risk. */
#define HAVE_PTYS
-/* Run only once. We need a `for'-loop because the code uses
- `continue'. */
+/* Run only once. We need a `for'-loop because the code uses `continue'. */
#define PTY_ITERATION for (i = 0; i < 1; i++)
#define PTY_NAME_SPRINTF /* none */
#define PTY_TTY_NAME_SPRINTF /* none */
} \
while (0)
-/**
- * PTYs only work correctly on Darwin 7 or higher. So make the
- * default for process-connection-type dependent on the kernel
- * version.
- */
+/* PTYs only work correctly on Darwin 7 or higher. So make the default
+ for process-connection-type dependent on the kernel version. */
#define MIN_PTY_KERNEL_VERSION '7'
/* Define this symbol if your system has the functions bcopy, etc. */
-
#define BSTRING
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-#define MAIL_USE_FLOCK
-
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* Avoid the use of the name init_process (process.c) because it is
/* Used in dispnew.c. Copied from freebsd.h. */
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
-/* System uses OXTABS instead of the expected TAB3. (Copied from
- bsd386.h.) */
+/* System uses OXTABS instead of the expected TAB3. (Copied from bsd386.h.) */
#define TAB3 OXTABS
-/* Darwin ld insists on the use of malloc routines in the System
- framework. */
+/* Darwin ld insists on the use of malloc routines in the System framework. */
#define SYSTEM_MALLOC
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
/* Definitions for how to dump. Copied from nextstep.h. */
-
#define UNEXEC unexmacosx.o
-#define START_FILES pre-crt0.o
-
/* start_of_text isn't actually used, so make it compile without error. */
#define TEXT_START (0)
/* Definitions for how to compile & link. */
-
#ifdef HAVE_NS
-#define LIBS_NSGUI -framework AppKit
#define SYSTEM_PURESIZE_EXTRA 200000
-#define HEADERPAD_EXTRA 6C8
-#else /* !HAVE_NS */
-#define LIBS_NSGUI
-#define HEADERPAD_EXTRA 690
-#endif /* !HAVE_NS */
+#endif
/* On Darwin, res_init appears not to be useful: see bug#562 and
http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html */
-
#undef HAVE_RES_INIT
#undef HAVE_LIBRESOLV
-/* The -headerpad option tells ld (see man page) to leave room at the
- end of the header for adding load commands. Needed for dumping.
- 0x690 is the total size of 30 segment load commands (at 56
- each); under Cocoa 31 commands are required. */
-#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA
-
-#define C_SWITCH_SYSTEM_TEMACS -Dtemacs
-
-#ifdef temacs
+#ifdef emacs
#define malloc unexec_malloc
#define realloc unexec_realloc
#define free unexec_free
-/* Don't use posix_memalign because it is not compatible with
- unexmacosx.c. */
+/* Don't use posix_memalign because it is not compatible with unexmacosx.c. */
#undef HAVE_POSIX_MEMALIGN
#endif
-/* The ncurses library has been moved out of the System framework in
- Mac OS X 10.2. So if ./configure detects it, set the command-line
- option to use it. */
-#ifdef HAVE_LIBNCURSES
-#define LIBS_TERMCAP -lncurses
-/* This prevents crashes when running Emacs in Terminal.app under
- 10.2. */
-#define TERMINFO
-#endif
-
-/* Link this program just by running cc. */
-#define ORDINARY_LINK
-
-/* We don't have a g library, so override the -lg LIBS_DEBUG switch. */
-#define LIBS_DEBUG
-
-/* Adding -lm confuses the dynamic linker, so omit it. */
-#define LIB_MATH
-
/* Define the following so emacs symbols will not conflict with those
in the System framework. Otherwise -prebind will not work. */
ioctl TIOCSCTTY. */
#define DONT_REOPEN_PTY
-/* This makes create_process in process.c save and restore signal
- handlers correctly. Suggested by Nozomu Ando.*/
-#define POSIX_SIGNALS
-
-/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
- stack. */
+/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
/* arch-tag: 481d443d-4f89-43ea-b5fb-49706d95fa41
/* System description header for FreeBSD systems.
- This file describes the parameters that system description files
- should define or not.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Author: Shawn M. Carey
(according to authors.el)
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Get the correct __FreeBSD_version, even if this is before that was
- defined. */
-#ifndef __FreeBSD_version
-#ifndef __FreeBSD__
-#define __FreeBSD_version 199401
-#elif __FreeBSD__ == 1
-#define __FreeBSD_version 199405
-#else
-#include <osreldate.h>
-#endif
-#endif /* !defined __FreeBSD_version */
-
-/* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
- Earlier versions do not have shared libraries, so inhibit them.
- You can inhibit them on newer systems if you wish
- by defining NO_SHARED_LIBS. */
-#ifndef __FreeBSD__
-#define NO_SHARED_LIBS
-#endif
-
/* Get most of the stuff from bsd-common */
#include "bsd-common.h"
/* For mem-limits.h. */
#define BSD4_2
-/* These aren't needed, since we have getloadavg. */
-#undef KERNEL_FILE
-#undef LDAV_SYMBOL
-
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
-#define LIBS_DEBUG
-#define LIBS_SYSTEM -lutil
-#if __FreeBSD_version < 400000
-#define LIBS_TERMCAP -ltermcap
-#else
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
-
-#define SYSV_SYSTEM_DIR
-
-/* freebsd has POSIX-style pgrp behavior. */
-#undef BSD_PGRPS
-
-#ifdef __ELF__
-
-/* Let `ld' find image libs and similar things in /usr/local/lib. The
- system compiler, GCC, has apparently been modified to not look
- there, contrary to what a stock GCC would do. */
-
-#define LD_SWITCH_SYSTEM -L/usr/local/lib
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
-#define UNEXEC unexelf.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
-#undef LIB_GCC
-#define LIB_GCC
-
-#else /* not __ELF__ */
-
-#ifdef NO_SHARED_LIBS
-#ifdef __FreeBSD__ /* shared libs are available, but the user prefers
- not to use them. */
-#define LD_SWITCH_SYSTEM -Bstatic -L/usr/local/lib
-#endif /* __FreeBSD__ */
-#endif /* NO_SHARED_LIBS */
-
-#endif /* not __ELF__ */
-
#define HAVE_GETLOADAVG 1
-#define HAVE_TERMIOS
-#define NO_TERMIO
#define DECLARE_GETPWUID_WITH_UID_T
-/* freebsd uses OXTABS instead of the expected TAB3. */
-#define TABDLY OXTABS
-#define TAB3 OXTABS
-
-/* this silences a few compilation warnings */
+/* This silences a few compilation warnings. */
#undef BSD_SYSTEM
#if __FreeBSD__ == 1
#define BSD_SYSTEM 199103
ioctl TIOCSCTTY. */
#define DONT_REOPEN_PTY
-/* If the system's imake configuration file defines `NeedWidePrototypes'
- as `NO', we must define NARROWPROTO manually. Such a define is
- generated in the Makefile generated by `xmkmf'. If we don't
- define NARROWPROTO, we will see the wrong function prototypes
- for X functions taking float or double parameters. */
-
-#define NARROWPROTO 1
-
-/* The following is needed to make `configure' find Xpm, Xaw3d and
- image include and library files if using /usr/bin/gcc. That
- compiler seems to be modified to not find headers in
- /usr/local/include or libs in /usr/local/lib by default. */
-
-#define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/local/include -L/usr/local/lib
-
/* Circumvent a bug in FreeBSD. In the following sequence of
writes/reads on a PTY, read(2) returns bogus data:
successfully after processing (for example with CRs added if the
terminal is set up that way which it is here). The same bytes will
be seen again in a later read(2), without the CRs. */
-
#define BROKEN_PTY_READ_AFTER_EAGAIN 1
/* Tell that garbage collector that setjmp is known to save all
- registers relevant for conservative garbage collection in the
- jmp_buf. */
-
+ registers relevant for conservative garbage collection in the jmp_buf. */
#define GC_SETJMP_WORKS 1
-/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
- stack. */
-
+/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
/* Define USE_MMAP_FOR_BUFFERS to let Emacs use mmap(2) to allocate
buffer text. This overrides REL_ALLOC. */
-
#define USE_MMAP_FOR_BUFFERS 1
-/* Use sigprocmask(2) and friends instead of sigblock(2); the man page
- of sigblock says it is obsolete. */
-
-#define POSIX_SIGNALS 1
-
-/* The `combreloc' setting became the default, and it seems to be
- incompatible with unexec. Symptom is an immediate SEGV in
- XtInitializeWidget when starting Emacs under X11. */
-
-#if defined __FreeBSD_version && __FreeBSD_version >= 500042
-#define LD_SWITCH_SYSTEM_TEMACS -znocombreloc
-#endif
-
/* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb
(do not change this comment) */
/* This file is the configuration file for Linux-based GNU systems
- Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+This file was put together by Michael K. Johnson and Rik Faith.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* This file was put together by Michael K. Johnson and Rik Faith. */
-
-
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
-
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#define USG
#define GNU_LINUX
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */
#ifndef NOT_C_CODE
#if defined HAVE_GRANTPT
#define UNIX98_PTYS
-/* Run only once. We need a `for'-loop because the code uses
- `continue'. */
-
+/* Run only once. We need a `for'-loop because the code uses `continue'. */
#define PTY_ITERATION for (i = 0; i < 1; i++)
#ifdef HAVE_GETPT
/* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
prevent sigchld_handler from intercepting the child's death. */
-
#define PTY_TTY_NAME_SPRINTF \
{ \
char *ptyname; \
/* Letter to use in finding device name of first pty,
if system supports pty's. 'p' means it is /dev/ptyp0 */
-
#define FIRST_PTY_LETTER 'p'
#endif /* not HAVE_GRANTPT */
/* Define HAVE_TERMIOS if the system provides POSIX-style
functions and macros for terminal control. */
-
#define HAVE_TERMIOS
-/* Define HAVE_PTYS if the system supports pty devices. */
-
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
#define HAVE_SOCKETS
-/* Define this symbol if your system has the functions bcopy, etc. */
-
+/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
/* This is used in list_system_processes. */
#define HAVE_PROCFS 1
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-/* On GNU/Linux systems, both methods are used by various mail
- programs. I assume that most people are using newer mailers that
- have heard of flock. Change this if you need to. */
-/* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
- configure gets the right answers, and that means *NOT* using flock.
- Using flock is guaranteed to be the wrong thing. See Debian Policy
- for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the
- Debian maintainer hasn't provided a clean fix for Emacs.
- movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
- HAVE_MAILLOCK_H are defined, so the following appears to be the
- correct logic. -- fx */
-/* We must check for HAVE_LIBLOCKFILE too, as movemail does.
- liblockfile is a Free Software replacement for libmail, used on
- Debian systems and elsewhere. -rfr */
-
-#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
- defined (HAVE_MAILLOCK_H))
-#define MAIL_USE_FLOCK
-#endif
-
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* Here, on a separate page, add any special hacks needed
your system and must be used only through an encapsulation
(Which you should place, by convention, in sysdep.c). */
\f
-/* This is needed for dispnew.c:update_frame */
-
+/* This is needed for dispnew.c:update_frame. */
#ifdef emacs
#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
-/* new C libio names */
+/* New C libio names. */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
#elif defined (__UCLIBC__)
-/* using the uClibc library */
+/* Using the uClibc library. */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->__bufpos - (FILE)->__bufstart)
#else /* !_IO_STDIO_H && ! __UCLIBC__ */
-/* old C++ iostream names */
+/* Old C++ iostream names. */
#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
((FILE)->_pptr - (FILE)->_pbase)
#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
-#endif /* emacs */
-/* Ask GCC where to find libgcc.a. */
-#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
-
-#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
-
-/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
- says where to find X windows at run time. */
-
-#ifdef __mips__
-#define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
-#else
-#define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
-#endif /* __mips__ */
-
-/* Link temacs with -z nocombreloc so that unexec works right, whether or
- not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
- switches, so this also works with older versions that don't implement
- -z combreloc. */
-#define LD_SWITCH_SYSTEM_TEMACS -z nocombreloc
-
-#ifdef emacs
#define INTERRUPT_INPUT
-#endif
+#endif /* emacs */
#define SYSV_SYSTEM_DIR /* use dirent.h */
#define POSIX /* affects getpagesize.h and systty.h */
-#define POSIX_SIGNALS
-
-/* Best not to include -lg, unless it is last on the command line */
-#define LIBS_DEBUG
-#undef LIB_GCC
-#define LIB_GCC
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
-
-/* Don't use -g in test compiles in configure.
- This is so we will use the same shared libs for that linking
- that are used when linking temacs. */
-#ifdef THIS_IS_CONFIGURE
-#define C_DEBUG_SWITCH
-#endif
-
-/* alane@wozzle.linet.org says that -lipc is not a separate library,
- since libc-4.4.1. So -lipc was deleted. */
-#define LIBS_SYSTEM
-/* _BSD_SOURCE is redundant, at least in glibc2, since we define
- _GNU_SOURCE. Left in in case it's relevant to libc5 systems and
- anyone's still using Emacs on those. --fx 2002-12-14 */
-#define C_SWITCH_SYSTEM -D_BSD_SOURCE
-
-/* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed. */
-#define LIB_MOTIF -lXm -lXpm
-
-#ifdef HAVE_LIBNCURSES
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
#define UNEXEC unexelf.o
#define HAVE_XRMSETDATABASE
#endif
-/* Use BSD process groups, but use setpgid() instead of setpgrp() to
- actually set a process group. */
-/* Interesting: only GNU/Linux defines this, but the BSDs do not... */
-#define BSD_PGRPS
-
#define NARROWPROTO 1
-/* Use mmap directly for allocating larger buffers. */
-#ifdef DOUG_LEA_MALLOC
-#undef REL_ALLOC
-#endif
-
/* Tell that garbage collector that setjmp is known to save all
- registers relevant for conservative garbage collection in the
- jmp_buf. */
+ registers relevant for conservative garbage collection in the jmp_buf. */
/* Not all the architectures are tested, but there are Debian packages
for SCM and/or Guile on them, so the technique must work. See also
comments in alloc.c concerning setjmp and gcc. Fixme: it's
register window-flushing. */
/* Don't use #cpu here since in newest development versions of GCC,
we must call cpp with -traditional, and that disables #cpu. */
-
#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
|| defined __alpha__ || defined __mips__ || defined __s390__ \
|| defined __arm__ || defined __powerpc__ || defined __amd64__ \
/* Definitions file for GNU Emacs running on the GNU Hurd.
- Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Get most of the stuff from bsd-common */
#include "bsd-common.h"
-/* For mem-limits.h. */
-#define BSD4_2
-
#undef SYSTEM_TYPE
#define SYSTEM_TYPE "gnu"
#undef NLIST_STRUCT
-#undef KERNEL_FILE
-#undef LDAV_SYMBOL
#define SIGNALS_VIA_CHARACTERS
-#define HAVE_TERMIOS
-#define NO_TERMIO
-
-#define LIBS_DEBUG
-
-/* XXX emacs should not expect TAB3 to be defined. */
-#define TABDLY OXTABS
-#define TAB3 OXTABS
-
-/* Tell Emacs that we are a terminfo based system; disable the use
- of local termcap. (GNU uses ncurses.) */
-#ifdef HAVE_LIBNCURSES
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
-
-#define SYSV_SYSTEM_DIR
-
-/* GNU has POSIX-style pgrp behavior. */
-#undef BSD_PGRPS
-
-/* Use mmap directly for allocating larger buffers. */
-#ifdef DOUG_LEA_MALLOC
-#undef REL_ALLOC
-#endif
-
-/* GNU needs its own crt0, and libc defines data_start. */
-#define ORDINARY_LINK
+/* libc defines data_start. */
#define DATA_START ({ extern int data_start; (char *) &data_start; })
-/* GNU now always uses the ELF format. */
-#define UNEXEC unexelf.o
-
/* Some losing code fails to include this and then assumes
that because it is braindead that O_RDONLY==0. */
#ifndef NOT_C_CODE
#include <fcntl.h>
#endif
-#define NARROWPROTO 1
-
#ifdef emacs
#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
/* System description file for hpux version 10.20.
- Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#define RUN_TIME_REMAP
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
-
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#define USG /* System III, System V, etc */
-
#define USG5
-
#define HPUX
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "hpux"
/* Letter to use in finding device name of first pty,
- if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */
-
+ if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */
#define FIRST_PTY_LETTER 'p'
-/*
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- */
-
+/* Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control. */
#define HAVE_TERMIO
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
-
#define HAVE_SOCKETS
/* Define this symbol if your system has the functions bcopy, etc.
- * s800 and later versions of s300 (s200) kernels have equivalents
- * of the BSTRING functions of BSD. If your s200 kernel doesn't have
- * em comment out this section.
- */
-
+ s800 and later versions of s300 (s200) kernels have equivalents
+ of the BSTRING functions of BSD. If your s200 kernel doesn't have
+ em comment out this section. */
#define BSTRING
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* The symbol in the kernel where the load average is found
/* Special hacks needed to make Emacs run on this system. */
-/* Use the system provided termcap(3) library */
-#define TERMINFO
-
/* In hpux, the symbol SIGIO is defined, but the feature
doesn't work in the way Emacs needs it to. */
-
#define BROKEN_SIGIO
/* Some additional system facilities exist. */
-
#define HAVE_PERROR /* Delete this line for version 6. */
+#define UNEXEC unexhp9k800.o
+
/* This is how to get the device name of the tty end of a pty. */
#define PTY_TTY_NAME_SPRINTF \
sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
/* This triggers a conditional in xfaces.c. */
#define XOS_NEEDS_TIME_H
-/* Don't use shared libraries. unexec doesn't handle them.
- Note GCC automatically passes -a archive to ld, and it has its own
- conflicting -a. */
-#define LD_SWITCH_SYSTEM_TEMACS
-
-#ifndef HAVE_LIBXMU
-/* HP-UX doesn't supply Xmu. */
-#define LIBXMU
-
-#endif
-
/* Assar Westerlund <assar@sics.se> says this is necessary for
HP-UX 10.20, and that it works for HP-UX 0 as well. */
#define NO_EDITRES
version number A.09.05.
You can fix the math library by installing patch number PHSS_4630.
- But we can fix it more reliably for Emacs like this. */
+ But we can fix it more reliably for Emacs like this. */
#undef HAVE_RINT
/* We have to go this route, rather than hpux9's approach of renaming the
/* AlainF 20-Jul-1996 says this is right. */
#define KERNEL_FILE "/stand/vmunix"
-#define LIBS_SYSTEM -l:libdld.sl
/* Rainer Malzbender <rainer@displaytech.com> says definining
- HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20
- using GCC. */
-
+ HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */
#ifndef HAVE_XRMSETDATABASE
#define HAVE_XRMSETDATABASE
#endif
-/* Make sure we get select from libc rather than from libcurses
- because libcurses on HPUX 10.10 has a broken version of select.
- We used to use -lc -lcurses, but this may be cleaner. */
-#define LIBS_TERMCAP -ltermcap
-
-/* However, HPUX 10 puts Xaw and Xmu in a strange place
- (if you install them at all). So search that place. */
-#define C_SWITCH_X_SYSTEM -I/usr/include/X11R6 -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/contrib/X11R6/include -I/usr/contrib/X11R5/include
-#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R6 -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 -L/usr/contrib/X11R5/lib
-
/* 2000-11-21: Temporarily disable Unix 98 large file support found by
configure. It fails on HPUX 11, at least, because it enables
header sections which lose when `static' is defined away, as it is
on HP-UX. (You get duplicate symbol errors on linking). */
-
#undef _FILE_OFFSET_BITS
-/* otherwise sigunblock wont be defined */
-#define POSIX_SIGNALS
+/* Define NO_REMAP if memory segmentation makes it not work well
+ to change the boundary between the text section and data section
+ when Emacs is dumped. If you define this, the preloaded Lisp
+ code will not be sharable; but that's better than failing completely. */
+#define NO_REMAP
+
+/* Define VIRT_ADDR_VARIES if the virtual addresses of
+ pure and impure space as loaded can vary, and even their
+ relative order cannot be relied on.
+
+ Otherwise Emacs assumes that text space precedes data space,
+ numerically. */
+#define VIRT_ADDR_VARIES
+\f
+/* The data segment on this machine always starts at address 0x40000000. */
+#define DATA_SEG_BITS 0x40000000
+
+#define DATA_START 0x40000000
+#define TEXT_START 0x00000000
+
+/* Data type of load average, as read out of kmem. */
+#define LOAD_AVE_TYPE double
+
+/* Convert that into an integer that is 100 for a load average of 1.0 */
+#define LOAD_AVE_CVT(x) ((int) (x * 100.0))
+
+/* The kernel symbol where the load average is found is named _avenrun.
+ At this time there are two major flavors of hp-ux (there is the s800
+ and s300 (s200) flavors). The differences are thusly moved to the
+ corresponding machine description file. */
+
+/* No underscore please. */
+#define LDAV_SYMBOL "avenrun"
+
+/* On USG systems these have different names. */
+#define index strchr
+#define rindex strrchr
/* arch-tag: 8d8dcbf1-ca9b-48a1-94be-b750de18a5c6
(do not change this comment) */
#include "hpux10-20.h"
-#ifdef POSIX_SIGNALS
-#undef POSIX_SIGNALS
-#endif
-#define POSIX_SIGNALS 1
-
/* SA_RESTART resets the timeout of `select', so don't use it. */
#define BROKEN_SA_RESTART
#define IRIX6_5 /* used in m/iris4d */
#include "usg5-4.h"
-#undef sigsetmask /* use sys_sigsetmask */
#undef _longjmp /* use system versions, not conservative aliases */
#undef _setjmp
#define SETPGRP_RELEASES_CTTY
-#ifdef LIB_STANDARD
-#undef LIB_STANDARD
-#endif
-
#ifdef SYSTEM_TYPE
#undef SYSTEM_TYPE
#endif
/* Make process_send_signal work by "typing" a signal character on the pty. */
#define SIGNALS_VIA_CHARACTERS
+/* Letter to use in finding device name of first pty,
+ if system supports pty's. 'a' means it is /dev/ptya0 */
+#undef FIRST_PTY_LETTER
+#define FIRST_PTY_LETTER 'q'
+
/* No need to use sprintf to get the tty name--we get that from _getpty. */
-#ifdef PTY_TTY_NAME_SPRINTF
-#undef PTY_TTY_NAME_SPRINTF
-#endif
#define PTY_TTY_NAME_SPRINTF
/* No need to get the pty name at all. */
#ifdef PTY_NAME_SPRINTF
strcpy (pty_name, name); \
}
-/* Since we use POSIX constructs in PTY_OPEN, we must force POSIX
- throughout. */
-#define POSIX_SIGNALS
-
/* Ulimit(UL_GMEMLIM) is busted... */
#define ULIMIT_BREAK_VALUE 0x14000000
/* Tell process_send_signal to use VSUSP instead of VSWTCH. */
#define PREFER_VSUSP
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-#define MAIL_USE_FLOCK
+#define UNEXEC unexelf.o
#define NARROWPROTO 1
#define USE_MMAP_FOR_BUFFERS 1
-/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b
- (do not change this comment) */
-
-
#if _MIPS_SZLONG == 64 /* -mabi=64 (gcc) or -64 (MIPSpro) */
#define _LP64 /* lisp.h takes care of the rest */
#endif /* _MIPS_SZLONG */
-/* The only supported 32-bit configuration of GCC under IRIX6.x produces
- n32 MIPS ABI binaries and also supports -g. */
-#ifdef __GNUC__
-#define C_DEBUG_SWITCH -g
-#else
-/* Optimize, inaccurate debugging, increase limit on size of what's
- optimized.
-
- This should also be applicable other than on Irix 6.5, but I don't
- know for which compiler versions. -- fx */
-#define C_DEBUG_SWITCH -g3 -O -OPT:Olimit=3500
-#endif
-
#undef SA_RESTART
#undef TIOCSIGSEND /* defined in usg5-4.h */
#define GC_SETJMP_WORKS 1
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
+/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b
+ (do not change this comment) */
+
/* arch-tag: d7ad9ec2-54ad-4b2f-adf2-0070c5c63e83
(do not change this comment) */
+++ /dev/null
-/* Definitions file for GNU Emacs running on LynxOS-3.0.1
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 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/>. */
-
-/* LynxOS is almost a bsd 4.2 system */
-#include "s/bsd4-2.h"
-
-/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
-/* override the bsd definition */
-#undef SYSTEM_TYPE
-#define SYSTEM_TYPE "lynxos 3.0.1"
-
-/* System stuff redefined from bsd4-2.h */
-#undef KERNEL_FILE
-#define KERNEL_FILE "/lynx.os"
-#undef LDAV_SYMBOL
-#define LDAV_SYMBOL "load_average"
-
-/* misc defines */
-#define LNOFLSH 0
-
-/* COFF related */
-#define COFF
-#define NO_REMAP
-#define SECTION_ALIGNMENT 0x1
-#define COFF_BSD_SYMBOLS
-#define etext __etext
-#define edata __edata
-#define _start __text
-
-/* Compilation options */
-#define LIBS_DEBUG
-#define ORDINARY_LINK
-/* we define following to prevent all the lynxos's stupid compilation */
-/* warning messages */
-#define C_SWITCH_SYSTEM -D__NO_INCLUDE_WARN__
-#define LIBS_SYSTEM -lbsd
-
-/* arch-tag: fbc81ec9-1c45-416b-a368-799ae7c094a1
- (do not change this comment) */
/* System description file for Windows NT.
- Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#ifndef WINDOWSNT
#define WINDOWSNT
#endif
/* If you are compiling with a non-C calling convention but need to
- declare vararg routines differently, put it here */
+ declare vararg routines differently, put it here. */
#define _VARARGS_ __cdecl
/* If you are providing a function to something that will call the
function back (like a signal handler and signal, or main) its calling
- convention must be whatever standard the libraries expect */
+ convention must be whatever standard the libraries expect. */
#define _CALLBACK_ __cdecl
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "windows-nt"
#define SYMS_SYSTEM syms_of_ntterm ()
#define NO_MATHERR 1
/* Letter to use in finding device name of first pty,
- if system supports pty's. 'a' means it is /dev/ptya0 */
-
+ if system supports pty's. 'a' means it is /dev/ptya0 */
#define FIRST_PTY_LETTER 'a'
-/*
- * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
- * Look in <sys/time.h> for a timeval structure.
- */
-
+/* Define HAVE_TIMEVAL if the system supports the BSD style clock values.
+ Look in <sys/time.h> for a timeval structure. */
#define HAVE_TIMEVAL 1
-/* NT supports Winsock which is close enough (with some hacks) */
-
+/* NT supports Winsock which is close enough (with some hacks). */
#define HAVE_SOCKETS 1
/* But our select implementation doesn't allow us to make non-blocking
connects. So until that is fixed, this is necessary: */
-
#define BROKEN_NON_BLOCKING_CONNECT 1
/* And the select implementation does 1-byte read-ahead waiting
for received packets, so datagrams are broken too. */
-
#define BROKEN_DATAGRAM_SOCKETS 1
-/* Define this symbol if your system has the functions bcopy, etc. */
-
+/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
#define bzero(b, l) memset(b, 0, l)
#define bcopy(s, d, l) memmove(d, s, l)
#define bcmp(a, b, l) memcmp(a, b, l)
-/* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe */
+/* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe. */
#define GAP_USE_BCOPY 1
#define BCOPY_UPWARD_SAFE 1
#define BCOPY_DOWNWARD_SAFE 1
/* If your system uses COFF (Common Object File Format) then define the
- preprocessor symbol "COFF". */
-
+ preprocessor symbol "COFF". */
#define COFF 1
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-/* #define MAIL_USE_FLOCK */
#define MAIL_USE_POP 1
#define MAIL_USE_SYSTEM_LOCK 1
/* ============================================================ */
-/* Here, add any special hacks needed
- to make Emacs work on this system. For example,
- you might define certain system call names that don't
- exist on your system, or that do different things on
- your system and must be used only through an encapsulation
- (Which you should place, by convention, in sysdep.c). */
+/* Here, add any special hacks needed to make Emacs work on this
+ system. For example, you might define certain system call names
+ that don't exist on your system, or that do different things on
+ your system and must be used only through an encapsulation (which
+ you should place, by convention, in sysdep.c). */
-/* Define this to be the separator between path elements */
+/* Define this to be the separator between path elements. */
#define DIRECTORY_SEP XINT (Vdirectory_sep_char)
-/* Define this to be the separator between devices and paths */
+/* Define this to be the separator between devices and paths. */
#define DEVICE_SEP ':'
/* We'll support either convention on NT. */
#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
-/* The null device on Windows NT. */
+#include <sys/types.h>
+struct sigaction {
+ int sa_flags;
+ void (*sa_handler)(int);
+ sigset_t sa_mask;
+};
+#define SIG_BLOCK 1
+#define SIG_SETMASK 2
+#define SIG_UNBLOCK 3
+
+/* The null device on Windows NT. */
#define NULL_DEVICE "NUL:"
#ifndef MAXPATHLEN
#define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
-/* get some redefinitions in place */
+/* Get some redefinitions in place. */
#ifdef emacs
-/* calls that are emulated or shadowed */
+/* Calls that are emulated or shadowed. */
#undef access
#define access sys_access
#undef chdir
#undef write
#define write sys_write
-/* subprocess calls that are emulated */
+/* Subprocess calls that are emulated. */
#define spawnve sys_spawnve
#define wait sys_wait
#define kill sys_kill
#define signal sys_signal
+/* termcap.c calls that are emulated. */
+#define tputs sys_tputs
+#define tgetstr sys_tgetstr
+
+/* cm.c calls that are emulated. */
+#define chcheckmagic sys_chcheckmagic
+#define cmcostinit sys_cmcostinit
+#define cmgoto sys_cmgoto
+#define cmputc sys_cmputc
+#define Wcm_clear sys_Wcm_clear
+
#endif /* emacs */
-/* map to MSVC names */
+/* Map to MSVC names. */
#define execlp _execlp
#define execvp _execvp
#define fdopen _fdopen
#define utime _utime
#endif
-/* this is hacky, but is necessary to avoid warnings about macro
- redefinitions using the SDK compilers */
+/* This is hacky, but is necessary to avoid warnings about macro
+ redefinitions using the SDK compilers. */
#ifndef __STDC__
#define __STDC__ 1
#define MUST_UNDEF__STDC__
#undef MUST_UNDEF__STDC__
#endif
-/* Defines that we need that aren't in the standard signal.h */
+/* Defines that we need that aren't in the standard signal.h. */
#define SIGHUP 1 /* Hang up */
#define SIGQUIT 3 /* Quit process */
#define SIGTRAP 5 /* Trace trap */
#include <sys/stat.h>
-/* Define for those source files that do not include enough NT
- system files. */
+/* Define for those source files that do not include enough NT system files. */
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
removed. Also, obviously, all files that define initialized data
must include config.h to pick up this pragma. */
-/* Names must be < 8 bytes */
+/* Names must be < 8 bytes. */
#ifdef _MSC_VER
#pragma data_seg("EMDATA")
#pragma bss_seg("EMBSS")
/* System description file for MS-DOS
- Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Note: lots of stuff here was taken from s-msdos.h in demacs. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
-
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
#ifndef MSDOS
#define MSDOS
#endif
-#ifdef __GO32__
#ifndef __DJGPP__
-#define __DJGPP__ 1 /* V2 defines __DJGPP__ == 2 */
-#endif
-#else
You lose; /* Emacs for DOS must be compiled with DJGPP */
#endif
#undef BSD_SYSTEM
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "ms-dos"
#define SYMS_SYSTEM syms_of_dosfns();syms_of_msdos();syms_of_win16select()
-/* NOMULTIPLEJOBS should be defined if your system's shell
- does not have "job control" (the ability to stop a program,
- run some other program, then continue the first one). */
-
-#define NOMULTIPLEJOBS
-
#define SYSV_SYSTEM_DIR
-/* Define this symbol if your system has the functions bcopy, etc. */
-
+/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
/* Define this is the compiler understands `volatile'. */
#define HAVE_VOLATILE
-/* subprocesses should be defined if you want to
- have code for asynchronous subprocesses
- (as used in M-x compile and M-x shell).
+/* subprocesses should be defined if you want to have code for
+ asynchronous subprocesses (as used in M-x compile and M-x shell).
This is the only system that needs this. */
-
#undef subprocesses
/* If your system uses COFF (Common Object File Format) then define the
- preprocessor symbol "COFF". */
-
+ preprocessor symbol "COFF". */
#define COFF
-/* Here, on a separate page, add any special hacks needed
- to make Emacs work on this system. For example,
- you might define certain system call names that don't
- exist on your system, or that do different things on
- your system and must be used only through an encapsulation
- (Which you should place, by convention, in sysdep.c). */
+/* Here, on a separate page, add any special hacks needed to make
+ Emacs work on this system. For example, you might define certain
+ system call names that don't exist on your system, or that do
+ different things on your system and must be used only through an
+ encapsulation (which you should place, by convention, in sysdep.c). */
\f
/* Avoid incompatibilities between gmalloc.c and system header files
in how to declare valloc. */
/* setjmp and longjmp can safely replace _setjmp and _longjmp,
but they will run slower. */
-
#define _setjmp setjmp
#define _longjmp longjmp
-#if __DJGPP__ < 2
-
-/* New chdir () routine.
- DJGPP v2.0 and later doesn't need it because its chdir() does
- set the drive itself. */
-#ifdef chdir
-#undef chdir
-#endif
-#define chdir sys_chdir
-
-#define LIBS_SYSTEM -lpc /* isn't required in DJGPP v2.0, either */
-
-#endif /* __DJGPP__ < 2 */
-
-#if __DJGPP__ > 1
-
#define DATA_START (&etext + 1)
#define TEXT_START &start
#define _NAIVE_DOS_REGS
-#else /* not __DJGPP__ > 1 */
-
-/* This somehow needs to be defined even though we use COFF. */
-#define TEXT_START -1
-
-#endif /* not __DJGPP__ > 1 */
-
-#define ORDINARY_LINK
-
/* command.com does not understand `...` so we define this. */
-#define LIB_GCC -Lgcc
#define SEPCHAR ';'
#define NULL_DEVICE "nul"
-#if __DJGPP__ < 2
-#define O_RDONLY 0x0001
-#define O_WRONLY 0x0002
-#define O_RDWR 0x0004
-#define O_CREAT 0x0100
-#define O_TRUNC 0x0200
-#define O_EXCL 0x0400
-#define O_APPEND 0x0800
-#define O_TEXT 0x4000
-#define O_BINARY 0x8000
-#define NO_MATHERR
-#endif
-
#define HAVE_INVERSE_HYPERBOLIC
#define FLOAT_CHECK_DOMAIN
:AB=<BG %d>:AF=<FG %d>:op=<DefC>:"
/* Define this to a function (Fdowncase, Fupcase) if your file system
- likes that */
+ likes that. */
#define FILE_SYSTEM_CASE Fmsdos_downcase_filename
-/* Define this to be the separator between devices and paths */
+/* Define this to be the separator between devices and paths. */
#define DEVICE_SEP ':'
/* We'll support either convention on MSDOG. */
#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
-/* Call init_gettimeofday when TZ changes. */
-#if __DJGPP__ < 2
-#define LOCALTIME_CACHE
-#define tzset init_gettimeofday
-#endif
-
-/* bcopy under djgpp is quite safe */
+/* bcopy under djgpp is quite safe. */
#define GAP_USE_BCOPY
#define BCOPY_UPWARD_SAFE 1
#define BCOPY_DOWNWARD_SAFE 1
/* Mode line description of a buffer's type. */
#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
-/* Do we have POSIX signals? */
-#if __DJGPP__ > 1
-#define POSIX_SIGNALS
-#endif
-
/* We have (the code to control) a mouse. */
#define HAVE_MOUSE
-/* We canuse mouse menus. */
+/* We can use mouse menus. */
#define HAVE_MENUS
/* Define one of these for easier conditionals. */
commentary below, in the non-X branch. The 140KB number was
measured on GNU/Linux and on MS-WIndows. */
#define SYSTEM_PURESIZE_EXTRA (-170000+140000)
-#define LIBX11_SYSTEM -lxext -lsys
#else
/* We need a little extra space, see ../../lisp/loadup.el.
As of 20091024, DOS-specific files use up 62KB of pure space. But
#endif
/* Tell the garbage collector that setjmp is known to save all
- registers relevant for conservative garbage collection in the
- jmp_buf. */
-
+ registers relevant for conservative garbage collection in the jmp_buf. */
#define GC_SETJMP_WORKS 1
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
+#define NO_REMAP
+
/* arch-tag: d184f860-815d-4ff4-8187-d05c0f3c37d0
(do not change this comment) */
-/* s/ file for netbsd system.
-
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 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/>. */
-
-
-/* Get most of the stuff from bsd-common */
-#include "bsd-common.h"
-
-#if defined (__alpha__) && !defined (__ELF__)
-#define NO_SHARED_LIBS
-#endif
-
-/* For mem-limits.h. */
-#define BSD4_2
-
-#undef KERNEL_FILE
-#undef LDAV_SYMBOL
-#define HAVE_GETLOADAVG 1
-
-#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
-
-/* netbsd uses OXTABS instead of the expected TAB3. */
-#define TABDLY OXTABS
-#define TAB3 OXTABS
-
-#define HAVE_TERMIOS
-#define NO_TERMIO
-
-#define LIBS_DEBUG
-/* -lutil is not needed for NetBSD >0.9. */
-/* #define LIBS_SYSTEM -lutil */
-#ifdef HAVE_TERM_H
-#define TERMINFO
-#define LIBS_TERMCAP -lterminfo
-#else
-#define LIBS_TERMCAP -ltermcap
-#endif
-
-#define NEED_ERRNO
-#define SYSV_SYSTEM_DIR
-
-/* Netbsd has POSIX-style pgrp behavior. */
-#undef BSD_PGRPS
-
-#if !defined (NO_SHARED_LIBS) && defined (__ELF__)
-#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
-#define UNEXEC unexelf.o
-#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
-#undef LIB_GCC
-#define LIB_GCC
-#endif
-
-#ifdef HAVE_CRTIN
-#define START_FILES_1 /usr/lib/crti.o
-#define END_FILES_1 /usr/lib/crtn.o
-#else
-#define START_FILES_1
-#define END_FILES_1
-#endif
-
-#define AMPERSAND_FULL_NAME
-
-#ifdef __ELF__
-/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option
- says where to find X windows at run time. We convert it to a -rpath option
- which is what OSF1 uses. */
-#define LD_SWITCH_SYSTEM_tmp `echo LD_SWITCH_X_SITE_AUX | sed -e 's/-R/-Wl,-rpath,/'`
-#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib
-
-/* The following is needed to make `configure' find Xpm, Xaw3d and
- image include and library files if using /usr/bin/gcc. That
- compiler seems to be modified to not find headers in
- /usr/local/include or libs in /usr/local/lib by default. */
-
-#define C_SWITCH_SYSTEM -I/usr/X11R6/include -I/usr/pkg/include -I/usr/local/include -L/usr/pkg/lib -L/usr/local/lib
-
-/* Link temacs with -z nocombreloc so that unexec works right, whether or
- not -z combreloc is the default. GNU ld ignores unknown -z KEYWORD
- switches, so this also works with older versions that don't implement
- -z combreloc. */
-
-#define LD_SWITCH_SYSTEM_TEMACS -Wl,-z,nocombreloc
-
-#endif /* __ELF__ */
-
-/* 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 */
-
-#define LINKER $(CC) -nostartfiles
-
-#define NARROWPROTO 1
-
-#define DEFAULT_SOUND_DEVICE "/dev/audio"
-
-/* Greg A. Woods <woods@weird.com> says we must include signal.h
- before syssignal.h is included, to work around interface conflicts
- that are handled with CPP __RENAME() macro in signal.h. */
-
-#ifndef NOT_C_CODE
-#include <signal.h>
-#endif
-
-/* Don't close pty in process.c to make it as controlling terminal.
- It is already a controlling terminal of subprocess, because we did
- ioctl TIOCSCTTY. */
-
-#define DONT_REOPEN_PTY
-
-/* Tell that garbage collector that setjmp is known to save all
- registers relevant for conservative garbage collection in the
- jmp_buf. */
-
-#define GC_SETJMP_WORKS 1
-
-/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method. */
-
-#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
-/* Use sigprocmask and friends instead of sigblock;
- sigblock is considered obsolete on NetBSD. */
-
-#define POSIX_SIGNALS 1
-
-/* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81
- (do not change this comment) */
+/* s/ file for netbsd system.
+
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 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/>. */
+
+
+/* Get most of the stuff from bsd-common. */
+#include "bsd-common.h"
+
+#define HAVE_GETLOADAVG 1
+
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
+#define DEFAULT_SOUND_DEVICE "/dev/audio"
+
+/* Greg A. Woods <woods@weird.com> says we must include signal.h
+ before syssignal.h is included, to work around interface conflicts
+ that are handled with CPP __RENAME() macro in signal.h. */
+#ifndef NOT_C_CODE
+#include <signal.h>
+#endif
+
+/* Don't close pty in process.c to make it as controlling terminal.
+ It is already a controlling terminal of subprocess, because we did
+ ioctl TIOCSCTTY. */
+#define DONT_REOPEN_PTY
+
+/* Tell that garbage collector that setjmp is known to save all
+ registers relevant for conservative garbage collection in the jmp_buf. */
+#define GC_SETJMP_WORKS 1
+
+/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method. */
+#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
+
+/* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81
+ (do not change this comment) */
-/* s/ file for openbsd systems. */
-
-/* Mostly the same as NetBSD. */
-#include "netbsd.h"
-
-/* This very-badly named symbol is conditionally defined in netbsd.h.
- Better would be either to not need it in the first place, or to choose
- a more descriptive name. */
-#ifndef LD_SWITCH_SYSTEM_tmp
-#define LD_SWITCH_SYSTEM_tmp /* empty */
-#endif
-
-/* David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
- is necessary. Otherwise Emacs dumps core when run -nw. */
-#undef LIBS_TERMCAP
-
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-
-#undef LD_SWITCH_SYSTEM_TEMACS
-#undef LD_SWITCH_SYSTEM
-#ifdef __ELF__
-
- /* Han Boetes <han@mijncomputer.nl> says this
- is necessary, otherwise Emacs dumps core on elf systems. */
-#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Z
-
-/* The version of gcc on OpenBSD doesn't search /usr/local/lib by
- default. */
-#define LD_SWITCH_X_DEFAULT -L/usr/local/lib
-
-#else
-
-#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp
-#define LD_SWITCH_X_DEFAULT -L/usr/local/lib
-
-#endif
-
-/* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2
- (do not change this comment) */
+/* System file for openbsd. */
+
+/* The same as NetBSD. Note there are differences in configure. */
+#include "netbsd.h"
+
+/* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2
+ (do not change this comment) */
-/* Handle Solaris 2.10. */
-
-#include "sol2-6.h"
-
-#define SYSTEM_MALLOC
-
-/*
- * Use the Solaris dldump() function, called from unexsol.c, to dump
- * emacs, instead of the generic ELF dump code found in unexelf.c.
- * The resulting binary has a complete symbol table, and is better
- * for debugging and other observabilty tools (debuggers, pstack, etc).
- *
- * If you encounter a problem using dldump(), please consider sending
- * a message to the OpenSolaris tools-linking mailing list:
- * http://mail.opensolaris.org/mailman/listinfo/tools-linking
- *
- * It is likely that dldump() works with older Solaris too,
- * but this has not been tested, and so, this change is for
- * Solaris 10 and newer only at this time.
- */
-#undef UNEXEC
-#define UNEXEC unexsol.o
-
-/* This is used in list_system_processes. */
-#define HAVE_PROCFS 1
-
-/* This is needed for the system_process_attributes implementation. */
-#define _STRUCTURED_PROC 1
-
-/* arch-tag: 7c51a134-5469-4d16-aa00-d69224640eeb
- (do not change this comment) */
+/* Handle Solaris 2.10. */
+
+#include "sol2-6.h"
+
+#define SYSTEM_MALLOC
+
+/* Use the Solaris dldump() function, called from unexsol.c, to dump
+ emacs, instead of the generic ELF dump code found in unexelf.c.
+ The resulting binary has a complete symbol table, and is better
+ for debugging and other observabilty tools (debuggers, pstack, etc).
+
+ If you encounter a problem using dldump(), please consider sending
+ a message to the OpenSolaris tools-linking mailing list:
+ http://mail.opensolaris.org/mailman/listinfo/tools-linking
+
+ It is likely that dldump() works with older Solaris too,
+ but this has not been tested, and so, this change is for
+ Solaris 10 and newer only at this time. */
+#undef UNEXEC
+#define UNEXEC unexsol.o
+
+/* This is used in list_system_processes. */
+#define HAVE_PROCFS 1
+
+/* This is needed for the system_process_attributes implementation. */
+#define _STRUCTURED_PROC 1
+
+/* arch-tag: 7c51a134-5469-4d16-aa00-d69224640eeb
+ (do not change this comment) */
+++ /dev/null
-/* Handle Solaris 2.4. */
-
-#include "sol2-3.h"
-
-#undef LD_SWITCH_SYSTEM
-
-/* `#ifdef USE_MOTIF' won't work here, since USE_MOTIF isn't defined yet.
- Instead, dynamically check whether USE_MOTIF expands to something. */
-#define NOT_USING_MOTIF { set x USE_MOTIF; test "$$2" = "USE_MOTIF"; }
-
-#ifndef __GNUC__
-#define LD_SWITCH_SYSTEM_TEMACS -L/usr/ccs/lib LD_SWITCH_X_SITE_AUX \
- `NOT_USING_MOTIF || echo ' -R/usr/dt/lib'`
-#else /* GCC */
-/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX
- has anything in it. It can be empty.
- This works ok in temacs. */
-#define LD_SWITCH_SYSTEM_TEMACS -L/usr/ccs/lib \
- `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX` \
- `NOT_USING_MOTIF || echo ' -R/usr/dt/lib -L/usr/dt/lib'`
-
-/* Get rid of -traditional and let const really do its thing. */
-#undef C_SWITCH_SYSTEM
-#undef const
-#endif /* GCC */
-
-/* Gregory Neil Shapiro <gshapiro@hhmi.org> reports the Motif header files
- are in this directory on Solaris 2.4. */
-#define C_SWITCH_X_SYSTEM -I/usr/dt/include
-
-/* arch-tag: 6f0de37b-cfda-427a-a5ae-b83ed54aaae7
- (do not change this comment) */
+++ /dev/null
-/* Handle Solaris 2.5. */
-
-#include "sol2-4.h"
-
-/* -lgen is needed for the regex and regcmp functions
- which are used by Motif. In the future we can try changing
- regex.c to provide them in Emacs, but this is safer for now. */
-#define LIB_MOTIF -lXm -lgen
-
-/* This is the only known way to avoid some crashes
- that seem to relate to screwed up malloc data
- after deleting a frame. */
-/* rms: I think the problems using ralloc had to do with system
- libraries that called the system malloc even if we linked in the
- GNU malloc. I could not see any way to fix the problem except to
- have just one malloc and that had to be the system one. */
-/* This is not always necessary. Turned off at present for testers to
- identify any problems with gmalloc more accurately. */
-/* #define SYSTEM_MALLOC */
-
-/* There have problems reported with mmap at least on Solaris 2.6
- and 2.7. For simplicity, let's not use mmap for anything >= 2.5.
- We can optimize this later. */
-
-#undef USE_MMAP_FOR_BUFFERS
-
-/* Probably OK also on earlier versions. */
-#define GC_SETJMP_WORKS 1
-#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
-/* arch-tag: 96d65526-21c9-4547-a797-2bd575c05be7
- (do not change this comment) */
-/* Definitions file for GNU Emacs running on Solaris 2.3.
+/* Definitions file for GNU Emacs running on Solaris 2.6.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#define POSIX
-#define LIBS_SYSTEM -lsocket -lnsl -lkstat
-
/* Prefer kstat over kvm in getloadavg.c, kstat doesn't require root.
ghazi@caip.rutgers.edu, 7/21/97. Don't redefine if already defined
(e.g., by config.h). */
/* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
XIM support. */
-
#define INHIBIT_X11R6_XIM
-/* Must use the system's termcap, if we use any termcap.
- It does special things. */
-
-#ifndef TERMINFO
-#define LIBS_TERMCAP -ltermcap
-#endif
-
-#define USE_MMAP_FOR_BUFFERS 1
-
-#ifndef __GNUC__
-#define LD_SWITCH_SYSTEM -L /usr/ccs/lib LD_SWITCH_X_SITE_AUX
-/* eggert thinks all versions of SunPro C allowed this. */
-#define C_DEBUG_SWITCH -g -O
-#else /* GCC */
-/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX
- has anything in it. It can be empty.
- This works ok in src. Luckily lib-src does not use LD_SWITCH_SYSTEM. */
-#define LD_SWITCH_SYSTEM -L /usr/ccs/lib \
- `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX`
-#endif /* GCC */
-
-/* Info from fnf@cygnus.com suggests this is appropriate. */
-#define POSIX_SIGNALS
-
-/* We don't need the definition from usg5-4.h with POSIX_SIGNALS. */
-#undef sigsetmask
-
/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
- rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't
- work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x
+ rather than sighold/sigrelse, which appear to be BSD4.1 specific.
+ It may also be appropriate for SVR4.x
(x<2) but I'm not sure. fnf@cygnus.com */
/* This sets the name of the slave side of the PTY. On SysVr4,
grantpt(3) forks a subprocess, so keep sigchld_handler() from
intercepting that death. If any child but grantpt's should die
within, it should be caught after sigrelse(2). */
-#undef PTY_TTY_NAME_SPRINTF
#define PTY_TTY_NAME_SPRINTF \
{ \
char *ptsname (), *ptyname; \
pty_name[sizeof (pty_name) - 1] = 0; \
}
-/* arch-tag: a8fe2e15-e517-49cb-a863-f346b80885fe
+/* This is the only known way to avoid some crashes
+ that seem to relate to screwed up malloc data
+ after deleting a frame. */
+/* rms: I think the problems using ralloc had to do with system
+ libraries that called the system malloc even if we linked in the
+ GNU malloc. I could not see any way to fix the problem except to
+ have just one malloc and that had to be the system one. */
+/* This is not always necessary. Turned off at present for testers to
+ identify any problems with gmalloc more accurately. */
+/* #define SYSTEM_MALLOC */
+
+/* Probably OK also on earlier versions. */
+#define GC_SETJMP_WORKS 1
+#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
+
+/* arch-tag: 71ea3857-89dc-4395-9623-77964e6ed3ca
(do not change this comment) */
/* Template for system description header files.
This file describes the parameters that system description files
should define or not.
- Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/*
- * Define symbols to identify the version of Unix this is.
- * Define all the symbols that apply correctly.
- */
+/* Define symbols to identify the version of Unix this is.
+ Define all the symbols that apply correctly. */
/* #define USG5 */
/* #define USG */
/* #define BSD_SYSTEM */
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "berkeley-unix"
-/* NOMULTIPLEJOBS should be defined if your system's shell
- does not have "job control" (the ability to stop a program,
- run some other program, then continue the first one). */
-
-/* #define NOMULTIPLEJOBS */
-
/* Emacs can read input using SIGIO and buffering characters itself,
or using CBREAK mode and making C-g cause SIGINT.
The choice is controlled by the variable interrupt_input.
Another method of doing input is planned but not implemented.
It would have Emacs fork off a separate process
to read the input and send it to the true Emacs process
- through a pipe. */
-
+ through a pipe. */
#define INTERRUPT_INPUT
/* Letter to use in finding device name of first pty,
- if system supports pty's. 'a' means it is /dev/ptya0 */
-
+ if system supports pty's. 'a' means it is /dev/ptya0. */
#define FIRST_PTY_LETTER 'a'
-/*
- * Define HAVE_TERMIOS if the system provides POSIX-style
- * functions and macros for terminal control.
- *
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- *
- * Do not define both. HAVE_TERMIOS is preferred, if it is
- * supported on your system.
- */
+/* Define HAVE_TERMIOS if the system provides POSIX-style
+ functions and macros for terminal control.
+
+ Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control.
+
+ Do not define both. HAVE_TERMIOS is preferred, if it is
+ supported on your system. */
#define HAVE_TERMIOS
/* #define HAVE_TERMIO */
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
-/* Define this symbol if your system has the functions bcopy, etc. */
-
+/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
/* subprocesses should be undefined if you do NOT want to
have code for asynchronous subprocesses
(as used in M-x compile and M-x shell).
- Currently only MSDOS does not support this. */
+ Currently only MSDOS does not support this. */
/* #undef subprocesses */
/* If your system uses COFF (Common Object File Format) then define the
- preprocessor symbol "COFF". */
+ preprocessor symbol "COFF". */
/* #define COFF */
-/* define MAIL_USE_FLOCK if the mailer uses flock
- to interlock access to /usr/spool/mail/$USER.
- The alternative is that a lock file named
- /usr/spool/mail/$USER.lock. */
-
-#define MAIL_USE_FLOCK
-
/* Define CLASH_DETECTION 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 Emacs. */
-
#define CLASH_DETECTION
/* Define this if your operating system declares signal handlers to
/* ============================================================ */
-/* Here, add any special hacks needed
- to make Emacs work on this system. For example,
- you might define certain system call names that don't
- exist on your system, or that do different things on
- your system and must be used only through an encapsulation
- (Which you should place, by convention, in sysdep.c). */
+/* Here, add any special hacks needed to make Emacs work on this
+ system. For example, you might define certain system call names
+ that don't exist on your system, or that do different things on
+ your system and must be used only through an encapsulation (which
+ you should place, by convention, in sysdep.c). */
/* If the system's imake configuration file defines `NeedWidePrototypes'
as `NO', we must define NARROWPROTO manually. Such a define is
/* ============================================================ */
/* After adding support for a new system, modify the large case
- statement in the `configure' script to recognize reasonable
+ statement in configure.in to recognize reasonable
configuration names, and add a description of the system to
`etc/MACHINES'.
+ Check for any tests of $opsys in configure.in, and add an entry
+ for the new system if needed.
+
If you've just fixed a problem in an existing configuration file,
you should also check `etc/MACHINES' to make sure its descriptions
of known problems in that configuration should be updated. */
-/* s/ file for System V release 4.2.
+/* s/ file for Unixware.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* #define HAVE_GETWD (appears to be buggy on SVR4.2) */
#undef HAVE_GETWD
-/* Info from fnf@cygnus.com suggests this is appropriate. */
-#define POSIX_SIGNALS
-
-/* We don't need the definition from usg5-3.h with POSIX_SIGNALS. */
-#undef sigsetmask
#undef HAVE_SYSV_SIGPAUSE
-/* Motif needs -lgen. */
-#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
-
/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
- rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't
- work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x
+ rather than sighold/sigrelse, which appear to be BSD4.1 specific.
+ It may also be appropriate for SVR4.x
(x<2) but I'm not sure. fnf@cygnus.com */
/* This sets the name of the slave side of the PTY. On SysVr4,
grantpt(3) forks a subprocess, so keep sigchld_handler() from
intercepting that death. If any child but grantpt's should die
- within, it should be caught after sigrelse(2). */
-
-#undef PTY_TTY_NAME_SPRINTF
+ within, it should be caught after sigrelse(2). */
#define PTY_TTY_NAME_SPRINTF \
{ \
char *ptsname(), *ptyname; \
pty_name[sizeof(pty_name) - 1] = 0; \
}
-/* Use libw.a along with X11R6 Xt. */
-#define NEED_LIBW
+/* Data type of load average, as read out of kmem. */
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0 */
+/* This is totally uncalibrated. */
+#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
+#define FSCALE 256.0
+
-/* ryanr@ellingtn.ftc.nrcs.usda.gov (Richard Anthony Ryan) says -lXimp
- is needed in UNIX_SV ... 4.2 1.1.2. */
-#define LIB_MOTIF -lXm -lXimp
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->__ptr - (FILE)->__base)
-/* arch-tag: 9bbfcfc1-19be-45a1-9699-af57b87da2c6
+/* arch-tag: d82e92e7-9443-4a60-a581-7f293cbae8a3
(do not change this comment) */
/* Definitions file for GNU Emacs running on AT&T's System V Release 4
- Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Written by James Van Artsdalen of Dell Computer Corp. james@bigtex.cactus.org.
+Subsequently improved for Dell 2.2 by Eric S. Raymond <esr@snark.thyrsus.com>.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* This file written by James Van Artsdalen of Dell Computer Corporation.
- * james@bigtex.cactus.org. Subsequently improved for Dell 2.2 by Eric
- * S. Raymond <esr@snark.thyrsus.com>.
- */
-
-/* Use the SysVr3 file for at least base configuration. */
-
+/* Use the SysVr3 file for at least base configuration. */
#define USG /* System III, System V, etc */
#define USG5
#define USG5_4
/* SYSTEM_TYPE should indicate the kind of system you are using.
- It sets the Lisp variable system-type. */
-
+ It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "usg-unix-v"
-/*
- * Define HAVE_TERMIO if the system provides sysV-style ioctls
- * for terminal control.
- */
-
+/* Define HAVE_TERMIO if the system provides sysV-style ioctls
+ for terminal control. */
#define HAVE_TERMIO
-/*
- * Define HAVE_PTYS if the system supports pty devices.
- */
-
-/*
- * Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
- * library functions. Almost, but not quite the same as
- * the 4.2 functions
- */
+/* Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir library
+ functions. Almost, but not quite the same as the 4.2 functions. */
#define SYSV_SYSTEM_DIR
/* The file containing the kernel's symbol table is called /unix. */
-
#define KERNEL_FILE "/unix"
-/* The symbol in the kernel where the load average is found
- is named avenrun. */
-
+/* The kernel symbol where the load average is found is named avenrun. */
#define LDAV_SYMBOL "avenrun"
-/* Special hacks needed to make Emacs run on this system. */
-
-/*
- * Make the sigsetmask function go away. Don't know what the
- * ramifications of this are, but doesn't seem possible to
- * emulate it properly anyway at this point.
- */
-
-#define sigsetmask(mask) /* Null expansion */
-
/* setjmp and longjmp can safely replace _setjmp and _longjmp,
but they will run slower. */
-
#define _setjmp setjmp
#define _longjmp longjmp
-/* On USG systems these have different names */
+/* On USG systems these have different names. */
#ifndef HAVE_INDEX
#define index strchr
#endif /* ! defined (HAVE_INDEX) */
#define rindex strrchr
#endif /* ! defined (HAVE_RINDEX) */
-/* Use terminfo instead of termcap. */
-
-#define TERMINFO
-
-
-/* The docs for system V/386 suggest v.3 has sigpause,
- so let's give it a try. */
+/* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
#define HAVE_SYSV_SIGPAUSE
-
-/* If we're using the System V X port, BSD bstring functions will be handy */
-
+/* If we're using the System V X port, BSD bstring functions will be handy. */
#ifdef HAVE_X_WINDOWS
#define BSTRING
#endif /* HAVE_X_WINDOWS */
-/* On USG systems signal handlers return void */
-
+/* On USG systems signal handlers return void. */
#define SIGTYPE void
-#define ORDINARY_LINK
-
-#define LIB_STANDARD
-
-/* there are no -lg libraries on this system, and no libPW */
-
-#define LIBS_DEBUG
-
-/* Undump with ELF */
-
+/* Undump with ELF. */
#undef COFF
#define UNEXEC unexelf.o
-/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
- * tchars. But get <termio.h> first to make sure ttold.h doesn't
- * interfere. And don't try to use SIGIO yet.
- */
-
+/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
+ But get <termio.h> first to make sure ttold.h doesn't interfere.
+ And don't try to use SIGIO yet. */
#ifndef NOT_C_CODE
#include <sys/wait.h>
#endif
#endif
/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
- * instead, there's a system variable _sys_nsig. Unfortunately, we need the
- * constant to dimension an array. So wire in the appropriate value here.
- */
+ instead, there's a system variable _sys_nsig. Unfortunately, we need the
+ constant to dimension an array. So wire in the appropriate value here. */
#define NSIG_MINIMUM 32
-/* We can support this */
-
+/* We can support this. */
#define CLASH_DETECTION
+/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
#define HAVE_TERMIOS
waiting, because a previous waitsys(2) cleaned up the carcass of child
without clearing the SIGCHLD pending info. So, use a non-blocking
wait3 instead, which maps to waitpid(2) in SysVr4. */
-
#define wait3(status, options, rusage) \
waitpid ((pid_t) -1, (status), (options))
#define WRETCODE(w) (w >> 8)
/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
this is all we need. */
-
#define TIOCSIGSEND TIOCSIGNAL
/* This change means that we don't loop through allocate_pty too many
- times in the (rare) event of a failure. */
-
+ times in the (rare) event of a failure. */
#define FIRST_PTY_LETTER 'z'
-/* This sets the name of the master side of the PTY. */
-
+/* This sets the name of the master side of the PTY. */
#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
-/* This sets the name of the slave side of the PTY. On SysVr4,
- grantpt(3) forks a subprocess, so keep sigchld_handler() from
- intercepting that death. If any child but grantpt's should die
- within, it should be caught after sigrelse(2). */
-
-#define PTY_TTY_NAME_SPRINTF \
- { \
- char *ptsname (), *ptyname; \
- \
- sighold (SIGCLD); \
- if (grantpt (fd) == -1) \
- { emacs_close (fd); return -1; } \
- sigrelse (SIGCLD); \
- if (unlockpt (fd) == -1) \
- { emacs_close (fd); return -1; } \
- if (!(ptyname = ptsname (fd))) \
- { emacs_close (fd); return -1; } \
- strncpy (pty_name, ptyname, sizeof (pty_name)); \
- pty_name[sizeof (pty_name) - 1] = 0; \
- }
-
-/* Push various streams modules onto a PTY channel. */
-
+/* Push various streams modules onto a PTY channel. */
#define SETUP_SLAVE_PTY \
if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
fatal ("ioctl I_PUSH ptem", errno); \
if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
fatal ("ioctl I_PUSH ttcompat", errno);
-/* This definition was suggested for next release.
- So give it a try. */
+/* This definition was suggested for next release. So give it a try. */
#define HAVE_SOCKETS
/* arch-tag: 1a0ed909-5faa-434b-b7c3-9d86c63d53a6
/* We optimize syntax-table lookup for rare updates. Thus we accept
only those `^\s(' which are good in global _and_ text-property
syntax-tables. */
- gl_state.current_syntax_table = current_buffer->syntax_table;
- gl_state.use_global = 0;
+ SETUP_BUFFER_SYNTAX_TABLE ();
while (PT > BEGV)
{
int c;
if (SYNTAX (c) == Sopen)
break;
/* Now fallback to the default value. */
- gl_state.current_syntax_table = current_buffer->syntax_table;
- gl_state.use_global = 0;
+ SETUP_BUFFER_SYNTAX_TABLE ();
}
/* Move to beg of previous line. */
scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1);
Lisp_Object character;
{
int char_int;
- gl_state.current_syntax_table = current_buffer->syntax_table;
-
- gl_state.use_global = 0;
- CHECK_NUMBER (character);
+ CHECK_CHARACTER (character);
char_int = XINT (character);
+ SETUP_BUFFER_SYNTAX_TABLE ();
return make_number (syntax_code_spec[(int) SYNTAX (char_int)]);
}
Lisp_Object character;
{
int char_int, code;
- gl_state.current_syntax_table = current_buffer->syntax_table;
- gl_state.use_global = 0;
CHECK_NUMBER (character);
char_int = XINT (character);
+ SETUP_BUFFER_SYNTAX_TABLE ();
code = SYNTAX (char_int);
if (code == Sopen || code == Sclose)
return SYNTAX_MATCH (char_int);
let's initialize it manually.
We ignore syntax-table text-properties for now, since that's
what we've done in the past. */
- SETUP_SYNTAX_TABLE (BEGV, 0);
+ SETUP_BUFFER_SYNTAX_TABLE ();
if (forwardp)
{
if (multibyte)
1) \
: 0))
+/* This macro sets up the buffer-global syntax table. */
+#define SETUP_BUFFER_SYNTAX_TABLE() \
+do \
+ { \
+ gl_state.use_global = 0; \
+ gl_state.current_syntax_table = current_buffer->syntax_table; \
+ } while (0)
+
/* This macro should be called with FROM at the start of forward
search, or after the last position of the backward search. It
makes sure that the first char is picked up with correct table, so
#define SETUP_SYNTAX_TABLE(FROM, COUNT) \
do \
{ \
+ SETUP_BUFFER_SYNTAX_TABLE (); \
gl_state.b_property = BEGV; \
gl_state.e_property = ZV + 1; \
gl_state.object = Qnil; \
- gl_state.use_global = 0; \
gl_state.offset = 0; \
- gl_state.current_syntax_table = current_buffer->syntax_table; \
if (parse_sexp_lookup_properties) \
if ((COUNT) > 0 || (FROM) > BEGV) \
update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT),\
#define SETUP_SYNTAX_TABLE_FOR_OBJECT(OBJECT, FROM, COUNT) \
do \
{ \
+ SETUP_BUFFER_SYNTAX_TABLE (); \
gl_state.object = (OBJECT); \
if (BUFFERP (gl_state.object)) \
{ \
gl_state.e_property = 1 + SCHARS (gl_state.object); \
gl_state.offset = 0; \
} \
- gl_state.use_global = 0; \
- gl_state.current_syntax_table = current_buffer->syntax_table; \
if (parse_sexp_lookup_properties) \
update_syntax_table (((FROM) + gl_state.offset \
+ (COUNT > 0 ? 0 : -1)), \
#include <errno.h>
#ifdef HAVE_SETPGID
-#if !defined (USG) || defined (BSD_PGRPS)
+#if !defined (USG)
#undef setpgrp
#define setpgrp setpgid
#endif
#include "msdos.h"
#include <sys/param.h>
-#if __DJGPP__ > 1
extern int etext;
extern unsigned start __asm__ ("start");
#endif
-#endif
-
-#ifndef USE_CRT_DLL
-#ifndef errno
-extern int errno;
-#endif
-#endif
#include <sys/file.h>
wait_without_blocking ()
{
-#ifdef BSD_SYSTEM
- wait3 (0, WNOHANG | WUNTRACED, 0);
-#else
croak ("wait_without_blocking");
-#endif
synch_process_alive = 0;
}
else
sigpause (SIGEMPTYMASK);
#else /* not BSD_SYSTEM, and not HPUX version >= 6 */
-#ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */
+#ifdef WINDOWSNT
+ wait (0);
+ break;
+#else /* not WINDOWSNT */
sigblock (sigmask (SIGCHLD));
errno = 0;
if (kill (pid, 0) == -1 && errno == ESRCH)
}
sigsuspend (&empty_mask);
-#else /* not POSIX_SIGNALS */
-#ifdef HAVE_SYSV_SIGPAUSE
- sighold (SIGCHLD);
- if (0 > kill (pid, 0))
- {
- sigrelse (SIGCHLD);
- break;
- }
- sigpause (SIGCHLD);
-#else /* not HAVE_SYSV_SIGPAUSE */
-#ifdef WINDOWSNT
- wait (0);
- break;
-#else /* not WINDOWSNT */
- if (0 > kill (pid, 0))
- break;
- /* Using sleep instead of pause avoids timing error.
- If the inferior dies just before the sleep,
- we lose just one second. */
- sleep (1);
#endif /* not WINDOWSNT */
-#endif /* not HAVE_SYSV_SIGPAUSE */
-#endif /* not POSIX_SIGNALS */
#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */
#else /* not subprocesses */
-#if __DJGPP__ > 1
break;
-#else /* not __DJGPP__ > 1 */
- if (kill (pid, 0) < 0)
- break;
- wait (0);
-#endif /* not __DJGPP__ > 1*/
#endif /* not subprocesses */
}
}
#endif
s.main.c_oflag &= ~TAB3; /* Disable tab expansion */
s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */
- s.main.c_lflag |= ICANON; /* Enable erase/kill and eof processing */
- s.main.c_cc[VEOF] = 04; /* insure that EOF is Control-D */
s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */
s.main.c_cc[VKILL] = CDISABLE; /* disable kill processing */
#endif /* not SIGNALS_VIA_CHARACTERS */
#ifdef AIX
-/* AIX enhanced edit loses NULs, so disable it */
-#ifndef IBMR2AIX
- s.main.c_line = 0;
- s.main.c_iflag &= ~ASCEDIT;
-#endif
/* Also, PTY overloads NUL and BREAK.
don't ignore break, but don't signal either, so it looks like NUL. */
s.main.c_iflag &= ~IGNBRK;
/* rms: Formerly it set s.main.c_cc[VINTR] to 0377 here
unconditionally. Then a SIGNALS_VIA_CHARACTERS conditional
would force it to 0377. That looks like duplicated code. */
- s.main.c_cc[VEOL] = CDISABLE;
s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */
#endif /* AIX */
s.main.sg_kill = 0377;
s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */
+ /* We used to enable ICANON (and set VEOF to 04), but this leads to
+ problems where process.c wants to send EOFs every once in a while
+ to force the output, which leads to weird effects when the
+ subprocess has disabled ICANON and ends up seeing those spurious
+ extra EOFs. So we don't send EOFs any more in
+ process.c:send_process, and instead we disable ICANON by default,
+ so if a subsprocess sets up ICANON, it's his problem (or the Elisp
+ package that talks to it) to deal with lines that are too long. */
+ s.main.c_lflag &= ~ICANON; /* Disable line editing and eof processing */
+ s.main.c_cc[VMIN] = 1;
+ s.main.c_cc[VTIME] = 0;
+
#endif /* not HAVE_TERMIO */
EMACS_SET_TTY (out, &s, 0);
#ifdef DOS_NT
pid = 0;
-#if __DJGPP__ > 1
save_signal_handlers (saved_handlers);
synch_process_alive = 1;
-#endif /* __DJGPP__ > 1 */
#else
pid = vfork ();
if (pid == -1)
}
/* Do this now if we did not do it before. */
-#if !defined (MSDOS) || __DJGPP__ == 1
+#ifndef MSDOS
save_signal_handlers (saved_handlers);
synch_process_alive = 1;
#endif
#endif /* FASYNC */
#endif /* F_SETFL */
#endif /* SIGIO */
-\f
-/* Saving and restoring the process group of Emacs's terminal. */
-
-#ifdef BSD_PGRPS
-
-/* The process group of which Emacs was a member when it initially
- started.
-
- If Emacs was in its own process group (i.e. inherited_pgroup ==
- getpid ()), then we know we're running under a shell with job
- control (Emacs would never be run as part of a pipeline).
- Everything is fine.
-
- If Emacs was not in its own process group, then we know we're
- running under a shell (or a caller) that doesn't know how to
- separate itself from Emacs (like sh). Emacs must be in its own
- process group in order to receive SIGIO correctly. In this
- situation, we put ourselves in our own pgroup, forcibly set the
- tty's pgroup to our pgroup, and make sure to restore and reinstate
- the tty's pgroup just like any other terminal setting. If
- inherited_group was not the tty's pgroup, then we'll get a
- SIGTTmumble when we try to change the tty's pgroup, and a CONT if
- it goes foreground in the future, which is what should happen.
-
- This variable is initialized in emacs.c. */
-int inherited_pgroup;
-
-/* Split off the foreground process group to Emacs alone. When we are
- in the foreground, but not started in our own process group,
- redirect the tty device handle FD to point to our own process
- group. We need to be in our own process group to receive SIGIO
- properly. */
-static void
-narrow_foreground_group (int fd)
-{
- int me = getpid ();
-
- setpgrp (0, inherited_pgroup);
-#if 0
- /* XXX inherited_pgroup should not be zero here, but GTK seems to
- mess this up. */
- if (! inherited_pgroup)
- abort (); /* Should not happen. */
-#endif
- if (inherited_pgroup != me)
- EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling tty. */
- setpgrp (0, me);
-}
-
-/* Set the tty to our original foreground group. */
-static void
-widen_foreground_group (int fd)
-{
- if (inherited_pgroup != getpid ())
- EMACS_SET_TTY_PGRP (fd, &inherited_pgroup);
- setpgrp (0, inherited_pgroup);
-}
-#endif /* BSD_PGRPS */
\f
/* Getting and setting emacs_tty structures. */
if (!tty_out->output)
return; /* The tty is suspended. */
-#ifdef BSD_PGRPS
-#if 0
- /* read_socket_hook is not global anymore. I think doing this
- unconditionally will not cause any problems. */
- if (! read_socket_hook && EQ (Vinitial_window_system, Qnil))
-#endif
- narrow_foreground_group (fileno (tty_out->input));
-#endif
-
if (! tty_out->old_tty)
tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
#endif /* mips or HAVE_TCATTR */
#ifdef AIX
-#ifndef IBMR2AIX
- /* AIX enhanced edit loses NULs, so disable it. */
- tty.main.c_line = 0;
- tty.main.c_iflag &= ~ASCEDIT;
-#else
tty.main.c_cc[VSTRT] = CDISABLE;
tty.main.c_cc[VSTOP] = CDISABLE;
tty.main.c_cc[VSUSP] = CDISABLE;
tty.main.c_cc[VDSUSP] = CDISABLE;
-#endif /* IBMR2AIX */
if (tty_out->flow_control)
{
#ifdef VSTART
if (tty_out->term_initted && no_redraw_on_reenter)
{
- /* XXX This seems wrong on multi-tty. */
- if (display_completed)
- direct_output_forward_char (0);
+ /* We used to call "direct_output_forward_char(0)" here,
+ but it's not clear why, since it may not do anything anyway. */
}
else
{
dos_ttcooked ();
#endif
-#ifdef BSD_PGRPS
- widen_foreground_group (fileno (tty_out->input));
-#endif
}
\f
#ifdef HAVE_PTYS
/* POSIX signals support - DJB */
/* Anyone with POSIX signals should have ANSI C declarations */
-#ifdef POSIX_SIGNALS
-
sigset_t empty_mask, full_mask;
+#ifndef WINDOWSNT
+
signal_handler_t
sys_signal (int signal_number, signal_handler_t action)
{
return (old_action.sa_handler);
}
+#endif /* WINDOWSNT */
+
#ifndef __GNUC__
/* If we're compiling with GCC, we don't need this function, since it
can be written as a macro. */
return (old_mask);
}
-#endif /* POSIX_SIGNALS */
\f
#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST
static char *my_sys_siglist[NSIG];
void
init_signals ()
{
-#ifdef POSIX_SIGNALS
sigemptyset (&empty_mask);
sigfillset (&full_mask);
-#endif
#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST
if (! initialized)
int rtnval;
rtnval = emacs_close (dirp->dd_fd);
-
- /* Some systems (like Solaris) allocate the buffer and the DIR all
- in one block. Why in the world are we freeing this ourselves
- anyway? */
-#if ! defined (SOLARIS2)
- xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */
-#endif
xfree ((char *) dirp);
return rtnval;
unsigned long minflt, majflt, cminflt, cmajflt, vsize;
time_t sec;
unsigned usec;
- EMACS_TIME tnow, tstart, tboot, telapsed,ttotal;
+ EMACS_TIME tnow, tstart, tboot, telapsed;
double pcpu, pmem;
Lisp_Object attrs = Qnil;
Lisp_Object cmd_str, decoded_cmd, tem;
extern pthread_t main_thread;
#endif
-#ifdef POSIX_SIGNALS
-
/* Don't #include <signal.h>. That header should always be #included
before "config.h", because some configuration files (like s/hpux.h)
indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file
#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)
-#else /* ! defined (POSIX_SIGNALS) */
-#ifdef USG5_4
-
-extern SIGMASKTYPE sigprocmask_set;
-
-#ifndef sigblock
-#define sigblock(sig) \
- (sigprocmask_set = SIGEMPTYMASK | (sig), \
- sigprocmask (SIG_BLOCK, &sigprocmask_set, NULL))
-#endif
-
-#ifndef sigunblock
-#define sigunblock(sig) \
- (sigprocmask_set = SIGFULLMASK & ~(sig), \
- sigprocmask (SIG_SETMASK, &sigprocmask_set, NULL))
-#endif
-
-#else
-#ifdef USG
-
-#ifndef sigunblock
-#define sigunblock(sig)
-#endif
-
-#else
-
-#ifndef sigunblock
-#define sigunblock(SIG) \
-{ SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); }
-#endif
-
-#endif /* ! defined (USG) */
-#endif /* ! defined (USG5_4) */
-#endif /* ! defined (POSIX_SIGNALS) */
-
#ifndef SIGMASKTYPE
#define SIGMASKTYPE int
#endif
#include <termios.h>
#endif
-#ifdef NEED_BSDTTY
+#ifdef HPUX
#include <sys/bsdtty.h>
-#endif
-
-#if defined (HPUX) && defined (HAVE_PTYS)
#include <sys/ptyio.h>
#endif
#include <sys/pty.h>
#endif /* AIX */
-#if (defined (POSIX) || defined (NEED_UNISTD_H)) && defined (HAVE_UNISTD_H)
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
won't find. */
-
-#if defined HAVE_TERMCAP_H && 0
-#include <termcap.h>
-#else
extern void tputs P_ ((const char *, int, int (*)(int)));
extern int tgetent P_ ((char *, const char *));
extern int tgetflag P_ ((char *id));
extern int tgetnum P_ ((char *id));
-#endif
#include "cm.h"
#ifdef HAVE_X_WINDOWS
+ it->glyph_row->used[it->area]);
end = it->glyph_row->glyphs[1 + it->area];
+ /* If the glyph row is reversed, we need to prepend the glyph rather
+ than append it. */
+ if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
+ {
+ struct glyph *g;
+ int move_by = it->pixel_width;
+
+ /* Make room for the new glyphs. */
+ if (move_by > end - glyph) /* don't overstep end of this area */
+ move_by = end - glyph;
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
+ g[move_by] = *g;
+ glyph = it->glyph_row->glyphs[it->area];
+ end = glyph + move_by;
+ }
+
+ /* BIDI Note: we put the glyphs of a "multi-pixel" character left to
+ right, even in the REVERSED_P case, since (a) all of its u.ch are
+ identical, and (b) the PADDING_P flag needs to be set for the
+ leftmost one, because we write to the terminal left-to-right. */
for (i = 0;
i < it->pixel_width && glyph < end;
++i)
glyph->padding_p = i > 0;
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
+ else
+ {
+ glyph->resolved_level = 0;
+ glyph->bidi_type = UNKNOWN_BT;
+ }
++it->glyph_row->used[it->area];
++glyph;
}
}
-
/* Produce glyphs for the display element described by IT. *IT
specifies what we want to produce a glyph for (character, image, ...),
and where in the glyph matrix we currently are (glyph row and hpos).
glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
if (glyph < it->glyph_row->glyphs[1 + it->area])
{
+ /* If the glyph row is reversed, we need to prepend the glyph
+ rather than append it. */
+ if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
+ {
+ struct glyph *g;
+
+ /* Make room for the new glyph. */
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
+ g[1] = *g;
+ glyph = it->glyph_row->glyphs[it->area];
+ }
glyph->type = COMPOSITE_GLYPH;
glyph->pixel_width = it->pixel_width;
glyph->u.cmp.id = it->cmp_it.id;
glyph->padding_p = 0;
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
+ else
+ {
+ glyph->resolved_level = 0;
+ glyph->bidi_type = UNKNOWN_BT;
+ }
++it->glyph_row->used[it->area];
++glyph;
if (what == IT_CONTINUATION)
{
- /* Continuation glyph. */
- SET_GLYPH_FROM_CHAR (glyph, '\\');
+ /* Continuation glyph. For R2L lines, we mirror it by hand. */
+ if (it->bidi_it.paragraph_dir == R2L)
+ SET_GLYPH_FROM_CHAR (glyph, '/');
+ else
+ SET_GLYPH_FROM_CHAR (glyph, '\\');
if (it->dp
&& (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc))
&& GLYPH_CODE_CHAR_VALID_P (gc))
{
+ /* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
&& (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc))
&& GLYPH_CODE_CHAR_VALID_P (gc))
{
+ /* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
struct tty_display_info *tty;
struct frame *f;
{
- Lisp_Object tem, val, color_mode_spec;
+ Lisp_Object tem, val;
Lisp_Object color_mode;
int mode;
extern Lisp_Object Qtty_color_mode;
if (INTEGERP (val))
color_mode = val;
- else
+ else if (SYMBOLP (tty_color_mode_alist))
{
- tem = (NILP (tty_color_mode_alist) ? Qnil
- : Fassq (val, XSYMBOL (tty_color_mode_alist)->value));
+ tem = Fassq (val, Fsymbol_value (tty_color_mode_alist));
color_mode = CONSP (tem) ? XCDR (tem) : Qnil;
}
+ else
+ color_mode = Qnil;
mode = INTEGERP (color_mode) ? XINT (color_mode) : 0;
EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */
if (pgid != -1)
{
-#if defined (USG) && !defined (BSD_PGRPS)
+#if defined (USG)
setpgrp ();
no_controlling_tty = 1;
#elif defined (CYGWIN)
}
if (status == 0)
{
-#ifdef TERMINFO
maybe_fatal (must_succeed, terminal,
"Terminal type %s is not defined",
"Terminal type %s is not defined.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
-`setenv TERM ...') to specify the correct type. It may be necessary\n\
-to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
- terminal_type);
+`setenv TERM ...') to specify the correct type. It may be necessary\n"
+#ifdef TERMINFO
+"to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
#else
- maybe_fatal (must_succeed, terminal,
- "Terminal type %s is not defined",
- "Terminal type %s is not defined.\n\
-If that is not the actual type of terminal you have,\n\
-use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
-`setenv TERM ...') to specify the correct type. It may be necessary\n\
-to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
- terminal_type);
+"to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
#endif
+ terminal_type);
}
#ifndef TERMINFO
{
maybe_fatal (must_succeed, terminal,
"Terminal type \"%s\" is not powerful enough to run Emacs",
-# ifdef TERMINFO
"Terminal type \"%s\" is not powerful enough to run Emacs.\n\
It lacks the ability to position the cursor.\n\
If that is not the actual type of terminal you have,\n\
use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
-`setenv TERM ...') to specify the correct type. It may be necessary\n\
-to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
+`setenv TERM ...') to specify the correct type. It may be necessary\n"
+# ifdef TERMINFO
+"to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
# else /* TERMCAP */
- "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
-It lacks the ability to position the cursor.\n\
-If that is not the actual type of terminal you have,\n\
-use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
-`setenv TERM ...') to specify the correct type. It may be necessary\n\
-to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
+"to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
# endif /* TERMINFO */
terminal_type);
}
{
int i, nwrite, ret;
char buf[80];
- extern int errno;
char zeros[UnexBlockSz];
for (i = 0; ptr < end;)
#ifdef HAVE_COFF_H
#include <coff.h>
#ifdef MSDOS
-#if __DJGPP__ > 1
#include <fcntl.h> /* for O_RDONLY, O_RDWR */
#include <crt0.h> /* for _crt0_startup_flags and its bits */
static int save_djgpp_startup_flags;
-#endif /* __DJGPP__ > 1 */
#define filehdr external_filehdr
#define scnhdr external_scnhdr
#define syment external_syment
if (a_out >= 0)
{
#ifdef MSDOS
-#if __DJGPP__ > 1
/* Support the coff-go32-exe format with a prepended stub, since
this is what GCC 2.8.0 and later generates by default in DJGPP. */
unsigned short mz_header[3];
}
else
lseek (a_out, 0L, 0);
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr))
{
{
register int i, nwrite, ret;
char buf[80];
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
/* This is the normal amount to write at once.
It is the size of block that NFS uses. */
int writesize = 1 << 13;
register char *ptr;
#ifdef MSDOS
-#if __DJGPP__ >= 2
/* Dump the original table of exception handlers, not the one
where our exception hooks are registered. */
__djgpp_exception_toggle ();
and which might change the way that dumped Emacs works. */
save_djgpp_startup_flags = _crt0_startup_flags;
_crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR);
-#endif
#endif
lseek (new, (long) text_scnptr, 0);
write_segment (new, ptr, end);
#ifdef MSDOS
-#if __DJGPP__ >= 2
/* Restore our exception hooks. */
__djgpp_exception_toggle ();
/* Restore the startup flags. */
_crt0_startup_flags = save_djgpp_startup_flags;
#endif
-#endif
return 0;
PERROR (name);
}
\f
-#ifndef COFF_BSD_SYMBOLS
/*
* If the COFF file contains a symbol table and a line number section,
return 0;
}
-#endif /* COFF_BSD_SYMBOLS */
-
/* ****************************************************************
* unexec
*
if (make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) < 0
|| copy_text_and_data (new, a_out) < 0
|| copy_sym (new, a_out, a_name, new_name) < 0
-#ifndef COFF_BSD_SYMBOLS
|| adjust_lnnoptrs (new, a_out, new_name) < 0
-#endif
)
{
close (new);
menus, and the Windows clipboard. */
/* Written by Dale P. Smith <dpsm@en.com> */
-/* Adapted to DJGPP v1 by Eli Zaretskii <eliz@is.elta.co.il> */
+/* Adapted to DJGPP by Eli Zaretskii <eliz@gnu.org> */
#ifdef MSDOS
/* The size of allocated storage for storing the clipboard data. */
static size_t clipboard_storage_size;
\f
-/* Emulation of `__dpmi_int' and friends for DJGPP v1.x */
-
-#if __DJGPP__ < 2
-
-typedef _go32_dpmi_registers __dpmi_regs;
-#define __tb _go32_info_block.linear_address_of_transfer_buffer
-#define _dos_ds _go32_info_block.selector_for_linear_memory
-
-static int
-__dpmi_int (intno, regs)
- int intno;
- __dpmi_regs *regs;
-{
- regs->x.ss = regs->x.sp = regs->x.flags = 0;
- return _go32_dpmi_simulate_int (intno, regs);
-}
-
-#endif /* __DJGPP__ < 2 */
-\f
/* C functions to access the Windows 3.1x clipboard from DOS apps.
The information was obtained from the Microsoft Knowledge Base,
into the clipboard if we run under Windows, so we cannot check
the clipboard alone.) */
if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY))
- && ! NILP (SYMBOL_VALUE (Fintern_soft (build_string ("kill-ring"),
- Qnil))))
+ && ! NILP (Fsymbol_value (Fintern_soft (build_string ("kill-ring"),
+ Qnil))))
return Qt;
if (EQ (selection, QCLIPBOARD))
return 0;
}
+int
+sigemptyset (sigset_t *set)
+{
+ return 0;
+}
+
+int
+sigaddset (sigset_t *set, int signo)
+{
+ return 0;
+}
+
+int
+sigfillset (sigset_t *set)
+{
+ return 0;
+}
+
+int
+sigprocmask (int how, const sigset_t *set, sigset_t *oset)
+{
+ return 0;
+}
+
int
setpgrp (int pid, int gid)
{
}
else
#endif
- nchars = _write (fd, buffer, count);
+ {
+ /* Some networked filesystems don't like too large writes, so
+ break them into smaller chunks. See the Comments section of
+ the MSDN documentation of WriteFile for details behind the
+ choice of the value of CHUNK below. See also the thread
+ http://thread.gmane.org/gmane.comp.version-control.git/145294
+ in the git mailing list. */
+ const unsigned char *p = buffer;
+ const unsigned chunk = 30 * 1024 * 1024;
+
+ nchars = 0;
+ while (count > 0)
+ {
+ unsigned this_chunk = count < chunk ? count : chunk;
+ int n = _write (fd, p, this_chunk);
+
+ nchars += n;
+ if (n < 0)
+ {
+ nchars = n;
+ break;
+ }
+ else if (n < this_chunk)
+ break;
+ count -= n;
+ p += n;
+ }
+ }
return nchars;
}
{
}
+/***********************************************************************
+ stubs from termcap.c
+ ***********************************************************************/
+
+void
+sys_tputs (char *str, int nlines, int (*outfun)())
+{
+}
+
+char *
+sys_tgetstr (char *cap, char **area)
+{
+ return NULL;
+}
+
+
+/***********************************************************************
+ stubs from cm.c
+ ***********************************************************************/
+
+struct tty_display_info *current_tty = NULL;
+int cost = 0;
+
+int
+evalcost (char c)
+{
+ return c;
+}
+
+int
+cmputc (char c)
+{
+ return c;
+}
+
+void
+cmcheckmagic (struct tty_display_info *tty)
+{
+}
+
+void
+cmcostinit (struct tty_display_info *tty)
+{
+}
+
+void
+cmgoto (struct tty_display_info *tty, int row, int col)
+{
+}
+
+void
+Wcm_clear (struct tty_display_info *tty)
+{
+}
+
+
/***********************************************************************
Faces
***********************************************************************/
extern Lisp_Object Vcommand_line_args, Vsystem_name;
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* A mask of extra modifier bits to put into every keyboard char. */
extern EMACS_INT extra_keyboard_modifiers;
}
if (glyph_row->exact_window_width_line_p
- && w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])
+ && (glyph_row->reversed_p
+ ? (w->phys_cursor.hpos < 0)
+ : (w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])))
{
glyph_row->cursor_in_fringe_p = 1;
- draw_fringe_bitmap (w, glyph_row, 0);
+ draw_fringe_bitmap (w, glyph_row, glyph_row->reversed_p);
return;
}
Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
Lisp_Object Qdisplay_buffer;
-Lisp_Object Qscroll_up, Qscroll_down;
+Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
Lisp_Object Qwindow_size_fixed;
extern Lisp_Object Qleft_margin, Qright_margin;
if (!NILP (Vscroll_preserve_screen_position))
{
/* We preserve the goal pixel coordinate across consecutive
- calls to scroll-up or scroll-down. This avoids the
+ calls to scroll-up, scroll-down and other commands that
+ have the `scroll-command' property. This avoids the
possibility of point becoming "stuck" on a tall line when
scrolling by one line. */
if (window_scroll_pixel_based_preserve_y < 0
- || (!EQ (current_kboard->Vlast_command, Qscroll_up)
- && !EQ (current_kboard->Vlast_command, Qscroll_down)))
+ || !SYMBOLP (current_kboard->Vlast_command)
+ || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
{
start_display (&it, w, start);
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
if (!NILP (Vscroll_preserve_screen_position))
{
if (window_scroll_preserve_vpos <= 0
- || (!EQ (current_kboard->Vlast_command, Qscroll_up)
- && !EQ (current_kboard->Vlast_command, Qscroll_down)))
+ || !SYMBOLP (current_kboard->Vlast_command)
+ || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
{
struct position posit
= *compute_motion (startpos, 0, 0, 0,
Qscroll_down = intern_c_string ("scroll-down");
staticpro (&Qscroll_down);
+ Qscroll_command = intern_c_string ("scroll-command");
+ staticpro (&Qscroll_command);
+
+ Fput (Qscroll_up, Qscroll_command, Qt);
+ Fput (Qscroll_down, Qscroll_command, Qt);
+
Qwindow_size_fixed = intern_c_string ("window-size-fixed");
staticpro (&Qwindow_size_fixed);
Fset (Qwindow_size_fixed, Qnil);
A value of t means point keeps its screen position if the scroll
command moved it vertically out of the window, e.g. when scrolling
by full screens.
-Any other value means point always keeps its screen position. */);
+Any other value means point always keeps its screen position.
+Scroll commands should have the `scroll-command' property
+on their symbols to be controlled by this variable. */);
Vscroll_preserve_screen_position = Qnil;
DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type,
initial_define_key (control_x_map, '<', "scroll-left");
initial_define_key (control_x_map, '>', "scroll-right");
- initial_define_key (global_map, Ctl ('V'), "scroll-up");
+ initial_define_key (global_map, Ctl ('V'), "scroll-up-command");
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
- initial_define_key (meta_map, 'v', "scroll-down");
-
- initial_define_key (global_map, Ctl('L'), "recenter");
- initial_define_key (meta_map, 'r', "move-to-window-line");
+ initial_define_key (meta_map, 'v', "scroll-down-command");
}
/* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f
/* The buffer displayed in this window */
/* Of the fields vchild, hchild and buffer, only one is non-nil. */
Lisp_Object buffer;
- /* A marker pointing to where in the text to start displaying */
+ /* A marker pointing to where in the text to start displaying.
+ BIDI Note: This is the _logical-order_ start, i.e. the smallest
+ buffer position visible in the window, not necessarily the
+ character displayed in the top left corner of the window. */
Lisp_Object start;
/* A marker pointing to where in the text point is in this window,
used only when the window is not selected.
decides it's time to do it. This is done either automatically for
you as part of the interpreter's command loop or as the result of
calling Lisp functions like `sit-for'. The C function `redisplay'
- in xdisp.c is the only entry into the inner redisplay code. (Or,
- let's say almost---see the description of direct update
- operations, below.)
+ in xdisp.c is the only entry into the inner redisplay code.
The following diagram shows how redisplay code is invoked. As you
can see, Lisp calls redisplay and vice versa. Under window systems
change the interpreter's state. If you don't follow these rules,
you will encounter bugs which are very hard to explain.
- (Direct functions, see below)
- direct_output_for_insert,
- direct_forward_char (dispnew.c)
- +---------------------------------+
- | |
- | V
+--------------+ redisplay +----------------+
| Lisp machine |---------------->| Redisplay code |<--+
+--------------+ (xdisp.c) +----------------+ |
then compared to find a cheap way to update the display, e.g. by
reusing part of the display by scrolling lines.
-
- Direct operations.
-
You will find a lot of redisplay optimizations when you start
looking at the innards of redisplay. The overall goal of all these
optimizations is to make redisplay fast because it is done
- frequently.
+ frequently. Some of these optimizations are implemented by the
+ following functions:
+
+ . try_cursor_movement
+
+ This function tries to update the display if the text in the
+ window did not change and did not scroll, only point moved, and
+ it did not move off the displayed portion of the text.
+
+ . try_window_reusing_current_matrix
+
+ This function reuses the current matrix of a window when text
+ has not changed, but the window start changed (e.g., due to
+ scrolling).
+
+ . try_window_id
+
+ This function attempts to redisplay a window by reusing parts of
+ its existing display. It finds and reuses the part that was not
+ changed, and redraws the rest.
- Two optimizations are not found in xdisp.c. These are the direct
- operations mentioned above. As the name suggests they follow a
- different principle than the rest of redisplay. Instead of
- building a desired matrix and then comparing it with the current
- display, they perform their actions directly on the display and on
- the current matrix.
+ . try_window
- One direct operation updates the display after one character has
- been entered. The other one moves the cursor by one position
- forward or backward. You find these functions under the names
- `direct_output_for_insert' and `direct_output_forward_char' in
- dispnew.c.
+ This function performs the full redisplay of a single window
+ assuming that its fonts were not changed and that the cursor
+ will not end up in the scroll margins. (Loading fonts requires
+ re-adjustment of dimensions of glyph matrices, which makes this
+ method impossible to use.)
+ These optimizations are tried in sequence (some can be skipped if
+ it is known that they are not applicable). If none of the
+ optimizations were successful, redisplay calls redisplay_windows,
+ which performs a full redisplay of all windows.
Desired matrices.
see in dispextern.h.
Glyphs in a desired matrix are normally constructed in a loop
- calling get_next_display_element and then produce_glyphs. The call
- to produce_glyphs will fill the iterator structure with pixel
+ calling get_next_display_element and then PRODUCE_GLYPHS. The call
+ to PRODUCE_GLYPHS will fill the iterator structure with pixel
information about the element being displayed and at the same time
produce glyphs for it. If the display element fits on the line
being displayed, set_iterator_to_next is called next, otherwise the
- glyphs produced are discarded.
-
+ glyphs produced are discarded. The function display_line is the
+ workhorse of filling glyph rows in the desired matrix with glyphs.
+ In addition to producing glyphs, it also handles line truncation
+ and continuation, word wrap, and cursor positioning (for the
+ latter, see also set_cursor_from_row).
Frame matrices.
wanted to have without having to move many bytes around. To be
honest, there is a little bit more done, but not much more. If you
plan to extend that code, take a look at dispnew.c. The function
- build_frame_matrix is a good starting point. */
+ build_frame_matrix is a good starting point.
+
+ Bidirectional display.
+
+ Bidirectional display adds quite some hair to this already complex
+ design. The good news are that a large portion of that hairy stuff
+ is hidden in bidi.c behind only 3 interfaces. bidi.c implements a
+ reordering engine which is called by set_iterator_to_next and
+ returns the next character to display in the visual order. See
+ commentary on bidi.c for more details. As far as redisplay is
+ concerned, the effect of calling bidi_move_to_visually_next, the
+ main interface of the reordering engine, is that the iterator gets
+ magically placed on the buffer or string position that is to be
+ displayed next. In other words, a linear iteration through the
+ buffer/string is replaced with a non-linear one. All the rest of
+ the redisplay is oblivious to the bidi reordering.
+
+ Well, almost oblivious---there are still complications, most of
+ them due to the fact that buffer and string positions no longer
+ change monotonously with glyph indices in a glyph row. Moreover,
+ for continued lines, the buffer positions may not even be
+ monotonously changing with vertical positions. Also, accounting
+ for face changes, overlays, etc. becomes more complex because
+ non-linear iteration could potentially skip many positions with
+ changes, and then cross them again on the way back...
+
+ One other prominent effect of bidirectional display is that some
+ paragraphs of text need to be displayed starting at the right
+ margin of the window---the so-called right-to-left, or R2L
+ paragraphs. R2L paragraphs are displayed with R2L glyph rows,
+ which have their reversed_p flag set. The bidi reordering engine
+ produces characters in such rows starting from the character which
+ should be the rightmost on display. PRODUCE_GLYPHS then reverses
+ the order, when it fills up the glyph row whose reversed_p flag is
+ set, by prepending each new glyph to what is already there, instead
+ of appending it. When the glyph row is complete, the function
+ extend_face_to_end_of_line fills the empty space to the left of the
+ leftmost character with special glyphs, which will display as,
+ well, empty. On text terminals, these special glyphs are simply
+ blank characters. On graphics terminals, there's a single stretch
+ glyph with suitably computed width. Both the blanks and the
+ stretch glyph are given the face of the background of the line.
+ This way, the terminal-specific back-end can still draw the glyphs
+ left to right, even for R2L lines. */
#include <config.h>
#include <stdio.h>
Lisp_Object Qgrow_only;
Lisp_Object Qinhibit_eval_during_redisplay;
Lisp_Object Qbuffer_position, Qposition, Qobject;
+Lisp_Object Qright_to_left, Qleft_to_right;
/* Cursor shapes */
Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
Lisp_Object Vauto_resize_tool_bars;
+/* Type of tool bar. Can be symbols image, text, both or both-hroiz. */
+
+Lisp_Object Vtool_bar_style;
+
+/* Maximum number of characters a label can have to be shown. */
+
+EMACS_INT tool_bar_max_label_size;
+
/* Non-zero means draw block and hollow cursor as wide as the glyph
under it. For example, if a block cursor is over a tab, it will be
drawn as wide as that tab on the display. */
/* Test if overflow newline into fringe. Called with iterator IT
at or past right window margin, and with IT->current_x set. */
-#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) \
- (!NILP (Voverflow_newline_into_fringe) \
- && FRAME_WINDOW_P (it->f) \
- && WINDOW_RIGHT_FRINGE_WIDTH (it->w) > 0 \
- && it->current_x == it->last_visible_x \
- && it->line_wrap != WORD_WRAP)
+#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(IT) \
+ (!NILP (Voverflow_newline_into_fringe) \
+ && FRAME_WINDOW_P ((IT)->f) \
+ && ((IT)->bidi_it.paragraph_dir == R2L \
+ ? (WINDOW_LEFT_FRINGE_WIDTH ((IT)->w) > 0) \
+ : (WINDOW_RIGHT_FRINGE_WIDTH ((IT)->w) > 0)) \
+ && (IT)->current_x == (IT)->last_visible_x \
+ && (IT)->line_wrap != WORD_WRAP)
#else /* !HAVE_WINDOW_SYSTEM */
#define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0
Lisp_Object Qnobreak_space;
/* The symbol `image' which is the car of the lists used to represent
- images in Lisp. */
+ images in Lisp. Also a tool bar style. */
Lisp_Object Qimage;
Lisp_Object QCmap, QCpointer;
Lisp_Object Qrect, Qcircle, Qpoly;
+/* Tool bar styles */
+Lisp_Object Qtext, Qboth, Qboth_horiz;
+
/* Non-zero means print newline to stdout before next mini-buffer
message. */
static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
static void x_consider_frame_title P_ ((Lisp_Object));
static void handle_stop P_ ((struct it *));
+static void handle_stop_backwards P_ ((struct it *, EMACS_INT));
static int tool_bar_lines_needed P_ ((struct frame *, int *));
static int single_display_spec_intangible_p P_ ((Lisp_Object));
static void ensure_echo_area_buffers P_ ((void));
static void notice_overwritten_cursor P_ ((struct window *,
enum glyph_row_area,
int, int, int, int));
+static void append_stretch_glyph P_ ((struct it *, Lisp_Object,
+ int, int, int));
specbind (Qinhibit_redisplay, Qt);
/* Use Qt to ensure debugger does not run,
so there is no possibility of wanting to redisplay. */
- val = internal_condition_case_2 (Ffuncall, nargs, args, Qt,
+ val = internal_condition_case_n (Ffuncall, nargs, args, Qt,
safe_eval_handler);
UNGCPRO;
val = unbind_to (count, val);
init_iterator (it, w, charpos, bytepos, row, base_face_id)
struct it *it;
struct window *w;
- int charpos, bytepos;
+ EMACS_INT charpos, bytepos;
struct glyph_row *row;
enum face_id base_face_id;
{
/* Are multibyte characters enabled in current_buffer? */
it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
+ /* Do we need to reorder bidirectional text? Not if this is a
+ unibyte buffer: by definition, none of the single-byte characters
+ are strong R2L, so no reordering is needed. And bidi.c doesn't
+ support unibyte buffers anyway. */
+ it->bidi_p
+ = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p;
+
/* Non-zero if we should highlight the region. */
highlight_region_p
= (!NILP (Vtransient_mark_mode)
it->glyph_row = row;
it->area = TEXT_AREA;
+ /* Forget any previous info about this row being reversed. */
+ if (it->glyph_row)
+ it->glyph_row->reversed_p = 0;
+
/* Get the dimensions of the display area. The display area
consists of the visible window area plus a horizontally scrolled
part to the left of the window. All x-values are relative to the
it->start_of_box_run_p = 1;
}
+ /* If we are to reorder bidirectional text, init the bidi
+ iterator. */
+ if (it->bidi_p)
+ {
+ /* Note the paragraph direction that this buffer wants to
+ use. */
+ if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right))
+ it->paragraph_embedding = L2R;
+ else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left))
+ it->paragraph_embedding = R2L;
+ else
+ it->paragraph_embedding = NEUTRAL_DIR;
+ bidi_init_it (charpos, bytepos, &it->bidi_it);
+ }
+
/* If a buffer position was specified, set the iterator there,
getting overlays and face properties from that position. */
if (charpos >= BUF_BEG (current_buffer))
struct window *w;
struct display_pos *pos;
{
- int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
+ EMACS_INT charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
int i, overlay_strings_with_newlines = 0;
/* If POS specifies a position in a display vector, this might
else
{
int invis_p;
- EMACS_INT newpos, next_stop, start_charpos;
+ EMACS_INT newpos, next_stop, start_charpos, tem;
Lisp_Object pos, prop, overlay;
/* First of all, is there invisible text at this position? */
- start_charpos = IT_CHARPOS (*it);
- pos = make_number (IT_CHARPOS (*it));
+ tem = start_charpos = IT_CHARPOS (*it);
+ pos = make_number (tem);
prop = get_char_property_and_overlay (pos, Qinvisible, it->window,
&overlay);
invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
/* If we are on invisible text, skip over it. */
- if (invis_p && IT_CHARPOS (*it) < it->end_charpos)
+ if (invis_p && start_charpos < it->end_charpos)
{
/* Record whether we have to display an ellipsis for the
invisible text. */
do
{
/* Try to skip some invisible text. Return value is the
- position reached which can be equal to IT's position
- if there is nothing invisible here. This skips both
+ position reached which can be equal to where we start
+ if there is nothing invisible there. This skips both
over invisible text properties and overlays with
invisible property. */
- newpos = skip_invisible (IT_CHARPOS (*it),
- &next_stop, ZV, it->window);
+ newpos = skip_invisible (tem, &next_stop, ZV, it->window);
/* If we skipped nothing at all we weren't at invisible
text in the first place. If everything to the end of
the buffer was skipped, end the loop. */
- if (newpos == IT_CHARPOS (*it) || newpos >= ZV)
+ if (newpos == tem || newpos >= ZV)
invis_p = 0;
else
{
/* If we ended up on invisible text, proceed to
skip starting with next_stop. */
if (invis_p)
- IT_CHARPOS (*it) = next_stop;
+ tem = next_stop;
/* If there are adjacent invisible texts, don't lose the
second one's ellipsis. */
while (invis_p);
/* The position newpos is now either ZV or on visible text. */
- IT_CHARPOS (*it) = newpos;
- IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
+ if (it->bidi_p && newpos < ZV)
+ {
+ /* With bidi iteration, the region of invisible text
+ could start and/or end in the middle of a non-base
+ embedding level. Therefore, we need to skip
+ invisible text using the bidi iterator, starting at
+ IT's current position, until we find ourselves
+ outside the invisible text. Skipping invisible text
+ _after_ bidi iteration avoids affecting the visual
+ order of the displayed text when invisible properties
+ are added or removed. */
+ if (it->bidi_it.first_elt)
+ {
+ /* If we were `reseat'ed to a new paragraph,
+ determine the paragraph base direction. We need
+ to do it now because next_element_from_buffer may
+ not have a chance to do it, if we are going to
+ skip any text at the beginning, which resets the
+ FIRST_ELT flag. */
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ }
+ do
+ {
+ bidi_move_to_visually_next (&it->bidi_it);
+ }
+ while (it->stop_charpos <= it->bidi_it.charpos
+ && it->bidi_it.charpos < newpos);
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ /* If we overstepped NEWPOS, record its position in the
+ iterator, so that we skip invisible text if later the
+ bidi iteration lands us in the invisible region
+ again. */
+ if (IT_CHARPOS (*it) >= newpos)
+ it->prev_stop = newpos;
+ }
+ else
+ {
+ IT_CHARPOS (*it) = newpos;
+ IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
+ }
/* If there are before-strings at the start of invisible
text, and the text is invisible because of a text
overlay property instead of a text property, this is
already handled in the overlay code.) */
if (NILP (overlay)
- && get_overlay_strings (it, start_charpos))
+ && get_overlay_strings (it, it->stop_charpos))
{
handled = HANDLED_RECOMPUTE_PROPS;
it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
first invisible character. */
if (!STRINGP (it->object))
{
- it->position.charpos = IT_CHARPOS (*it) - 1;
+ it->position.charpos = newpos - 1;
it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
}
it->ellipsis_p = 1;
return 0;
}
-
-/* Determine which buffer position in W's buffer STRING comes from.
- AROUND_CHARPOS is an approximate position where it could come from.
- Value is the buffer position or 0 if it couldn't be determined.
+/* Look for STRING in overlays and text properties in W's buffer,
+ between character positions FROM and TO (excluding TO).
+ BACK_P non-zero means look back (in this case, TO is supposed to be
+ less than FROM).
+ Value is the first character position where STRING was found, or
+ zero if it wasn't found before hitting TO.
W's buffer must be current.
- This function is necessary because we don't record buffer positions
- in glyphs generated from strings (to keep struct glyph small).
This function may only use code that doesn't eval because it is
called asynchronously from note_mouse_highlight. */
-int
-string_buffer_position (w, string, around_charpos)
+static EMACS_INT
+string_buffer_position_lim (w, string, from, to, back_p)
struct window *w;
Lisp_Object string;
- int around_charpos;
+ EMACS_INT from, to;
+ int back_p;
{
Lisp_Object limit, prop, pos;
- const int MAX_DISTANCE = 1000;
int found = 0;
- pos = make_number (around_charpos);
- limit = make_number (min (XINT (pos) + MAX_DISTANCE, ZV));
- while (!found && !EQ (pos, limit))
+ pos = make_number (from);
+
+ if (!back_p) /* looking forward */
{
- prop = Fget_char_property (pos, Qdisplay, Qnil);
- if (!NILP (prop) && display_prop_string_p (prop, string))
- found = 1;
- else
- pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil, limit);
+ limit = make_number (min (to, ZV));
+ while (!found && !EQ (pos, limit))
+ {
+ prop = Fget_char_property (pos, Qdisplay, Qnil);
+ if (!NILP (prop) && display_prop_string_p (prop, string))
+ found = 1;
+ else
+ pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil,
+ limit);
+ }
}
-
- if (!found)
+ else /* looking back */
{
- pos = make_number (around_charpos);
- limit = make_number (max (XINT (pos) - MAX_DISTANCE, BEGV));
+ limit = make_number (max (to, BEGV));
while (!found && !EQ (pos, limit))
{
prop = Fget_char_property (pos, Qdisplay, Qnil);
return found ? XINT (pos) : 0;
}
+/* Determine which buffer position in W's buffer STRING comes from.
+ AROUND_CHARPOS is an approximate position where it could come from.
+ Value is the buffer position or 0 if it couldn't be determined.
+
+ W's buffer must be current.
+
+ This function is necessary because we don't record buffer positions
+ in glyphs generated from strings (to keep struct glyph small).
+ This function may only use code that doesn't eval because it is
+ called asynchronously from note_mouse_highlight. */
+
+EMACS_INT
+string_buffer_position (w, string, around_charpos)
+ struct window *w;
+ Lisp_Object string;
+ EMACS_INT around_charpos;
+{
+ Lisp_Object limit, prop, pos;
+ const int MAX_DISTANCE = 1000;
+ EMACS_INT found = string_buffer_position_lim (w, string, around_charpos,
+ around_charpos + MAX_DISTANCE,
+ 0);
+
+ if (!found)
+ found = string_buffer_position_lim (w, string, around_charpos,
+ around_charpos - MAX_DISTANCE, 1);
+ return found;
+}
+
\f
/***********************************************************************
p = it->stack + it->sp;
p->stop_charpos = it->stop_charpos;
+ p->prev_stop = it->prev_stop;
+ p->base_level_stop = it->base_level_stop;
p->cmp_it = it->cmp_it;
xassert (it->face_id >= 0);
p->face_id = it->face_id;
++it->sp;
}
+static void
+iterate_out_of_display_property (it)
+ struct it *it;
+{
+ /* Maybe initialize paragraph direction. If we are at the beginning
+ of a new paragraph, next_element_from_buffer may not have a
+ chance to do that. */
+ if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ /* prev_stop can be zero, so check against BEGV as well. */
+ while (it->bidi_it.charpos >= BEGV
+ && it->prev_stop <= it->bidi_it.charpos
+ && it->bidi_it.charpos < CHARPOS (it->position))
+ bidi_move_to_visually_next (&it->bidi_it);
+ /* Record the stop_pos we just crossed, for when we cross it
+ back, maybe. */
+ if (it->bidi_it.charpos > CHARPOS (it->position))
+ it->prev_stop = CHARPOS (it->position);
+ /* If we ended up not where pop_it put us, resync IT's
+ positional members with the bidi iterator. */
+ if (it->bidi_it.charpos != CHARPOS (it->position))
+ {
+ SET_TEXT_POS (it->position,
+ it->bidi_it.charpos, it->bidi_it.bytepos);
+ it->current.pos = it->position;
+ }
+}
/* Restore IT's settings from IT->stack. Called, for example, when no
more overlay strings must be processed, and we return to delivering
--it->sp;
p = it->stack + it->sp;
it->stop_charpos = p->stop_charpos;
+ it->prev_stop = p->prev_stop;
+ it->base_level_stop = p->base_level_stop;
it->cmp_it = p->cmp_it;
it->face_id = p->face_id;
it->current = p->current;
break;
case GET_FROM_BUFFER:
it->object = it->w->buffer;
+ if (it->bidi_p)
+ {
+ /* Bidi-iterate until we get out of the portion of text, if
+ any, covered by a `display' text property or an overlay
+ with `display' property. (We cannot just jump there,
+ because the internal coherency of the bidi iterator state
+ can not be preserved across such jumps.) We also must
+ determine the paragraph base direction if the overlay we
+ just processed is at the beginning of a new
+ paragraph. */
+ iterate_out_of_display_property (it);
+ }
break;
case GET_FROM_STRING:
it->object = it->string;
if (IT_CHARPOS (*it) <= BEGV)
break;
- /* If selective > 0, then lines indented more than that values
- are invisible. */
+ /* If selective > 0, then lines indented more than its value are
+ invisible. */
if (it->selective > 0
&& indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
(double) it->selective)) /* iftc */
if (force_p
|| CHARPOS (pos) > it->stop_charpos
|| CHARPOS (pos) < original_pos)
- handle_stop (it);
+ {
+ if (it->bidi_p)
+ {
+ /* For bidi iteration, we need to prime prev_stop and
+ base_level_stop with our best estimations. */
+ if (CHARPOS (pos) < it->prev_stop)
+ {
+ handle_stop_backwards (it, BEGV);
+ if (CHARPOS (pos) < it->base_level_stop)
+ it->base_level_stop = 0;
+ }
+ else if (CHARPOS (pos) > it->stop_charpos
+ && it->stop_charpos >= BEGV)
+ handle_stop_backwards (it, it->stop_charpos);
+ else /* force_p */
+ handle_stop (it);
+ }
+ else
+ {
+ handle_stop (it);
+ it->prev_stop = it->base_level_stop = 0;
+ }
+
+ }
CHECK_IT (it);
}
it->sp = 0;
it->string_from_display_prop_p = 0;
it->face_before_selective_p = 0;
+ if (it->bidi_p)
+ it->bidi_it.first_elt = 1;
if (set_stop_p)
- it->stop_charpos = CHARPOS (pos);
+ {
+ it->stop_charpos = CHARPOS (pos);
+ it->base_level_stop = CHARPOS (pos);
+ }
}
\f
/***********************************************************************
Iteration
- ***********************************************************************/
+***********************************************************************/
/* Map enum it_method value to corresponding next_element_from_* function. */
if (it->what == IT_CHARACTER)
{
+ /* UAX#9, L4: "A character is depicted by a mirrored glyph if
+ and only if (a) the resolved directionality of that character
+ is R..." */
+ /* FIXME: Do we need an exception for characters from display
+ tables? */
+ if (it->bidi_p && it->bidi_it.type == STRONG_R)
+ it->c = bidi_mirror_char (it->c);
/* Map via display table or translate control characters.
IT->c, IT->len etc. have been set to the next character by
the function call above. If we have a display table, and it
Lisp_Object dv;
struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
enum { char_is_other = 0, char_is_nbsp, char_is_soft_hyphen }
- nbsp_or_shy = char_is_other;
+ nbsp_or_shy = char_is_other;
int decoded = it->c;
if (it->dp
happen actually, but due to bugs it may
happen. Let's print the char as is, there's
not much meaningful we can do with it. */
- str[0] = it->c;
- str[1] = it->c >> 8;
- str[2] = it->c >> 16;
- str[3] = it->c >> 24;
- len = 4;
- }
+ str[0] = it->c;
+ str[1] = it->c >> 8;
+ str[2] = it->c >> 16;
+ str[3] = it->c >> 24;
+ len = 4;
+ }
for (i = 0; i < len; i++)
{
reseat_at_next_visible_line_start (it, 0);
else if (it->cmp_it.id >= 0)
{
- IT_CHARPOS (*it) += it->cmp_it.nchars;
- IT_BYTEPOS (*it) += it->cmp_it.nbytes;
- if (it->cmp_it.to < it->cmp_it.nglyphs)
- it->cmp_it.from = it->cmp_it.to;
+ /* We are currently getting glyphs from a composition. */
+ int i;
+
+ if (! it->bidi_p)
+ {
+ IT_CHARPOS (*it) += it->cmp_it.nchars;
+ IT_BYTEPOS (*it) += it->cmp_it.nbytes;
+ if (it->cmp_it.to < it->cmp_it.nglyphs)
+ {
+ it->cmp_it.from = it->cmp_it.to;
+ }
+ else
+ {
+ it->cmp_it.id = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it),
+ it->stop_charpos, Qnil);
+ }
+ }
+ else if (! it->cmp_it.reversed_p)
+ {
+ /* Composition created while scanning forward. */
+ /* Update IT's char/byte positions to point to the first
+ character of the next grapheme cluster, or to the
+ character visually after the current composition. */
+ for (i = 0; i < it->cmp_it.nchars; i++)
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+
+ if (it->cmp_it.to < it->cmp_it.nglyphs)
+ {
+ /* Proceed to the next grapheme cluster. */
+ it->cmp_it.from = it->cmp_it.to;
+ }
+ else
+ {
+ /* No more grapheme clusters in this composition.
+ Find the next stop position. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ /* Now we are scanning backward and don't know
+ where to stop. */
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
+ }
else
{
- it->cmp_it.id = -1;
- composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
- IT_BYTEPOS (*it), it->stop_charpos,
- Qnil);
+ /* Composition created while scanning backward. */
+ /* Update IT's char/byte positions to point to the last
+ character of the previous grapheme cluster, or the
+ character visually after the current composition. */
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+
+ if (it->cmp_it.from > 0)
+ {
+ /* Proceed to the previous grapheme cluster. */
+ it->cmp_it.to = it->cmp_it.from;
+ }
+ else
+ {
+ /* No more grapheme clusters in this composition.
+ Find the next stop position. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ /* Now we are scanning backward and don't know
+ where to stop. */
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
}
}
else
{
xassert (it->len != 0);
- IT_BYTEPOS (*it) += it->len;
- IT_CHARPOS (*it) += 1;
+
+ if (!it->bidi_p)
+ {
+ IT_BYTEPOS (*it) += it->len;
+ IT_CHARPOS (*it) += 1;
+ }
+ else
+ {
+ int prev_scan_dir = it->bidi_it.scan_dir;
+ /* If this is a new paragraph, determine its base
+ direction (a.k.a. its base embedding level). */
+ if (it->bidi_it.new_paragraph)
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+ if (prev_scan_dir != it->bidi_it.scan_dir)
+ {
+ /* As the scan direction was changed, we must
+ re-compute the stop position for composition. */
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
+ }
xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
}
break;
it->face_id = it->saved_face_id;
/* KFS: This code used to check ip->dpvec[0] instead of the current element.
- That seemed totally bogus - so I changed it... */
+ That seemed totally bogus - so I changed it... */
gc = it->dpvec[it->current.dpvec_index];
if (GLYPH_CODE_P (gc) && GLYPH_CODE_CHAR_VALID_P (gc))
return 1;
}
+/* Scan forward from CHARPOS in the current buffer, until we find a
+ stop position > current IT's position. Then handle the stop
+ position before that. This is called when we bump into a stop
+ position while reordering bidirectional text. CHARPOS should be
+ the last previously processed stop_pos (or BEGV, if none were
+ processed yet) whose position is less that IT's current
+ position. */
+
+static void
+handle_stop_backwards (it, charpos)
+ struct it *it;
+ EMACS_INT charpos;
+{
+ EMACS_INT where_we_are = IT_CHARPOS (*it);
+ struct display_pos save_current = it->current;
+ struct text_pos save_position = it->position;
+ struct text_pos pos1;
+ EMACS_INT next_stop;
+
+ /* Scan in strict logical order. */
+ it->bidi_p = 0;
+ do
+ {
+ it->prev_stop = charpos;
+ SET_TEXT_POS (pos1, charpos, CHAR_TO_BYTE (charpos));
+ reseat_1 (it, pos1, 0);
+ compute_stop_pos (it);
+ /* We must advance forward, right? */
+ if (it->stop_charpos <= it->prev_stop)
+ abort ();
+ charpos = it->stop_charpos;
+ }
+ while (charpos <= where_we_are);
+
+ next_stop = it->stop_charpos;
+ it->stop_charpos = it->prev_stop;
+ it->bidi_p = 1;
+ it->current = save_current;
+ it->position = save_position;
+ handle_stop (it);
+ it->stop_charpos = next_stop;
+}
/* Load IT with the next display element from current_buffer. Value
is zero if end of buffer reached. IT->stop_charpos is the next
xassert (IT_CHARPOS (*it) >= BEGV);
+ /* With bidi reordering, the character to display might not be the
+ character at IT_CHARPOS. BIDI_IT.FIRST_ELT non-zero means that
+ we were reseat()ed to a new buffer position, which is potentially
+ a different paragraph. */
+ if (it->bidi_p && it->bidi_it.first_elt)
+ {
+ it->bidi_it.charpos = IT_CHARPOS (*it);
+ it->bidi_it.bytepos = IT_BYTEPOS (*it);
+ if (it->bidi_it.bytepos == ZV_BYTE)
+ {
+ /* Nothing to do, but reset the FIRST_ELT flag, like
+ bidi_paragraph_init does, because we are not going to
+ call it. */
+ it->bidi_it.first_elt = 0;
+ }
+ else if (it->bidi_it.bytepos == BEGV_BYTE
+ /* FIXME: Should support all Unicode line separators. */
+ || FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n'
+ || FETCH_CHAR (it->bidi_it.bytepos) == '\n')
+ {
+ /* If we are at the beginning of a line, we can produce the
+ next element right away. */
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ bidi_move_to_visually_next (&it->bidi_it);
+ }
+ else
+ {
+ int orig_bytepos = IT_BYTEPOS (*it);
+
+ /* We need to prime the bidi iterator starting at the line's
+ beginning, before we will be able to produce the next
+ element. */
+ IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it), -1);
+ IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
+ it->bidi_it.charpos = IT_CHARPOS (*it);
+ it->bidi_it.bytepos = IT_BYTEPOS (*it);
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ do
+ {
+ /* Now return to buffer position where we were asked to
+ get the next display element, and produce that. */
+ bidi_move_to_visually_next (&it->bidi_it);
+ }
+ while (it->bidi_it.bytepos != orig_bytepos
+ && it->bidi_it.bytepos < ZV_BYTE);
+ }
+
+ it->bidi_it.first_elt = 0; /* paranoia: bidi.c does this */
+ /* Adjust IT's position information to where we ended up. */
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ SET_TEXT_POS (it->position, IT_CHARPOS (*it), IT_BYTEPOS (*it));
+ {
+ EMACS_INT stop = it->stop_charpos;
+ if (it->bidi_it.scan_dir < 0)
+ stop = -1;
+ composition_compute_stop_pos (&it->cmp_it, IT_CHARPOS (*it),
+ IT_BYTEPOS (*it), stop, Qnil);
+ }
+ }
+
if (IT_CHARPOS (*it) >= it->stop_charpos)
{
if (IT_CHARPOS (*it) >= it->end_charpos)
success_p = 0;
}
}
+ else if (!(!it->bidi_p
+ || BIDI_AT_BASE_LEVEL (it->bidi_it)
+ || IT_CHARPOS (*it) == it->stop_charpos))
+ {
+ /* With bidi non-linear iteration, we could find ourselves
+ far beyond the last computed stop_charpos, with several
+ other stop positions in between that we missed. Scan
+ them all now, in buffer's logical order, until we find
+ and handle the last stop_charpos that precedes our
+ current position. */
+ handle_stop_backwards (it, it->stop_charpos);
+ return GET_NEXT_DISPLAY_ELEMENT (it);
+ }
else
{
+ if (it->bidi_p)
+ {
+ /* Take note of the stop position we just moved across,
+ for when we will move back across it. */
+ it->prev_stop = it->stop_charpos;
+ /* If we are at base paragraph embedding level, take
+ note of the last stop position seen at this
+ level. */
+ if (BIDI_AT_BASE_LEVEL (it->bidi_it))
+ it->base_level_stop = it->stop_charpos;
+ }
handle_stop (it);
return GET_NEXT_DISPLAY_ELEMENT (it);
}
}
+ else if (it->bidi_p
+ /* We can sometimes back up for reasons that have nothing
+ to do with bidi reordering. E.g., compositions. The
+ code below is only needed when we are above the base
+ embedding level, so test for that explicitly. */
+ && !BIDI_AT_BASE_LEVEL (it->bidi_it)
+ && IT_CHARPOS (*it) < it->prev_stop)
+ {
+ if (it->base_level_stop <= 0)
+ it->base_level_stop = BEGV;
+ if (IT_CHARPOS (*it) < it->base_level_stop)
+ abort ();
+ handle_stop_backwards (it, it->base_level_stop);
+ return GET_NEXT_DISPLAY_ELEMENT (it);
+ }
else
{
/* No face changes, overlays etc. in sight, so just return a
character from current_buffer. */
unsigned char *p;
+ EMACS_INT stop;
/* Maybe run the redisplay end trigger hook. Performance note:
This doesn't seem to cost measurable time. */
&& IT_CHARPOS (*it) >= it->redisplay_end_trigger_charpos)
run_redisplay_end_trigger_hook (it);
+ stop = it->bidi_it.scan_dir < 0 ? -1 : it->end_charpos;
if (CHAR_COMPOSED_P (it, IT_CHARPOS (*it), IT_BYTEPOS (*it),
- it->end_charpos)
+ stop)
&& next_element_from_composition (it))
{
return 1;
{
IT_CHARPOS (*it) += it->cmp_it.nchars;
IT_BYTEPOS (*it) += it->cmp_it.nbytes;
+ if (it->bidi_p)
+ {
+ if (it->bidi_it.new_paragraph)
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ /* Resync the bidi iterator with IT's new position.
+ FIXME: this doesn't support bidirectional text. */
+ while (it->bidi_it.charpos < IT_CHARPOS (*it))
+ bidi_move_to_visually_next (&it->bidi_it);
+ }
return 0;
}
it->position = it->current.pos;
it->object = it->w->buffer;
it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it),
IT_BYTEPOS (*it), Qnil);
+ if (it->cmp_it.reversed_p)
+ {
+ /* Now it->position points the last character of the current
+ grapheme cluster. Adjust it to point the first one. We
+ have to do it here so that append_composite_glyph sets
+ correct (struct glyph)->charpos. */
+ int i;
+ for (i = 0; i < it->cmp_it.nchars - 1; i++)
+ bidi_move_to_visually_next (&it->bidi_it);
+ IT_CHARPOS (*it) = it->bidi_it.charpos;
+ IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+ it->position = it->current.pos;
+ }
}
return 1;
}
line on the display without producing glyphs.
OP should be a bit mask including some or all of these bits:
- MOVE_TO_X: Stop on reaching x-position TO_X.
- MOVE_TO_POS: Stop on reaching buffer or string position TO_CHARPOS.
- Regardless of OP's value, stop in reaching the end of the display line.
+ MOVE_TO_X: Stop upon reaching x-position TO_X.
+ MOVE_TO_POS: Stop upon reaching buffer or string position TO_CHARPOS.
+ Regardless of OP's value, stop upon reaching the end of the display line.
TO_X is normally a value 0 <= TO_X <= IT->last_visible_x.
This means, in particular, that TO_X includes window's horizontal
struct glyph_row *saved_glyph_row;
struct it wrap_it, atpos_it, atx_it;
int may_wrap = 0;
+ enum it_method prev_method = it->method;
+ EMACS_INT prev_pos = IT_CHARPOS (*it);
/* Don't produce glyphs in produce_glyphs. */
saved_glyph_row = it->glyph_row;
#define BUFFER_POS_REACHED_P() \
((op & MOVE_TO_POS) != 0 \
&& BUFFERP (it->object) \
- && IT_CHARPOS (*it) >= to_charpos \
+ && (IT_CHARPOS (*it) == to_charpos \
+ || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos)) \
&& (it->method == GET_FROM_BUFFER \
|| (it->method == GET_FROM_DISPLAY_VECTOR \
&& it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
if ((op & MOVE_TO_POS) != 0
&& BUFFERP (it->object)
&& it->method == GET_FROM_BUFFER
- && IT_CHARPOS (*it) > to_charpos)
+ && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos)
+ || (it->bidi_p
+ && (prev_method == GET_FROM_IMAGE
+ || prev_method == GET_FROM_STRETCH)
+ /* Passed TO_CHARPOS from left to right. */
+ && ((prev_pos < to_charpos
+ && IT_CHARPOS (*it) > to_charpos)
+ /* Passed TO_CHARPOS from right to left. */
+ || (prev_pos > to_charpos
+ && IT_CHARPOS (*it) < to_charpos)))))
{
if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0)
{
atpos_it = *it;
}
+ prev_method = it->method;
+ if (it->method == GET_FROM_BUFFER)
+ prev_pos = IT_CHARPOS (*it);
/* Stop when ZV reached.
We used to stop here when TO_CHARPOS reached as well, but that is
too soon if this glyph does not fit on this line. So we handle it
break;
}
+ if (it->method == GET_FROM_BUFFER)
+ prev_pos = IT_CHARPOS (*it);
/* The current display element has been consumed. Advance
to the next. */
set_iterator_to_next (it, 1);
if (m)
{
int len;
-#ifdef NO_ARG_ARRAY
char *a[3];
a[0] = (char *) a1;
a[1] = (char *) a2;
len = doprnt (FRAME_MESSAGE_BUF (f),
FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3, a);
-#else
- len = doprnt (FRAME_MESSAGE_BUF (f),
- FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3,
- (char **) &a1);
-#endif /* NO_ARG_ARRAY */
message2 (FRAME_MESSAGE_BUF (f), len, 0);
}
&& overlay_touches_p (Z - end))
unchanged_p = 0;
}
+
+ /* Under bidi reordering, adding or deleting a character in the
+ beginning of a paragraph, before the first strong directional
+ character, can change the base direction of the paragraph (unless
+ the buffer specifies a fixed paragraph direction), which will
+ require to redisplay the whole paragraph. It might be worthwhile
+ to find the paragraph limits and widen the range of redisplayed
+ lines to that, but for now just give up this optimization. */
+ if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+ && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ unchanged_p = 0;
}
return unchanged_p;
select_frame_for_redisplay (frame)
Lisp_Object frame;
{
- Lisp_Object tail, symbol, val;
+ Lisp_Object tail, tem;
Lisp_Object old = selected_frame;
struct Lisp_Symbol *sym;
selected_frame = frame;
- do
- {
- for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
- if (CONSP (XCAR (tail))
- && (symbol = XCAR (XCAR (tail)),
- SYMBOLP (symbol))
- && (sym = indirect_variable (XSYMBOL (symbol)),
- val = sym->value,
- (BUFFER_LOCAL_VALUEP (val)))
- && XBUFFER_LOCAL_VALUE (val)->check_frame)
- /* Use find_symbol_value rather than Fsymbol_value
- to avoid an error if it is void. */
- find_symbol_value (symbol);
- } while (!EQ (frame, old) && (frame = old, 1));
+ do {
+ for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
+ if (CONSP (XCAR (tail))
+ && (tem = XCAR (XCAR (tail)),
+ SYMBOLP (tem))
+ && (sym = indirect_variable (XSYMBOL (tem)),
+ sym->redirect == SYMBOL_LOCALIZED)
+ && sym->val.blv->frame_local)
+ /* Use find_symbol_value rather than Fsymbol_value
+ to avoid an error if it is void. */
+ find_symbol_value (tem);
+ } while (!EQ (frame, old) && (frame = old, 1));
}
if (!f->glyphs_initialized_p)
return;
- /* The flag redisplay_performed_directly_p is set by
- direct_output_for_insert when it already did the whole screen
- update necessary. */
- if (redisplay_performed_directly_p)
- {
- redisplay_performed_directly_p = 0;
- if (!hscroll_windows (selected_window))
- return;
- }
-
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
if (popup_activated ())
return;
if (windows_or_buffers_changed && !pause)
goto retry;
- /* Clear the face cache eventually. */
- if (consider_all_windows_p)
+ /* Clear the face and image caches.
+
+ We used to do this only if consider_all_windows_p. But the cache
+ needs to be cleared if a timer creates images in the current
+ buffer (e.g. the test case in Bug#6230). */
+
+ if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
{
- if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
- {
- clear_face_cache (0);
- clear_face_cache_count = 0;
- }
+ clear_face_cache (0);
+ clear_face_cache_count = 0;
+ }
+
#ifdef HAVE_WINDOW_SYSTEM
- if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
- {
- clear_image_caches (Qnil);
- clear_image_cache_count = 0;
- }
-#endif /* HAVE_WINDOW_SYSTEM */
+ if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
+ {
+ clear_image_caches (Qnil);
+ clear_image_cache_count = 0;
}
+#endif /* HAVE_WINDOW_SYSTEM */
end_of_redisplay:
unbind_to (count, Qnil);
struct glyph *glyph = row->glyphs[TEXT_AREA];
struct glyph *end = glyph + row->used[TEXT_AREA];
struct glyph *cursor = NULL;
- /* The first glyph that starts a sequence of glyphs from a string
- that is a value of a display property. */
- struct glyph *string_start;
- /* The X coordinate of string_start. */
- int string_start_x;
/* The last known character position in row. */
int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
- /* The last known character position before string_start. */
- int string_before_pos;
int x = row->x;
- int cursor_x = x;
- /* Last buffer position covered by an overlay. */
- int cursor_from_overlay_pos = 0;
- int pt_old = PT - delta;
-
- /* Skip over glyphs not having an object at the start of the row.
- These are special glyphs like truncation marks on terminal
- frames. */
+ EMACS_INT pt_old = PT - delta;
+ EMACS_INT pos_before = MATRIX_ROW_START_CHARPOS (row) + delta;
+ EMACS_INT pos_after = MATRIX_ROW_END_CHARPOS (row) + delta;
+ struct glyph *glyph_before = glyph - 1, *glyph_after = end;
+ /* A glyph beyond the edge of TEXT_AREA which we should never
+ touch. */
+ struct glyph *glyphs_end = end;
+ /* Non-zero means we've found a match for cursor position, but that
+ glyph has the avoid_cursor_p flag set. */
+ int match_with_avoid_cursor = 0;
+ /* Non-zero means we've seen at least one glyph that came from a
+ display string. */
+ int string_seen = 0;
+ /* Largest buffer position seen so far during scan of glyph row. */
+ EMACS_INT bpos_max = last_pos;
+ /* Last buffer position covered by an overlay string with an integer
+ `cursor' property. */
+ EMACS_INT bpos_covered = 0;
+
+ /* Skip over glyphs not having an object at the start and the end of
+ the row. These are special glyphs like truncation marks on
+ terminal frames. */
if (row->displays_text_p)
- while (glyph < end
- && INTEGERP (glyph->object)
- && glyph->charpos < 0)
+ {
+ if (!row->reversed_p)
+ {
+ while (glyph < end
+ && INTEGERP (glyph->object)
+ && glyph->charpos < 0)
+ {
+ x += glyph->pixel_width;
+ ++glyph;
+ }
+ while (end > glyph
+ && INTEGERP ((end - 1)->object)
+ /* CHARPOS is zero for blanks and stretch glyphs
+ inserted by extend_face_to_end_of_line. */
+ && (end - 1)->charpos <= 0)
+ --end;
+ glyph_before = glyph - 1;
+ glyph_after = end;
+ }
+ else
+ {
+ struct glyph *g;
+
+ /* If the glyph row is reversed, we need to process it from back
+ to front, so swap the edge pointers. */
+ glyphs_end = end = glyph - 1;
+ glyph += row->used[TEXT_AREA] - 1;
+
+ while (glyph > end + 1
+ && INTEGERP (glyph->object)
+ && glyph->charpos < 0)
+ {
+ --glyph;
+ x -= glyph->pixel_width;
+ }
+ if (INTEGERP (glyph->object) && glyph->charpos < 0)
+ --glyph;
+ /* By default, in reversed rows we put the cursor on the
+ rightmost (first in the reading order) glyph. */
+ for (g = end + 1; g < glyph; g++)
+ x += g->pixel_width;
+ while (end < glyph
+ && INTEGERP ((end + 1)->object)
+ && (end + 1)->charpos <= 0)
+ ++end;
+ glyph_before = glyph + 1;
+ glyph_after = end;
+ }
+ }
+ else if (row->reversed_p)
+ {
+ /* In R2L rows that don't display text, put the cursor on the
+ rightmost glyph. Case in point: an empty last line that is
+ part of an R2L paragraph. */
+ cursor = end - 1;
+ /* Avoid placing the cursor on the last glyph of the row, where
+ on terminal frames we hold the vertical border between
+ adjacent windows. */
+ if (!FRAME_WINDOW_P (WINDOW_XFRAME (w))
+ && !WINDOW_RIGHTMOST_P (w)
+ && cursor == row->glyphs[LAST_AREA] - 1)
+ cursor--;
+ x = -1; /* will be computed below, at label compute_x */
+ }
+
+ /* Step 1: Try to find the glyph whose character position
+ corresponds to point. If that's not possible, find 2 glyphs
+ whose character positions are the closest to point, one before
+ point, the other after it. */
+ if (!row->reversed_p)
+ while (/* not marched to end of glyph row */
+ glyph < end
+ /* glyph was not inserted by redisplay for internal purposes */
+ && !INTEGERP (glyph->object))
{
+ if (BUFFERP (glyph->object))
+ {
+ EMACS_INT dpos = glyph->charpos - pt_old;
+
+ if (glyph->charpos > bpos_max)
+ bpos_max = glyph->charpos;
+ if (!glyph->avoid_cursor_p)
+ {
+ /* If we hit point, we've found the glyph on which to
+ display the cursor. */
+ if (dpos == 0)
+ {
+ match_with_avoid_cursor = 0;
+ break;
+ }
+ /* See if we've found a better approximation to
+ POS_BEFORE or to POS_AFTER. Note that we want the
+ first (leftmost) glyph of all those that are the
+ closest from below, and the last (rightmost) of all
+ those from above. */
+ if (0 > dpos && dpos > pos_before - pt_old)
+ {
+ pos_before = glyph->charpos;
+ glyph_before = glyph;
+ }
+ else if (0 < dpos && dpos <= pos_after - pt_old)
+ {
+ pos_after = glyph->charpos;
+ glyph_after = glyph;
+ }
+ }
+ else if (dpos == 0)
+ match_with_avoid_cursor = 1;
+ }
+ else if (STRINGP (glyph->object))
+ {
+ Lisp_Object chprop;
+ int glyph_pos = glyph->charpos;
+
+ chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
+ glyph->object);
+ if (INTEGERP (chprop))
+ {
+ bpos_covered = bpos_max + XINT (chprop);
+ /* If the `cursor' property covers buffer positions up
+ to and including point, we should display cursor on
+ this glyph. Note that overlays and text properties
+ with string values stop bidi reordering, so every
+ buffer position to the left of the string is always
+ smaller than any position to the right of the
+ string. Therefore, if a `cursor' property on one
+ of the string's characters has an integer value, we
+ will break out of the loop below _before_ we get to
+ the position match above. IOW, integer values of
+ the `cursor' property override the "exact match for
+ point" strategy of positioning the cursor. */
+ /* Implementation note: bpos_max == pt_old when, e.g.,
+ we are in an empty line, where bpos_max is set to
+ MATRIX_ROW_START_CHARPOS, see above. */
+ if (bpos_max <= pt_old && bpos_covered >= pt_old)
+ {
+ cursor = glyph;
+ break;
+ }
+ }
+
+ string_seen = 1;
+ }
x += glyph->pixel_width;
++glyph;
}
+ else if (glyph > end) /* row is reversed */
+ while (!INTEGERP (glyph->object))
+ {
+ if (BUFFERP (glyph->object))
+ {
+ EMACS_INT dpos = glyph->charpos - pt_old;
- string_start = NULL;
- while (glyph < end
- && !INTEGERP (glyph->object)
- && (!BUFFERP (glyph->object)
- || (last_pos = glyph->charpos) < pt_old
- || glyph->avoid_cursor_p))
+ if (glyph->charpos > bpos_max)
+ bpos_max = glyph->charpos;
+ if (!glyph->avoid_cursor_p)
+ {
+ if (dpos == 0)
+ {
+ match_with_avoid_cursor = 0;
+ break;
+ }
+ if (0 > dpos && dpos > pos_before - pt_old)
+ {
+ pos_before = glyph->charpos;
+ glyph_before = glyph;
+ }
+ else if (0 < dpos && dpos <= pos_after - pt_old)
+ {
+ pos_after = glyph->charpos;
+ glyph_after = glyph;
+ }
+ }
+ else if (dpos == 0)
+ match_with_avoid_cursor = 1;
+ }
+ else if (STRINGP (glyph->object))
+ {
+ Lisp_Object chprop;
+ int glyph_pos = glyph->charpos;
+
+ chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
+ glyph->object);
+ if (INTEGERP (chprop))
+ {
+ bpos_covered = bpos_max + XINT (chprop);
+ /* If the `cursor' property covers buffer positions up
+ to and including point, we should display cursor on
+ this glyph. */
+ if (bpos_max <= pt_old && bpos_covered >= pt_old)
+ {
+ cursor = glyph;
+ break;
+ }
+ }
+ string_seen = 1;
+ }
+ --glyph;
+ if (glyph == glyphs_end) /* don't dereference outside TEXT_AREA */
+ {
+ x--; /* can't use any pixel_width */
+ break;
+ }
+ x -= glyph->pixel_width;
+ }
+
+ /* Step 2: If we didn't find an exact match for point, we need to
+ look for a proper place to put the cursor among glyphs between
+ GLYPH_BEFORE and GLYPH_AFTER. */
+ if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
+ && BUFFERP (glyph->object) && glyph->charpos == pt_old)
+ && bpos_covered < pt_old)
{
- if (! STRINGP (glyph->object))
+ if (row->ends_in_ellipsis_p && pos_after == last_pos)
{
- string_start = NULL;
- x += glyph->pixel_width;
- ++glyph;
- /* If we are beyond the cursor position computed from the
- last overlay seen, that overlay is not in effect for
- current cursor position. Reset the cursor information
- computed from that overlay. */
- if (cursor_from_overlay_pos
- && last_pos >= cursor_from_overlay_pos)
+ EMACS_INT ellipsis_pos;
+
+ /* Scan back over the ellipsis glyphs. */
+ if (!row->reversed_p)
{
- cursor_from_overlay_pos = 0;
- cursor = NULL;
+ ellipsis_pos = (glyph - 1)->charpos;
+ while (glyph > row->glyphs[TEXT_AREA]
+ && (glyph - 1)->charpos == ellipsis_pos)
+ glyph--, x -= glyph->pixel_width;
+ /* That loop always goes one position too far, including
+ the glyph before the ellipsis. So scan forward over
+ that one. */
+ x += glyph->pixel_width;
+ glyph++;
}
- }
- else
- {
- if (string_start == NULL)
+ else /* row is reversed */
{
- string_before_pos = last_pos;
- string_start = glyph;
- string_start_x = x;
+ ellipsis_pos = (glyph + 1)->charpos;
+ while (glyph < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1
+ && (glyph + 1)->charpos == ellipsis_pos)
+ glyph++, x += glyph->pixel_width;
+ x -= glyph->pixel_width;
+ glyph--;
}
- /* Skip all glyphs from a string. */
- do
+ }
+ else if (match_with_avoid_cursor
+ /* zero-width characters produce no glyphs */
+ || ((row->reversed_p
+ ? glyph_after > glyphs_end
+ : glyph_after < glyphs_end)
+ && eabs (glyph_after - glyph_before) == 1))
+ {
+ cursor = glyph_after;
+ x = -1;
+ }
+ else if (string_seen)
+ {
+ int incr = row->reversed_p ? -1 : +1;
+
+ /* Need to find the glyph that came out of a string which is
+ present at point. That glyph is somewhere between
+ GLYPH_BEFORE and GLYPH_AFTER, and it came from a string
+ positioned between POS_BEFORE and POS_AFTER in the
+ buffer. */
+ struct glyph *stop = glyph_after;
+ EMACS_INT pos = pos_before;
+
+ x = -1;
+ for (glyph = glyph_before + incr;
+ row->reversed_p ? glyph > stop : glyph < stop; )
{
- Lisp_Object cprop;
- int pos;
- if ((cursor == NULL || glyph > cursor)
- && (cprop = Fget_char_property (make_number ((glyph)->charpos),
- Qcursor, (glyph)->object),
- !NILP (cprop))
- && (pos = string_buffer_position (w, glyph->object,
- string_before_pos),
- (pos == 0 /* from overlay */
- || pos == pt_old)))
+
+ /* Any glyphs that come from the buffer are here because
+ of bidi reordering. Skip them, and only pay
+ attention to glyphs that came from some string. */
+ if (STRINGP (glyph->object))
{
- /* Compute the first buffer position after the overlay.
- If the `cursor' property tells us how many positions
- are associated with the overlay, use that. Otherwise,
- estimate from the buffer positions of the glyphs
- before and after the overlay. */
- cursor_from_overlay_pos = (pos ? 0 : last_pos
- + (INTEGERP (cprop) ? XINT (cprop) : 0));
- cursor = glyph;
- cursor_x = x;
+ Lisp_Object str;
+ EMACS_INT tem;
+
+ str = glyph->object;
+ tem = string_buffer_position_lim (w, str, pos, pos_after, 0);
+ if (tem == 0 /* from overlay */
+ || pos <= tem)
+ {
+ /* If the string from which this glyph came is
+ found in the buffer at point, then we've
+ found the glyph we've been looking for. If
+ it comes from an overlay (tem == 0), and it
+ has the `cursor' property on one of its
+ glyphs, record that glyph as a candidate for
+ displaying the cursor. (As in the
+ unidirectional version, we will display the
+ cursor on the last candidate we find.) */
+ if (tem == 0 || tem == pt_old)
+ {
+ /* The glyphs from this string could have
+ been reordered. Find the one with the
+ smallest string position. Or there could
+ be a character in the string with the
+ `cursor' property, which means display
+ cursor on that character's glyph. */
+ int strpos = glyph->charpos;
+
+ cursor = glyph;
+ for (glyph += incr;
+ (row->reversed_p ? glyph > stop : glyph < stop)
+ && EQ (glyph->object, str);
+ glyph += incr)
+ {
+ Lisp_Object cprop;
+ int gpos = glyph->charpos;
+
+ cprop = Fget_char_property (make_number (gpos),
+ Qcursor,
+ glyph->object);
+ if (!NILP (cprop))
+ {
+ cursor = glyph;
+ break;
+ }
+ if (glyph->charpos < strpos)
+ {
+ strpos = glyph->charpos;
+ cursor = glyph;
+ }
+ }
+
+ if (tem == pt_old)
+ goto compute_x;
+ }
+ if (tem)
+ pos = tem + 1; /* don't find previous instances */
+ }
+ /* This string is not what we want; skip all of the
+ glyphs that came from it. */
+ do
+ glyph += incr;
+ while ((row->reversed_p ? glyph > stop : glyph < stop)
+ && EQ (glyph->object, str));
}
- x += glyph->pixel_width;
- ++glyph;
+ else
+ glyph += incr;
}
- while (glyph < end && EQ (glyph->object, string_start->object));
+
+ /* If we reached the end of the line, and END was from a string,
+ the cursor is not on this line. */
+ if (cursor == NULL
+ && (row->reversed_p ? glyph <= end : glyph >= end)
+ && STRINGP (end->object)
+ && row->continued_p)
+ return 0;
}
}
+ compute_x:
if (cursor != NULL)
+ glyph = cursor;
+ if (x < 0)
{
- glyph = cursor;
- x = cursor_x;
- }
- else if (row->ends_in_ellipsis_p && glyph == end)
- {
- /* Scan back over the ellipsis glyphs, decrementing positions. */
- while (glyph > row->glyphs[TEXT_AREA]
- && (glyph - 1)->charpos == last_pos)
- glyph--, x -= glyph->pixel_width;
- /* That loop always goes one position too far, including the
- glyph before the ellipsis. So scan forward over that one. */
- x += glyph->pixel_width;
- glyph++;
- }
- else if (string_start
- && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old))
- {
- /* We may have skipped over point because the previous glyphs
- are from string. As there's no easy way to know the
- character position of the current glyph, find the correct
- glyph on point by scanning from string_start again. */
- Lisp_Object limit;
- Lisp_Object string;
- struct glyph *stop = glyph;
- int pos;
-
- limit = make_number (pt_old + 1);
- glyph = string_start;
- x = string_start_x;
- string = glyph->object;
- pos = string_buffer_position (w, string, string_before_pos);
- /* If POS == 0, STRING is from overlay. We skip such glyphs
- because we always put the cursor after overlay strings. */
- while (pos == 0 && glyph < stop)
- {
- string = glyph->object;
- SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
- if (glyph < stop)
- pos = string_buffer_position (w, glyph->object, string_before_pos);
- }
+ struct glyph *g;
- while (glyph < stop)
+ /* Need to compute x that corresponds to GLYPH. */
+ for (g = row->glyphs[TEXT_AREA], x = row->x; g < glyph; g++)
{
- pos = XINT (Fnext_single_char_property_change
- (make_number (pos), Qdisplay, Qnil, limit));
- if (pos > pt_old)
- break;
- /* Skip glyphs from the same string. */
- string = glyph->object;
- SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
- /* Skip glyphs from an overlay. */
- while (glyph < stop
- && ! string_buffer_position (w, glyph->object, pos))
- {
- string = glyph->object;
- SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
- }
- }
-
- /* If we reached the end of the line, and END was from a string,
- the cursor is not on this line. */
- if (glyph == end && row->continued_p)
+ if (g >= row->glyphs[TEXT_AREA] + row->used[TEXT_AREA])
+ abort ();
+ x += g->pixel_width;
+ }
+ }
+
+ /* ROW could be part of a continued line, which, under bidi
+ reordering, might have other rows whose start and end charpos
+ occlude point. Only set w->cursor if we found a better
+ approximation to the cursor position than we have from previously
+ examined candidate rows belonging to the same continued line. */
+ if (/* we already have a candidate row */
+ w->cursor.vpos >= 0
+ /* that candidate is not the row we are processing */
+ && MATRIX_ROW (matrix, w->cursor.vpos) != row
+ /* the row we are processing is part of a continued line */
+ && (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row))
+ /* Make sure cursor.vpos specifies a row whose start and end
+ charpos occlude point. This is because some callers of this
+ function leave cursor.vpos at the row where the cursor was
+ displayed during the last redisplay cycle. */
+ && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old
+ && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)))
+ {
+ struct glyph *g1 =
+ MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
+
+ /* Don't consider glyphs that are outside TEXT_AREA. */
+ if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end))
+ return 0;
+ /* Keep the candidate whose buffer position is the closest to
+ point. */
+ if (/* previous candidate is a glyph in TEXT_AREA of that row */
+ w->cursor.hpos >= 0
+ && w->cursor.hpos < MATRIX_ROW_USED(matrix, w->cursor.vpos)
+ && BUFFERP (g1->object)
+ && (g1->charpos == pt_old /* an exact match always wins */
+ || (BUFFERP (glyph->object)
+ && eabs (g1->charpos - pt_old)
+ < eabs (glyph->charpos - pt_old))))
+ return 0;
+ /* If this candidate gives an exact match, use that. */
+ if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
+ /* Otherwise, keep the candidate that comes from a row
+ spanning less buffer positions. This may win when one or
+ both candidate positions are on glyphs that came from
+ display strings, for which we cannot compare buffer
+ positions. */
+ && MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
+ - MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
+ < MATRIX_ROW_END_CHARPOS (row) - MATRIX_ROW_START_CHARPOS (row))
return 0;
}
-
w->cursor.hpos = glyph - row->glyphs[TEXT_AREA];
w->cursor.x = x;
w->cursor.vpos = MATRIX_ROW_VPOS (row, matrix) + dvpos;
++row;
if (!row->enabled_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ /* If rows are bidi-reordered, back up until we find a row
+ that does not belong to a continuation line. This is
+ because we must consider all rows of a continued line as
+ candidates for cursor positioning, since row start and
+ end positions change non-linearly with vertical position
+ in such rows. */
+ /* FIXME: Revisit this when glyph ``spilling'' in
+ continuation lines' rows is implemented for
+ bidi-reordered rows. */
+ if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ {
+ while (MATRIX_ROW_CONTINUATION_LINE_P (row))
+ {
+ xassert (row->enabled_p);
+ --row;
+ /* If we hit the beginning of the displayed portion
+ without finding the first row of a continued
+ line, give up. */
+ if (row <= w->current_matrix->rows)
+ {
+ rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ break;
+ }
+
+ }
+ }
}
if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
++row;
}
- /* The end position of a row equals the start position
- of the next row. If PT is there, we would rather
- display it in the next line. */
+ /* If the end position of a row equals the start
+ position of the next row, and PT is at that position,
+ we would rather display cursor in the next line. */
while (MATRIX_ROW_BOTTOM_Y (row) < last_y
&& MATRIX_ROW_END_CHARPOS (row) == PT
+ && row < w->current_matrix->rows
+ + w->current_matrix->nrows - 1
+ && MATRIX_ROW_START_CHARPOS (row+1) == PT
&& !cursor_row_p (w, row))
++row;
}
else if (scroll_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
+ else if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ {
+ /* With bidi-reordered rows, there could be more than
+ one candidate row whose start and end positions
+ occlude point. We need to let set_cursor_from_row
+ find the best candidate. */
+ /* FIXME: Revisit this when glyph ``spilling'' in
+ continuation lines' rows is implemented for
+ bidi-reordered rows. */
+ int rv = 0;
+
+ do
+ {
+ rv |= set_cursor_from_row (w, row, w->current_matrix,
+ 0, 0, 0, 0);
+ /* As soon as we've found the first suitable row
+ whose ends_at_zv_p flag is set, we are done. */
+ if (rv
+ && MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p)
+ {
+ rc = CURSOR_MOVEMENT_SUCCESS;
+ break;
+ }
+ ++row;
+ }
+ while (MATRIX_ROW_BOTTOM_Y (row) < last_y
+ && MATRIX_ROW_START_CHARPOS (row) <= PT
+ && PT <= MATRIX_ROW_END_CHARPOS (row)
+ && cursor_row_p (w, row));
+ /* If we didn't find any candidate rows, or exited the
+ loop before all the candidates were examined, signal
+ to the caller that this method failed. */
+ if (rc != CURSOR_MOVEMENT_SUCCESS
+ && (!rv
+ || (MATRIX_ROW_START_CHARPOS (row) <= PT
+ && PT <= MATRIX_ROW_END_CHARPOS (row))))
+ rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
+ else
+ rc = CURSOR_MOVEMENT_SUCCESS;
+ }
else
{
do
= try_window_reusing_current_matrix (w)))
{
IF_DEBUG (debug_method_add (w, "1"));
- if (try_window (window, startp, 1) < 0)
+ if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
/* -1 means we need to scroll.
0 means we need new matrices, but fonts_changed_p
is set in that case, so we will detect it below. */
Value is 1 if successful. It is zero if fonts were loaded during
redisplay which makes re-adjusting glyph matrices necessary, and -1
if point would appear in the scroll margins.
- (We check that only if CHECK_MARGINS is nonzero. */
+ (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is
+ unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is
+ set in FLAGS.) */
int
-try_window (window, pos, check_margins)
+try_window (window, pos, flags)
Lisp_Object window;
struct text_pos pos;
- int check_margins;
+ int flags;
{
struct window *w = XWINDOW (window);
struct it it;
{
if (display_line (&it))
last_text_row = it.glyph_row - 1;
- if (fonts_changed_p)
+ if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
return 0;
}
/* Don't let the cursor end in the scroll margins. */
- if (check_margins
+ if ((flags & TRY_WINDOW_CHECK_MARGINS)
&& !MINI_WINDOW_P (w))
{
int this_scroll_margin;
/* The variable new_start now holds the new window start. The old
start `start' can be determined from the current matrix. */
SET_TEXT_POS_FROM_MARKER (new_start, w->start);
- start = start_row->start.pos;
+ start = start_row->minpos;
start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
/* Clear the desired matrix for the display below. */
{
/* Advance to the next row as the "start". */
start_row++;
- start = start_row->start.pos;
+ start = start_row->minpos;
/* If there are no more rows to try, or just one, give up. */
if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
|| w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
struct glyph *end = glyph + row->used[TEXT_AREA];
- for (; glyph < end
- && (!BUFFERP (glyph->object)
- || glyph->charpos < PT);
- glyph++)
+ /* Can't use this optimization with bidi-reordered glyph
+ rows, unless cursor is already at point. */
+ if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
{
- w->cursor.hpos++;
- w->cursor.x += glyph->pixel_width;
+ if (!(w->cursor.hpos >= 0
+ && w->cursor.hpos < row->used[TEXT_AREA]
+ && BUFFERP (glyph->object)
+ && glyph->charpos == PT))
+ return 0;
}
+ else
+ for (; glyph < end
+ && (!BUFFERP (glyph->object)
+ || glyph->charpos < PT);
+ glyph++)
+ {
+ w->cursor.hpos++;
+ w->cursor.x += glyph->pixel_width;
+ }
}
}
int dy;
{
struct glyph_row *row = start;
+ struct glyph_row *best_row = NULL;
+ EMACS_INT mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
int last_y;
/* If we happen to start on a header-line, skip that. */
&& !row->ends_at_zv_p
&& !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))
&& charpos >= MATRIX_ROW_START_CHARPOS (row))
- return row;
+ {
+ struct glyph *g;
+
+ if (NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+ return row;
+ /* In bidi-reordered rows, there could be several rows
+ occluding point. We need to find the one which fits
+ CHARPOS the best. */
+ for (g = row->glyphs[TEXT_AREA];
+ g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+ g++)
+ {
+ if (!STRINGP (g->object))
+ {
+ if (g->charpos > 0 && eabs (g->charpos - charpos) < mindif)
+ {
+ mindif = eabs (g->charpos - charpos);
+ best_row = row;
+ }
+ }
+ }
+ }
+ else if (best_row)
+ return best_row;
++row;
}
}
if (!NILP (XBUFFER (w->buffer)->word_wrap))
GIVE_UP (21);
+ /* Under bidi reordering, adding or deleting a character in the
+ beginning of a paragraph, before the first strong directional
+ character, can change the base direction of the paragraph (unless
+ the buffer specifies a fixed paragraph direction), which will
+ require to redisplay the whole paragraph. It might be worthwhile
+ to find the paragraph limits and widen the range of redisplayed
+ lines to that, but for now just give up this optimization and
+ redisplay from scratch. */
+ if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+ && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+ GIVE_UP (22);
+
/* Make sure beg_unchanged and end_unchanged are up to date. Do it
only if buffer has really changed. The reason is that the gap is
initially at Z for freshly visited files. The code below would
as is, without changing glyph positions since no text has
been added/removed in front of the window end. */
r0 = MATRIX_FIRST_TEXT_ROW (current_matrix);
- if (TEXT_POS_EQUAL_P (start, r0->start.pos)
+ if (TEXT_POS_EQUAL_P (start, r0->minpos)
/* PT must not be in a partially visible line. */
&& !(PT >= MATRIX_ROW_START_CHARPOS (row)
&& MATRIX_ROW_BOTTOM_Y (row) > window_text_bottom_y (w)))
{
/* We have to compute the window end anew since text
- can have been added/removed after it. */
+ could have been added/removed after it. */
w->window_end_pos
= make_number (Z - MATRIX_ROW_END_CHARPOS (row));
w->window_end_bytepos
start is not in changed text, otherwise positions would not be
comparable. */
row = MATRIX_FIRST_TEXT_ROW (current_matrix);
- if (!TEXT_POS_EQUAL_P (start, row->start.pos))
+ if (!TEXT_POS_EQUAL_P (start, row->minpos))
GIVE_UP (16);
/* Give up if the window ends in strings. Overlay strings
produce_special_glyphs (&truncate_it, IT_TRUNCATION);
/* Overwrite glyphs from IT with truncation glyphs. */
- from = truncate_it.glyph_row->glyphs[TEXT_AREA];
- end = from + truncate_it.glyph_row->used[TEXT_AREA];
- to = it->glyph_row->glyphs[TEXT_AREA];
- toend = to + it->glyph_row->used[TEXT_AREA];
-
- while (from < end)
- *to++ = *from++;
-
- /* There may be padding glyphs left over. Overwrite them too. */
- while (to < toend && CHAR_GLYPH_PADDING_P (*to))
+ if (!it->glyph_row->reversed_p)
{
from = truncate_it.glyph_row->glyphs[TEXT_AREA];
+ end = from + truncate_it.glyph_row->used[TEXT_AREA];
+ to = it->glyph_row->glyphs[TEXT_AREA];
+ toend = to + it->glyph_row->used[TEXT_AREA];
+
while (from < end)
*to++ = *from++;
+
+ /* There may be padding glyphs left over. Overwrite them too. */
+ while (to < toend && CHAR_GLYPH_PADDING_P (*to))
+ {
+ from = truncate_it.glyph_row->glyphs[TEXT_AREA];
+ while (from < end)
+ *to++ = *from++;
+ }
+
+ if (to > toend)
+ it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA];
}
+ else
+ {
+ /* In R2L rows, overwrite the last (rightmost) glyphs, and do
+ that back to front. */
+ end = truncate_it.glyph_row->glyphs[TEXT_AREA];
+ from = end + truncate_it.glyph_row->used[TEXT_AREA] - 1;
+ toend = it->glyph_row->glyphs[TEXT_AREA];
+ to = toend + it->glyph_row->used[TEXT_AREA] - 1;
+
+ while (from >= end && to >= toend)
+ *to-- = *from--;
+ while (to >= toend && CHAR_GLYPH_PADDING_P (*to))
+ {
+ from =
+ truncate_it.glyph_row->glyphs[TEXT_AREA]
+ + truncate_it.glyph_row->used[TEXT_AREA] - 1;
+ while (from >= end && to >= toend)
+ *to-- = *from--;
+ }
+ if (from >= end)
+ {
+ /* Need to free some room before prepending additional
+ glyphs. */
+ int move_by = from - end + 1;
+ struct glyph *g0 = it->glyph_row->glyphs[TEXT_AREA];
+ struct glyph *g = g0 + it->glyph_row->used[TEXT_AREA] - 1;
- if (to > toend)
- it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA];
+ for ( ; g >= g0; g--)
+ g[move_by] = *g;
+ while (from >= end)
+ *to-- = *from--;
+ it->glyph_row->used[TEXT_AREA] += move_by;
+ }
+ }
}
/* Extend the face of the last glyph in the text area of IT->glyph_row
- to the end of the display line. Called from display_line.
- If the glyph row is empty, add a space glyph to it so that we
- know the face to draw. Set the glyph row flag fill_line_p. */
+ to the end of the display line. Called from display_line. If the
+ glyph row is empty, add a space glyph to it so that we know the
+ face to draw. Set the glyph row flag fill_line_p. If the glyph
+ row is R2L, prepend a stretch glyph to cover the empty space to the
+ left of the leftmost glyph. */
static void
extend_face_to_end_of_line (it)
struct face *face;
struct frame *f = it->f;
- /* If line is already filled, do nothing. */
- if (it->current_x >= it->last_visible_x)
+ /* If line is already filled, do nothing. Non window-system frames
+ get a grace of one more ``pixel'' because their characters are
+ 1-``pixel'' wide, so they hit the equality too early. This grace
+ is needed only for R2L rows that are not continued, to produce
+ one extra blank where we could display the cursor. */
+ if (it->current_x >= it->last_visible_x
+ + (!FRAME_WINDOW_P (f)
+ && it->glyph_row->reversed_p
+ && !it->glyph_row->continued_p))
return;
/* Face extension extends the background and box of IT->face_id
to the end of the line. If the background equals the background
of the frame, we don't have to do anything. */
if (it->face_before_selective_p)
- face = FACE_FROM_ID (it->f, it->saved_face_id);
+ face = FACE_FROM_ID (f, it->saved_face_id);
else
face = FACE_FROM_ID (f, it->face_id);
&& it->glyph_row->displays_text_p
&& face->box == FACE_NO_BOX
&& face->background == FRAME_BACKGROUND_PIXEL (f)
- && !face->stipple)
+ && !face->stipple
+ && !it->glyph_row->reversed_p)
return;
/* Set the glyph row flag indicating that the face of the last glyph
it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id;
it->glyph_row->used[TEXT_AREA] = 1;
}
+#ifdef HAVE_WINDOW_SYSTEM
+ if (it->glyph_row->reversed_p)
+ {
+ /* Prepend a stretch glyph to the row, such that the
+ rightmost glyph will be drawn flushed all the way to the
+ right margin of the window. The stretch glyph that will
+ occupy the empty space, if any, to the left of the
+ glyphs. */
+ struct font *font = face->font ? face->font : FRAME_FONT (f);
+ struct glyph *row_start = it->glyph_row->glyphs[TEXT_AREA];
+ struct glyph *row_end = row_start + it->glyph_row->used[TEXT_AREA];
+ struct glyph *g;
+ int row_width, stretch_ascent, stretch_width;
+ struct text_pos saved_pos;
+ int saved_face_id, saved_avoid_cursor;
+
+ for (row_width = 0, g = row_start; g < row_end; g++)
+ row_width += g->pixel_width;
+ stretch_width = window_box_width (it->w, TEXT_AREA) - row_width;
+ if (stretch_width > 0)
+ {
+ stretch_ascent =
+ (((it->ascent + it->descent)
+ * FONT_BASE (font)) / FONT_HEIGHT (font));
+ saved_pos = it->position;
+ bzero (&it->position, sizeof it->position);
+ saved_avoid_cursor = it->avoid_cursor_p;
+ it->avoid_cursor_p = 1;
+ saved_face_id = it->face_id;
+ /* The last row's stretch glyph should get the default
+ face, to avoid painting the rest of the window with
+ the region face, if the region ends at ZV. */
+ if (it->glyph_row->ends_at_zv_p)
+ it->face_id = DEFAULT_FACE_ID;
+ else
+ it->face_id = face->id;
+ append_stretch_glyph (it, make_number (0), stretch_width,
+ it->ascent + it->descent, stretch_ascent);
+ it->position = saved_pos;
+ it->avoid_cursor_p = saved_avoid_cursor;
+ it->face_id = saved_face_id;
+ }
+ }
+#endif /* HAVE_WINDOW_SYSTEM */
}
else
{
it->object = make_number (0);
it->c = ' ';
it->len = 1;
- it->face_id = face->id;
+ /* The last row's blank glyphs should get the default face, to
+ avoid painting the rest of the window with the region face,
+ if the region ends at ZV. */
+ if (it->glyph_row->ends_at_zv_p)
+ it->face_id = DEFAULT_FACE_ID;
+ else
+ it->face_id = face->id;
PRODUCE_GLYPHS (it);
struct glyph *start = row->glyphs[TEXT_AREA];
struct glyph *glyph = start + used - 1;
+ if (row->reversed_p)
+ {
+ /* Right-to-left rows need to be processed in the opposite
+ direction, so swap the edge pointers. */
+ glyph = start;
+ start = row->glyphs[TEXT_AREA] + used - 1;
+ }
+
/* Skip over glyphs inserted to display the cursor at the
end of a line, for extending the face of the last glyph
to the end of the line on terminals, and for truncation
and continuation glyphs. */
- while (glyph >= start
- && glyph->type == CHAR_GLYPH
- && INTEGERP (glyph->object))
- --glyph;
+ if (!row->reversed_p)
+ {
+ while (glyph >= start
+ && glyph->type == CHAR_GLYPH
+ && INTEGERP (glyph->object))
+ --glyph;
+ }
+ else
+ {
+ while (glyph <= start
+ && glyph->type == CHAR_GLYPH
+ && INTEGERP (glyph->object))
+ ++glyph;
+ }
/* If last glyph is a space or stretch, and it's trailing
whitespace, set the face of all trailing whitespace glyphs in
IT->glyph_row to `trailing-whitespace'. */
- if (glyph >= start
+ if ((row->reversed_p ? glyph <= start : glyph >= start)
&& BUFFERP (glyph->object)
&& (glyph->type == STRETCH_GLYPH
|| (glyph->type == CHAR_GLYPH
if (face_id < 0)
return;
- while (glyph >= start
- && BUFFERP (glyph->object)
- && (glyph->type == STRETCH_GLYPH
- || (glyph->type == CHAR_GLYPH
- && glyph->u.ch == ' ')))
- (glyph--)->face_id = face_id;
+ if (!row->reversed_p)
+ {
+ while (glyph >= start
+ && BUFFERP (glyph->object)
+ && (glyph->type == STRETCH_GLYPH
+ || (glyph->type == CHAR_GLYPH
+ && glyph->u.ch == ' ')))
+ (glyph--)->face_id = face_id;
+ }
+ else
+ {
+ while (glyph <= start
+ && BUFFERP (glyph->object)
+ && (glyph->type == STRETCH_GLYPH
+ || (glyph->type == CHAR_GLYPH
+ && glyph->u.ch == ' ')))
+ (glyph++)->face_id = face_id;
+ }
}
}
}
{
int cursor_row_p = 1;
- if (PT == MATRIX_ROW_END_CHARPOS (row))
+ if (PT == CHARPOS (row->end.pos))
{
/* Suppose the row ends on a string.
Unless the row is continued, that means it ends on a newline
{
/* If the row ends in middle of a real character,
and the line is continued, we want the cursor here.
- That's because MATRIX_ROW_END_CHARPOS would equal
+ That's because CHARPOS (ROW->end.pos) would equal
PT if PT is before the character. */
if (!row->ends_in_ellipsis_p)
cursor_row_p = row->continued_p;
else
/* If the row ends in an ellipsis, then
- MATRIX_ROW_END_CHARPOS will equal point after the invisible text.
- We want that position to be displayed after the ellipsis. */
+ CHARPOS (ROW->end.pos) will equal point after the
+ invisible text. We want that position to be displayed
+ after the ellipsis. */
cursor_row_p = 0;
}
/* If the row ends at ZV, display the cursor at the end of that
\f
+/* Remove N glyphs at the start of a reversed IT->glyph_row. Called
+ only for R2L lines from display_line, when it decides that too many
+ glyphs were produced by PRODUCE_GLYPHS, and the line needs to be
+ continued. */
+static void
+unproduce_glyphs (it, n)
+ struct it *it;
+ int n;
+{
+ struct glyph *glyph, *end;
+
+ xassert (it->glyph_row);
+ xassert (it->glyph_row->reversed_p);
+ xassert (it->area == TEXT_AREA);
+ xassert (n <= it->glyph_row->used[TEXT_AREA]);
+
+ if (n > it->glyph_row->used[TEXT_AREA])
+ n = it->glyph_row->used[TEXT_AREA];
+ glyph = it->glyph_row->glyphs[TEXT_AREA] + n;
+ end = it->glyph_row->glyphs[TEXT_AREA] + it->glyph_row->used[TEXT_AREA];
+ for ( ; glyph < end; glyph++)
+ glyph[-n] = *glyph;
+}
+
+/* Find the positions in a bidi-reordered ROW to serve as ROW->minpos
+ and ROW->maxpos. */
+static void
+find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
+ struct it *it;
+ struct glyph_row *row;
+ EMACS_INT min_pos, min_bpos, max_pos, max_bpos;
+{
+ /* FIXME: Revisit this when glyph ``spilling'' in continuation
+ lines' rows is implemented for bidi-reordered rows. */
+
+ /* ROW->minpos is the value of min_pos, the minimal buffer position
+ we have in ROW. */
+ if (min_pos <= ZV)
+ SET_TEXT_POS (row->minpos, min_pos, min_bpos);
+ else
+ {
+ /* We didn't find _any_ valid buffer positions in any of the
+ glyphs, so we must trust the iterator's computed
+ positions. */
+ row->minpos = row->start.pos;
+ max_pos = CHARPOS (it->current.pos);
+ max_bpos = BYTEPOS (it->current.pos);
+ }
+
+ if (!max_pos)
+ abort ();
+
+ /* Here are the various use-cases for ending the row, and the
+ corresponding values for ROW->maxpos:
+
+ Line ends in a newline from buffer eol_pos + 1
+ Line is continued from buffer max_pos + 1
+ Line is truncated on right it->current.pos
+ Line ends in a newline from string max_pos
+ Line is continued from string max_pos
+ Line is continued from display vector max_pos
+ Line is entirely from a string min_pos == max_pos
+ Line is entirely from a display vector min_pos == max_pos
+ Line that ends at ZV ZV
+
+ If you discover other use-cases, please add them here as
+ appropriate. */
+ if (row->ends_at_zv_p)
+ row->maxpos = it->current.pos;
+ else if (row->used[TEXT_AREA])
+ {
+ if (row->ends_in_newline_from_string_p)
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+ else if (CHARPOS (it->eol_pos) > 0)
+ SET_TEXT_POS (row->maxpos,
+ CHARPOS (it->eol_pos) + 1, BYTEPOS (it->eol_pos) + 1);
+ else if (row->continued_p)
+ {
+ /* If max_pos is different from IT's current position, it
+ means IT->method does not belong to the display element
+ at max_pos. However, it also means that the display
+ element at max_pos was displayed in its entirety on this
+ line, which is equivalent to saying that the next line
+ starts at the next buffer position. */
+ if (IT_CHARPOS (*it) == max_pos && it->method != GET_FROM_BUFFER)
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+ else
+ {
+ INC_BOTH (max_pos, max_bpos);
+ SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+ }
+ }
+ else if (row->truncated_on_right_p)
+ /* display_line already called reseat_at_next_visible_line_start,
+ which puts the iterator at the beginning of the next line, in
+ the logical order. */
+ row->maxpos = it->current.pos;
+ else if (max_pos == min_pos && it->method != GET_FROM_BUFFER)
+ /* A line that is entirely from a string/image/stretch... */
+ row->maxpos = row->minpos;
+ else
+ abort ();
+ }
+ else
+ row->maxpos = it->current.pos;
+}
+
/* Construct the glyph row IT->glyph_row in the desired matrix of
IT->w from text at the current position of IT. See dispextern.h
for an overview of struct it. Value is non-zero if
int wrap_row_used = -1, wrap_row_ascent, wrap_row_height;
int wrap_row_phys_ascent, wrap_row_phys_height;
int wrap_row_extra_line_spacing;
+ EMACS_INT wrap_row_min_pos, wrap_row_min_bpos;
+ EMACS_INT wrap_row_max_pos, wrap_row_max_bpos;
+ int cvpos;
+ EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos;
/* We always start displaying at hpos zero even if hscrolled. */
xassert (it->hpos == 0 && it->current_x == 0);
row->phys_height = it->max_phys_ascent + it->max_phys_descent;
row->extra_line_spacing = it->max_extra_line_spacing;
+/* Utility macro to record max and min buffer positions seen until now. */
+#define RECORD_MAX_MIN_POS(IT) \
+ do \
+ { \
+ if (IT_CHARPOS (*(IT)) < min_pos) \
+ { \
+ min_pos = IT_CHARPOS (*(IT)); \
+ min_bpos = IT_BYTEPOS (*(IT)); \
+ } \
+ if (IT_CHARPOS (*(IT)) > max_pos) \
+ { \
+ max_pos = IT_CHARPOS (*(IT)); \
+ max_bpos = IT_BYTEPOS (*(IT)); \
+ } \
+ } \
+ while (0)
+
/* Loop generating characters. The loop is left with IT on the next
character to display. */
while (1)
it->continuation_lines_width = 0;
row->ends_at_zv_p = 1;
+ /* A row that displays right-to-left text must always have
+ its last face extended all the way to the end of line,
+ even if this row ends in ZV, because we still write to th
+ screen left to right. */
+ if (row->reversed_p)
+ extend_face_to_end_of_line (it);
break;
}
wrap_row_phys_ascent = row->phys_ascent;
wrap_row_phys_height = row->phys_height;
wrap_row_extra_line_spacing = row->extra_line_spacing;
+ wrap_row_min_pos = min_pos;
+ wrap_row_min_bpos = min_bpos;
+ wrap_row_max_pos = max_pos;
+ wrap_row_max_bpos = max_bpos;
may_wrap = 0;
}
}
it->max_extra_line_spacing);
if (it->current_x - it->pixel_width < it->first_visible_x)
row->x = x - it->first_visible_x;
+ /* Record the maximum and minimum buffer positions seen so
+ far in glyphs that will be displayed by this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
}
else
{
it->current_x = new_x;
it->continuation_lines_width += new_x;
++it->hpos;
+ /* Record the maximum and minimum buffer
+ positions seen so far in glyphs that will be
+ displayed by this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
if (i == nglyphs - 1)
{
/* If line-wrap is on, check if a previous
/* A padding glyph that doesn't fit on this line.
This means the whole character doesn't fit
on the line. */
+ if (row->reversed_p)
+ unproduce_glyphs (it, row->used[TEXT_AREA]
+ - n_glyphs_before);
row->used[TEXT_AREA] = n_glyphs_before;
/* Fill the rest of the row with continuation
else if (wrap_row_used > 0)
{
back_to_wrap:
+ if (row->reversed_p)
+ unproduce_glyphs (it,
+ row->used[TEXT_AREA] - wrap_row_used);
*it = wrap_it;
it->continuation_lines_width += wrap_x;
row->used[TEXT_AREA] = wrap_row_used;
row->phys_ascent = wrap_row_phys_ascent;
row->phys_height = wrap_row_phys_height;
row->extra_line_spacing = wrap_row_extra_line_spacing;
+ min_pos = wrap_row_min_pos;
+ min_bpos = wrap_row_min_bpos;
+ max_pos = wrap_row_max_pos;
+ max_bpos = wrap_row_max_bpos;
row->continued_p = 1;
row->ends_at_zv_p = 0;
row->exact_window_width_line_p = 0;
/* Something other than a TAB that draws past
the right edge of the window. Restore
positions to values before the element. */
+ if (row->reversed_p)
+ unproduce_glyphs (it, row->used[TEXT_AREA]
+ - (n_glyphs_before + i));
row->used[TEXT_AREA] = n_glyphs_before + i;
/* Display continuation glyphs. */
/* Increment number of glyphs actually displayed. */
++it->hpos;
+ /* Record the maximum and minimum buffer positions
+ seen so far in glyphs that will be displayed by
+ this row. */
+ if (it->bidi_p)
+ RECORD_MAX_MIN_POS (it);
+
if (x < it->first_visible_x)
/* Glyph is partially visible, i.e. row starts at
negative X position. */
if (used_before == 0)
row->glyphs[TEXT_AREA]->charpos = CHARPOS (it->position);
+ /* Record the position of the newline, for use in
+ find_row_edges. */
+ it->eol_pos = it->current.pos;
+
/* Consume the line end. This skips over invisible lines. */
set_iterator_to_next (it, 1);
it->continuation_lines_width = 0;
{
int i, n;
- for (i = row->used[TEXT_AREA] - 1; i > 0; --i)
- if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
- break;
+ if (!row->reversed_p)
+ {
+ for (i = row->used[TEXT_AREA] - 1; i > 0; --i)
+ if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
+ break;
+ }
+ else
+ {
+ for (i = 0; i < row->used[TEXT_AREA]; i++)
+ if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i]))
+ break;
+ /* Remove any padding glyphs at the front of ROW, to
+ make room for the truncation glyphs we will be
+ adding below. The loop below always inserts at
+ least one truncation glyph, so also remove the
+ last glyph added to ROW. */
+ unproduce_glyphs (it, i + 1);
+ /* Adjust i for the loop below. */
+ i = row->used[TEXT_AREA] - (i + 1);
+ }
for (n = row->used[TEXT_AREA]; i < n; ++i)
{
/* If line is not empty and hscrolled, maybe insert truncation glyphs
at the left window margin. */
if (it->first_visible_x
- && IT_CHARPOS (*it) != MATRIX_ROW_START_CHARPOS (row))
+ && IT_CHARPOS (*it) != CHARPOS (row->start.pos))
{
if (!FRAME_WINDOW_P (it->f))
insert_left_trunc_glyphs (it);
/* Remember the position at which this line ends. */
row->end = it->current;
+ if (!it->bidi_p)
+ {
+ row->minpos = row->start.pos;
+ row->maxpos = row->end.pos;
+ }
+ else
+ {
+ /* ROW->minpos and ROW->maxpos must be the smallest and
+ `1 + the largest' buffer positions in ROW. But if ROW was
+ bidi-reordered, these two positions can be anywhere in the
+ row, so we must determine them now. */
+ find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos);
+ }
/* Record whether this row ends inside an ellipsis. */
row->ends_in_ellipsis_p
it->right_user_fringe_face_id = 0;
/* Maybe set the cursor. */
- if (it->w->cursor.vpos < 0
+ cvpos = it->w->cursor.vpos;
+ if ((cvpos < 0
+ /* In bidi-reordered rows, keep checking for proper cursor
+ position even if one has been found already, because buffer
+ positions in such rows change non-linearly with ROW->VPOS,
+ when a line is continued. One exception: when we are at ZV,
+ display cursor on the first suitable glyph row, since all
+ the empty rows after that also have their position set to ZV. */
+ /* FIXME: Revisit this when glyph ``spilling'' in continuation
+ lines' rows is implemented for bidi-reordered rows. */
+ || (it->bidi_p
+ && !MATRIX_ROW (it->w->desired_matrix, cvpos)->ends_at_zv_p))
&& PT >= MATRIX_ROW_START_CHARPOS (row)
&& PT <= MATRIX_ROW_END_CHARPOS (row)
&& cursor_row_p (it->w, row))
row to be used. */
it->current_x = it->hpos = 0;
it->current_y += row->height;
+ SET_TEXT_POS (it->eol_pos, 0, 0);
++it->vpos;
++it->glyph_row;
- it->start = it->current;
+ /* The next row should by default use the same value of the
+ reversed_p flag as this one. set_iterator_to_next decides when
+ it's a new paragraph, and PRODUCE_GLYPHS recomputes the value of
+ the flag accordingly. */
+ if (it->glyph_row < MATRIX_BOTTOM_TEXT_ROW (it->w->desired_matrix, it->w))
+ it->glyph_row->reversed_p = row->reversed_p;
+ it->start = row->end;
return row->displays_text_p;
+
+#undef RECORD_MAX_MIN_POS
+}
+
+DEFUN ("current-bidi-paragraph-direction", Fcurrent_bidi_paragraph_direction,
+ Scurrent_bidi_paragraph_direction, 0, 1, 0,
+ doc: /* Return paragraph direction at point in BUFFER.
+Value is either `left-to-right' or `right-to-left'.
+If BUFFER is omitted or nil, it defaults to the current buffer.
+
+Paragraph direction determines how the text in the paragraph is displayed.
+In left-to-right paragraphs, text begins at the left margin of the window
+and the reading direction is generally left to right. In right-to-left
+paragraphs, text begins at the right margin and is read from right to left.
+
+See also `bidi-paragraph-direction'. */)
+ (buffer)
+ Lisp_Object buffer;
+{
+ struct buffer *buf;
+ struct buffer *old;
+
+ if (NILP (buffer))
+ buf = current_buffer;
+ else
+ {
+ CHECK_BUFFER (buffer);
+ buf = XBUFFER (buffer);
+ old = current_buffer;
+ }
+
+ if (NILP (buf->bidi_display_reordering))
+ return Qleft_to_right;
+ else if (!NILP (buf->bidi_paragraph_direction))
+ return buf->bidi_paragraph_direction;
+ else
+ {
+ /* Determine the direction from buffer text. We could try to
+ use current_matrix if it is up to date, but this seems fast
+ enough as it is. */
+ struct bidi_it itb;
+ EMACS_INT pos = BUF_PT (buf);
+ EMACS_INT bytepos = BUF_PT_BYTE (buf);
+
+ if (buf != current_buffer)
+ set_buffer_temp (buf);
+ /* Find previous non-empty line. */
+ if (pos >= ZV && pos > BEGV)
+ {
+ pos--;
+ bytepos = CHAR_TO_BYTE (pos);
+ }
+ while (FETCH_BYTE (bytepos) == '\n')
+ {
+ if (bytepos <= BEGV_BYTE)
+ break;
+ bytepos--;
+ pos--;
+ }
+ while (!CHAR_HEAD_P (FETCH_BYTE (bytepos)))
+ bytepos--;
+ itb.charpos = pos;
+ itb.bytepos = bytepos;
+ itb.first_elt = 1;
+
+ bidi_paragraph_init (NEUTRAL_DIR, &itb);
+ if (buf != current_buffer)
+ set_buffer_temp (old);
+ switch (itb.paragraph_dir)
+ {
+ case L2R:
+ return Qleft_to_right;
+ break;
+ case R2L:
+ return Qright_to_left;
+ break;
+ default:
+ abort ();
+ }
+ }
}
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
+ /* If the glyph row is reversed, we need to prepend the glyph
+ rather than append it. */
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ struct glyph *g;
+
+ /* Make room for the additional glyph. */
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
+ g[1] = *g;
+ glyph = it->glyph_row->glyphs[area];
+ }
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
if (it->pixel_width > 0)
glyph->u.ch = it->char_to_display;
glyph->slice = null_glyph_slice;
glyph->font_type = FONT_TYPE_UNKNOWN;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
+ else
+ {
+ glyph->resolved_level = 0;
+ glyph->bidi_type = UNKNOWN_BT;
+ }
++it->glyph_row->used[area];
}
else
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
+ /* If the glyph row is reversed, we need to prepend the glyph
+ rather than append it. */
+ if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
+ {
+ struct glyph *g;
+
+ /* Make room for the new glyph. */
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
+ g[1] = *g;
+ glyph = it->glyph_row->glyphs[it->area];
+ }
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
glyph->pixel_width = it->pixel_width;
glyph->face_id = it->face_id;
glyph->slice = null_glyph_slice;
glyph->font_type = FONT_TYPE_UNKNOWN;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
++it->glyph_row->used[area];
}
else
glyph->u.img_id = img->id;
glyph->slice = slice;
glyph->font_type = FONT_TYPE_UNKNOWN;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
++it->glyph_row->used[area];
}
else
glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
if (glyph < it->glyph_row->glyphs[area + 1])
{
+ /* If the glyph row is reversed, we need to prepend the glyph
+ rather than append it. */
+ if (it->glyph_row->reversed_p && area == TEXT_AREA)
+ {
+ struct glyph *g;
+
+ /* Make room for the additional glyph. */
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
+ g[1] = *g;
+ glyph = it->glyph_row->glyphs[area];
+ }
glyph->charpos = CHARPOS (it->position);
glyph->object = object;
glyph->pixel_width = width;
glyph->u.stretch.height = height;
glyph->slice = null_glyph_slice;
glyph->font_type = FONT_TYPE_UNKNOWN;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ if ((it->bidi_it.type & 7) != it->bidi_it.type)
+ abort ();
+ glyph->bidi_type = it->bidi_it.type;
+ }
+ else
+ {
+ glyph->resolved_level = 0;
+ glyph->bidi_type = UNKNOWN_BT;
+ }
++it->glyph_row->used[area];
}
else
if (row->cursor_in_fringe_p)
{
row->cursor_in_fringe_p = 0;
- draw_fringe_bitmap (w, row, 0);
+ draw_fringe_bitmap (w, row, row->reversed_p);
w->phys_cursor_on_p = 0;
return;
}
/* If cursor hpos is out of bounds, don't draw garbage. This can
happen in mini-buffer windows when switching between echo area
glyphs and mini-buffer. */
- if (w->phys_cursor.hpos < row->used[TEXT_AREA])
+ if ((row->reversed_p
+ ? (w->phys_cursor.hpos >= 0)
+ : (w->phys_cursor.hpos < row->used[TEXT_AREA])))
{
int on_p = w->phys_cursor_on_p;
int x1;
if (cursor_row->cursor_in_fringe_p)
{
cursor_row->cursor_in_fringe_p = 0;
- draw_fringe_bitmap (w, cursor_row, 0);
+ draw_fringe_bitmap (w, cursor_row, cursor_row->reversed_p);
goto mark_cursor_off;
}
should have cleared the cursor. Note that we wouldn't be
able to erase the cursor in this case because we don't have a
cursor glyph at hand. */
- if (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA])
+ if ((cursor_row->reversed_p
+ ? (w->phys_cursor.hpos < 0)
+ : (w->phys_cursor.hpos >= cursor_row->used[TEXT_AREA])))
goto mark_cursor_off;
/* If the cursor is in the mouse face area, redisplay that when
/* Don't redraw the cursor's spot in mouse face if it is at the
end of a line (on a newline). The cursor appears there, but
mouse highlighting does not. */
- && cursor_row->used[TEXT_AREA] > hpos)
+ && cursor_row->used[TEXT_AREA] > hpos && hpos >= 0)
mouse_face_here_p = 1;
/* Maybe clear the display under the cursor. */
glyph = NULL;
if (!glyph_row->exact_window_width_line_p
- || hpos < glyph_row->used[TEXT_AREA])
+ || (0 <= hpos && hpos < glyph_row->used[TEXT_AREA]))
glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
xassert (interrupt_input_blocked);
associated with the end position, which must not be
highlighted. */
Lisp_Object prev_object;
- int pos;
+ EMACS_INT pos;
while (glyph > row->glyphs[TEXT_AREA])
{
&& XFASTINT (w->last_modified) == BUF_MODIFF (b)
&& XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
{
- int hpos, vpos, pos, i, dx, dy, area;
+ int hpos, vpos, i, dx, dy, area;
+ EMACS_INT pos;
struct glyph *glyph;
Lisp_Object object;
Lisp_Object mouse_face = Qnil, overlay = Qnil, position;
struct glyph_row *r
= MATRIX_ROW (w->current_matrix, vpos);
int start = MATRIX_ROW_START_CHARPOS (r);
- int pos = string_buffer_position (w, object, start);
+ EMACS_INT pos = string_buffer_position (w, object, start);
if (pos > 0)
{
help = Fget_char_property (make_number (pos),
struct glyph_row *r
= MATRIX_ROW (w->current_matrix, vpos);
int start = MATRIX_ROW_START_CHARPOS (r);
- int pos = string_buffer_position (w, object, start);
+ EMACS_INT pos = string_buffer_position (w, object,
+ start);
if (pos > 0)
pointer = Fget_char_property (make_number (pos),
Qpointer, w->buffer);
#endif
defsubr (&Sformat_mode_line);
defsubr (&Sinvisible_p);
+ defsubr (&Scurrent_bidi_paragraph_direction);
staticpro (&Qmenu_bar_update_hook);
Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook");
staticpro (&Qnobreak_space);
Qimage = intern_c_string ("image");
staticpro (&Qimage);
+ Qtext = intern_c_string ("text");
+ staticpro (&Qtext);
+ Qboth = intern_c_string ("both");
+ staticpro (&Qboth);
+ Qboth_horiz = intern_c_string ("both-horiz");
+ staticpro (&Qboth_horiz);
QCmap = intern_c_string (":map");
staticpro (&QCmap);
QCpointer = intern_c_string (":pointer");
staticpro (&previous_help_echo_string);
help_echo_pos = -1;
+ Qright_to_left = intern_c_string ("right-to-left");
+ staticpro (&Qright_to_left);
+ Qleft_to_right = intern_c_string ("left-to-right");
+ staticpro (&Qleft_to_right);
+
#ifdef HAVE_WINDOW_SYSTEM
DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p,
doc: /* *Non-nil means draw block cursor as wide as the glyph under it.
doc: /* *Relief thickness of tool-bar buttons. */);
tool_bar_button_relief = DEFAULT_TOOL_BAR_BUTTON_RELIEF;
+ DEFVAR_LISP ("tool-bar-style", &Vtool_bar_style,
+ doc: /* *Tool bar style to use.
+It can be one of
+ image - show images only
+ text - show text only
+ both - show both, text under image
+ both-horiz - show text to the right of the image
+ any other - use system default or image if no system default. */);
+ Vtool_bar_style = Qnil;
+
+ DEFVAR_INT ("tool-bar-max-label-size", &tool_bar_max_label_size,
+ doc: /* *Maximum number of characters a label can have to be shown.
+The tool bar style must also show labels for this to have any effect, see
+`tool-bar-style'. */);
+ tool_bar_max_label_size = DEFAULT_TOOL_BAR_LABEL_SIZE;
+
DEFVAR_LISP ("fontification-functions", &Vfontification_functions,
doc: /* List of functions to call to fontify regions of text.
Each function is called with one argument POS. Functions must
extern LWLIB_ID widget_id_tick;
-#ifdef USE_LUCID
-/* This is part of a kludge--see lwlib/xlwmenu.c. */
-extern XFontStruct *xlwmenu_default_font;
-#endif
-
extern void free_frame_menubar ();
extern double atof ();
extern Lisp_Object Vwindow_system_version;
+/* In editfns.c */
+
+extern Lisp_Object Vsystem_name;
+
/* The below are defined in frame.c. */
#if GLYPH_DEBUG
return Qnil;
}
+static void
+set_machine_and_pid_properties (struct frame *f)
+{
+ /* See the above comment "Note: Encoding strategy". */
+ XTextProperty text;
+ int bytes, stringp;
+ int do_free_text_value = 0;
+ long pid = (long) getpid ();
+
+ text.value = x_encode_text (Vsystem_name,
+ Qcompound_text, 0, &bytes, &stringp,
+ &do_free_text_value);
+ text.encoding = (stringp ? XA_STRING
+ : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
+ text.format = 8;
+ text.nitems = bytes;
+ XSetWMClientMachine (FRAME_X_DISPLAY (f),
+ FRAME_OUTER_WINDOW (f),
+ &text);
+ if (do_free_text_value)
+ xfree (text.value);
+
+ XChangeProperty (FRAME_X_DISPLAY (f),
+ FRAME_OUTER_WINDOW (f),
+ XInternAtom (FRAME_X_DISPLAY (f),
+ "_NET_WM_PID",
+ False),
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *) &pid, 1);
+}
+
DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1, 1, 0,
doc: /* Make a new X window, which is called a "frame" in Emacs terms.
error ("Invalid frame font");
}
-#ifdef USE_LUCID
- /* Prevent lwlib/xlwmenu.c from crashing because of a bug
- whereby it fails to get any font. */
- BLOCK_INPUT;
- xlwmenu_default_font = XLoadQueryFont (FRAME_X_DISPLAY (f), "fixed");
- UNBLOCK_INPUT;
-#endif
-
/* Frame contents get displaced if an embedded X window has a border. */
if (! FRAME_X_EMBEDDED_P (f))
- x_default_parameter (f, parms, Qborder_width, make_number (2),
+ x_default_parameter (f, parms, Qborder_width, make_number (0),
"borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 1 in order to match xterm. We recognize either
#endif
"internalBorderWidth", "internalBorderWidth",
RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qvertical_scroll_bars, Qleft,
+ x_default_parameter (f, parms, Qvertical_scroll_bars,
+#if defined(USE_GTK) && defined(USE_TOOLKIT_SCROLL_BARS)
+ Qright,
+#else
+ Qleft,
+#endif
"verticalScrollBars", "ScrollBars",
RES_TYPE_SYMBOL);
;
}
+ BLOCK_INPUT;
+
+ /* Set machine name and pid for the purpose of window managers. */
+ set_machine_and_pid_properties(f);
+
/* Set the WM leader property. GTK does this itself, so this is not
needed when using GTK. */
if (dpyinfo->client_leader_window != 0)
{
- BLOCK_INPUT;
XChangeProperty (FRAME_X_DISPLAY (f),
FRAME_OUTER_WINDOW (f),
dpyinfo->Xatom_wm_client_leader,
XA_WINDOW, 32, PropModeReplace,
(unsigned char *) &dpyinfo->client_leader_window, 1);
- UNBLOCK_INPUT;
}
+ UNBLOCK_INPUT;
+
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
if (FRAME_HAS_MINIBUF_P (f)
vinfo_template.screen = XScreenNumberOfScreen (screen);
vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask,
&vinfo_template, &n_visuals);
- if (n_visuals != 1)
+ if (n_visuals <= 0)
fatal ("Can't get proper X visual info");
dpyinfo->n_planes = vinfo->depth;
needed to determine window geometry. */
x_default_font_parameter (f, parms);
- x_default_parameter (f, parms, Qborder_width, make_number (2),
+ x_default_parameter (f, parms, Qborder_width, make_number (0),
"borderWidth", "BorderWidth", RES_TYPE_NUMBER);
/* This defaults to 2 in order to match xterm. We recognize either
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
- try_window (FRAME_ROOT_WINDOW (f), pos, 0);
+ try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
/* Compute width and height of the tooltip. */
width = height = 0;
/* Let the row go over the full width of the frame. */
row->full_width_p = 1;
+ row_width = row->pixel_width;
/* There's a glyph at the end of rows that is used to place
the cursor there. Don't include the width of this glyph. */
if (row->used[TEXT_AREA])
{
last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
- row_width = row->pixel_width - last->pixel_width;
+ if (INTEGERP (last->object))
+ row_width -= last->pixel_width;
}
- else
- row_width = row->pixel_width;
height += row->height;
width = max (width, row_width);
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#ifdef USE_LUCID
+#include "xsettings.h"
+#include "../lwlib/xlwmenu.h"
#ifdef HAVE_XAW3D
#include <X11/Xaw3d/Paned.h>
#else /* !HAVE_XAW3D */
return 1;
}
+#ifdef USE_LUCID
+static void
+apply_systemfont_to_dialog (w)
+ Widget w;
+{
+ const char *fn = xsettings_get_system_normal_font ();
+ if (fn)
+ {
+ XrmDatabase db = XtDatabase (XtDisplay (w));
+ if (db)
+ XrmPutStringResource (&db, "*dialog.faceName", fn);
+ }
+}
+
+static void
+apply_systemfont_to_menu (w)
+ Widget w;
+{
+ const char *fn = xsettings_get_system_normal_font ();
+ int defflt;
+
+ if (!fn) return;
+
+ if (XtIsShell (w)) /* popup menu */
+ {
+ Widget *childs = NULL;
+
+ XtVaGetValues (w, XtNchildren, &childs, NULL);
+ if (*childs) w = *childs;
+ }
+
+ /* Only use system font if the default is used for the menu. */
+ XtVaGetValues (w, XtNdefaultFace, &defflt, NULL);
+ if (defflt)
+ XtVaSetValues (w, XtNfaceName, fn, NULL);
+}
+#endif
+
/* Set the contents of the menubar widgets of frame F.
The argument FIRST_TIME is currently ignored;
it is set the first time this is called, from initialize_frame_menubar. */
/* Make menu pop down on C-g. */
XtOverrideTranslations (menubar_widget, override);
+ apply_systemfont_to_menu (menubar_widget);
}
{
popup_deactivate_callback,
menu_highlight_callback);
+ apply_systemfont_to_menu (menu);
+
dummy.type = ButtonPress;
dummy.serial = 0;
dummy.send_event = 0;
abort();
dialog_id = widget_id_tick++;
+#ifdef HAVE_XFT
+ apply_systemfont_to_dialog (f->output_data.x->widget);
+#endif
lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
f->output_data.x->widget, 1, 0,
dialog_selection_callback, 0, 0);
lw_modify_all_widgets (dialog_id, first_wv->contents, True);
-
/* Display the dialog box. */
lw_pop_up_all_widgets (dialog_id);
popup_activated_flag = 1;
#include <unistd.h>
#endif
+#include <errno.h>
#include <epaths.h>
#include <stdio.h>
#include <setjmp.h>
-#if 1 /* I'd really appreciate it if this code could go away... -JimB */
-/* This avoids lossage in the `dual-universe' headers on AT&T SysV
- X11. Don't do it on Solaris, because it breaks compilation with
- XFree86 4.0.3 (and probably many other X11R6 releases) on Solaris
- 2 */
-#if defined(USG5) && !defined(SOLARIS2)
-#ifndef SYSV
-#define SYSV
-#endif
-#endif /* USG5 && !SOLARIS2 */
-
-#endif /* 1 */
-
#include <X11/Xlib.h>
#include <X11/Xatom.h>
-#if 0
-#include <X11/Xos.h>
-#endif
#include <X11/X.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
char *msg, *prog;
int x1, x2, x3, x4, x5;
{
- extern int errno;
-
if (errno)
perror (prog);
-/* Functions for handle font changes dynamically.
+/* Functions for handle font and other changes dynamically.
Copyright (C) 2009, 2010
Free Software Foundation, Inc.
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "config.h"
+#include <limits.h>
#include <setjmp.h>
#include <fcntl.h>
#include "lisp.h"
#endif
static char *current_mono_font;
+static char *current_font;
static struct x_display_info *first_dpyinfo;
-static Lisp_Object Qfont_name, Qfont_render;
+static Lisp_Object Qmonospace_font_name, Qfont_name, Qfont_render,
+ Qtool_bar_style;
static int use_system_font;
static Lisp_Object Vxft_settings;
-
+static Lisp_Object current_tool_bar_style;
#ifdef HAVE_GCONF
static GConfClient *gconf_client;
static void
-store_font_changed_event (arg, display_name)
+store_config_changed_event (arg, display_name)
Lisp_Object arg;
Lisp_Object display_name;
{
kbd_buffer_store_event (&event);
}
+#define XSETTINGS_FONT_NAME "Gtk/FontName"
+#define XSETTINGS_TOOL_BAR_STYLE "Gtk/ToolbarStyle"
+
+enum {
+ SEEN_AA = 0x01,
+ SEEN_HINTING = 0x02,
+ SEEN_RGBA = 0x04,
+ SEEN_LCDFILTER = 0x08,
+ SEEN_HINTSTYLE = 0x10,
+ SEEN_DPI = 0x20,
+ SEEN_FONT = 0x40,
+ SEEN_TB_STYLE = 0x80,
+};
+struct xsettings
+{
+#ifdef HAVE_XFT
+ FcBool aa, hinting;
+ int rgba, lcdfilter, hintstyle;
+ double dpi;
+#endif
+
+ char *font;
+ char *tb_style;
+
+ unsigned seen;
+};
+
#ifdef HAVE_GCONF
-#define SYSTEM_MONO_FONT "/desktop/gnome/interface/monospace_font_name"
+#define SYSTEM_MONO_FONT "/desktop/gnome/interface/monospace_font_name"
+#define SYSTEM_FONT "/desktop/gnome/interface/font_name"
/* Callback called when something changed in GConf that we care about,
that is SYSTEM_MONO_FONT. */
found = dpyinfo == first_dpyinfo;
if (found && use_system_font)
- store_font_changed_event (Qfont_name,
- XCAR (first_dpyinfo->name_list_element));
+ store_config_changed_event (Qmonospace_font_name,
+ XCAR (first_dpyinfo->name_list_element));
}
}
#endif /* HAVE_GCONF */
#define FC_LCD_FILTER "lcdfilter"
#endif
+#endif /* HAVE_XFT */
+
/* Find the window that contains the XSETTINGS property values. */
static void
XUngrabServer (dpy);
}
-enum {
- SEEN_AA = 0x01,
- SEEN_HINTING = 0x02,
- SEEN_RGBA = 0x04,
- SEEN_LCDFILTER = 0x08,
- SEEN_HINTSTYLE = 0x10,
- SEEN_DPI = 0x20,
-};
-struct xsettings
-{
- FcBool aa, hinting;
- int rgba, lcdfilter, hintstyle;
- double dpi;
-
- unsigned seen;
-};
-
#define SWAP32(nr) (((nr) << 24) | (((nr) << 8) & 0xff0000) \
| (((nr) >> 8) & 0xff00) | ((nr) >> 24))
#define SWAP16(nr) (((nr) << 8) | ((nr) >> 8))
*/
static int
-parse_xft_settings (prop, bytes, settings)
+parse_settings (prop, bytes, settings)
unsigned char *prop;
unsigned long bytes;
struct xsettings *settings;
memset (settings, 0, sizeof (*settings));
- while (bytes_parsed+4 < bytes && settings_seen < 6
+ while (bytes_parsed+4 < bytes && settings_seen < 7
&& i < n_settings)
{
int type = prop[bytes_parsed++];
CARD32 vlen, ival = 0;
char name[128]; /* The names we are looking for are not this long. */
char sval[128]; /* The values we are looking for are not this long. */
- int is_xft;
+ int want_this;
int to_cpy;
sval[0] = '\0';
bytes_parsed += 4; /* Skip serial for this value */
if (bytes_parsed > bytes) return BadLength;
- is_xft = nlen > 6 && strncmp (name, "Xft/", 4) == 0;
+ want_this =
+#ifdef HAVE_XFT
+ (nlen > 6 && strncmp (name, "Xft/", 4) == 0)
+ ||
+#endif
+ (strcmp (XSETTINGS_FONT_NAME, name) == 0)
+ || (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0);
switch (type)
{
case 0: /* Integer */
if (bytes_parsed+4 > bytes) return BadLength;
- if (is_xft)
+ if (want_this)
{
memcpy (&ival, prop+bytes_parsed, 4);
if (my_bo != that_bo) ival = SWAP32 (ival);
memcpy (&vlen, prop+bytes_parsed, 4);
bytes_parsed += 4;
if (my_bo != that_bo) vlen = SWAP32 (vlen);
- if (is_xft)
+ if (want_this)
{
to_cpy = vlen > 127 ? 127 : vlen;
memcpy (sval, prop+bytes_parsed, to_cpy);
return BadValue;
}
- if (is_xft)
+ if (want_this)
{
++settings_seen;
- if (strcmp (name, "Xft/Antialias") == 0)
+ if (strcmp (name, XSETTINGS_FONT_NAME) == 0)
+ {
+ settings->font = xstrdup (sval);
+ settings->seen |= SEEN_FONT;
+ }
+ else if (strcmp (name, XSETTINGS_TOOL_BAR_STYLE) == 0)
+ {
+ settings->tb_style = xstrdup (sval);
+ settings->seen |= SEEN_TB_STYLE;
+ }
+#ifdef HAVE_XFT
+ else if (strcmp (name, "Xft/Antialias") == 0)
{
settings->seen |= SEEN_AA;
settings->aa = ival != 0;
else
settings->seen &= ~SEEN_LCDFILTER;
}
+#endif /* HAVE_XFT */
}
}
}
static int
-read_xft_settings (dpyinfo, settings)
+read_settings (dpyinfo, settings)
struct x_display_info *dpyinfo;
struct xsettings *settings;
{
if (rc == Success && prop != NULL && act_form == 8 && nitems > 0
&& act_type == dpyinfo->Xatom_xsettings_prop)
- rc = parse_xft_settings (prop, nitems, settings);
+ rc = parse_settings (prop, nitems, settings);
XFree (prop);
static void
-apply_xft_settings (dpyinfo, send_event_p)
+apply_xft_settings (dpyinfo, send_event_p, settings)
struct x_display_info *dpyinfo;
int send_event_p;
+ struct xsettings *settings;
{
+#ifdef HAVE_XFT
FcPattern *pat;
- struct xsettings settings, oldsettings;
+ struct xsettings oldsettings;
int changed = 0;
char buf[256];
- if (!read_xft_settings (dpyinfo, &settings))
- return;
-
memset (&oldsettings, 0, sizeof (oldsettings));
buf[0] = '\0';
pat = FcPatternCreate ();
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
- if ((settings.seen & SEEN_AA) != 0 && oldsettings.aa != settings.aa)
+ if ((settings->seen & SEEN_AA) != 0 && oldsettings.aa != settings->aa)
{
FcPatternDel (pat, FC_ANTIALIAS);
- FcPatternAddBool (pat, FC_ANTIALIAS, settings.aa);
+ FcPatternAddBool (pat, FC_ANTIALIAS, settings->aa);
++changed;
- oldsettings.aa = settings.aa;
+ oldsettings.aa = settings->aa;
}
sprintf (buf, "Antialias: %d", oldsettings.aa);
- if ((settings.seen & SEEN_HINTING) != 0
- && oldsettings.hinting != settings.hinting)
+ if ((settings->seen & SEEN_HINTING) != 0
+ && oldsettings.hinting != settings->hinting)
{
FcPatternDel (pat, FC_HINTING);
- FcPatternAddBool (pat, FC_HINTING, settings.hinting);
+ FcPatternAddBool (pat, FC_HINTING, settings->hinting);
++changed;
- oldsettings.hinting = settings.hinting;
+ oldsettings.hinting = settings->hinting;
}
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "Hinting: %d", oldsettings.hinting);
- if ((settings.seen & SEEN_RGBA) != 0 && oldsettings.rgba != settings.rgba)
+ if ((settings->seen & SEEN_RGBA) != 0 && oldsettings.rgba != settings->rgba)
{
FcPatternDel (pat, FC_RGBA);
- FcPatternAddInteger (pat, FC_RGBA, settings.rgba);
- oldsettings.rgba = settings.rgba;
+ FcPatternAddInteger (pat, FC_RGBA, settings->rgba);
+ oldsettings.rgba = settings->rgba;
++changed;
}
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "RGBA: %d", oldsettings.rgba);
/* Older fontconfig versions don't have FC_LCD_FILTER. */
- if ((settings.seen & SEEN_LCDFILTER) != 0
- && oldsettings.lcdfilter != settings.lcdfilter)
+ if ((settings->seen & SEEN_LCDFILTER) != 0
+ && oldsettings.lcdfilter != settings->lcdfilter)
{
FcPatternDel (pat, FC_LCD_FILTER);
- FcPatternAddInteger (pat, FC_LCD_FILTER, settings.lcdfilter);
+ FcPatternAddInteger (pat, FC_LCD_FILTER, settings->lcdfilter);
++changed;
- oldsettings.lcdfilter = settings.lcdfilter;
+ oldsettings.lcdfilter = settings->lcdfilter;
}
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter);
- if ((settings.seen & SEEN_HINTSTYLE) != 0
- && oldsettings.hintstyle != settings.hintstyle)
+ if ((settings->seen & SEEN_HINTSTYLE) != 0
+ && oldsettings.hintstyle != settings->hintstyle)
{
FcPatternDel (pat, FC_HINT_STYLE);
- FcPatternAddInteger (pat, FC_HINT_STYLE, settings.hintstyle);
+ FcPatternAddInteger (pat, FC_HINT_STYLE, settings->hintstyle);
++changed;
- oldsettings.hintstyle = settings.hintstyle;
+ oldsettings.hintstyle = settings->hintstyle;
}
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle);
- if ((settings.seen & SEEN_DPI) != 0 && oldsettings.dpi != settings.dpi
- && settings.dpi > 0)
+ if ((settings->seen & SEEN_DPI) != 0 && oldsettings.dpi != settings->dpi
+ && settings->dpi > 0)
{
Lisp_Object frame, tail;
FcPatternDel (pat, FC_DPI);
- FcPatternAddDouble (pat, FC_DPI, settings.dpi);
+ FcPatternAddDouble (pat, FC_DPI, settings->dpi);
++changed;
- oldsettings.dpi = settings.dpi;
+ oldsettings.dpi = settings->dpi;
/* Change the DPI on this display and all frames on the display. */
- dpyinfo->resy = dpyinfo->resx = settings.dpi;
+ dpyinfo->resy = dpyinfo->resx = settings->dpi;
FOR_EACH_FRAME (tail, frame)
if (FRAME_X_P (XFRAME (frame))
&& FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
- XFRAME (frame)->resy = XFRAME (frame)->resx = settings.dpi;
+ XFRAME (frame)->resy = XFRAME (frame)->resx = settings->dpi;
}
if (strlen (buf) > 0) strcat (buf, ", ");
{
XftDefaultSet (dpyinfo->display, pat);
if (send_event_p)
- store_font_changed_event (Qfont_render,
- XCAR (dpyinfo->name_list_element));
+ store_config_changed_event (Qfont_render,
+ XCAR (dpyinfo->name_list_element));
Vxft_settings = make_string (buf, strlen (buf));
}
else
FcPatternDestroy (pat);
+#endif /* HAVE_XFT */
}
-#endif /* HAVE_XFT */
+static void
+read_and_apply_settings (dpyinfo, send_event_p)
+ struct x_display_info *dpyinfo;
+ int send_event_p;
+{
+ struct xsettings settings;
+ Lisp_Object dpyname = XCAR (dpyinfo->name_list_element);
+
+ if (!read_settings (dpyinfo, &settings))
+ return;
+
+ apply_xft_settings (dpyinfo, True, &settings);
+ if (settings.seen & SEEN_TB_STYLE)
+ {
+ Lisp_Object style = Qnil;
+ if (strcmp (settings.tb_style, "both") == 0)
+ style = Qboth;
+ else if (strcmp (settings.tb_style, "both-horiz") == 0)
+ style = Qboth_horiz;
+ else if (strcmp (settings.tb_style, "icons") == 0)
+ style = Qimage;
+ else if (strcmp (settings.tb_style, "text") == 0)
+ style = Qtext;
+ if (!NILP (style) && !EQ (style, current_tool_bar_style))
+ {
+ current_tool_bar_style = style;
+ if (send_event_p)
+ store_config_changed_event (Qtool_bar_style, dpyname);
+ }
+ free (settings.tb_style);
+ }
+
+ if (settings.seen & SEEN_FONT)
+ {
+ if (!current_font || strcmp (current_font, settings.font) != 0)
+ {
+ free (current_font);
+ current_font = settings.font;
+ if (send_event_p)
+ store_config_changed_event (Qfont_name, dpyname);
+ }
+ else
+ free (settings.font);
+ }
+}
void
xft_settings_event (dpyinfo, event)
struct x_display_info *dpyinfo;
XEvent *event;
{
-#ifdef HAVE_XFT
int check_window_p = 0;
+ int apply_settings = 0;
switch (event->type)
{
if (event->xproperty.window == dpyinfo->xsettings_window
&& event->xproperty.state == PropertyNewValue
&& event->xproperty.atom == dpyinfo->Xatom_xsettings_prop)
- {
- apply_xft_settings (dpyinfo, True);
- }
+ apply_settings = 1;
break;
}
+
if (check_window_p)
{
dpyinfo->xsettings_window = None;
get_prop_window (dpyinfo);
if (dpyinfo->xsettings_window != None)
- apply_xft_settings (dpyinfo, True);
+ apply_settings = 1;
}
-#endif /* HAVE_XFT */
+
+ if (apply_settings)
+ read_and_apply_settings (dpyinfo, True);
}
current_mono_font = xstrdup (s);
g_free (s);
}
+ s = gconf_client_get_string (gconf_client, SYSTEM_FONT, NULL);
+ if (s)
+ {
+ current_font = xstrdup (s);
+ g_free (s);
+ }
gconf_client_set_error_handling (gconf_client, GCONF_CLIENT_HANDLE_NONE);
gconf_client_add_dir (gconf_client,
SYSTEM_MONO_FONT,
}
static void
-init_xfd_settings (dpyinfo)
+init_xsettings (dpyinfo)
struct x_display_info *dpyinfo;
{
-#ifdef HAVE_XFT
char sel[64];
Display *dpy = dpyinfo->display;
get_prop_window (dpyinfo);
if (dpyinfo->xsettings_window != None)
- apply_xft_settings (dpyinfo, False);
+ read_and_apply_settings (dpyinfo, False);
UNBLOCK_INPUT;
-
-#else /* ! HAVE_XFT */
-
- dpyinfo->Xatom_xsettings_sel = None;
- dpyinfo->Xatom_xsettings_prop = None;
- dpyinfo->Xatom_xsettings_mgr = None;
- dpyinfo->xsettings_window = None;
-
-#endif /* ! HAVE_XFT */
}
void
{
if (first_dpyinfo == NULL) first_dpyinfo = dpyinfo;
init_gconf ();
- init_xfd_settings (dpyinfo);
+ init_xsettings (dpyinfo);
}
const char *
return current_mono_font;
}
+const char *
+xsettings_get_system_normal_font ()
+{
+ return current_font;
+}
+
+DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font,
+ Sfont_get_system_normal_font,
+ 0, 0, 0,
+ doc: /* Get the system default font. */)
+ ()
+{
+ return current_font && use_system_font
+ ? make_string (current_font, strlen (current_font))
+ : Qnil;
+}
+
DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
0, 0, 0,
doc: /* Get the system default monospaced font. */)
: Qnil;
}
+DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, Stool_bar_get_system_style,
+ 0, 0, 0,
+ doc: /* Get the system tool bar style.
+If no system tool bar style is known, return `tool-bar-style' if set to a
+known style. Otherwise return image. */)
+ ()
+{
+ if (EQ (Vtool_bar_style, Qimage)
+ || EQ (Vtool_bar_style, Qtext)
+ || EQ (Vtool_bar_style, Qboth)
+ || EQ (Vtool_bar_style, Qboth_horiz))
+ return Vtool_bar_style;
+ if (!NILP (current_tool_bar_style))
+ return current_tool_bar_style;
+ return Qimage;
+}
+
void
syms_of_xsettings ()
{
current_mono_font = NULL;
+ current_font = NULL;
first_dpyinfo = NULL;
#ifdef HAVE_GCONF
gconf_client = NULL;
#endif
+ Qmonospace_font_name = intern_c_string ("monospace-font-name");
+ staticpro (&Qmonospace_font_name);
Qfont_name = intern_c_string ("font-name");
staticpro (&Qfont_name);
Qfont_render = intern_c_string ("font-render");
staticpro (&Qfont_render);
defsubr (&Sfont_get_system_font);
+ defsubr (&Sfont_get_system_normal_font);
DEFVAR_BOOL ("font-use-system-font", &use_system_font,
doc: /* *Non-nil means to use the system defined font. */);
Fprovide (intern_c_string ("system-font-setting"), Qnil);
#endif
#endif
+
+ current_tool_bar_style = Qnil;
+ Qtool_bar_style = intern_c_string ("tool-bar-style");
+ staticpro (&Qtool_bar_style);
+ defsubr (&Stool_bar_get_system_style);
+
+ Fprovide (intern_c_string ("dynamic-setting"), Qnil);
}
/* arch-tag: 541716ed-2e6b-42e1-8212-3197e01ea61d
#define XSETTINGS_H
EXFUN (Ffont_get_system_font, 0);
+EXFUN (Ffont_get_system_normal_font, 0);
+EXFUN (Ftool_bar_get_system_style, 0);
+
extern void xsettings_initialize P_ ((struct x_display_info *dpyinfo));
extern void xft_settings_event P_ ((struct x_display_info *dpyinfo,
XEvent *));
extern const char *xsettings_get_system_font P_ ((void));
+extern const char *xsettings_get_system_normal_font P_ ((void));
#endif /* XSETTINGS_H */
#define NOSPLASH_OPT "--no-splash"
+/* The option to make Emacs start in the given directory. */
+
+#define CHDIR_OPT "--chdir="
+
static void
ice_connection_closed ()
{
int props_idx = 0;
char *cwd = NULL;
- char *smid_opt;
+ char *smid_opt, *chdir_opt = NULL;
/* How to start a new instance of Emacs. */
props[props_idx] = &prop_ptr[props_idx];
props[props_idx]->vals[0].value = SDATA (Vinvocation_name);
++props_idx;
- /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx --no-splash). */
+ /* How to restart Emacs. */
props[props_idx] = &prop_ptr[props_idx];
props[props_idx]->name = SmRestartCommand;
props[props_idx]->type = SmLISTofARRAY8;
- props[props_idx]->num_vals = 3; /* /path/to/emacs, --smid=xxx --no-splash */
+ /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir */
+ props[props_idx]->num_vals = 4;
props[props_idx]->vals = &values[val_idx];
props[props_idx]->vals[0].length = strlen (emacs_program);
props[props_idx]->vals[0].value = emacs_program;
props[props_idx]->vals[2].length = strlen (NOSPLASH_OPT);
props[props_idx]->vals[2].value = NOSPLASH_OPT;
- val_idx += 3;
+
+ cwd = get_current_dir_name ();
+ if (cwd)
+ {
+ chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1);
+ strcpy (chdir_opt, CHDIR_OPT);
+ strcat (chdir_opt, cwd);
+
+ props[props_idx]->vals[3].length = strlen (chdir_opt);
+ props[props_idx]->vals[3].value = chdir_opt;
+ }
+
+ val_idx += cwd ? 4 : 3;
++props_idx;
/* User id. */
props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
++props_idx;
- cwd = get_current_dir_name ();
if (cwd)
{
SmcSetProperties (smcConn, props_idx, props);
xfree (smid_opt);
+ xfree (chdir_opt);
free (cwd);
#include <sys/types.h>
#endif /* makedev */
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
-#endif /* ! defined (BSD_SYSTEM) */
+#endif /* ! defined (HAVE_SYS_IOCTL_H) */
#include "systime.h"
extern Lisp_Object Qeql;
-extern int errno;
-
/* A mask of extra modifier bits to put into every keyboard char. */
extern EMACS_INT extra_keyboard_modifiers;
x_draw_image_relief (s)
struct glyph_string *s;
{
- int x0, y0, x1, y1, thick, raised_p;
+ int x0, y0, x1, y1, thick, raised_p, extra;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
raised_p = s->img->relief > 0;
}
- x0 = x - thick;
- y0 = y - thick;
- x1 = x + s->slice.width + thick - 1;
- y1 = y + s->slice.height + thick - 1;
+ extra = s->face->id == TOOL_BAR_FACE_ID
+ ? XINT (Vtool_bar_button_margin) : 0;
+
+ x0 = x - thick - extra;
+ y0 = y - thick - extra;
+ x1 = x + s->slice.width + thick - 1 + extra;
+ y1 = y + s->slice.height + thick - 1 + extra;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
w->phys_cursor_on_p = 1;
if (glyph_row->exact_window_width_line_p
- && w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])
+ && (glyph_row->reversed_p
+ ? (w->phys_cursor.hpos < 0)
+ : (w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA])))
{
glyph_row->cursor_in_fringe_p = 1;
- draw_fringe_bitmap (w, glyph_row, 0);
+ draw_fringe_bitmap (w, glyph_row, glyph_row->reversed_p);
}
else
- switch (cursor_type)
{
- case HOLLOW_BOX_CURSOR:
- x_draw_hollow_cursor (w, glyph_row);
- break;
+ switch (cursor_type)
+ {
+ case HOLLOW_BOX_CURSOR:
+ x_draw_hollow_cursor (w, glyph_row);
+ break;
- case FILLED_BOX_CURSOR:
- draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
- break;
+ case FILLED_BOX_CURSOR:
+ draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
+ break;
- case BAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
- break;
+ case BAR_CURSOR:
+ x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
+ break;
- case HBAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
- break;
+ case HBAR_CURSOR:
+ x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
+ break;
- case NO_CURSOR:
- w->phys_cursor_width = 0;
- break;
+ case NO_CURSOR:
+ w->phys_cursor_width = 0;
+ break;
- default:
- abort ();
+ default:
+ abort ();
+ }
}
#ifdef HAVE_X_I18N
if (terminal_list->next_terminal == NULL)
{
fprintf (stderr, "%s\n", error_msg);
- shut_down_emacs (0, 0, Qnil);
- exit (70);
+ Fkill_emacs (make_number (70));
+ /* NOTREACHED */
}
xg_display_close (dpyinfo->display);
#endif
if (terminal_list == 0)
{
fprintf (stderr, "%s\n", error_msg);
- shut_down_emacs (0, 0, Qnil);
- exit (70);
+ Fkill_emacs (make_number (70));
+ /* NOTREACHED */
}
/* Ordinary stack unwind doesn't deal with these. */
* cedet/tests/testdoublens.cpp:
* cedet/tests/testdoublens.hpp: Add copyright header.
- * cedet/semantic-tests.el (semanticdb-test-gnu-global): Remove
- reference to deleted files.
+ * cedet/semantic-tests.el (semanticdb-test-gnu-global):
+ Remove reference to deleted files.
+
+2010-03-30 Juri Linkov <juri@jurta.org>
+
+ * occur-testsuite.el (occur-tests): Add tests for context lines.
+
+2010-03-23 Juri Linkov <juri@jurta.org>
+
+ * occur-testsuite.el: New file.
+
+2010-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * Branch for 23.2.
2010-02-19 Ulf Jasper <ulf.jasper@web.de>
--- /dev/null
+;;; occur-testsuite.el --- Test suite for occur.
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Juri Linkov <juri@jurta.org>
+;; Keywords: matching, internal
+
+;; 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:
+
+;; Type M-x test-occur RET to test the functionality of `occur'.
+
+;;; Code:
+
+(defconst occur-tests
+ '(
+ ;; * Test one-line matches (at bob, eob, bol, eol).
+ ("x" 0 "\
+xa
+b
+cx
+xd
+xex
+fx
+" "\
+5 matches for \"x\" in buffer: *temp*
+ 1:xa
+ 3:cx
+ 4:xd
+ 5:xex
+ 6:fx
+")
+ ;; * Test multi-line matches, this is the first test from
+ ;; http://lists.gnu.org/archive/html/emacs-devel/2005-06/msg01008.html
+ ;; where numbers are replaced with letters.
+ ("a\na" 0 "\
+a
+a
+a
+a
+a
+" "\
+2 matches for \"a^Ja\" in buffer: *temp*
+ 1:a
+ :a
+ 3:a
+ :a
+")
+ ;; * Test multi-line matches, this is the second test from
+ ;; http://lists.gnu.org/archive/html/emacs-devel/2005-06/msg01008.html
+ ;; where numbers are replaced with letters.
+ ("a\nb" 0 "\
+a
+b
+c
+a
+b
+" "\
+2 matches for \"a^Jb\" in buffer: *temp*
+ 1:a
+ :b
+ 4:a
+ :b
+")
+ ;; * Test line numbers for multi-line matches with empty last match line.
+ ("a\n" 0 "\
+a
+
+c
+a
+
+" "\
+2 matches for \"a^J\" in buffer: *temp*
+ 1:a
+ :
+ 4:a
+ :
+")
+ ;; * Test multi-line matches with 3 match lines.
+ ("x\n.x\n" 0 "\
+ax
+bx
+c
+d
+ex
+fx
+" "\
+2 matches for \"x^J.x^J\" in buffer: *temp*
+ 1:ax
+ :bx
+ :c
+ 5:ex
+ :fx
+ :
+")
+ ;; * Test non-overlapping context lines with matches at bob/eob.
+ ("x" 1 "\
+ax
+b
+c
+d
+ex
+f
+g
+hx
+" "\
+3 matches for \"x\" in buffer: *temp*
+ 1:ax
+ :b
+-------
+ :d
+ 5:ex
+ :f
+-------
+ :g
+ 8:hx
+")
+ ;; * Test non-overlapping context lines with matches not at bob/eob.
+ ("x" 1 "\
+a
+bx
+c
+d
+ex
+f
+" "\
+2 matches for \"x\" in buffer: *temp*
+ :a
+ 2:bx
+ :c
+-------
+ :d
+ 5:ex
+ :f
+")
+ ;; * Test overlapping context lines with matches at bob/eob.
+ ("x" 2 "\
+ax
+bx
+c
+dx
+e
+f
+gx
+h
+i
+j
+kx
+" "\
+5 matches for \"x\" in buffer: *temp*
+ 1:ax
+ 2:bx
+ :c
+ 4:dx
+ :e
+ :f
+ 7:gx
+ :h
+ :i
+ :j
+ 11:kx
+")
+ ;; * Test overlapping context lines with matches not at bob/eob.
+ ("x" 2 "\
+a
+b
+cx
+d
+e
+f
+gx
+h
+i
+" "\
+2 matches for \"x\" in buffer: *temp*
+ :a
+ :b
+ 3:cx
+ :d
+ :e
+ :f
+ 7:gx
+ :h
+ :i
+")
+ ;; * Test overlapping context lines with empty first and last line..
+ ("x" 2 "\
+
+b
+cx
+d
+e
+f
+gx
+h
+
+" "\
+2 matches for \"x\" in buffer: *temp*
+ :
+ :b
+ 3:cx
+ :d
+ :e
+ :f
+ 7:gx
+ :h
+ :
+")
+ ;; * Test multi-line overlapping context lines.
+ ("x\n.x" 2 "\
+ax
+bx
+c
+d
+ex
+fx
+g
+h
+i
+jx
+kx
+" "\
+3 matches for \"x^J.x\" in buffer: *temp*
+ 1:ax
+ :bx
+ :c
+ :d
+ 5:ex
+ :fx
+ :g
+ :h
+ :i
+ 10:jx
+ :kx
+")
+ ;; * Test multi-line non-overlapping context lines.
+ ("x\n.x" 2 "\
+ax
+bx
+c
+d
+e
+f
+gx
+hx
+" "\
+2 matches for \"x^J.x\" in buffer: *temp*
+ 1:ax
+ :bx
+ :c
+ :d
+-------
+ :e
+ :f
+ 7:gx
+ :hx
+")
+ ;; * Test non-overlapping negative (before-context) lines.
+ ("x" -2 "\
+a
+bx
+c
+d
+e
+fx
+g
+h
+ix
+" "\
+3 matches for \"x\" in buffer: *temp*
+ :a
+ 2:bx
+-------
+ :d
+ :e
+ 6:fx
+-------
+ :g
+ :h
+ 9:ix
+")
+ ;; * Test overlapping negative (before-context) lines.
+ ("x" -3 "\
+a
+bx
+c
+dx
+e
+f
+gx
+h
+" "\
+3 matches for \"x\" in buffer: *temp*
+ :a
+ 2:bx
+ :c
+ 4:dx
+ :e
+ :f
+ 7:gx
+")
+
+)
+ "List of tests for `occur'.
+Each element has the format:
+\(REGEXP NLINES INPUT-BUFFER-STRING OUTPUT-BUFFER-STRING).")
+
+(defun test-occur ()
+ (interactive)
+ (let ((count 1)
+ failed
+ (occur-hook nil))
+ (dolist (test occur-tests)
+ (let ((regexp (nth 0 test))
+ (nlines (nth 1 test))
+ (input-buffer-string (nth 2 test))
+ (output-buffer-string (nth 3 test)))
+ (save-excursion
+ (with-temp-buffer
+ (insert input-buffer-string)
+ (occur regexp nlines)
+ (unless (equal output-buffer-string
+ (with-current-buffer "*Occur*"
+ (buffer-string)))
+ (setq failed (cons count failed))))))
+ (setq count (1+ count)))
+ (if failed
+ (message "FAILED TESTS: %S" (reverse failed))
+ (message "SUCCESS"))))
+
+(provide 'occur-testsuite)
+
+;;; occur-testsuite.el ends here