# HG changeset patch # User Katsumi Yamaoka # Date 1273492629 0 # Node ID 5b2cee3284b0615fbaf1dccef652497d5c4e4dc1 # Parent e9ddc22923367985f1990c9efae5f4c72c596a8d# Parent 7642d075642b6896a7b32d18ac80c0f7c1878a0b Merge from mainline. diff -r e9ddc2292336 -r 5b2cee3284b0 ChangeLog --- a/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,9 +1,28 @@ +2010-05-10 Glenn Morris + + * 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 (tiny change) + + * INSTALL: Fix typos. + +2010-05-08 Chong Yidong + + * configure.in: Add check for buggy version of GCC (Bug#6031). + 2010-05-08 Glenn Morris * 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 + + * Version 23.2 released. + 2010-05-07 Stefan Monnier * configure.in: Add tests for `isnan' and `copysign'. @@ -138,7 +157,7 @@ * configure.in (REAL_CFLAGS, CFLAGS): Restore -g for gcc. -2010-04-22 Miles Bader +2010-04-22 Miles Bader * configure.in: Get rid of "unix" pre-defined macro when preprocessing Makefile. (Bug#5857) diff -r e9ddc2292336 -r 5b2cee3284b0 INSTALL --- a/INSTALL Sat May 08 10:54:36 2010 +0000 +++ b/INSTALL Mon May 10 11:57:09 2010 +0000 @@ -408,7 +408,7 @@ switch to the compiler, and link against libfoo.a and libbar.a libraries in addition to the standard ones. -For some libraries, like Gtk+, fontconfig and ALSA, `configure' use +For some libraries, like Gtk+, fontconfig and ALSA, `configure' uses pkg-config to find where those libraries are installed. If you want pkg-config to look in special directories, you have to set the environment variable PKG_CONFIG_PATH to point to the directories @@ -466,7 +466,7 @@ documentation strings to be in the etc/DOC file (see src/Makefile.in if you wish to figure out how to do that). For all else, use site-init.el. Do not load byte-compiled code which -was build with a non-nil value of `byte-compile-dynamic'. +was built with a non-nil value of `byte-compile-dynamic'. If you set load-path to a different value in site-init.el or site-load.el, Emacs will use *precisely* that value when it starts up @@ -491,7 +491,7 @@ copying it, if you wish; then it automatically uses the sibling directories ../lisp, ../lib-src, ../info. -Or you can "install" the executable and the other Emacs into their +Or you can "install" the executable and the other files into their installed locations, with `make install'. By default, Emacs's files are installed in the following directories: diff -r e9ddc2292336 -r 5b2cee3284b0 admin/CPP-DEFINES --- a/admin/CPP-DEFINES Sat May 08 10:54:36 2010 +0000 +++ b/admin/CPP-DEFINES Mon May 10 11:57:09 2010 +0000 @@ -215,8 +215,6 @@ IS_DIRECTORY_SEP KERNEL_FILE LDAV_SYMBOL -LIBS_SYSTEM -LIBXMU LINKER LINUX_VERSION_CODE LISP_FLOAT_TYPE diff -r e9ddc2292336 -r 5b2cee3284b0 admin/ChangeLog --- a/admin/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/admin/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-04-01 Eli Zaretskii * CPP-DEFINES (__DJGPP__, __GO32__): Remove, no longer used. diff -r e9ddc2292336 -r 5b2cee3284b0 configure --- a/configure Sat May 08 10:54:36 2010 +0000 +++ b/configure Mon May 10 11:57:09 2010 +0000 @@ -704,6 +704,7 @@ LD_SWITCH_SYSTEM C_SWITCH_MACHINE C_SWITCH_SYSTEM +LIBS_SYSTEM CRT_DIR LIB_MATH START_FILES @@ -755,6 +756,7 @@ ALLOCA liblockfile LIBS_MAIL +BLESSMAIL_TARGET LIBOBJS NEED_SETGID KMEM_GROUP @@ -5837,10 +5839,6 @@ echo ' #include "'${srcdir}'/src/'${opsysfile}'" #include "'${srcdir}'/src/'${machfile}'" -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM -#endif -configure___ libsrc_libs=LIBS_SYSTEM configure___ LIBX=-lX11 @@ -6036,6 +6034,23 @@ +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 @@ -10939,7 +10954,7 @@ REL_ALLOC=no fi -LIBS="$libsrc_libs $LIBS" +LIBS="$LIBS_SYSTEM $LIBS" { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 @@ -11157,6 +11172,18 @@ 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*) @@ -17565,6 +17592,56 @@ +## 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 + + + @@ -26209,6 +26286,16 @@ CFLAGS="$REAL_CFLAGS" CPPFLAGS="$REAL_CPPFLAGS" +## Hack to detect a buggy GCC version. +if test "x$GCC" = xyes \ + && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ + && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \ + && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then + { { $as_echo "$as_me:$LINENO: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&5 +$as_echo "$as_me: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&2;} + { (exit 1); exit 1; }; } +fi + #### Find out which version of Emacs this is. version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` diff -r e9ddc2292336 -r 5b2cee3284b0 configure.in --- a/configure.in Sat May 08 10:54:36 2010 +0000 +++ b/configure.in Mon May 10 11:57:09 2010 +0000 @@ -859,10 +859,6 @@ echo ' #include "'${srcdir}'/src/'${opsysfile}'" #include "'${srcdir}'/src/'${machfile}'" -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM -#endif -configure___ libsrc_libs=LIBS_SYSTEM configure___ LIBX=-lX11 @@ -1003,6 +999,23 @@ 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 @@ -1586,7 +1599,7 @@ 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. @@ -1600,6 +1613,18 @@ 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 @@ -2482,6 +2507,48 @@ 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 \ random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ @@ -2923,6 +2990,14 @@ CFLAGS="$REAL_CFLAGS" CPPFLAGS="$REAL_CPPFLAGS" +## Hack to detect a buggy GCC version. +if test "x$GCC" = xyes \ + && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ + && test x"`echo $CFLAGS | grep '\-O@<:@23@:>@'`" != x \ + && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then + AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.]) +fi + #### Find out which version of Emacs this is. [version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \ | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`] diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/ChangeLog --- a/doc/emacs/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,28 @@ +2010-05-08 Chong Yidong + + * building.texi (GDB Graphical Interface): Remove misleading comparison + to an IDE (Bug#6128). + +2010-05-08 Štěpán Němec (tiny change) + + * programs.texi (Man Page): + * misc.texi (Invoking emacsclient): + * mini.texi (Repetition): + * mark.texi (Setting Mark): Fix typos. + +2010-05-08 Chong Yidong + + * misc.texi (Printing): Document htmlfontify-buffer. + +2010-05-08 Glenn Morris + + * calendar.texi (Displaying the Diary, Format of Diary File): + Fix external cross-references for TeX format output. + +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-02 Jan Djärv * cmdargs.texi (Initial Options): Mention --chdir. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/building.texi --- a/doc/emacs/building.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/building.texi Mon May 10 11:57:09 2010 +0000 @@ -836,12 +836,11 @@ @subsection GDB Graphical Interface The command @code{gdb} starts GDB in a graphical interface, using -Emacs windows for display program state information. In effect, this -makes Emacs into an IDE (interactive development environment). With -it, you do not need to use textual GDB commands; you can control the -debugging session with the mouse. For example, you can click in the -fringe of a source buffer to set a breakpoint there, or on a stack -frame in the stack buffer to select that frame. +Emacs windows for display program state information. With it, you do +not need to use textual GDB commands; you can control the debugging +session with the mouse. For example, you can click in the fringe of a +source buffer to set a breakpoint there, or on a stack frame in the +stack buffer to select that frame. This mode requires telling GDB that its ``screen size'' is unlimited, so it sets the height and width accordingly. For correct diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/calendar.texi --- a/doc/emacs/calendar.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/calendar.texi Mon May 10 11:57:09 2010 +0000 @@ -1082,7 +1082,7 @@ shown either in the buffer or in the mode line, depending on the display method you choose @iftex -(@pxref{Diary Display,, emacs-xtra}). +(@pxref{Diary Display,,, emacs-xtra, Specialized Emacs Features}). @end iftex @ifnottex (@pxref{Diary Display}). @@ -1186,7 +1186,7 @@ This entry will have a different appearance if you use the simple diary display @iftex -(@pxref{Diary Display,, emacs-xtra}). +(@pxref{Diary Display,,, emacs-xtra, Specialized Emacs Features}). @end iftex @ifnottex (@pxref{Diary Display}). diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/mark.texi --- a/doc/emacs/mark.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/mark.texi Mon May 10 11:57:09 2010 +0000 @@ -80,7 +80,7 @@ character in @acronym{ASCII}; usually, typing @kbd{C-@key{SPC}} on a text terminal gives the character @kbd{C-@@}. This key is also bound to @code{set-mark-command}, so unless you are unlucky enough to have -an text terminal that behaves differently, you might as well think of +a text terminal that behaves differently, you might as well think of @kbd{C-@@} as @kbd{C-@key{SPC}}.}. This sets the mark where point is, and activates it. You can then move point away, leaving the mark behind. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/mini.texi --- a/doc/emacs/mini.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/mini.texi Mon May 10 11:57:09 2010 +0000 @@ -601,7 +601,7 @@ unchanged. You can also change the command by editing the Lisp expression before you execute it. The repeated command is added to the front of the command history unless it is identical to the most -recently item. +recent item. Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r}, diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/misc.texi --- a/doc/emacs/misc.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/misc.texi Mon May 10 11:57:09 2010 +0000 @@ -1528,7 +1528,7 @@ @kbd{C-x #} (@code{server-edit}) in its buffer. This saves the file and sends a message back to the @command{emacsclient} program, telling it to exit. Programs that use @env{EDITOR} usually wait for the -``editor''---in the case @command{emacsclient}---to exit before doing +``editor''---in this case @command{emacsclient}---to exit before doing something else. You can also call @command{emacsclient} with multiple file name @@ -1701,8 +1701,14 @@ Emacs provides commands for printing hard copies of either an entire buffer or just part of one, with or without page headers. You can invoke the printing commands directly, as detailed in the following -section, or using the @samp{File} menu on the menu bar. See also the -hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary +section, or using the @samp{File} menu on the menu bar. + +@findex htmlfontify-buffer + Aside from the commands described in this section, you can also +``print'' an Emacs buffer to HTML with @kbd{M-x htmlfontify-buffer}. +This command converts the current buffer to a HTML file, replacing +Emacs faces with CSS-based markup. In addition, see the hardcopy +commands of Dired (@pxref{Misc File Ops}) and the diary (@pxref{Displaying the Diary}). @table @kbd diff -r e9ddc2292336 -r 5b2cee3284b0 doc/emacs/programs.texi --- a/doc/emacs/programs.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/emacs/programs.texi Mon May 10 11:57:09 2010 +0000 @@ -1202,7 +1202,7 @@ your machine; the list of available manual pages is computed automatically the first time you invoke @code{woman}. The word at point in the current buffer is used to suggest the default for the -name the manual page. +name of the manual page. With a numeric argument, @kbd{M-x woman} recomputes the list of the manual pages used for completion. This is useful if you add or delete diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispintro/ChangeLog --- a/doc/lispintro/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispintro/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-03-10 Chong Yidong * Branch for 23.2. @@ -13,8 +17,7 @@ 2009-12-09 David Robinow (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 @@ -72,7 +75,7 @@ 2009-02-22 Karl Berry - * 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 diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/ChangeLog --- a/doc/lispref/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,38 @@ +2010-05-08 Štěpán Němec (tiny change) + + * windows.texi (Textual Scrolling): + * tips.texi (Coding Conventions): + * minibuf.texi (Minibuffer History): + * maps.texi (Standard Keymaps): + * loading.texi (Where Defined): + * edebug.texi (Instrumenting): Fix typos. + +2010-05-08 Chong Yidong + + * keymaps.texi (Menu Bar): Document :advertised-binding property. + + * functions.texi (Obsolete Functions): + Document set-advertised-calling-convention. + + * minibuf.texi (Basic Completion): Document completion-in-region. + (Programmed Completion): Document completion-annotate-function. + + * commands.texi (Reading One Event): Document read-key. + (Distinguish Interactive): Document KIND arg to + called-interactively-p. Delete obsolete interactive-p. + + * elisp.texi (Top): Update node description. + +2010-05-08 Eli Zaretskii + + * nonascii.texi (Character Properties): + Document unicode-category-table. Add an index entry for Unicode + general category. + +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-04-20 Juanma Barranquero * locals.texi (Standard Buffer-Local Variables): diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/commands.texi --- a/doc/lispref/commands.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/commands.texi Mon May 10 11:57:09 2010 +0000 @@ -696,71 +696,67 @@ because it allows callers to say ``treat this call as interactive.'' But you can also do the job by testing @code{called-interactively-p}. -@defun called-interactively-p +@defun called-interactively-p kind This function returns @code{t} when the calling function was called using @code{call-interactively}. -If the containing function was called by Lisp evaluation (or with -@code{apply} or @code{funcall}), then it was not called interactively. +The argument @var{kind} should be either the symbol @code{interactive} +or the symbol @code{any}. If it is @code{interactive}, then +@code{called-interactively-p} returns @code{t} only if the call was +made directly by the user---e.g., if the user typed a key sequence +bound to the calling function, but @emph{not} if the user ran a +keyboard macro that called the function (@pxref{Keyboard Macros}). If +@var{kind} is @code{any}, @code{called-interactively-p} returns +@code{t} for any kind of interactive call, including keyboard macros. + +If in doubt, use @code{any}; the only known proper use of +@code{interactive} is if you need to decide whether to display a +helpful message while a function is running. + +A function is never considered to be called interactively if it was +called via Lisp evaluation (or with @code{apply} or @code{funcall}). @end defun - Here's an example of using @code{called-interactively-p}: +@noindent +Here is an example of using @code{called-interactively-p}: @example @group (defun foo () (interactive) - (when (called-interactively-p) - (message "foo")) - 'haha) - @result{} foo + (when (called-interactively-p 'any) + (message "Interactive!") + 'foo-called-interactively)) @end group @group ;; @r{Type @kbd{M-x foo}.} - @print{} foo + @print{} Interactive! @end group @group (foo) - @result{} haha + @result{} nil @end group @end example - Here is another example that contrasts direct and indirect -calls to @code{called-interactively-p}. +@noindent +Here is another example that contrasts direct and indirect calls to +@code{called-interactively-p}. @example @group (defun bar () (interactive) - (setq foobar (list (foo) (called-interactively-p)))) - @result{} bar + (message "%s" (list (foo) (called-interactively-p 'any)))) @end group @group ;; @r{Type @kbd{M-x bar}.} -;; @r{This does not display a message.} -@end group - -@group -foobar - @result{} (nil t) + @print{} (nil t) @end group @end example - If you want to treat commands run in keyboard macros just like calls -from Lisp programs, test @code{interactive-p} instead of -@code{called-interactively-p}. - -@defun interactive-p -This function returns @code{t} if the containing function (the one -whose code includes the call to @code{interactive-p}) was called in -direct response to user input. This means that it was called with the -function @code{call-interactively}, and that a keyboard macro is -not running, and that Emacs is not running in batch mode. -@end defun - @node Command Loop Info @comment node-name, next, previous, up @section Information from the Command Loop @@ -2309,10 +2305,8 @@ @cindex reading a single event @cindex event, reading only one - The lowest level functions for command input are those that read a -single event. - -None of the three functions below suppresses quitting. + The lowest level functions for command input are @code{read-event}, +@code{read-char}, and @code{read-char-exclusive}. @defun read-event &optional prompt inherit-input-method seconds This function reads and returns the next event of command input, waiting @@ -2409,11 +2403,31 @@ gets a character. The arguments work as in @code{read-event}. @end defun + None of the above functions suppress quitting. + @defvar num-nonmacro-input-events This variable holds the total number of input events received so far from the terminal---not counting those generated by keyboard macros. @end defvar + We emphasize that, unlike @code{read-key-sequence}, the functions +@code{read-event}, @code{read-char}, and @code{read-char-exclusive} do +not perform the translations described in @ref{Translation Keymaps}. +If you wish to read a single key taking these translations into +account, use the function @code{read-key}: + +@defun read-key &optional prompt +This function reads a single key. It is ``intermediate'' between +@code{read-key-sequence} and @code{read-event}. Unlike the former, it +reads a single key, not a key sequence. Unlike the latter, it does +not return a raw event, but decodes and translates the user input +according to @code{input-decode-map}, @code{local-function-key-map}, +and @code{key-translation-map} (@pxref{Translation Keymaps}). + +The argument @var{prompt} is either a string to be displayed in the +echo area as a prompt, or @code{nil}, meaning not to display a prompt. +@end defun + @node Event Mod @subsection Modifying and Translating Input Events diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/edebug.texi --- a/doc/lispref/edebug.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/edebug.texi Mon May 10 11:57:09 2010 +0000 @@ -186,7 +186,7 @@ While Edebug is active, the command @kbd{I} (@code{edebug-instrument-callee}) instruments the definition of the -function or macro called by the list form after point, if is not already +function or macro called by the list form after point, if it is not already instrumented. This is possible only if Edebug knows where to find the source for that function; for this reason, after loading Edebug, @code{eval-region} records the position of every definition it diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/elisp.texi --- a/doc/lispref/elisp.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/elisp.texi Mon May 10 11:57:09 2010 +0000 @@ -649,7 +649,6 @@ Completion * Basic Completion:: Low-level functions for completing strings. - (These are too low level to use the minibuffer.) * Minibuffer Completion:: Invoking the minibuffer with completion. * Completion Commands:: Minibuffer commands that do completion. * High-Level Completion:: Convenient special cases of completion diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/functions.texi --- a/doc/lispref/functions.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/functions.texi Mon May 10 11:57:09 2010 +0000 @@ -1197,7 +1197,7 @@ @end defun You can define a function as an alias and declare it obsolete at the -same time using the macro @code{define-obsolete-function-alias}. +same time using the macro @code{define-obsolete-function-alias}: @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring This macro marks the function @var{obsolete-name} obsolete and also @@ -1210,6 +1210,33 @@ @end example @end defmac +In addition, you can mark a certain a particular calling convention +for a function as obsolete: + +@defun set-advertised-calling-convention function signature +This function specifies the argument list @var{signature} as the +correct way to call @var{function}. This causes the Emacs byte +compiler to issue a warning whenever it comes across an Emacs Lisp +program that calls @var{function} any other way (however, it will +still allow the code to be byte compiled). + +For instance, in old versions of Emacs the @code{sit-for} function +accepted three arguments, like this + +@smallexample + (sit-for seconds milliseconds nodisp) +@end smallexample + +However, calling @code{sit-for} this way is considered obsolete +(@pxref{Waiting}). The old calling convention is deprecated like +this: + +@smallexample +(set-advertised-calling-convention + 'sit-for '(seconds &optional nodisp)) +@end smallexample +@end defun + @node Inline Functions @section Inline Functions @cindex inline functions diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/keymaps.texi --- a/doc/lispref/keymaps.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/keymaps.texi Mon May 10 11:57:09 2010 +0000 @@ -2470,9 +2470,13 @@ @cindex menu bar Most window systems allow each frame to have a @dfn{menu bar}---a -permanently displayed menu stretching horizontally across the top of the -frame. The items of the menu bar are the subcommands of the fake -``function key'' @code{menu-bar}, as defined in the active keymaps. +permanently displayed menu stretching horizontally across the top of +the frame. (In order for a frame to display a menu bar, its +@code{menu-bar-lines} parameter must be greater than zero. +@xref{Layout Parameters}.) + + The items of the menu bar are the subcommands of the fake ``function +key'' @code{menu-bar}, as defined in the active keymaps. To add an item to the menu bar, invent a fake ``function key'' of your own (let's call it @var{key}), and make a binding for the key sequence @@ -2490,13 +2494,6 @@ from the keymaps that would be active if @code{overriding-local-map} were @code{nil}. @xref{Active Keymaps}. - In order for a frame to display a menu bar, its @code{menu-bar-lines} -parameter must be greater than zero. Emacs uses just one line for the -menu bar itself; if you specify more than one line, the other lines -serve to separate the menu bar from the windows in the frame. We -recommend 1 or 2 as the value of @code{menu-bar-lines}. @xref{Layout -Parameters}. - Here's an example of setting up a menu bar item: @example @@ -2535,8 +2532,8 @@ @end example @noindent -@code{edit} is the fake function key used by the global map for the -@samp{Edit} menu bar item. The main reason to suppress a global +Here, @code{edit} is the fake function key used by the global map for +the @samp{Edit} menu bar item. The main reason to suppress a global menu bar item is to regain space for mode-specific items. @defvar menu-bar-final-items @@ -2557,6 +2554,23 @@ in the usual case. @end defvar +Next to every menu bar item, Emacs displays a key binding that runs +the same command (if such a key binding exists). This serves as a +convenient hint for users who do not know the key binding. If a +command has multiple bindings, Emacs normally displays the first one +it finds. You can specify one particular key binding by assigning an +@code{:advertised-binding} symbol property to the command. For +instance, the following tells Emacs to show @kbd{C-/} for the +@code{undo} menu item: + +@smallexample +(put 'undo :advertised-binding [?\C-/]) +@end smallexample + +@noindent +If the @code{:advertised-binding} property specifies a key binding +that the command does not actually have, it is ignored. + @node Tool Bar @subsection Tool bars @cindex tool bar diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/loading.texi --- a/doc/lispref/loading.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/loading.texi Mon May 10 11:57:09 2010 +0000 @@ -823,7 +823,7 @@ @code{load-history}. @defvar load-history -This value of this variable is an alist that associates the names of +The value of this variable is an alist that associates the names of loaded library files with the names of the functions and variables they defined, as well as the features they provided or required. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/locals.texi --- a/doc/lispref/locals.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/locals.texi Mon May 10 11:57:09 2010 +0000 @@ -85,6 +85,9 @@ @item case-fold-search @xref{Searching and Case}. +@item comment-column +@xref{Comments,,, emacs, The GNU Emacs Manual}. + @item ctl-arrow @xref{Usual Display}. @@ -94,9 +97,6 @@ @item cursor-type @xref{Cursor Parameters}. -@item comment-column -@xref{Comments,,, emacs, The GNU Emacs Manual}. - @item default-directory @xref{File Name Expansion}. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/maps.texi --- a/doc/lispref/maps.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/maps.texi Mon May 10 11:57:09 2010 +0000 @@ -163,7 +163,7 @@ @item key-translation-map A keymap for translating keys. This one overrides ordinary key -bindings, unlike @code{local- function-key-map}. @xref{Translation +bindings, unlike @code{local-function-key-map}. @xref{Translation Keymaps}. @item kmacro-map diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/minibuf.texi --- a/doc/lispref/minibuf.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/minibuf.texi Mon May 10 11:57:09 2010 +0000 @@ -511,7 +511,7 @@ @defopt history-length The value of this variable specifies the maximum length for all history lists that don't specify their own maximum lengths. If the -value is @code{t}, that means there no maximum (don't delete old +value is @code{t}, that means there is no maximum (don't delete old elements). The value of @code{history-length} property of the history list variable's symbol, if set, overrides this variable for that particular history list. @@ -626,7 +626,6 @@ @menu * Basic Completion:: Low-level functions for completing strings. - (These are too low level to use the minibuffer.) * Minibuffer Completion:: Invoking the minibuffer with completion. * Completion Commands:: Minibuffer commands that do completion. * High-Level Completion:: Convenient special cases of completion @@ -640,31 +639,23 @@ @node Basic Completion @subsection Basic Completion Functions - The completion functions @code{try-completion}, -@code{all-completions} and @code{test-completion} have nothing in -themselves to do with minibuffers. We describe them in this chapter -so as to keep them near the higher-level completion features that do -use the minibuffer. - - If you store a completion alist in a variable, you should mark the -variable as ``risky'' with a non-@code{nil} -@code{risky-local-variable} property. + The following completion functions have nothing in themselves to do +with minibuffers. We describe them here to keep them near the +higher-level completion features that do use the minibuffer. @defun try-completion string collection &optional predicate This function returns the longest common substring of all possible completions of @var{string} in @var{collection}. The value of @var{collection} must be a list of strings or symbols, an alist, an -obarray, a hash table, or a function that implements a virtual set of -strings (see below). +obarray, a hash table, or a completion function (@pxref{Programmed +Completion}). Completion compares @var{string} against each of the permissible -completions specified by @var{collection}; if the beginning of the -permissible completion equals @var{string}, it matches. If no permissible -completions match, @code{try-completion} returns @code{nil}. If only -one permissible completion matches, and the match is exact, then -@code{try-completion} returns @code{t}. Otherwise, the value is the -longest initial sequence common to all the permissible completions that -match. +completions specified by @var{collection}. If no permissible +completions match, @code{try-completion} returns @code{nil}. If there +is just one matching completion, and the match is exact, it returns +@code{t}. Otherwise, it returns the longest initial sequence common +to all possible matching completions. If @var{collection} is an alist (@pxref{Association Lists}), the permissible completions are the elements of the alist that are either @@ -688,13 +679,13 @@ If @var{collection} is a hash table, then the keys that are strings are the possible completions. Other keys are ignored. -You can also use a symbol that is a function as @var{collection}. Then -the function is solely responsible for performing completion; +You can also use a symbol that is a function as @var{collection}. +Then the function is solely responsible for performing completion; @code{try-completion} returns whatever this function returns. The function is called with three arguments: @var{string}, @var{predicate} -and @code{nil}. (The reason for the third argument is so that the same +and @code{nil} (the reason for the third argument is so that the same function can be used in @code{all-completions} and do the appropriate -thing in either case.) @xref{Programmed Completion}. +thing in either case). @xref{Programmed Completion}. If the argument @var{predicate} is non-@code{nil}, then it must be a function of one argument, unless @var{collection} is a hash table, in @@ -823,6 +814,10 @@ it returns, @code{test-completion} returns in turn. @end defun +If you store a completion alist in a variable, you should mark the +variable as ``risky'' with a non-@code{nil} +@code{risky-local-variable} property. @xref{File Local Variables}. + @defvar completion-ignore-case If the value of this variable is non-@code{nil}, Emacs does not consider case significant in completion. Note, however, that this @@ -855,6 +850,23 @@ @end smallexample @end defmac +The function @code{completion-in-region} provides a convenient way to +perform completion on an arbitrary stretch of text in an Emacs buffer: + +@defun completion-in-region start end collection &optional predicate +This function completes the text in the current buffer between the +positions @var{start} and @var{end}, using @var{collection}. The +argument @var{collection} has the same meaning as in +@code{try-completion} (@pxref{Basic Completion}). + +This function inserts the completion text directly into the current +buffer. Unlike @code{completing-read} (@pxref{Minibuffer +Completion}), it does not activate the minibuffer. + +For this function to work, point must be somewhere between @var{start} +and @var{end}. +@end defun + @node Minibuffer Completion @subsection Completion and the Minibuffer @cindex minibuffer completion @@ -869,12 +881,12 @@ @var{prompt}, which must be a string. The actual completion is done by passing @var{collection} and -@var{predicate} to the function @code{try-completion}. This happens -in certain commands bound in the local keymaps used for completion. -Some of these commands also call @code{test-completion}. Thus, if -@var{predicate} is non-@code{nil}, it should be compatible with -@var{collection} and @code{completion-ignore-case}. @xref{Definition -of test-completion}. +@var{predicate} to the function @code{try-completion} (@pxref{Basic +Completion}). This happens in certain commands bound in the local +keymaps used for completion. Some of these commands also call +@code{test-completion}. Thus, if @var{predicate} is non-@code{nil}, +it should be compatible with @var{collection} and +@code{completion-ignore-case}. @xref{Definition of test-completion}. The value of the optional argument @var{require-match} determines how the user may exit the minibuffer: @@ -1603,8 +1615,10 @@ Sometimes it is not possible to create an alist or an obarray containing all the intended possible completions. In such a case, you -can supply your own function to compute the completion of a given string. -This is called @dfn{programmed completion}. +can supply your own function to compute the completion of a given +string. This is called @dfn{programmed completion}. Emacs uses +programmed completion when completing file names (@pxref{File Name +Completion}). To use this feature, pass a symbol with a function definition as the @var{collection} argument to @code{completing-read}. The function @@ -1659,9 +1673,6 @@ function. So you must arrange for any function you wish to use for completion to be encapsulated in a symbol. - Emacs uses programmed completion when completing file names. -@xref{File Name Completion}. - @defun completion-table-dynamic function This function is a convenient way to write a function that can act as programmed completion function. The argument @var{function} should be @@ -1671,6 +1682,19 @@ and the interface for programmed completion functions. @end defun +@defvar completion-annotate-function +The value of this variable, if non-@code{nil}, should be a function +for ``annotating'' the entries in the @samp{*Completions*} buffer. +The function should accept a single argument, the completion string +for an entry. It should return an additional string to display next +to that entry in the @samp{*Completions*} buffer, or @code{nil} if no +additional string is to be displayed. + +The function can determine the collection used for the current +completion via the variable @code{minibuffer-completion-table} +(@pxref{Completion Commands}). +@end defvar + @node Yes-or-No Queries @section Yes-or-No Queries @cindex asking the user questions diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/nonascii.texi --- a/doc/lispref/nonascii.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/nonascii.texi Mon May 10 11:57:09 2010 +0000 @@ -375,6 +375,7 @@ 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 @@ -501,13 +502,18 @@ @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 diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/tips.texi --- a/doc/lispref/tips.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/tips.texi Mon May 10 11:57:09 2010 +0000 @@ -90,7 +90,7 @@ If a file requires certain other Lisp programs to be loaded beforehand, then the comments at the beginning of the file should say so. Also, use @code{require} to make sure they are loaded. -x@xref{Named Features}. +@xref{Named Features}. @item If a file @var{foo} uses a macro defined in another file @var{bar}, diff -r e9ddc2292336 -r 5b2cee3284b0 doc/lispref/windows.texi --- a/doc/lispref/windows.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/lispref/windows.texi Mon May 10 11:57:09 2010 +0000 @@ -1661,8 +1661,8 @@ @end defopt @defopt scroll-step -This variable is an older variant of @code{scroll-conservatively}. The -difference is that it if its value is @var{n}, that permits scrolling +This variable is an older variant of @code{scroll-conservatively}. +The difference is that if its value is @var{n}, that permits scrolling only by precisely @var{n} lines, not a smaller number. This feature does not work with @code{scroll-margin}. The default value is zero. @end defopt diff -r e9ddc2292336 -r 5b2cee3284b0 doc/man/ChangeLog --- a/doc/man/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/doc/man/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,11 +1,15 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-03-10 Chong Yidong * Branch for 23.2. 2010-01-09 Chong Yidong - * 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 diff -r e9ddc2292336 -r 5b2cee3284b0 doc/misc/ChangeLog --- a/doc/misc/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/doc/misc/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,11 +1,28 @@ +2010-05-08 Štěpán Němec (tiny change) + + * url.texi (HTTP language/coding, Customization): + * message.texi (Header Commands, Responses): + * cl.texi (Argument Lists): Fix typos. + +2010-05-08 Chong Yidong + + * 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-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-01 Daniel E. Doherty (tiny change) * calc.texi (Tutorial): Use "^{\prime}" to indicate primes. 2010-05-01 Michael Albinus - * tramp.texi (Inline methods, Default Method): Mention - `tramp-inline-compress-start-size'. + * tramp.texi (Inline methods, Default Method): + Mention `tramp-inline-compress-start-size'. 2010-04-18 Teodor Zlatanov diff -r e9ddc2292336 -r 5b2cee3284b0 doc/misc/cl.texi --- a/doc/misc/cl.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/misc/cl.texi Mon May 10 11:57:09 2010 +0000 @@ -356,7 +356,7 @@ calls to it may be expanded into in-line code by the byte compiler. This is analogous to the @code{defsubst} form; @code{defsubst*} uses a different method (compiler macros) which -works in all version of Emacs, and also generates somewhat more +works in all versions of Emacs, and also generates somewhat more efficient inline expansions. In particular, @code{defsubst*} arranges for the processing of keyword arguments, default values, etc., to be done at compile-time whenever possible. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/misc/ede.texi --- a/doc/misc/ede.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/misc/ede.texi Mon May 10 11:57:09 2010 +0000 @@ -129,27 +129,26 @@ @node EDE Mode, Creating a project, EDE Project Concepts, top @chapter @ede{} Mode -@ede{} is implemented as a minor-mode, which augments other modes such +@ede{} is implemented as a minor mode, which augments other modes such as C mode, and Texinfo mode. You can enable @ede{} for all buffers by running the command @code{global-ede-mode}, or by putting this in your -@file{~/.emacs} file: +init file: @example (global-ede-mode t) @end example -When @ede{} is active for a given buffer, the menu item -``Development'' appears. This menu provides several menu items for -high-level @ede{} commands. These menu items, and their corresponding -keybindings, are independent of the type of project you are actually -working on. +Activating @ede{} adds a menu named @samp{Development} to the menu +bar. This menu provides several menu items for high-level @ede{} +commands. These menu items, and their corresponding keybindings, are +independent of the type of project you are actually working on. @node Creating a project, Modifying your project, EDE Mode, top @chapter Creating a project To create a new project, first visit a file that you want to include -in that project. If you have a hierarchy of directories, choose a -file in the topmost directory first. From this buffer, type @kbd{M-x +in that project. If you have a hierarchy of directories, first visit +a file in the topmost directory. From this buffer, type @kbd{M-x ede-new}, or click on the @samp{Create Project} item in the @samp{Development} menu. @@ -220,8 +219,8 @@ @node Add/Remove target, Add/Remove files, Modifying your project, Modifying your project @section Add/Remove target -To create a new target, type @kbd{C-c . t} (@code{M-x ede-new-target}) -or use the @samp{Add Target} menu item in the @samp{Project Options} +To create a new target, type @kbd{C-c . t} (@code{ede-new-target}) or +use the @samp{Add Target} menu item in the @samp{Project Options} submenu. This prompts for a target name, and adds the current buffer to that target. @@ -237,7 +236,7 @@ @section Add/Remove files To add the current file to an existing target, type @kbd{C-c . a} -(@code{ede-add-file}), or or use the @samp{Add File} menu item in the +(@code{ede-add-file}), or use the @samp{Add File} menu item in the @samp{Target Options} submenu. You can add a file to more than one target; this is OK. diff -r e9ddc2292336 -r 5b2cee3284b0 doc/misc/message.texi --- a/doc/misc/message.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/misc/message.texi Mon May 10 11:57:09 2010 +0000 @@ -659,7 +659,7 @@ @findex message-insert-disposition-notification-to Insert a request for a disposition notification. (@code{message-insert-disposition-notification-to}). -This means that if the recipient support RFC 2298 she might send you a +This means that if the recipient supports RFC 2298 she might send you a notification that she received the message. @item M-x message-insert-importance-high @@ -2387,7 +2387,7 @@ @item wide reply A @dfn{wide reply} is a mail response that includes @emph{all} entities -mentioned in the message you are responded to. All mailboxes from the +mentioned in the message you are responding to. All mailboxes from the following headers will be concatenated to form the outgoing @code{To}/@code{Cc} headers: diff -r e9ddc2292336 -r 5b2cee3284b0 doc/misc/url.texi --- a/doc/misc/url.texi Sat May 08 10:54:36 2010 +0000 +++ b/doc/misc/url.texi Mon May 10 11:57:09 2010 +0000 @@ -313,7 +313,7 @@ variables, the value is a string; it can specify a single choice, or it can be a comma-separated list. -Normally this list ordered by descending preference. However, each +Normally, this list is ordered by descending preference. However, each element can be followed by @samp{;q=@var{priority}} to specify its preference level, a decimal number from 0 to 1; e.g., for @code{url-mime-language-string}, @w{@code{"de, en-gb;q=0.8, @@ -1120,11 +1120,11 @@ @defopt url-debug @cindex debugging -Specifies the types of debug messages the library which are logged to +Specifies the types of debug messages which are logged to the @code{*URL-DEBUG*} buffer. @code{t} means log all messages. A number means log all messages and show them with @code{message}. -If may also be a list of the types of messages to be logged. +It may also be a list of the types of messages to be logged. @end defopt @defopt url-personal-mail-address @end defopt diff -r e9ddc2292336 -r 5b2cee3284b0 etc/AUTHORS --- a/etc/AUTHORS Sat May 08 10:54:36 2010 +0000 +++ b/etc/AUTHORS Mon May 10 11:57:09 2010 +0000 @@ -92,7 +92,7 @@ Alexander Becher: changed vc-annotate.el -Alexander Klimov: changed man.el +Alexander Klimov: changed calc-graph.el man.el Alexander Kreuzer: changed nnrss.el @@ -167,9 +167,9 @@ Andreas Politz: changed editfns.c elp.el ido.el term.el Andreas Schwab: changed Makefile.in configure.in lisp.h xdisp.c files.el - coding.c alloc.c process.c print.c editfns.c fileio.c fns.c dired.el + coding.c alloc.c process.c fileio.c print.c editfns.c fns.c dired.el xterm.c keyboard.c simple.el eval.c info.el buffer.c sysdep.c emacs.c - and 483 other files + and 485 other files Andreas Seltenreich: changed nnweb.el gnus.texi message.el gnus.el nnslashdot.el gnus-util.el mm-url.el mm-uu.el url-http.el xterm.c @@ -435,8 +435,8 @@ and co-wrote longlines.el and changed xdisp.c simple.el files.el display.texi frames.texi files.texi emacs.texi keyboard.c cus-edit.el faces.el xterm.c - Makefile.in xfaces.c font.c startup.el xfns.c misc.texi image.c - compile.el custom.texi text.texi and 633 other files + Makefile.in misc.texi xfaces.c font.c startup.el xfns.c compile.el + image.c custom.texi configure.in and 635 other files Chris Chase: co-wrote idlw-shell.el idlwave.el @@ -868,7 +868,7 @@ and changed msdos.c makefile.w32-in Makefile.in files.el info.el rmail.el fileio.c mainmake.v2 pc-win.el startup.el config.bat simple.el msdos.h dired.c w32.c frame.c internal.el menu-bar.el process.c INSTALL - xfaces.c and 602 other files + xfaces.c and 603 other files Elias Oltmanns: changed tls.el gnus-agent.el gnus-int.el gnus-srvr.el gnus.el @@ -1002,7 +1002,7 @@ Florian Weimer: changed message.el gnus.el coding.c gnus-sum.el gnus.texi mm-decode.el mm-util.el -Francesc Rocher: changed startup.el MORE.STUFF cus-start.el gnus.el +Francesc Rocher: changed MORE.STUFF startup.el cus-start.el gnus.el gnus.png gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c xdisp.c xterm.c @@ -1131,9 +1131,9 @@ Glenn Morris: wrote check-declare.el and changed Makefile.in calendar.el diary-lib.el rmail.el f90.el cal-menu.el cal-hebrew.el fortran.el holidays.el configure.in - cal-islam.el bytecomp.el calendar.texi cal-bahai.el files.el appt.el - cal-china.el emacs.texi rmailsum.el simple.el startup.el - and 975 other files + cal-islam.el bytecomp.el calendar.texi cal-bahai.el emacs.texi files.el + appt.el cal-china.el rmailsum.el simple.el startup.el + and 976 other files Glynn Clements: wrote gamegrid.el snake.el tetris.el @@ -1346,7 +1346,7 @@ and changed gtkutil.c xterm.c xfns.c configure.in xterm.h xmenu.c x-win.el Makefile.in gtkutil.h keyboard.c frame.c frames.texi config.in emacs.c xselect.c xresources.texi startup.el alloc.c cus-start.el - xlwmenu.c process.c and 203 other files + xlwmenu.c frame.h and 203 other files Jan Moringen: co-wrote cpp.el @@ -1635,7 +1635,7 @@ Juanma Barranquero: changed makefile.w32-in subr.el files.el faces.el bs.el help-fns.el w32fns.c org.el server.el simple.el emacsclient.c desktop.el buffer.c mule-cmds.el ido.el window.c xdisp.c allout.el - keyboard.c replace.el eval.c and 930 other files + keyboard.c replace.el eval.c and 932 other files Juergen Hoetzel: changed url-handlers.el @@ -1657,7 +1657,7 @@ and changed info.el isearch.el simple.el replace.el dired-aux.el startup.el grep.el compile.el dired.el files.el faces.el display.texi menu-bar.el descr-text.el cus-edit.el bindings.el man.el image-mode.el - ispell.el text.texi dired-x.el and 280 other files + ispell.el text.texi dired-x.el and 281 other files Justin Bogner: changed fortune.el @@ -1770,7 +1770,7 @@ and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el quail.el and changed coding.c mule-cmds.el mule.el fontset.c charset.c fontset.el xdisp.c xterm.c font.c fileio.c Makefile.in mule-conf.el characters.el - fns.c mule-diag.el ccl.c charset.h ftfont.c xfaces.c coding.h + fns.c mule-diag.el ftfont.c ccl.c charset.h xfaces.c coding.h japanese.el and 377 other files Kenichi Okada: co-wrote sasl-cram.el sasl-digest.el @@ -1969,7 +1969,7 @@ Magnus Henoch: changed url-http.el ispell.el url.el dbusbind.c dns.el url-gw.el url-parse.el url-proxy.el autoinsert.el cl.texi configure.in cyrillic.el dbus.el gnus.texi hashcash.el log-edit.el message.el - org-latex.el org-table.el process.c rcirc.el and 7 other files + org-latex.el org-table.el process.c rcirc.el and 8 other files Malcolm Purvis: changed spam-stat.el @@ -2432,7 +2432,7 @@ eudc-vars.el eudc.el eudcb-bbdb.el eudcb-ldap.el eudcb-ph.el ldap.el and changed ph.el -Óscar Fuentes: changed emacsclient.c ido.el vc-bzr.el +Óscar Fuentes: changed ido.el emacsclient.c vc-bzr.el P. E. Jareth Hein: changed gnus-util.el @@ -2951,7 +2951,9 @@ Steinar Bang: changed imap.el -Štěpán Němec: changed subr.el vc-git.el +Štěpán Němec: changed INSTALL cl.texi edebug.texi loading.texi maps.texi + mark.texi message.texi mini.texi minibuf.texi misc.texi programs.texi + subr.el tips.texi url.texi vc-git.el windows.texi Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi ediff-mult.el @@ -3080,7 +3082,7 @@ and changed spam.el gnus.el gnus-sum.el gnus.texi nnimap.el netrc.el spam-stat.el gnus-start.el gnus-util.el nnmail.el encrypt.el message.el gnus-encrypt.el mail-source.el assistant.el auth.texi imap.el - nnbabyl.el nnfolder.el nnmbox.el nnmh.el and 48 other files + nnbabyl.el nnfolder.el nnmbox.el nnmh.el and 51 other files Terje Rosten: changed xfns.c version.el xterm.c xterm.h diff -r e9ddc2292336 -r 5b2cee3284b0 etc/ChangeLog --- a/etc/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/etc/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,15 @@ +2010-05-08 Chong Yidong + + * PROBLEMS: Document gcc-4.5 bug (Bug#6031). + +2010-05-08 Kenichi Handa + + * HELLO: Adjust Burmese for Unicode 5.2 encoding. + +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-07 Eli Zaretskii * HELLO: Reorder Arabic greetings into logical order (they were diff -r e9ddc2292336 -r 5b2cee3284b0 etc/HELLO --- a/etc/HELLO Sat May 08 10:54:36 2010 +0000 +++ b/etc/HELLO Mon May 10 11:57:09 2010 +0000 @@ -7,7 +7,7 @@ Middle/Near East: ,Hylem(B, ,GGdSqdGe(B ,GYdjce(B South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B, $,1AFAzB4AvB=B AqB*(B, $,1-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B - South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HYrmH"HH3gGO<6b727>(B) $,17(7.787M6u7>70(B Braille $,2(3(1('('(5(B -Burmese ($,1H9HYH;H4HYrlH9HL(B) $,1H9H$HYrmH"H improvment. + improvement. + Refill after yank. [Refill mode does that.] @@ -272,4 +272,4 @@ 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 . + along with this program. If not, see <. diff -r e9ddc2292336 -r 5b2cee3284b0 leim/ChangeLog --- a/leim/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/leim/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-04-06 Chong Yidong * quail/vntelex.el: Fix "af" rule (Bug#5836). diff -r e9ddc2292336 -r 5b2cee3284b0 lib-src/ChangeLog --- a/lib-src/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lib-src/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,7 +1,26 @@ +2010-05-10 Glenn Morris + + * 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 (tiny change) + + * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis + for macros for nmake compatibility. + 2010-05-08 Glenn Morris * Makefile.in (THIS_IS_MAKEFILE): Remove, unused. +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-06 Glenn Morris * Makefile.in: Minimize blessmail-related cpp usage. diff -r e9ddc2292336 -r 5b2cee3284b0 lib-src/Makefile.in --- a/lib-src/Makefile.in Sat May 08 10:54:36 2010 +0000 +++ b/lib-src/Makefile.in Mon May 10 11:57:09 2010 +0000 @@ -131,8 +131,8 @@ # If neither flag is set, blessmail is used. MOVE_FLAGS= -## May be reset below by cpp. -BLESSMAIL_TARGET= +## 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@ @@ -154,6 +154,9 @@ ## 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. @@ -164,20 +167,12 @@ # ========================== start of cpp stuff ======================= /* From here on, comments must be done in C syntax. */ -#define NOT_C_CODE +#ifdef MSDOS #include "../src/config.h" - -/* Some s/SYSTEM.h files define this to request special libraries. */ -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM +LIBS_SYSTEM = MSDOS_LIBS_SYSTEM #endif -LOADLIBES=LIBS_SYSTEM -#ifndef MAIL_USE_FLOCK -#ifndef MAIL_USE_LOCKF -BLESSMAIL_TARGET = need-blessmail -#endif -#endif +LOADLIBES=$(LIBS_SYSTEM) .SUFFIXES: .m diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/ChangeLog --- a/lisp/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,204 @@ +2010-05-09 Michael R. Mauger + + * progmodes/sql.el: Version 2.1 + (sql-product-alist): Redesigned 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): Added "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): Added C-c C-i to start interactive mode. + (sql-mode-menu): Updated 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): Updated 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): Corrected 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 + + * 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 + + * 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 + + * progmodes/compile.el (compilation-buffer-modtime): Rename from + buffer-modtime. Adjust users. + +2010-05-08 Chong Yidong + + * international/mule.el (auto-coding-alist): Only purecopy + car of each item, not the whole list (Bug#6083). + +2010-05-08 Chong Yidong + + * progmodes/js.el (js-mode): Make paragraph variables local before + calling c-setup-paragraph-variables (Bug#6071). + +2010-05-08 Eli Zaretskii + + * composite.el (compose-region, reference-point-alist): Fix typos + in the doc strings. + +2010-05-08 Alexander Klimov (tiny change) + + * calc/calc-graph.el (calc-graph-plot): Use the proper form for + gnuplot's "set" command. + +2010-05-08 Juanma Barranquero + + * abbrev.el (last-abbrev-text): Doc fix. + (abbrev-prefix-mark): Don't escape parenthesis. + +2010-05-08 Andreas Schwab + + * composite.el (find-composition): Doc fix. + +2010-05-08 Juanma Barranquero + + * 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 + + * 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 + + * image-mode.el (image-mode-as-text): Fix typo in docstring. + +2010-05-08 Juanma Barranquero + + * filecache.el (file-cache-add-directory-list) + (file-cache-add-directory-recursively): Fix typos in docstrings. + +2010-05-08 Kenichi Handa + + * language/indian.el (gurmukhi-composable-pattern): Fix typo. + (gujarati-composable-pattern): Fix typo. + +2010-05-08 Kenichi Handa + + * 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 + + * files.el (copy-directory): Handle symlinks (Bug#5982). + +2010-05-08 Dan Nicolaescu + + * 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 + + * 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 * electric.el (Electric-command-loop): Minor tweak. @@ -5,6 +206,10 @@ * ebuff-menu.el (electric-buffer-list): Try and make it behave a bit better with dedicated windows. +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-07 Deniz Dogan (tiny change) Stefan Monnier diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/abbrev.el --- a/lisp/abbrev.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/abbrev.el Mon May 10 11:57:09 2010 +0000 @@ -338,7 +338,7 @@ Abbrev to be expanded starts here rather than at beginning of word. This way, you can expand an abbrev with a prefix: insert the prefix, use this command, then insert the abbrev. This command inserts a -temporary hyphen after the prefix \(until the intended abbrev +temporary hyphen after the prefix (until the intended abbrev expansion occurs). If the prefix is itself an abbrev, this command expands it, unless ARG is non-nil. Interactively, ARG is the prefix argument." @@ -460,7 +460,7 @@ (defvar last-abbrev-text nil "The exact text of the last abbrev expanded. -nil if the abbrev has already been unexpanded.") +It is nil if the abbrev has already been unexpanded.") (defvar last-abbrev-location 0 "The location of the start of the last abbrev expanded.") diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/calc/calc-graph.el --- a/lisp/calc/calc-graph.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/calc/calc-graph.el Mon May 10 11:57:09 2010 +0000 @@ -345,7 +345,7 @@ "set xlabel\nset ylabel\nset title\n" "set noclip points\nset clip one\nset clip two\n" "set format \"%g\"\nset tics\nset xtics\nset ytics\n" - "set data style linespoints\n" + "set style data linespoints\n" "set nogrid\nset nokey\nset nopolar\n")) (if (>= ver 3) (insert "set surface\nset nocontour\n" diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/emacs-lisp/lisp.el --- a/lisp/emacs-lisp/lisp.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/emacs-lisp/lisp.el Mon May 10 11:57:09 2010 +0000 @@ -628,11 +628,12 @@ (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) + (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data) (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* ((pos (point)) (beg (with-syntax-table emacs-lisp-mode-syntax-table diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/erc/ChangeLog --- a/lisp/erc/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/erc/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-03-10 Chong Yidong * Branch for 23.2. @@ -12,8 +16,8 @@ (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 diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/filecache.el --- a/lisp/filecache.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/filecache.el Mon May 10 11:57:09 2010 +0000 @@ -296,8 +296,8 @@ (defun file-cache-add-directory-list (directory-list &optional regexp) "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." (interactive "XAdd files from directory list: ") (mapcar (lambda (dir) (file-cache-add-directory dir regexp)) @@ -370,10 +370,10 @@ ;;;###autoload (defun file-cache-add-directory-recursively (dir &optional regexp) "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." (interactive "DAdd directory: ") (require 'find-lisp) (mapcar diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/files.el --- a/lisp/files.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/files.el Mon May 10 11:57:09 2010 +0000 @@ -4753,10 +4753,14 @@ (mapc (lambda (file) (let ((target (expand-file-name - (file-name-nondirectory file) newname))) - (if (file-directory-p file) - (copy-directory file target keep-time parents) - (copy-file file target t keep-time)))) + (file-name-nondirectory file) newname)) + (attrs (file-attributes file))) + (cond ((file-directory-p file) + (copy-directory file target keep-time parents)) + ((stringp (car attrs)) ; Symbolic link + (make-symbolic-link (car attrs) target t)) + (t + (copy-file file target t keep-time))))) ;; We do not want to copy "." and "..". (directory-files directory 'full directory-files-no-dot-files-regexp)) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/gnus/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,4 +1,15 @@ -2010-05-07 Christian von Roques (tiny change) +2010-05-10 Katsumi Yamaoka + + * 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 + + * 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 (tiny change) * mml2015.el (mml2015-epg-find-usable-key): Skip disabled key (Bug#5592). diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/gnus/message.el --- a/lisp/gnus/message.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/gnus/message.el Mon May 10 11:57:09 2010 +0000 @@ -7161,14 +7161,20 @@ (defun message-forward-make-body-plain (forward-buffer) (insert "\n-------------------- Start of forwarded message --------------------\n") - (let ((b (point)) e) + (let ((b (point)) + contents multibyte-p e) + (with-current-buffer forward-buffer + (setq contents (buffer-string) + multibyte-p (mm-multibyte-p))) (insert (with-temp-buffer - (mm-disable-multibyte) - (insert - (with-current-buffer forward-buffer - (mm-with-unibyte-current-buffer (buffer-string)))) - (mm-enable-multibyte) + (if multibyte-p + (progn + (mm-enable-multibyte) + (insert contents)) + (mm-disable-multibyte) + (insert contents) + (mm-enable-multibyte)) (mime-to-mml) (goto-char (point-min)) (when (looking-at "From ") @@ -7212,18 +7218,24 @@ (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 multibyte-p) + (with-current-buffer forward-buffer + (setq contents (buffer-string) + multibyte-p (mm-multibyte-p))) + (insert + (with-temp-buffer + (if multibyte-p + (progn + (mm-enable-multibyte) + (insert contents)) + (mm-disable-multibyte) + (insert contents) + (mm-enable-multibyte)) + (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) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/gnus/mm-util.el --- a/lisp/gnus/mm-util.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/gnus/mm-util.el Mon May 10 11:57:09 2010 +0000 @@ -1230,33 +1230,23 @@ (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 +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)." +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) - ;; FIXME: (default-value 'enable-multibyte-characters) is read-only - ;; so let-binding it is wrong. The right fix is to not use this - ;; macro at all any more, since it's been ill-defined from the start. - (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))))) + (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)) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/image-mode.el --- a/lisp/image-mode.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/image-mode.el Mon May 10 11:57:09 2010 +0000 @@ -392,7 +392,7 @@ 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 inititally. +to display an image file as text initially. See commands `image-mode' and `image-minor-mode' for more information on these modes." diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/info.el --- a/lisp/info.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/info.el Mon May 10 11:57:09 2010 +0000 @@ -4343,8 +4343,7 @@ (cond ((> Info-breadcrumbs-depth 0) (let ((ov (make-overlay (point-min) (1+ header-end)))) - (overlay-put ov 'invisible t) - (overlay-put ov 'after-string (Info-breadcrumbs)) + (overlay-put ov 'display (Info-breadcrumbs)) (overlay-put ov 'evaporate t))) ((not (bobp)) ;; Hide the punctuation at the end, too. diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/international/mule.el --- a/lisp/international/mule.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/international/mule.el Mon May 10 11:57:09 2010 +0000 @@ -1690,7 +1690,8 @@ (defcustom auto-coding-alist ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. - (purecopy '(("\\.\\(\ + (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) + '(("\\.\\(\ arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . no-conversion-multibyte) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/language/indian.el --- a/lisp/language/indian.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/language/indian.el Mon May 10 11:57:09 2010 +0000 @@ -198,15 +198,14 @@ (defconst gurmukhi-composable-pattern (let ((table - '(("a" . "[\u0A01-\u0A02]") ; SIGN ADAK BINDI .. BINDI - ("A" . "\u0A03]") ; SIGN VISARGA + '(("a" . "[\u0A01-\u0A02\u0A70]") ; SIGN ADAK BINDI .. BINDI, TIPPI + ("A" . "\u0A03") ; SIGN VISARGA ("V" . "[\u0A05-\u0A14]") ; independent vowel ("C" . "[\u0A15-\u0A39\u0A59-\u0A5E]") ; consonant - ("Y" . "[\u0A2F\u0A30\u0A35\u0A39]") ; YA, RA, VA, HA + ("Y" . "[\u0A2F-u0A30\u0A35\u0A39]") ; YA, RA, VA, HA ("n" . "\u0A3C") ; NUKTA ("v" . "[\u0A3E-\u0A4C]") ; vowel sign ("H" . "\u0A4D") ; VIRAMA - ("a" . "\u0A70") ; TIPPI ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ ("X" . "[\u0A00-\u0A7F]")))) ; all coverage @@ -226,7 +225,7 @@ (defconst gujarati-composable-pattern (let ((table '(("a" . "[\u0A81-\u0A82]") ; SIGN CANDRABINDU .. ANUSVARA - ("A" . "\u0A83]") ; SIGN VISARGA + ("A" . "\u0A83") ; SIGN VISARGA ("V" . "[\u0A85-\u0A94\u0AE0-\u0AE1]") ; independent vowel ("C" . "[\u0A95-\u0AB9]") ; consonant ("R" . "\u0AB0") ; RA @@ -258,7 +257,7 @@ ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form ("R" . "\u0B30") ; RA ("n" . "\u0B3C") ; NUKTA - ("v" . "[\u0B3E-\u0B44\u0B47\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign + ("v" . "[\u0B3E-\u0B4C\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign ("H" . "\u0B4D") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -281,7 +280,7 @@ '(("a" . "\u0B82") ; SIGN ANUSVARA ("V" . "[\u0B85-\u0B94]") ; independent vowel ("C" . "[\u0B95-\u0BB9]") ; consonant - ("v" . "[\u0BBE-\u0BC8\u0BD7]") ; vowel sign + ("v" . "[\u0BBE-\u0BCC\u0BD7]") ; vowel sign ("H" . "\u0BCD") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -351,7 +350,7 @@ ("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel ("C" . "[\u0D15-\u0D39]") ; consonant ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]") ; YA, RA, LA, VA - ("v" . "[\u0D3E-\u0D48\u0D57\u0D62-\u0D63]") ; postbase matra + ("v" . "[\u0D3E-\u0D4C\u0D57\u0D62-\u0D63]") ; postbase matra ("H" . "\u0D4D") ; SIGN VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/mh-e/ChangeLog --- a/lisp/mh-e/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/mh-e/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-03 Stefan Monnier * mh-show.el (mh-showing-mode): Move function to mh-e.el. diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/minibuffer.el --- a/lisp/minibuffer.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/minibuffer.el Mon May 10 11:57:09 2010 +0000 @@ -1169,7 +1169,7 @@ `:predicate' a predicate that completion candidates need to satisfy. `:annotation-function' the value to use for `completion-annotate-function'.") -(defun complete-symbol (&optional arg) +(defun completion-at-point (&optional arg) "Perform completion on the text around point. The completion method is determined by `completion-at-point-functions'. @@ -1193,7 +1193,7 @@ (completion-in-region start end (nth 2 res) (plist-get plist :predicate)))))))) -(defalias 'completion-at-point 'complete-symbol) +(define-obsolete-function-alias 'complete-symbol 'completion-at-point "24.1") ;;; Key bindings. @@ -1769,6 +1769,14 @@ :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. @@ -1781,7 +1789,7 @@ (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))) @@ -1794,11 +1802,12 @@ (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 @@ -1824,11 +1833,10 @@ (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) + "\\(.*?\\)" ".*?"))) pattern "")))) ;; Avoid pathological backtracking. @@ -2057,9 +2065,9 @@ ;; here any more. (unless unique (push elem res) - (when (memq elem '(star point)) + (when (memq elem '(star point prefix)) ;; Extract common suffix additionally to common prefix. - ;; Only do it for `point' and `star' since for + ;; 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))) @@ -2074,8 +2082,7 @@ (mapconcat (lambda (x) (cond ((stringp x) x) ((eq x 'star) "*") - ((eq x 'any) "") - ((eq x 'point) ""))) + (t ""))) ;any, point, prefix. pattern "")) @@ -2117,6 +2124,7 @@ (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))) @@ -2147,7 +2155,7 @@ beforepoint afterpoint bounds)) (pattern (if (not (stringp (car basic-pattern))) basic-pattern - (cons 'any basic-pattern))) + (cons 'prefix basic-pattern))) (all (completion-pcm--all-completions prefix pattern table pred))) (list all pattern prefix suffix (car bounds)))) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/net/tramp-cmds.el --- a/lisp/net/tramp-cmds.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/net/tramp-cmds.el Mon May 10 11:57:09 2010 +0000 @@ -106,8 +106,7 @@ (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) @@ -254,7 +253,7 @@ (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. @@ -283,10 +282,8 @@ (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." @@ -308,15 +305,14 @@ (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))) @@ -328,7 +324,7 @@ (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. @@ -376,10 +372,10 @@ 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. diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/net/tramp-compat.el --- a/lisp/net/tramp-compat.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/net/tramp-compat.el Mon May 10 11:57:09 2010 +0000 @@ -89,14 +89,25 @@ (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)) @@ -182,8 +193,8 @@ 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 () @@ -191,8 +202,8 @@ 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 () @@ -201,7 +212,7 @@ 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))) @@ -227,8 +238,7 @@ result) (if (fboundp 'make-temp-file) (setq result - (funcall - (symbol-function 'make-temp-file) prefix dir-flag extension)) + (tramp-compat-funcall 'make-temp-file prefix dir-flag extension)) ;; We use our own implementation, taken from files.el. (while (condition-case () @@ -261,19 +271,27 @@ ((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) + (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. @@ -281,8 +299,7 @@ (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. @@ -323,7 +340,7 @@ (if (null force) (delete-file filename) (condition-case nil - (funcall (symbol-function 'delete-file) filename force) + (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 @@ -341,7 +358,7 @@ (if (null recursive) (delete-directory directory) (condition-case nil - (funcall (symbol-function 'delete-directory) directory recursive) + (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 @@ -360,7 +377,7 @@ (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)) @@ -390,15 +407,13 @@ (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)))) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/net/tramp-gvfs.el --- a/lisp/net/tramp-gvfs.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/net/tramp-gvfs.el Mon May 10 11:57:09 2010 +0000 @@ -629,8 +629,8 @@ (defun tramp-gvfs-handle-file-selinux-context (filename) "Like `file-selinux-context' for Tramp files." - (funcall (symbol-function 'file-selinux-context) - (tramp-gvfs-fuse-file-name filename))) + (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." diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/net/tramp-imap.el --- a/lisp/net/tramp-imap.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/net/tramp-imap.el Mon May 10 11:57:09 2010 +0000 @@ -63,6 +63,7 @@ (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") diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/net/tramp.el --- a/lisp/net/tramp.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/net/tramp.el Mon May 10 11:57:09 2010 +0000 @@ -145,8 +145,7 @@ ;; this would load dbus.el. (when (and (featurep 'dbusbind) (condition-case nil - (funcall (symbol-function '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) @@ -2274,14 +2273,14 @@ ;; introduced in Emacs 24.1. (when (<= ,level tramp-verbose) (condition-case nil - (setq pr (funcall (symbol-function 'make-progress-reporter) ,message) - tm (run-at-time 3 0.1 'progress-reporter-update pr)) + (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. (progn ,@body) ;; Stop progress reporter. - (if tm (cancel-timer tm)) + (if tm (tramp-compat-funcall 'cancel-timer tm)) (tramp-message ,vec ,level "%s...done" ,message)))) (put 'with-progress-reporter 'lisp-indent-function 3) @@ -2398,15 +2397,16 @@ 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 @@ -2425,10 +2425,12 @@ `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 @@ -2438,8 +2440,9 @@ (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 @@ -2989,9 +2992,8 @@ ;; local host. (and (functionp 'subr-arity) (subrp (symbol-function 'format-time-string)) - (= 3 (cdr (funcall (symbol-function 'subr-arity) - (symbol-function - 'format-time-string))))))) + (= 3 (cdr (tramp-compat-funcall + 'subr-arity 'format-time-string)))))) (tramp-send-command-and-check v (format "%s touch -t %s %s" (if utc "TZ=UTC; export TZ;" "") @@ -4157,8 +4159,8 @@ (tramp-send-command-and-check v (concat (nth 2 suffix) " " (tramp-shell-quote-argument localname)))) - ;; `dired-remove-file' is not defined in XEmacs - (funcall (symbol-function 'dired-remove-file) file) + ;; `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 @@ -4169,8 +4171,8 @@ (tramp-send-command-and-check v (concat "gzip -f " (tramp-shell-quote-argument localname)))) - ;; `dired-remove-file' is not defined in XEmacs - (funcall (symbol-function 'dired-remove-file) file) + ;; `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")) @@ -4714,8 +4716,7 @@ ;; 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. @@ -5638,7 +5639,8 @@ (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) partial-completion-mode) + (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) @@ -5730,19 +5732,18 @@ ;; `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. @@ -6777,10 +6778,11 @@ (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)) @@ -6907,7 +6909,7 @@ (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))) @@ -6920,8 +6922,8 @@ (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. @@ -6950,7 +6952,7 @@ ;; 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)) @@ -7333,7 +7335,7 @@ '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 @@ -8612,16 +8614,17 @@ (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)) @@ -8629,14 +8632,13 @@ (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 @@ -8673,16 +8675,17 @@ ;; 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) @@ -8693,18 +8696,18 @@ "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) @@ -8712,8 +8715,8 @@ 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)) ;; ------------------------------------------------------------ @@ -8773,8 +8776,7 @@ ;; 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) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/org/ChangeLog --- a/lisp/org/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/org/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-05 Stefan Monnier * org-table.el (orgtbl-setup): @@ -40,8 +44,7 @@ * 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. + (org-splice-latex-header): Implement placement according to cookies. 2010-04-10 Carsten Dominik @@ -54,8 +57,8 @@ 2010-04-10 Carsten Dominik - * org-latex.el (org-export-latex-make-header): Use - `org-splice-latex-header' to build the header. + * 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. diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/progmodes/compile.el Mon May 10 11:57:09 2010 +0000 @@ -748,9 +748,9 @@ "If non-nil, automatically jump to the next error encountered.") (make-variable-buffer-local 'compilation-auto-jump-to-next) -(defvar buffer-modtime nil +(defvar compilation-buffer-modtime nil "The buffer modification time, for buffers not associated with files.") -(make-variable-buffer-local 'buffer-modtime) +(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.") @@ -1588,7 +1588,7 @@ mode-name (or name-of-mode "Compilation")) (set (make-local-variable 'page-delimiter) compilation-page-delimiter) - (set (make-local-variable 'buffer-modtime) nil) + (set (make-local-variable 'compilation-buffer-modtime) nil) (compilation-setup) (setq buffer-read-only t) (run-mode-hooks 'compilation-mode-hook)) @@ -1804,7 +1804,7 @@ (unless comint-inhibit-carriage-motion (comint-carriage-motion (process-mark proc) (point))) (set-marker (process-mark proc) (point)) - (set (make-local-variable 'buffer-modtime) (current-time)) + (set (make-local-variable 'compilation-buffer-modtime) (current-time)) (run-hooks 'compilation-filter-hook)) (goto-char pos) (narrow-to-region min max) @@ -1978,7 +1978,7 @@ ;; 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 buffer-modtime))) + (setq timestamp compilation-buffer-modtime))) (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) (cadr (car (nth 2 loc)))) (save-restriction diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/progmodes/js.el --- a/lisp/progmodes/js.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/progmodes/js.el Mon May 10 11:57:09 2010 +0000 @@ -3327,6 +3327,13 @@ comment-start-skip "\\(//+\\|/\\*+\\)\\s *") (let ((c-buffer-is-cc-mode t)) + ;; FIXME: These are normally set by `c-basic-common-init'. Should + ;; we call it instead? (Bug#6071) + (make-local-variable 'paragraph-start) + (make-local-variable 'paragraph-separate) + (make-local-variable 'paragraph-ignore-fill-prefix) + (make-local-variable 'adaptive-fill-mode) + (make-local-variable 'adaptive-fill-regexp) (c-setup-paragraph-variables)) (set (make-local-variable 'syntax-begin-function) diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/progmodes/sql.el --- a/lisp/progmodes/sql.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/progmodes/sql.el Mon May 10 11:57:09 2010 +0000 @@ -5,7 +5,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger -;; 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 @@ -103,83 +103,79 @@ ;; 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. - -;; (const :tag "XyzDB" xyz) - -;; 2) Add an entry to the `sql-product-alist' list. - -;; (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"))) - -;; 3) Add customizable values for the product interpreter and options. - -;; ;; Customization for XyzDB -;; -;; (defcustom sql-xyz-program "ixyz" -;; "*Command to start ixyz by XyzDB." +;; 1) Add the product to the list of known products. + +;; (sql-add-product 'xyz "XyzDB" +;; '(:free-software t)) + +;; 2) Define font lock settings. All ANSI keywords will be +;; highlighted automatically, so only product specific keywords +;; need to be defined here. + +;; (defvar my-sql-mode-xyz-font-lock-keywords +;; '(("\\b\\(red\\|orange\\|yellow\\)\\b" +;; . font-lock-keyword-face)) +;; "XyzDB SQL keywords used by font-lock.") + +;; (sql-set-product-feature 'xyz +;; :font-lock +;; 'my-sql-mode-xyz-font-lock-keywords) + +;; 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'." +;; (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) + +;; (defcustom my-sql-xyz-options '("-X" "-Y" "-Z") +;; "List of additional options for `sql-xyz-program'." ;; :type '(repeat string) ;; :group 'SQL) - -;; 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. - -;; (defun sql-connect-xyz () -;; "Create comint buffer and connect to XyzDB using the login -;; parameters and command options." +;; +;; (sql-set-product-feature 'xyz +;; :sqli-options 'my-sql-xyz-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)) @@ -188,25 +184,36 @@ ;; (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)))) - -;; 9) Save and compile sql.el. +;; (sql-connect product params))) +;; +;; (sql-set-product-feature 'xyz +;; :sqli-connect-func 'my-sql-connect-xyz) + +;; 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. - -;; Add different hilighting levels. +;; 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. + +;; 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 Schroeder -- the original author ;; Kai Blauberg ;; ;; Yair Friedman @@ -217,7 +224,7 @@ ;; Michael Mauger -- improved product support ;; Drew Adams -- Emacs 20 support ;; Harald Maier -- sql-send-string -;; Stefan Monnier -- font-lock corrections +;; Stefan Monnier -- font-lock corrections; code polish @@ -240,32 +247,43 @@ (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 @@ -276,108 +294,176 @@ '((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-connect the name of a function which accepts no + :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-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 @@ -385,19 +471,45 @@ 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) @@ -407,8 +519,12 @@ ,(car prod-info))) sql-product-alist)) :group 'SQL) - -;; misc customization of sql.el behavior +(put 'sql-product 'safe-local-variable 'symbolp) + +(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. @@ -419,19 +535,49 @@ If set to nil, then you must use \\[comint-send-input] in order to send current input in the SQLi buffer to the process." :type '(choice (const :tag "Nothing" nil) - (const :tag "The semikolon `;'" semicolon) + (const :tag "The semicolon `;'" semicolon) (const :tag "The string `go' by itself" go)) :version "20.8" :group 'SQL) +(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) + (defcustom sql-pop-to-buffer-after-send-region nil - "*If t, pop to the buffer SQL statements are sent to. - -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'." + "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) @@ -445,19 +591,20 @@ ("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'. This is used to set `imenu-generic-expression' when SQL mode is -entered. Subsequent changes to sql-imenu-generic-expression will not -affect existing SQL buffers because imenu-generic-expression is a -local variable.") +entered. Subsequent changes to `sql-imenu-generic-expression' will +not affect existing SQL buffers because imenu-generic-expression is +a local variable.") ;; 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, @@ -474,7 +621,7 @@ :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 @@ -492,17 +639,17 @@ ;; 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." @@ -512,144 +659,220 @@ ;; 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. -Under NT, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to +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'." +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 buffer 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. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start SQLite. + +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. + +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'. 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) -;; Customization for MySql - -(defcustom sql-mysql-program "mysql" - "*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'." - :type 'file - :group 'SQL) - -(defcustom sql-mysql-options nil - "*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" +(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. - -Starts `sql-interactive-mode' after doing some setup. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start SOLID SQL Editor. + +Starts `sql-interactive-mode' after doing some setup." :type 'file :group 'SQL) +(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) + ;; Customization for SyBase (defcustom sql-sybase-program "isql" - "*Command to start isql by SyBase. - -Starts `sql-interactive-mode' after doing some setup. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start isql by SyBase. + +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. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start dbaccess by Informix. + +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. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start sql by Ingres. + +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. - -Starts `sql-interactive-mode' after doing some setup. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start osql by Microsoft. + +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 @@ -660,55 +883,91 @@ :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. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start isql by Interbase. + +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. - -The program can also specify a TCP connection. See `make-comint'." + "Command to start db2 by IBM. + +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) + ;;; Variables which do not need customization @@ -722,12 +981,15 @@ (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 "Current SQLi buffer. -The global value of sql-buffer is the name of the latest SQLi buffer +The global value of `sql-buffer' is the name of the latest SQLi buffer created. Any SQL buffer created will make a local copy of this value. See `sql-interactive-mode' for more on multiple sessions. If you want to change the SQLi buffer a SQL mode sends its SQL strings to, change @@ -775,6 +1037,7 @@ (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'.") @@ -786,16 +1049,15 @@ `("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" @@ -888,25 +1150,64 @@ 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"))) - -(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" -)) - - (ansi-non-reserved (sql-keywords-re +;; 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. + +(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)))) + +(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" @@ -934,9 +1235,9 @@ "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" @@ -972,31 +1273,86 @@ "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 regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-ansi-font-lock-keywords. You may want to -add functions and PL/SQL keywords.") +you define your own `sql-mode-ansi-font-lock-keywords'. You may want +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" @@ -1027,9 +1383,9 @@ "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" @@ -1115,22 +1471,29 @@ "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" -)) - - (plsql-keywords (sql-keywords-re +"%type" +) + + ;; Oracle PL/SQL Functions + (sql-font-lock-keywords-builder 'font-lock-builtin-face nil +"extend" "prior" +) + + ;; 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" @@ -1138,14 +1501,16 @@ "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" @@ -1153,66 +1518,21 @@ "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. This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-oracle-font-lock-keywords. You may want +you define your own `sql-mode-oracle-font-lock-keywords'. You may want 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" @@ -1237,9 +1557,9 @@ "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" @@ -1274,9 +1594,10 @@ "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" @@ -1287,19 +1608,18 @@ "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 regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-postgres-font-lock-keywords.") +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" @@ -1324,9 +1644,10 @@ "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" @@ -1344,16 +1665,10 @@ "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" @@ -1364,13 +1679,16 @@ "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode" "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap" "instr" "least" "multime" "replace" "width" +) + + ;; 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-keywords . font-lock-keyword-face) - (,linter-reserved . font-lock-keyword-face) - (,linter-functions . font-lock-builtin-face) - (,linter-types . font-lock-type-face))) - "Linter SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1378,7 +1696,29 @@ 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" @@ -1411,19 +1751,10 @@ "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" @@ -1452,37 +1783,26 @@ "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-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 Variables + '("\\b@[a-zA-Z0-9_]*\\b" . font-lock-variable-name-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. This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-ms-font-lock-keywords.") +you define your own `sql-mode-ms-font-lock-keywords'.") (defvar sql-mode-sybase-font-lock-keywords nil "Sybase SQL keywords used by font-lock. @@ -1490,7 +1810,7 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-sybase-font-lock-keywords.") +you define your own `sql-mode-sybase-font-lock-keywords'.") (defvar sql-mode-informix-font-lock-keywords nil "Informix SQL keywords used by font-lock. @@ -1498,7 +1818,7 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-informix-font-lock-keywords.") +you define your own `sql-mode-informix-font-lock-keywords'.") (defvar sql-mode-interbase-font-lock-keywords nil "Interbase SQL keywords used by font-lock. @@ -1506,7 +1826,7 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-interbase-font-lock-keywords.") +you define your own `sql-mode-interbase-font-lock-keywords'.") (defvar sql-mode-ingres-font-lock-keywords nil "Ingres SQL keywords used by font-lock. @@ -1514,7 +1834,7 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-interbase-font-lock-keywords.") +you define your own `sql-mode-interbase-font-lock-keywords'.") (defvar sql-mode-solid-font-lock-keywords nil "Solid SQL keywords used by font-lock. @@ -1522,10 +1842,13 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-solid-font-lock-keywords.") +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" @@ -1548,9 +1871,10 @@ "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" @@ -1576,9 +1900,10 @@ "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" @@ -1590,16 +1915,12 @@ "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 regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-mysql-font-lock-keywords.") +you define your own `sql-mode-mysql-font-lock-keywords'.") (defvar sql-mode-sqlite-font-lock-keywords nil "SQLite SQL keywords used by font-lock. @@ -1607,7 +1928,7 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-sqlite-font-lock-keywords.") +you define your own `sql-mode-sqlite-font-lock-keywords'.") (defvar sql-mode-db2-font-lock-keywords nil "DB2 SQL keywords used by font-lock. @@ -1615,58 +1936,146 @@ This variable is used by `sql-mode' and `sql-interactive-mode'. The regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before -you define your own sql-mode-db2-font-lock-keywords.") +you define your own `sql-mode-db2-font-lock-keywords'.") (defvar sql-mode-font-lock-keywords nil "SQL keywords used by font-lock. Setting this variable directly no longer has any affect. Use `sql-product' and `sql-add-product-keywords' to control the -highlighting rules in sql-mode.") +highlighting rules in SQL mode.") ;;; SQL Product support functions -(defun sql-product-feature (feature &optional product) - "Lookup `feature' needed to support the current SQL product. - -See \[sql-product-alist] for a list of products and supported features." - (plist-get - (cdr (assoc (or product sql-product) - sql-product-alist)) - feature)) +(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." + (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'." + "Configures 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)) @@ -1683,7 +2092,7 @@ ;; 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) @@ -1705,38 +2114,40 @@ 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)))))) ;;; Functions to switch highlighting (defun sql-highlight-product () - "Turns on the appropriate font highlighting for the SQL product -selected." + "Turns 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) @@ -1752,7 +2163,7 @@ (if (not (fboundp 'comint-line-beginning-position)) ;; comint-line-beginning-position is defined in Emacs 21 (defun comint-line-beginning-position () - "Returns the buffer position of the beginning of the line, after any prompt. + "Return the buffer position of the beginning of the line, after any prompt. The prompt is assumed to be any text at the beginning of the line matching the regular expression `comint-prompt-regexp', a buffer local variable." (save-excursion (comint-bol nil) (point)))) @@ -1788,6 +2199,30 @@ (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. @@ -1797,24 +2232,17 @@ 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 @@ -1829,6 +2257,30 @@ 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) @@ -1844,12 +2296,13 @@ `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)." @@ -1859,22 +2312,27 @@ ((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))) @@ -1958,7 +2416,7 @@ (message "Current SQLi buffer is %s." (buffer-name sql-buffer))))) (defun sql-make-alternate-buffer-name () - "Return a string that can be used to rename a SQLi buffer. + "Returns a string that can be used to rename a SQLi buffer. This is used to set `sql-alternate-buffer-name' within `sql-interactive-mode'." @@ -1974,7 +2432,7 @@ sql-database))) (defun sql-rename-buffer () - "Renames a SQLi buffer." + "Rename a SQLi buffer." (interactive) (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t)) @@ -1984,7 +2442,7 @@ (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)) @@ -2007,69 +2465,98 @@ (insert column) (message "%s" column)))) -;; On NT, SQL*Plus for Oracle turns on full buffering for stdout if it -;; is not attached to a character device; therefore placeholder +;; On Windows, SQL*Plus for Oracle turns on full buffering for stdout +;; if it is not attached to a character device; therefore placeholder ;; replacement by SQL*Plus is fully buffered. The workaround lets ;; Emacs query for the placeholders. (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 and ampersand like &this. -This function is used for `comint-input-sender' if using `sql-oracle' on NT." - (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 and 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) + "Escapes 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)))) +;;; Input sender for SQLi buffers + +(defun sql-input-sender (proc string) + "Sends 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." @@ -2087,29 +2574,46 @@ (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) + "Sends 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 given the optional parameter VALUE, sets -sql-toggle-pop-to-buffer-after-send-region to VALUE." +`sql-toggle-pop-to-buffer-after-send-region' to VALUE." (interactive "P") (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)))) @@ -2187,8 +2691,8 @@ "Major mode to use a SQL interpreter interactively. Do not call this function by yourself. The environment must be -initialized by an entry function specific for the SQL interpreter. See -`sql-help' for a list of available entry functions. +initialized by an entry function specific for the SQL interpreter. +See `sql-help' for a list of available entry functions. \\[comint-send-input] after the end of the process' output sends the text from the end of process to the end of the current line. @@ -2252,24 +2756,29 @@ \(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 "--") @@ -2284,16 +2793,19 @@ (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. @@ -2323,29 +2835,82 @@ ;;;###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 () @@ -2360,7 +2925,7 @@ 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 @@ -2374,27 +2939,23 @@ (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 WindowsNT; 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))) @@ -2411,7 +2972,7 @@ `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 @@ -2425,12 +2986,11 @@ (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)) @@ -2439,8 +2999,7 @@ (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))) @@ -2455,7 +3014,7 @@ 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 @@ -2469,13 +3028,15 @@ (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)))) @@ -2494,7 +3055,7 @@ `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 @@ -2508,18 +3069,15 @@ (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))) @@ -2538,7 +3096,7 @@ `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 @@ -2552,9 +3110,8 @@ (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)) @@ -2562,14 +3119,14 @@ (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))) @@ -2585,7 +3142,7 @@ 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 @@ -2599,20 +3156,18 @@ (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))) @@ -2627,7 +3182,7 @@ 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 @@ -2641,13 +3196,14 @@ (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))) @@ -2664,7 +3220,7 @@ 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 @@ -2678,12 +3234,11 @@ (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)) @@ -2699,8 +3254,7 @@ ;; 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))) @@ -2717,7 +3271,7 @@ 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 @@ -2736,23 +3290,21 @@ (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))) @@ -2768,7 +3320,7 @@ 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 @@ -2782,20 +3334,18 @@ (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))) @@ -2810,7 +3360,7 @@ 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 @@ -2829,15 +3379,14 @@ (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 () @@ -2850,7 +3399,7 @@ 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 @@ -2859,19 +3408,20 @@ 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.)" (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)) @@ -2880,8 +3430,7 @@ (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))) @@ -2890,3 +3439,4 @@ ;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3 ;;; sql.el ends here + diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/url/ChangeLog --- a/lisp/url/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lisp/url/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-03 Stefan Monnier * url-dired.el (url-dired-minor-mode): Use define-minor-mode. @@ -62,8 +66,8 @@ 2009-09-12 Chong Yidong * 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 diff -r e9ddc2292336 -r 5b2cee3284b0 lisp/vc-hg.el --- a/lisp/vc-hg.el Sat May 08 10:54:36 2010 +0000 +++ b/lisp/vc-hg.el Mon May 10 11:57:09 2010 +0000 @@ -168,12 +168,13 @@ (condition-case nil ;; Ignore all errors. (let ((process-environment - ;; Avoid localization of messages so we can parse the output. - (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") process-environment))) - - (process-file - "hg" nil t nil - "status" "-A" (file-relative-name file))) + ;; Avoid localization of messages so we + ;; can parse the output. + (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") + process-environment))) + (process-file + "hg" nil t nil + "status" "-A" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. (error nil))))))) @@ -197,7 +198,7 @@ ((status nil) (default-directory (file-name-directory file)) ;; Avoid localization of messages so we can parse the output. - (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") + (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") process-environment)) (out (with-output-to-string @@ -209,7 +210,7 @@ ;; Ignore all errors. (process-file "hg" nil t nil - "parent" "--template" "{rev}" (file-relative-name file))) + "parents" "--template" "{rev}" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. (error nil))))))) diff -r e9ddc2292336 -r 5b2cee3284b0 lwlib/ChangeLog --- a/lwlib/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/lwlib/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,12 @@ +2010-05-08 Jan Djärv + + * xlwmenu.c (XlwMenuDestroy): Remove XtDestroyWidget on subwidgets + (Bug #6127). + +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-06 Glenn Morris * Makefile.in (CPP, LN_S, TOP, LN): Remove unused variables. @@ -23,17 +32,16 @@ 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. + (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. + 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. + 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) diff -r e9ddc2292336 -r 5b2cee3284b0 lwlib/xlwmenu.c --- a/lwlib/xlwmenu.c Sat May 08 10:54:36 2010 +0000 +++ b/lwlib/xlwmenu.c Mon May 10 11:57:09 2010 +0000 @@ -2177,7 +2177,6 @@ { if (mw->menu.windows [i].pixmap != None) XFreePixmap (XtDisplay (mw), mw->menu.windows [i].pixmap); - XtDestroyWidget (mw->menu.windows [i].w); #ifdef HAVE_XFT if (mw->menu.windows [i].xft_draw) XftDrawDestroy (mw->menu.windows [i].xft_draw); diff -r e9ddc2292336 -r 5b2cee3284b0 msdos/ChangeLog --- a/msdos/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/msdos/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,13 @@ +2010-05-10 Glenn Morris + + * sed1v2.inp, sed3v2.inp (LIBS_SYSTEM): Edit to empty. + + * sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail. + +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-08 Glenn Morris * sed1v2.inp (LIBS_TERMCAP): Edit to empty. diff -r e9ddc2292336 -r 5b2cee3284b0 msdos/sed1v2.inp --- a/msdos/sed1v2.inp Sat May 08 10:54:36 2010 +0000 +++ b/msdos/sed1v2.inp Mon May 10 11:57:09 2010 +0000 @@ -50,6 +50,7 @@ /^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@// +/^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@// /^LIBTIFF *=/s/@LIBTIFF@// /^LIBJPEG *=/s/@LIBJPEG@// /^LIBPNG *=/s/@LIBPNG@// diff -r e9ddc2292336 -r 5b2cee3284b0 msdos/sed3v2.inp --- a/msdos/sed3v2.inp Sat May 08 10:54:36 2010 +0000 +++ b/msdos/sed3v2.inp Mon May 10 11:57:09 2010 +0000 @@ -26,6 +26,7 @@ /^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 @@ -34,6 +35,7 @@ /^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@// diff -r e9ddc2292336 -r 5b2cee3284b0 nextstep/ChangeLog --- a/nextstep/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/nextstep/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-03-10 Chong Yidong * Branch for 23.2. diff -r e9ddc2292336 -r 5b2cee3284b0 nt/ChangeLog --- a/nt/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/nt/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-04 Glenn Morris * config.nt (LD_SWITCH_X_SITE_AUX): Remove. @@ -55,8 +59,8 @@ 2009-01-26 Jason Rumney - * 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 diff -r e9ddc2292336 -r 5b2cee3284b0 oldXMenu/ChangeLog --- a/oldXMenu/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/oldXMenu/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,15 +1,19 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-05-06 Glenn Morris * Makefile.in (RANLIB): Let configure set it. - (libXMenu11.a): configure sets RANLIB = : on systems without 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 - * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Use - @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than + * 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 diff -r e9ddc2292336 -r 5b2cee3284b0 src/ChangeLog --- a/src/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/src/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,67 @@ +2010-05-10 Glenn Morris + + * 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 + + * Version 23.2 released. + +2010-05-08 Andreas Schwab + + * composite.c (autocmp_chars): Save point as marker before calling + auto-composition-function (Bug#5984). + + * lisp.h (restore_point_unwind): Add prototype. + + * fileio.c (restore_point_unwind): Remove static attribute. + +2010-05-08 Kenichi Handa + + * 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. + (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. + +2010-05-08 Jan Djärv + + * 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 + + * makefile.w32-in ($(BLD)/eval.$(O), $(BLD)/w32fns.$(O)): + Update dependencies. + 2010-05-08 Eli Zaretskii * fringe.c (update_window_fringes): Set up truncation bitmaps for diff -r e9ddc2292336 -r 5b2cee3284b0 src/Makefile.in --- a/src/Makefile.in Sat May 08 10:54:36 2010 +0000 +++ b/src/Makefile.in Mon May 10 11:57:09 2010 +0000 @@ -88,6 +88,9 @@ ## Flags to pass to ld only for temacs. TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS) +## Some systems define this to request special libraries. +LIBS_SYSTEM=@LIBS_SYSTEM@ + LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ LIBPNG=@LIBPNG@ @@ -195,11 +198,6 @@ do not let it interfere with this file. */ #undef register -/* Some s/SYSTEM.h files define this to request special libraries. */ -#ifndef LIBS_SYSTEM -#define LIBS_SYSTEM -#endif - /* This macro is for switches specifically related to X Windows. */ #ifndef LD_SWITCH_X_SITE #define LD_SWITCH_X_SITE @@ -324,9 +322,9 @@ #endif #ifdef MSDOS +LIBS_SYSTEM = MSDOS_LIBS_SYSTEM #ifdef HAVE_X_WINDOWS MSDOS_OBJ = dosfns.o msdos.o -#define LIBS_SYSTEM -lxext -lsys #else MSDOS_OBJ = dosfns.o msdos.o w16select.o termcap.o #endif @@ -656,8 +654,8 @@ with GCC, we might need gnulib 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} \ + $(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@ \ $(GNULIB_VAR) @LIB_MATH@ @LIB_STANDARD@ $(GNULIB_VAR) diff -r e9ddc2292336 -r 5b2cee3284b0 src/composite.c --- a/src/composite.c Sat May 08 10:54:36 2010 +0000 +++ b/src/composite.c Mon May 10 11:57:09 2010 +0000 @@ -990,6 +990,14 @@ { Lisp_Object args[6]; + /* Save point as marker before calling out to lisp. */ + if (NILP (string)) + { + Lisp_Object m = Fmake_marker (); + set_marker_both (m, Qnil, pt, pt_byte); + record_unwind_protect (restore_point_unwind, m); + } + args[0] = Vauto_composition_function; args[1] = AREF (elt, 2); args[2] = pos; @@ -998,8 +1006,10 @@ args[5] = string; gstring = safe_call (6, args); } - if (NILP (string)) - TEMP_SET_PT_BOTH (pt, pt_byte); + else if (NILP (string)) + { + TEMP_SET_PT_BOTH (pt, pt_byte); + } return unbind_to (count, gstring); } } diff -r e9ddc2292336 -r 5b2cee3284b0 src/config.in --- a/src/config.in Sat May 08 10:54:36 2010 +0000 +++ b/src/config.in Mon May 10 11:57:09 2010 +0000 @@ -321,10 +321,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_KERBEROS_KRB_H -/* Define to 1 if `e_text' is a member of `krb5_error'. */ +/* Define to 1 if `e_text' is member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_E_TEXT -/* Define to 1 if `text' is a member of `krb5_error'. */ +/* Define to 1 if `text' is member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_TEXT /* Define to 1 if you have the header file. */ @@ -612,25 +612,25 @@ /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL -/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */ +/* Define to 1 if `ifr_addr' is member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_ADDR -/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */ +/* Define to 1 if `ifr_broadaddr' is member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_BROADADDR -/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */ +/* Define to 1 if `ifr_flags' is member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_FLAGS -/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */ +/* Define to 1 if `ifr_hwaddr' is member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_HWADDR -/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */ +/* Define to 1 if `ifr_netmask' is member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_NETMASK -/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */ +/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ #undef HAVE_STRUCT_NLIST_N_UN_N_NAME -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +/* Define to 1 if `tm_zone' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if `struct utimbuf' is declared by . */ @@ -819,6 +819,12 @@ /* Define to unlink, rather than empty, mail spool after reading. */ #undef MAIL_UNLINK_SPOOL +/* Define if the mailer uses flock to interlock the mail spool. */ +#undef MAIL_USE_FLOCK + +/* 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 @@ -853,9 +859,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -890,6 +893,9 @@ /* 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 and . */ #undef TIME_WITH_SYS_TIME @@ -912,28 +918,6 @@ /* Define to 1 if using the Motif X toolkit. */ #undef USE_MOTIF -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - /* Define to 1 if we should use toolkit scroll bars. */ #undef USE_TOOLKIT_SCROLL_BARS @@ -969,6 +953,28 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX diff -r e9ddc2292336 -r 5b2cee3284b0 src/fileio.c --- a/src/fileio.c Sat May 08 10:54:36 2010 +0000 +++ b/src/fileio.c Mon May 10 11:57:09 2010 +0000 @@ -299,7 +299,7 @@ /* Restore point, having saved it as a marker. */ -static Lisp_Object +Lisp_Object restore_point_unwind (location) Lisp_Object location; { diff -r e9ddc2292336 -r 5b2cee3284b0 src/ftfont.c --- a/src/ftfont.c Sat May 08 10:54:36 2010 +0000 +++ b/src/ftfont.c Mon May 10 11:57:09 2010 +0000 @@ -1578,6 +1578,14 @@ #ifdef HAVE_M17N_FLT +#if ((LIBOTF_MAJOR_VERSION > 1) || (LIBOTF_RELEASE_NUMBER >= 10) \ + && (M17NLIB_MAJOR_VERSION > 1) || (M17NLIB_MINOR_VERSION >= 6)) +/* We can use the new feature of libotf and m17n-flt to handle the + character encoding scheme introduced in Unicode 5.1 and 5.2 for + some Agian scripts. */ +#define M17N_FLT_USE_NEW_FEATURE +#endif + struct MFLTFontFT { MFLTFont flt_font; @@ -1696,10 +1704,16 @@ else tags[n] = spec->features[i][n]; } +#ifdef M17N_FLT_USE_NEW_FEATURE + if (OTF_check_features (otf, i == 0, spec->script, spec->langsys, + tags, n - negative) != 1) + return 0; +#else /* not M17N_FLT_USE_NEW_FEATURE */ if (n - negative > 0 && OTF_check_features (otf, i == 0, spec->script, spec->langsys, tags, n - negative) != 1) return 0; +#endif /* not M17N_FLT_USE_NEW_FEATURE */ } return 1; } @@ -1757,6 +1771,356 @@ memset (otf_gstring.glyphs, 0, sizeof (OTF_Glyph) * size); } +#ifdef M17N_FLT_USE_NEW_FEATURE + +/* Pack 32-bit OTF tag (0x7F7F7F7F) into 28-bit (0x0FFFFFFF). */ +#define PACK_OTF_TAG(TAG) \ + ((((TAG) & 0x7F000000) >> 3) \ + | (((TAG) & 0x7F0000) >> 2) \ + | (((TAG) & 0x7F00) >> 1) \ + | ((TAG) & 0x7F)) + +/* Assuming that FONT is an OpenType font, apply OpenType features + specified in SPEC on glyphs between FROM and TO of IN, and record + the lastly applied feature in each glyph of IN. If OUT is not + NULL, append the resulting glyphs to OUT while storing glyph + position adjustment information in ADJUSTMENT. */ + +static int +ftfont_drive_otf (font, spec, in, from, to, out, adjustment) + MFLTFont *font; + MFLTOtfSpec *spec; + MFLTGlyphString *in; + int from, to; + MFLTGlyphString *out; + MFLTGlyphAdjustment *adjustment; +{ + struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; + FT_Face ft_face = flt_font_ft->ft_face; + OTF *otf = flt_font_ft->otf; + int len = to - from; + int i, j, gidx; + OTF_Glyph *otfg; + char script[5], *langsys = NULL; + char *gsub_features = NULL, *gpos_features = NULL; + OTF_Feature *features; + + if (len == 0) + return from; + OTF_tag_name (spec->script, script); + if (spec->langsys) + { + langsys = alloca (5); + OTF_tag_name (spec->langsys, langsys); + } + for (i = 0; i < 2; i++) + { + char *p; + + if (spec->features[i] && spec->features[i][1] != 0xFFFFFFFF) + { + for (j = 0; spec->features[i][j]; j++); + if (i == 0) + p = gsub_features = alloca (6 * j); + else + p = gpos_features = alloca (6 * j); + for (j = 0; spec->features[i][j]; j++) + { + if (spec->features[i][j] == 0xFFFFFFFF) + *p++ = '*', *p++ = ','; + else + { + OTF_tag_name (spec->features[i][j], p); + p[4] = ','; + p += 5; + } + } + *--p = '\0'; + } + } + + setup_otf_gstring (len); + for (i = 0; i < len; i++) + { + otf_gstring.glyphs[i].c = in->glyphs[from + i].c; + otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code; + } + + OTF_drive_gdef (otf, &otf_gstring); + gidx = out ? out->used : from; + + if (gsub_features && out) + { + if (OTF_drive_gsub_with_log (otf, &otf_gstring, script, langsys, + gsub_features) < 0) + goto simple_copy; + if (out->allocated < out->used + otf_gstring.used) + return -2; + features = otf->gsub->FeatureList.Feature; + for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; ) + { + MFLTGlyph *g; + int min_from, max_to; + int j; + int feature_idx = otfg->positioning_type >> 4; + + g = out->glyphs + out->used; + *g = in->glyphs[from + otfg->f.index.from]; + if (g->code != otfg->glyph_id) + { + g->c = 0; + g->code = otfg->glyph_id; + g->measured = 0; + } + out->used++; + min_from = g->from; + max_to = g->to; + if (otfg->f.index.from < otfg->f.index.to) + { + /* OTFG substitutes multiple glyphs in IN. */ + for (j = from + otfg->f.index.from + 1; + j <= from + otfg->f.index.to; j++) + { + if (min_from > in->glyphs[j].from) + min_from = in->glyphs[j].from; + if (max_to < in->glyphs[j].to) + max_to = in->glyphs[j].to; + } + g->from = min_from; + g->to = max_to; + } + if (feature_idx) + { + unsigned int tag = features[feature_idx - 1].FeatureTag; + tag = PACK_OTF_TAG (tag); + g->internal = (g->internal & ~0x1FFFFFFF) | tag; + } + for (i++, otfg++; (i < otf_gstring.used + && otfg->f.index.from == otfg[-1].f.index.from); + i++, otfg++) + { + g = out->glyphs + out->used; + *g = in->glyphs[from + otfg->f.index.to]; + if (g->code != otfg->glyph_id) + { + g->c = 0; + g->code = otfg->glyph_id; + g->measured = 0; + } + feature_idx = otfg->positioning_type >> 4; + if (feature_idx) + { + unsigned int tag = features[feature_idx - 1].FeatureTag; + tag = PACK_OTF_TAG (tag); + g->internal = (g->internal & ~0x1FFFFFFF) | tag; + } + out->used++; + } + } + } + else if (gsub_features) + { + /* Just for checking which features will be applied. */ + if (OTF_drive_gsub_with_log (otf, &otf_gstring, script, langsys, + gsub_features) < 0) + goto simple_copy; + features = otf->gsub->FeatureList.Feature; + for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; i++, + otfg++) + { + int feature_idx = otfg->positioning_type >> 4; + + if (feature_idx) + { + unsigned int tag = features[feature_idx - 1].FeatureTag; + tag = PACK_OTF_TAG (tag); + for (j = otfg->f.index.from; j <= otfg->f.index.to; j++) + { + MFLTGlyph *g = in->glyphs + (from + j); + g->internal = (g->internal & ~0x1FFFFFFF) | tag; + } + } + } + } + else if (out) + { + if (out->allocated < out->used + len) + return -2; + for (i = 0; i < len; i++) + out->glyphs[out->used++] = in->glyphs[from + i]; + } + + if (gpos_features && out) + { + MFLTGlyph *base = NULL, *mark = NULL, *g; + int x_ppem, y_ppem, x_scale, y_scale; + + if (OTF_drive_gpos_with_log (otf, &otf_gstring, script, langsys, + gpos_features) < 0) + return to; + features = otf->gpos->FeatureList.Feature; + x_ppem = ft_face->size->metrics.x_ppem; + y_ppem = ft_face->size->metrics.y_ppem; + x_scale = ft_face->size->metrics.x_scale; + y_scale = ft_face->size->metrics.y_scale; + + for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx; + i < otf_gstring.used; i++, otfg++, g++) + { + MFLTGlyph *prev; + int feature_idx = otfg->positioning_type >> 4; + + if (feature_idx) + { + unsigned int tag = features[feature_idx - 1].FeatureTag; + tag = PACK_OTF_TAG (tag); + g->internal = (g->internal & ~0x1FFFFFFF) | tag; + } + + if (! otfg->glyph_id) + continue; + switch (otfg->positioning_type & 0xF) + { + case 0: + break; + case 1: /* Single */ + case 2: /* Pair */ + { + int format = otfg->f.f1.format; + + if (format & OTF_XPlacement) + adjustment[i].xoff + = otfg->f.f1.value->XPlacement * x_scale / 0x10000; + if (format & OTF_XPlaDevice) + adjustment[i].xoff + += DEVICE_DELTA (otfg->f.f1.value->XPlaDevice, x_ppem); + if (format & OTF_YPlacement) + adjustment[i].yoff + = - (otfg->f.f1.value->YPlacement * y_scale / 0x10000); + if (format & OTF_YPlaDevice) + adjustment[i].yoff + -= DEVICE_DELTA (otfg->f.f1.value->YPlaDevice, y_ppem); + if (format & OTF_XAdvance) + adjustment[i].xadv + += otfg->f.f1.value->XAdvance * x_scale / 0x10000; + if (format & OTF_XAdvDevice) + adjustment[i].xadv + += DEVICE_DELTA (otfg->f.f1.value->XAdvDevice, x_ppem); + if (format & OTF_YAdvance) + adjustment[i].yadv + += otfg->f.f1.value->YAdvance * y_scale / 0x10000; + if (format & OTF_YAdvDevice) + adjustment[i].yadv + += DEVICE_DELTA (otfg->f.f1.value->YAdvDevice, y_ppem); + adjustment[i].set = 1; + } + break; + case 3: /* Cursive */ + /* Not yet supported. */ + break; + case 4: /* Mark-to-Base */ + case 5: /* Mark-to-Ligature */ + if (! base) + break; + prev = base; + goto label_adjust_anchor; + default: /* i.e. case 6 Mark-to-Mark */ + if (! mark) + break; + prev = mark; + + label_adjust_anchor: + { + int base_x, base_y, mark_x, mark_y; + int this_from, this_to; + + base_x = otfg->f.f4.base_anchor->XCoordinate * x_scale / 0x10000; + base_y = otfg->f.f4.base_anchor->YCoordinate * y_scale / 0x10000; + mark_x = otfg->f.f4.mark_anchor->XCoordinate * x_scale / 0x10000; + mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000; + + if (otfg->f.f4.base_anchor->AnchorFormat != 1) + adjust_anchor (ft_face, otfg->f.f4.base_anchor, + prev->code, x_ppem, y_ppem, &base_x, &base_y); + if (otfg->f.f4.mark_anchor->AnchorFormat != 1) + adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->code, + x_ppem, y_ppem, &mark_x, &mark_y); + adjustment[i].xoff = (base_x - mark_x); + adjustment[i].yoff = - (base_y - mark_y); + adjustment[i].back = (g - prev); + adjustment[i].xadv = 0; + adjustment[i].advance_is_absolute = 1; + adjustment[i].set = 1; + this_from = g->from; + this_to = g->to; + for (j = 0; prev + j < g; j++) + { + if (this_from > prev[j].from) + this_from = prev[j].from; + if (this_to < prev[j].to) + this_to = prev[j].to; + } + for (; prev <= g; prev++) + { + prev->from = this_from; + prev->to = this_to; + } + } + } + if (otfg->GlyphClass == OTF_GlyphClass0) + base = mark = g; + else if (otfg->GlyphClass == OTF_GlyphClassMark) + mark = g; + else + base = g; + } + } + else if (gpos_features) + { + if (OTF_drive_gpos_with_log (otf, &otf_gstring, script, langsys, + gpos_features) < 0) + return to; + features = otf->gpos->FeatureList.Feature; + for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; + i++, otfg++) + if (otfg->positioning_type & 0xF) + { + int feature_idx = otfg->positioning_type >> 4; + + if (feature_idx) + { + unsigned int tag = features[feature_idx - 1].FeatureTag; + tag = PACK_OTF_TAG (tag); + for (j = otfg->f.index.from; j <= otfg->f.index.to; j++) + { + MFLTGlyph *g = in->glyphs + (from + j); + g->internal = (g->internal & ~0x1FFFFFFF) | tag; + } + } + } + } + return to; + + simple_copy: + if (! out) + return to; + if (out->allocated < out->used + len) + return -2; + font->get_metrics (font, in, from, to); + memcpy (out->glyphs + out->used, in->glyphs + from, + sizeof (MFLTGlyph) * len); + out->used += len; + return to; +} + +static int +ftfont_try_otf (MFLTFont *font, MFLTOtfSpec *spec, + MFLTGlyphString *in, int from, int to) +{ + return ftfont_drive_otf (font, spec, in, from, to, NULL, NULL); +} + +#else /* not M17N_FLT_USE_NEW_FEATURE */ static int ftfont_drive_otf (font, spec, in, from, to, out, adjustment) @@ -2011,6 +2375,8 @@ return to; } +#endif /* not M17N_FLT_USE_NEW_FEATURE */ + static MFLTGlyphString gstring; static int m17n_flt_initialized; @@ -2034,6 +2400,10 @@ if (! m17n_flt_initialized) { M17N_INIT (); +#ifdef M17N_FLT_USE_NEW_FEATURE + mflt_enable_new_feature = 1; + mflt_try_otf = ftfont_try_otf; +#endif /* M17N_FLT_USE_NEW_FEATURE */ m17n_flt_initialized = 1; } diff -r e9ddc2292336 -r 5b2cee3284b0 src/gtkutil.c --- a/src/gtkutil.c Sat May 08 10:54:36 2010 +0000 +++ b/src/gtkutil.c Mon May 10 11:57:09 2010 +0000 @@ -3778,7 +3778,9 @@ 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. */ @@ -3794,13 +3796,6 @@ 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); @@ -3877,8 +3872,6 @@ 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 @@ -3963,6 +3956,7 @@ 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)); diff -r e9ddc2292336 -r 5b2cee3284b0 src/lisp.h --- a/src/lisp.h Sat May 08 10:54:36 2010 +0000 +++ b/src/lisp.h Mon May 10 11:57:09 2010 +0000 @@ -3059,6 +3059,7 @@ EXFUN (Ffile_executable_p, 1); EXFUN (Fread_file_name, 6); 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, Lisp_Object)); extern void syms_of_fileio P_ ((void)); diff -r e9ddc2292336 -r 5b2cee3284b0 src/makefile.w32-in --- a/src/makefile.w32-in Sat May 08 10:54:36 2010 +0000 +++ b/src/makefile.w32-in Mon May 10 11:57:09 2010 +0000 @@ -697,6 +697,7 @@ $(SRC)/commands.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ + $(SRC)/frame.h \ $(SRC)/keyboard.h \ $(SRC)/systime.h \ $(SRC)/w32gui.h @@ -1554,6 +1555,7 @@ $(SRC)/keyboard.h \ $(SRC)/systime.h \ $(SRC)/termhooks.h \ + $(SRC)/w32.h \ $(SRC)/w32font.h \ $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/aix4-2.h --- a/src/s/aix4-2.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/aix4-2.h Mon May 10 11:57:09 2010 +0000 @@ -87,15 +87,6 @@ #define LINKER cc #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_SYSTEM -lrts -lIM -liconv -lpthreads -#else -/* IBM's X11R5 use -lIM and -liconv in AIX 3.2.2. */ -#define LIBS_SYSTEM -lrts -lIM -liconv -#endif - /* 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 @@ -110,7 +101,6 @@ /* Perry Smith says these are correct. */ #define SIGNALS_VIA_CHARACTERS -#define MAIL_USE_LOCKF #define CLASH_DETECTION /* Perry Smith says these are correct. */ diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/bsd-common.h --- a/src/s/bsd-common.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/bsd-common.h Mon May 10 11:57:09 2010 +0000 @@ -1,6 +1,7 @@ /* 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. @@ -18,10 +19,8 @@ along with GNU Emacs. If not, see . */ -/* - * 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 to avoid warnings about redefined macros. */ @@ -55,61 +54,41 @@ 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. */ - #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 diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/darwin.h --- a/src/s/darwin.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/darwin.h Mon May 10 11:57:09 2010 +0000 @@ -1,6 +1,7 @@ /* 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. @@ -18,10 +19,8 @@ along with GNU Emacs. If not, see . */ -/* - * 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 */ @@ -31,13 +30,11 @@ 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. */ - #define DARWIN_OS /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ - #define SYSTEM_TYPE "darwin" /* Emacs can read input using SIGIO and buffering characters itself, @@ -61,12 +58,10 @@ 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' /* @@ -79,16 +74,13 @@ * 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 /* Run only once. We need a `for'-loop because the code uses `continue'. */ @@ -117,20 +109,11 @@ #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 @@ -152,21 +135,18 @@ #define HAVE_SOCKETS /* Definitions for how to dump. Copied from nextstep.h. */ - #define UNEXEC unexmacosx.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 SYSTEM_PURESIZE_EXTRA 200000 #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 diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/freebsd.h --- a/src/s/freebsd.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/freebsd.h Mon May 10 11:57:09 2010 +0000 @@ -30,8 +30,6 @@ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) -#define LIBS_SYSTEM -lutil - #undef LIB_GCC #define LIB_GCC diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/gnu-linux.h --- a/src/s/gnu-linux.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/gnu-linux.h Mon May 10 11:57:09 2010 +0000 @@ -103,41 +103,15 @@ #define HAVE_SOCKETS /* 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 diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/hpux10-20.h --- a/src/s/hpux10-20.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/hpux10-20.h Mon May 10 11:57:09 2010 +0000 @@ -1,6 +1,7 @@ /* 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. @@ -126,13 +127,10 @@ /* AlainF 20-Jul-1996 says this is right. */ #define KERNEL_FILE "/stand/vmunix" -#define LIBS_SYSTEM -l:libdld.sl - /* Rainer Malzbender says definining HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */ - #ifndef HAVE_XRMSETDATABASE #define HAVE_XRMSETDATABASE #endif diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/irix6-5.h --- a/src/s/irix6-5.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/irix6-5.h Mon May 10 11:57:09 2010 +0000 @@ -85,21 +85,10 @@ #define UNEXEC unexelf.o -/* 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 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 */ @@ -112,5 +101,8 @@ #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) */ diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/ms-w32.h --- a/src/s/ms-w32.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/ms-w32.h Mon May 10 11:57:09 2010 +0000 @@ -1,6 +1,7 @@ /* 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. @@ -89,12 +90,6 @@ #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 diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/msdos.h --- a/src/s/msdos.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/msdos.h Mon May 10 11:57:09 2010 +0000 @@ -1,7 +1,7 @@ /* 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. @@ -140,8 +140,9 @@ 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 LIBS_SYSTEM -lxext -lsys +#define MSDOS_LIBS_SYSTEM -lxext -lsys #else +#define MSDOS_LIBS_SYSTEM /* We need a little extra space, see ../../lisp/loadup.el. As of 20091024, DOS-specific files use up 62KB of pure space. But overall, we end up wasting 130KB of pure space, because diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/sol2-6.h --- a/src/s/sol2-6.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/sol2-6.h Mon May 10 11:57:09 2010 +0000 @@ -27,8 +27,6 @@ #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). */ diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/template.h --- a/src/s/template.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/template.h Mon May 10 11:57:09 2010 +0000 @@ -1,8 +1,9 @@ /* 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. @@ -102,13 +103,6 @@ /* #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. */ diff -r e9ddc2292336 -r 5b2cee3284b0 src/s/unixware.h --- a/src/s/unixware.h Sat May 08 10:54:36 2010 +0000 +++ b/src/s/unixware.h Mon May 10 11:57:09 2010 +0000 @@ -1,7 +1,7 @@ /* 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. @@ -28,9 +28,6 @@ #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. It may also be appropriate for SVR4.x diff -r e9ddc2292336 -r 5b2cee3284b0 src/xsettings.c --- a/src/xsettings.c Sat May 08 10:54:36 2010 +0000 +++ b/src/xsettings.c Mon May 10 11:57:09 2010 +0000 @@ -740,7 +740,7 @@ 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' is set to a +If no system tool bar style is known, return `tool-bar-style' if set to a known style. Otherwise return image. */) () { diff -r e9ddc2292336 -r 5b2cee3284b0 test/ChangeLog --- a/test/ChangeLog Sat May 08 10:54:36 2010 +0000 +++ b/test/ChangeLog Mon May 10 11:57:09 2010 +0000 @@ -1,3 +1,7 @@ +2010-05-07 Chong Yidong + + * Version 23.2 released. + 2010-03-29 Chong Yidong * cedet/semantic-ia-utest.el